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
Create an updated entity for this test. This is a static method, as tests for other entities might also need it, if they test an entity which requires the current entity.
public static InventoryProvider createUpdatedEntity(EntityManager em) { InventoryProvider inventoryProvider = new InventoryProvider() .idInventoryProvider(UPDATED_ID_INVENTORY_PROVIDER) .code(UPDATED_CODE) .name(UPDATED_NAME) .price(UPDATED_PRICE) .cuantity(UPDATED_CUANTITY); return inventoryProvider; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Student createUpdatedEntity(EntityManager em) {\n Student student = new Student()\n .firstName(UPDATED_FIRST_NAME)\n .middleName(UPDATED_MIDDLE_NAME)\n .lastName(UPDATED_LAST_NAME)\n .studentRegNumber(UPDATED_STUDENT_REG_NUMBER)\n .dateOfBirth(UPDATED_DATE_OF_BIRTH)\n .regDocType(UPDATED_REG_DOC_TYPE)\n .registrationDocumentNumber(UPDATED_REGISTRATION_DOCUMENT_NUMBER)\n .gender(UPDATED_GENDER)\n .nationality(UPDATED_NATIONALITY)\n .dateJoined(UPDATED_DATE_JOINED)\n .deleted(UPDATED_DELETED)\n .wxtJwtPq55wd(UPDATED_WXT_JWT_PQ_55_WD);\n // Add required entity\n NextOfKin nextOfKin;\n if (TestUtil.findAll(em, NextOfKin.class).isEmpty()) {\n nextOfKin = NextOfKinResourceIT.createUpdatedEntity(em);\n em.persist(nextOfKin);\n em.flush();\n } else {\n nextOfKin = TestUtil.findAll(em, NextOfKin.class).get(0);\n }\n student.getRelatives().add(nextOfKin);\n return student;\n }", "protected T createSimulatedExistingEntity() {\n final T entity = createNewEntity();\n entity.setId(IDUtil.randomPositiveLong());\n\n when(getDAO().findOne(entity.getId())).thenReturn(entity);\n return entity;\n }", "public static Prestamo createUpdatedEntity(EntityManager em) {\n Prestamo prestamo = new Prestamo().observaciones(UPDATED_OBSERVACIONES).fechaFin(UPDATED_FECHA_FIN);\n // Add required entity\n Libro libro;\n if (TestUtil.findAll(em, Libro.class).isEmpty()) {\n libro = LibroResourceIT.createUpdatedEntity(em);\n em.persist(libro);\n em.flush();\n } else {\n libro = TestUtil.findAll(em, Libro.class).get(0);\n }\n prestamo.setLibro(libro);\n // Add required entity\n Persona persona;\n if (TestUtil.findAll(em, Persona.class).isEmpty()) {\n persona = PersonaResourceIT.createUpdatedEntity(em);\n em.persist(persona);\n em.flush();\n } else {\n persona = TestUtil.findAll(em, Persona.class).get(0);\n }\n prestamo.setPersona(persona);\n // Add required entity\n User user = UserResourceIT.createEntity(em);\n em.persist(user);\n em.flush();\n prestamo.setUser(user);\n return prestamo;\n }", "public static SitAndGo createUpdatedEntity(EntityManager em) {\n SitAndGo sitAndGo = new SitAndGo()\n .format(UPDATED_FORMAT)\n .buyIn(UPDATED_BUY_IN)\n .ranking(UPDATED_RANKING)\n .profit(UPDATED_PROFIT)\n .bounty(UPDATED_BOUNTY);\n return sitAndGo;\n }", "public static ItemSubstitution createUpdatedEntity(EntityManager em) {\n ItemSubstitution itemSubstitution = new ItemSubstitution()\n .timestamp(UPDATED_TIMESTAMP)\n .type(UPDATED_TYPE)\n .substituteType(UPDATED_SUBSTITUTE_TYPE)\n .substituteNo(UPDATED_SUBSTITUTE_NO)\n .description(UPDATED_DESCRIPTION)\n .isInterchangeable(UPDATED_IS_INTERCHANGEABLE)\n .relationsLevel(UPDATED_RELATIONS_LEVEL)\n .isCheckedToOriginal(UPDATED_IS_CHECKED_TO_ORIGINAL)\n .origCheckDate(UPDATED_ORIG_CHECK_DATE);\n // Add required entity\n Item item;\n if (TestUtil.findAll(em, Item.class).isEmpty()) {\n item = ItemResourceIT.createUpdatedEntity(em);\n em.persist(item);\n em.flush();\n } else {\n item = TestUtil.findAll(em, Item.class).get(0);\n }\n itemSubstitution.getItems().add(item);\n return itemSubstitution;\n }", "Entity createEntity();", "@PostConstruct\n protected void initNewEntity() {\n setNewEntity(getService().create());\n }", "public static A createUpdatedEntity(EntityManager em) {\n A a = new A();\n return a;\n }", "public static Testtable2 createUpdatedEntity(EntityManager em) {\n Testtable2 testtable2 = new Testtable2();\n testtable2.setColumn2(UPDATED_COLUMN_2);\n return testtable2;\n }", "public static XepLoai createUpdatedEntity(EntityManager em) {\n XepLoai xepLoai = new XepLoai()\n .tenXepLoai(UPDATED_TEN_XEP_LOAI);\n return xepLoai;\n }", "public static QuizQuestion createUpdatedEntity(EntityManager em) {\n QuizQuestion quizQuestion = new QuizQuestion()\n .text(UPDATED_TEXT)\n .description(UPDATED_DESCRIPTION);\n // Add required entity\n Quiz quiz;\n if (TestUtil.findAll(em, Quiz.class).isEmpty()) {\n quiz = QuizResourceIT.createUpdatedEntity(em);\n em.persist(quiz);\n em.flush();\n } else {\n quiz = TestUtil.findAll(em, Quiz.class).get(0);\n }\n quizQuestion.setQuiz(quiz);\n return quizQuestion;\n }", "public static OrderItem createUpdatedEntity(EntityManager em) {\n OrderItem orderItem = new OrderItem().quantity(UPDATED_QUANTITY).totalPrice(UPDATED_TOTAL_PRICE).status(UPDATED_STATUS);\n return orderItem;\n }", "public static Arrete createUpdatedEntity(EntityManager em) {\n Arrete arrete = new Arrete()\n .intituleArrete(UPDATED_INTITULE_ARRETE)\n .numeroArrete(UPDATED_NUMERO_ARRETE)\n .dateSignature(UPDATED_DATE_SIGNATURE)\n .nombreAgrement(UPDATED_NOMBRE_AGREMENT);\n return arrete;\n }", "public static Unidade createUpdatedEntity(EntityManager em) {\n Unidade unidade = new Unidade()\n .descricao(UPDATED_DESCRICAO)\n .sigla(UPDATED_SIGLA)\n .situacao(UPDATED_SITUACAO)\n .controleDeEstoque(UPDATED_CONTROLE_DE_ESTOQUE)\n .idAlmoxarifado(UPDATED_ID_ALMOXARIFADO)\n .andar(UPDATED_ANDAR)\n .capacidade(UPDATED_CAPACIDADE)\n .horarioInicio(UPDATED_HORARIO_INICIO)\n .horarioFim(UPDATED_HORARIO_FIM)\n .localExame(UPDATED_LOCAL_EXAME)\n .rotinaDeFuncionamento(UPDATED_ROTINA_DE_FUNCIONAMENTO)\n .anexoDocumento(UPDATED_ANEXO_DOCUMENTO)\n .setor(UPDATED_SETOR)\n .idCentroDeAtividade(UPDATED_ID_CENTRO_DE_ATIVIDADE)\n .idChefia(UPDATED_ID_CHEFIA);\n // Add required entity\n TipoUnidade tipoUnidade;\n if (TestUtil.findAll(em, TipoUnidade.class).isEmpty()) {\n tipoUnidade = TipoUnidadeResourceIT.createUpdatedEntity(em);\n em.persist(tipoUnidade);\n em.flush();\n } else {\n tipoUnidade = TestUtil.findAll(em, TipoUnidade.class).get(0);\n }\n unidade.setTipoUnidade(tipoUnidade);\n return unidade;\n }", "public static Note createUpdatedEntity(EntityManager em) {\n Note note = new Note().content(UPDATED_CONTENT).title(UPDATED_TITLE).xpos(UPDATED_XPOS).ypos(UPDATED_YPOS);\n return note;\n }", "@Test\r\n public void testUpdate() throws Exception {\r\n MonitoriaEntity entity = data.get(0);\r\n PodamFactory pf = new PodamFactoryImpl();\r\n MonitoriaEntity nuevaEntity = pf.manufacturePojo(MonitoriaEntity.class);\r\n nuevaEntity.setId(entity.getId());\r\n persistence.update(nuevaEntity);\r\n// Assert.assertEquals(nuevaEntity.getName(), resp.getName());\r\n }", "@Override\n protected void createEntity() {\n ProjectStatus status = createProjectStatus(5);\n setEntity(status);\n }", "public static Restaurant createUpdatedEntity(EntityManager em) {\n Restaurant restaurant = new Restaurant()\n .restaurantName(UPDATED_RESTAURANT_NAME)\n .deliveryPrice(UPDATED_DELIVERY_PRICE)\n .restaurantAddress(UPDATED_RESTAURANT_ADDRESS)\n .restaurantCity(UPDATED_RESTAURANT_CITY);\n return restaurant;\n }", "public static Enseigner createUpdatedEntity(EntityManager em) {\n Enseigner enseigner = new Enseigner().dateDebut(UPDATED_DATE_DEBUT).dateFin(UPDATED_DATE_FIN);\n return enseigner;\n }", "public static Lot createUpdatedEntity(EntityManager em) {\n Lot lot = new Lot()\n .createdAt(UPDATED_CREATED_AT)\n .updatedAt(UPDATED_UPDATED_AT)\n .qte(UPDATED_QTE)\n .qtUg(UPDATED_QT_UG)\n .num(UPDATED_NUM)\n .dateFabrication(UPDATED_DATE_FABRICATION)\n .peremption(UPDATED_PEREMPTION)\n .peremptionstatus(UPDATED_PEREMPTIONSTATUS);\n return lot;\n }", "void createOrUpdate(T entity);", "public static EnteteVente createUpdatedEntity(EntityManager em) {\n EnteteVente enteteVente = new EnteteVente()\n .enteteVenteType(UPDATED_ENTETE_VENTE_TYPE)\n .enteteVenteTotalHT(UPDATED_ENTETE_VENTE_TOTAL_HT)\n .enteteVenteTotalTTC(UPDATED_ENTETE_VENTE_TOTAL_TTC)\n .enteteVenteDateCreation(UPDATED_ENTETE_VENTE_DATE_CREATION);\n return enteteVente;\n }", "public static TaskComment createUpdatedEntity(EntityManager em) {\n TaskComment taskComment = new TaskComment()\n .value(UPDATED_VALUE);\n // Add required entity\n Task newTask = TaskResourceIT.createUpdatedEntity(em);\n Task task = TestUtil.findAll(em, Task.class).stream()\n .filter(x -> x.getId().equals(newTask.getId()))\n .findAny().orElse(null);\n if (task == null) {\n task = newTask;\n em.persist(task);\n em.flush();\n }\n taskComment.setTask(task);\n return taskComment;\n }", "protected abstract ENTITY createEntity();", "public static Bounty createUpdatedEntity() {\n Bounty bounty = new Bounty()\n// .status(UPDATED_STATUS)\n// .issueUrl(UPDATED_URL)\n .amount(UPDATED_AMOUNT)\n// .experience(UPDATED_EXPERIENCE)\n// .commitment(UPDATED_COMMITMENT)\n// .type(UPDATED_TYPE)\n// .category(UPDATED_CATEGORY)\n// .keywords(UPDATED_KEYWORDS)\n .permission(UPDATED_PERMISSION)\n .expiryDate(UPDATED_EXPIRES);\n return bounty;\n }", "public static Articulo createUpdatedEntity(EntityManager em) {\n Articulo articulo = new Articulo()\n .titulo(UPDATED_TITULO)\n .contenido(UPDATED_CONTENIDO)\n .fechaCreacion(UPDATED_FECHA_CREACION);\n return articulo;\n }", "TestEntity buildEntity () {\n TestEntity testEntity = new TestEntity();\n testEntity.setName(\"Test name\");\n testEntity.setCheck(true);\n testEntity.setDateCreated(new Date(System.currentTimeMillis()));\n testEntity.setDescription(\"description\");\n\n Specialization specialization = new Specialization();\n specialization.setName(\"Frontend\");\n specialization.setLevel(\"Senior\");\n specialization.setYears(10);\n\n testEntity.setSpecialization(specialization);\n\n return testEntity;\n }", "public static GoodsReceiptDetails createUpdatedEntity(EntityManager em) {\n GoodsReceiptDetails goodsReceiptDetails = new GoodsReceiptDetails()\n .grnQty(UPDATED_GRN_QTY);\n return goodsReceiptDetails;\n }", "public static Emprunt createUpdatedEntity(EntityManager em) {\n Emprunt emprunt = new Emprunt()\n .dateEmprunt(UPDATED_DATE_EMPRUNT);\n return emprunt;\n }", "public static AnnotationType createUpdatedEntity() {\n return new AnnotationType()\n .name(UPDATED_NAME)\n .label(UPDATED_LABEL)\n .description(UPDATED_DESCRIPTION)\n .emotional(UPDATED_EMOTIONAL)\n .weight(UPDATED_WEIGHT)\n .color(UPDATED_COLOR)\n .projectId(DEFAULT_PROJECT_ID);\n }", "public static Invoice createUpdatedEntity(EntityManager em) {\n Invoice invoice = new Invoice()\n .companyName(UPDATED_COMPANY_NAME)\n .userName(UPDATED_USER_NAME)\n .userLastName(UPDATED_USER_LAST_NAME)\n .userEmail(UPDATED_USER_EMAIL)\n .dateCreated(UPDATED_DATE_CREATED)\n .total(UPDATED_TOTAL)\n .subTotal(UPDATED_SUB_TOTAL)\n .tax(UPDATED_TAX)\n .purchaseDescription(UPDATED_PURCHASE_DESCRIPTION)\n .itemQuantity(UPDATED_ITEM_QUANTITY)\n .itemPrice(UPDATED_ITEM_PRICE);\n return invoice;\n }", "public static TypeOeuvre createUpdatedEntity(EntityManager em) {\n TypeOeuvre typeOeuvre = new TypeOeuvre()\n .intitule(UPDATED_INTITULE);\n return typeOeuvre;\n }", "public static Demand createUpdatedEntity(EntityManager em) {\n Demand demand = new Demand()\n .name(UPDATED_NAME)\n .value(UPDATED_VALUE);\n return demand;\n }", "public static Acheteur createUpdatedEntity(EntityManager em) {\n Acheteur acheteur = new Acheteur()\n .typeClient(UPDATED_TYPE_CLIENT)\n .nom(UPDATED_NOM)\n .prenom(UPDATED_PRENOM)\n .tel(UPDATED_TEL)\n .cnib(UPDATED_CNIB)\n .email(UPDATED_EMAIL)\n .adresse(UPDATED_ADRESSE)\n .numroBanquaire(UPDATED_NUMRO_BANQUAIRE)\n .deleted(UPDATED_DELETED);\n return acheteur;\n }", "T createEntity();", "public static MGachaRendition createUpdatedEntity(EntityManager em) {\n MGachaRendition mGachaRendition = new MGachaRendition()\n .mainPrefabName(UPDATED_MAIN_PREFAB_NAME)\n .resultExpectedUpPrefabName(UPDATED_RESULT_EXPECTED_UP_PREFAB_NAME)\n .resultQuestionPrefabName(UPDATED_RESULT_QUESTION_PREFAB_NAME)\n .soundSwitchEventName(UPDATED_SOUND_SWITCH_EVENT_NAME);\n return mGachaRendition;\n }", "public static BII createUpdatedEntity() {\n BII bII = new BII()\n .name(UPDATED_NAME)\n .type(UPDATED_TYPE)\n .biiId(UPDATED_BII_ID)\n .detectionTimestamp(UPDATED_DETECTION_TIMESTAMP)\n .sourceId(UPDATED_SOURCE_ID)\n .detectionSystemName(UPDATED_DETECTION_SYSTEM_NAME)\n .detectedValue(UPDATED_DETECTED_VALUE)\n .detectionContext(UPDATED_DETECTION_CONTEXT)\n .etc(UPDATED_ETC)\n .etcetc(UPDATED_ETCETC);\n return bII;\n }", "E create(E entity);", "E create(E entity);", "public static EnrollmentDate createUpdatedEntity(EntityManager em) {\n EnrollmentDate enrollmentDate = new EnrollmentDate()\n .name(UPDATED_NAME)\n .isPreEnrollment(UPDATED_IS_PRE_ENROLLMENT)\n .startDate(UPDATED_START_DATE)\n .endDate(UPDATED_END_DATE);\n // Add required entity\n Semester semester;\n if (TestUtil.findAll(em, Semester.class).isEmpty()) {\n semester = SemesterResourceIT.createUpdatedEntity(em);\n em.persist(semester);\n em.flush();\n } else {\n semester = TestUtil.findAll(em, Semester.class).get(0);\n }\n enrollmentDate.setSemester(semester);\n return enrollmentDate;\n }", "public static Posicion createUpdatedEntity(EntityManager em) {\n Posicion posicion = new Posicion()\n .titulo(UPDATED_TITULO)\n .descripcion(UPDATED_DESCRIPCION)\n .numeroPuestos(UPDATED_NUMERO_PUESTOS)\n .salarioMinimo(UPDATED_SALARIO_MINIMO)\n .salarioMaximo(UPDATED_SALARIO_MAXIMO)\n .fechaAlta(UPDATED_FECHA_ALTA)\n .fechaNecesidad(UPDATED_FECHA_NECESIDAD);\n return posicion;\n }", "@Test\n void updateSuccess () {\n TestEntity testEntity = buildEntity();\n Api2 instance = new Api2();\n Long result = instance.save(testEntity);\n\n String name = \"Edited name\";\n boolean check = false;\n String description = \"edited description\";\n\n if (result != null) {\n testEntity.setName(name);\n testEntity.setCheck(check);\n testEntity.setDescription(description);\n instance.update(testEntity);\n\n Optional<TestEntity> optionalTestEntity = instance.getById(TestEntity.class, testEntity.getId());\n assertTrue(optionalTestEntity.isPresent());\n\n if (optionalTestEntity.isPresent()) {\n TestEntity entity = optionalTestEntity.get();\n\n assertEquals(entity.getName(), name);\n assertEquals(entity.getDescription(), description);\n assertEquals(entity.isCheck(), check);\n } else {\n fail();\n }\n } else {\n fail();\n }\n }", "public static Poen createUpdatedEntity(EntityManager em) {\n Poen poen = new Poen()\n .tip(UPDATED_TIP);\n return poen;\n }", "public static OrderDetailInfo createUpdatedEntity(EntityManager em) {\n OrderDetailInfo orderDetailInfo = new OrderDetailInfo()\n .productName(UPDATED_PRODUCT_NAME)\n .priceProduct(UPDATED_PRICE_PRODUCT)\n .quantityOrder(UPDATED_QUANTITY_ORDER)\n .amount(UPDATED_AMOUNT)\n .orderDate(UPDATED_ORDER_DATE);\n return orderDetailInfo;\n }", "public static ProcessExecution createUpdatedEntity(EntityManager em) {\n ProcessExecution processExecution = new ProcessExecution()\n .execution(UPDATED_EXECUTION);\n return processExecution;\n }", "public static Incident createUpdatedEntity(EntityManager em) {\n Incident incident = new Incident()\n .title(UPDATED_TITLE)\n .risk(UPDATED_RISK)\n .notes(UPDATED_NOTES);\n return incident;\n }", "public static Territorio createUpdatedEntity(EntityManager em) {\n Territorio territorio = new Territorio().nome(UPDATED_NOME);\n return territorio;\n }", "public static Invite createUpdatedEntity(EntityManager em) {\n Invite invite = new Invite()\n .nom(UPDATED_NOM)\n .prenom(UPDATED_PRENOM)\n .mail(UPDATED_MAIL)\n .mdp(UPDATED_MDP)\n .login(UPDATED_LOGIN)\n .points(UPDATED_POINTS);\n return invite;\n }", "public static DataModel createUpdatedEntity(EntityManager em) {\n DataModel dataModel = new DataModel()\n .key(UPDATED_KEY)\n .label(UPDATED_LABEL)\n .dataFormat(UPDATED_DATA_FORMAT)\n .maxLength(UPDATED_MAX_LENGTH)\n .precision(UPDATED_PRECISION)\n .modelValues(UPDATED_MODEL_VALUES);\n return dataModel;\n }", "void create(T entity);", "public static Horaire createUpdatedEntity(EntityManager em) {\n Horaire horaire = new Horaire()\n .heureDepart(UPDATED_HEURE_DEPART)\n .heureFin(UPDATED_HEURE_FIN)\n .dateJour(UPDATED_DATE_JOUR);\n return horaire;\n }", "public static Empleado createUpdatedEntity(EntityManager em) {\n Empleado empleado = new Empleado()\n .nombre(UPDATED_NOMBRE)\n .primerApellido(UPDATED_PRIMER_APELLIDO)\n .segundoApellido(UPDATED_SEGUNDO_APELLIDO)\n .sexo(UPDATED_SEXO)\n .fechaNacimiento(UPDATED_FECHA_NACIMIENTO)\n .fechaIngreso(UPDATED_FECHA_INGRESO)\n .salario(UPDATED_SALARIO)\n .puesto(UPDATED_PUESTO)\n .estado(UPDATED_ESTADO);\n return empleado;\n }", "public static Allegato createUpdatedEntity(EntityManager em) {\n Allegato allegato = new Allegato()\n .nomeAttachment(UPDATED_NOME_ATTACHMENT)\n .algoritmoCompressione(UPDATED_ALGORITMO_COMPRESSIONE)\n .formatoAttachment(UPDATED_FORMATO_ATTACHMENT)\n .descrizioneAttachment(UPDATED_DESCRIZIONE_ATTACHMENT)\n .attachment(UPDATED_ATTACHMENT);\n return allegato;\n }", "public static NoteMaster createUpdatedEntity(EntityManager em) {\n NoteMaster noteMaster = new NoteMaster()\n .semestre(UPDATED_SEMESTRE)\n .noteCC1(UPDATED_NOTE_CC_1)\n .noteCC2(UPDATED_NOTE_CC_2)\n .noteFinal(UPDATED_NOTE_FINAL)\n .date(UPDATED_DATE);\n return noteMaster;\n }", "public static TaskExecution createUpdatedEntity(EntityManager em) {\n TaskExecution taskExecution = new TaskExecution()\n .jobOrderTimestamp(UPDATED_JOB_ORDER_TIMESTAMP)\n .taskExecutionStatus(UPDATED_TASK_EXECUTION_STATUS)\n .taskExecutionStartTimestamp(UPDATED_TASK_EXECUTION_START_TIMESTAMP)\n .taskExecutionEndTimestamp(UPDATED_TASK_EXECUTION_END_TIMESTAMP);\n return taskExecution;\n }", "void create(E entity);", "public static WorkPlace createUpdatedEntity(EntityManager em) {\n WorkPlace workPlace = new WorkPlace()\n .doctorIdpCode(UPDATED_DOCTOR_IDP_CODE)\n .name(UPDATED_NAME)\n .locationName(UPDATED_LOCATION_NAME)\n .location(UPDATED_LOCATION);\n return workPlace;\n }", "public static EventAttendance createUpdatedEntity(EntityManager em) {\n EventAttendance eventAttendance = new EventAttendance()\n .attendanceDate(UPDATED_ATTENDANCE_DATE);\n return eventAttendance;\n }", "public static Fornecedor createUpdatedEntity(EntityManager em) {\n Fornecedor fornecedor = new Fornecedor()\n .tipo(UPDATED_TIPO)\n .cpf(UPDATED_CPF)\n .cnpj(UPDATED_CNPJ)\n .primeiroNome(UPDATED_PRIMEIRO_NOME)\n .nomeMeio(UPDATED_NOME_MEIO)\n .sobreNome(UPDATED_SOBRE_NOME)\n .saudacao(UPDATED_SAUDACAO)\n .titulo(UPDATED_TITULO)\n .cep(UPDATED_CEP)\n .tipoLogradouro(UPDATED_TIPO_LOGRADOURO)\n .nomeLogradouro(UPDATED_NOME_LOGRADOURO)\n .complemento(UPDATED_COMPLEMENTO);\n return fornecedor;\n }", "public Entity newEntity() { return newMyEntity(); }", "public Entity newEntity() { return newMyEntity(); }", "public static Transaction createUpdatedEntity(EntityManager em) {\n Transaction transaction = new Transaction()\n .date(UPDATED_DATE);\n return transaction;\n }", "public static Author createUpdatedEntity(EntityManager em) {\n Author author = new Author()\n .firstName(UPDATED_FIRST_NAME)\n .lastName(UPDATED_LAST_NAME);\n return author;\n }", "public void updateEntity();", "public static IndActivation createUpdatedEntity(EntityManager em) {\n IndActivation indActivation = new IndActivation()\n .name(UPDATED_NAME)\n .activity(UPDATED_ACTIVITY)\n .customerId(UPDATED_CUSTOMER_ID)\n .individualId(UPDATED_INDIVIDUAL_ID);\n return indActivation;\n }", "public EntityType initUpdateEntity(DtoType dto) throws ClassNotFoundException, IllegalArgumentException, IllegalAccessException;", "public static MQuestSpecialReward createUpdatedEntity(EntityManager em) {\n MQuestSpecialReward mQuestSpecialReward = new MQuestSpecialReward()\n .groupId(UPDATED_GROUP_ID)\n .weight(UPDATED_WEIGHT)\n .rank(UPDATED_RANK)\n .contentType(UPDATED_CONTENT_TYPE)\n .contentId(UPDATED_CONTENT_ID)\n .contentAmount(UPDATED_CONTENT_AMOUNT);\n return mQuestSpecialReward;\n }", "public static Sectie createUpdatedEntity(EntityManager em) {\n Sectie sectie = new Sectie()\n .sectieId(UPDATED_SECTIE_ID)\n .nume(UPDATED_NUME)\n .sefId(UPDATED_SEF_ID)\n .tag(UPDATED_TAG)\n .nrPaturi(UPDATED_NR_PATURI);\n return sectie;\n }", "protected abstract EntityBase createEntity() throws Exception;", "public static RolEmpleado createUpdatedEntity(EntityManager em) {\n RolEmpleado rolEmpleado = new RolEmpleado();\n return rolEmpleado;\n }", "public static ExUser createUpdatedEntity(EntityManager em) {\n ExUser exUser = new ExUser()\n .userKey(UPDATED_USER_KEY);\n return exUser;\n }", "public static ConceptDataType createUpdatedEntity(EntityManager em) {\n ConceptDataType conceptDataType = new ConceptDataType()\n .uuid(UPDATED_UUID)\n .name(UPDATED_NAME)\n .hl7Abbreviation(UPDATED_HL_7_ABBREVIATION)\n .description(UPDATED_DESCRIPTION);\n return conceptDataType;\n }", "public static Info createUpdatedEntity(EntityManager em) {\n Info info = new Info()\n .nom(UPDATED_NOM)\n .prenom(UPDATED_PRENOM)\n .etablissement(UPDATED_ETABLISSEMENT);\n return info;\n }", "public static Dishestype createUpdatedEntity(EntityManager em) {\n Dishestype dishestype = new Dishestype()\n .name(UPDATED_NAME)\n .state(UPDATED_STATE)\n .creator(UPDATED_CREATOR)\n .createdate(UPDATED_CREATEDATE)\n .modifier(UPDATED_MODIFIER)\n .modifierdate(UPDATED_MODIFIERDATE)\n .modifiernum(UPDATED_MODIFIERNUM)\n .logicdelete(UPDATED_LOGICDELETE)\n .other(UPDATED_OTHER);\n return dishestype;\n }", "public static UserDetails createUpdatedEntity(EntityManager em) {\n UserDetails userDetails = new UserDetails()\n .studentCardNumber(UPDATED_STUDENT_CARD_NUMBER)\n .name(UPDATED_NAME)\n .surname(UPDATED_SURNAME)\n .telephoneNumber(UPDATED_TELEPHONE_NUMBER)\n .studyYear(UPDATED_STUDY_YEAR)\n .faculty(UPDATED_FACULTY)\n .fieldOfStudy(UPDATED_FIELD_OF_STUDY);\n return userDetails;\n }", "public static QueryData createUpdatedEntity(EntityManager em) {\n QueryData queryData = new QueryData()\n .dataValue(UPDATED_DATA_VALUE);\n return queryData;\n }", "E update(E entity);", "E update(E entity);", "public static Pessoa createUpdatedEntity(EntityManager em) {\n Pessoa pessoa = new Pessoa()\n .nome(UPDATED_NOME)\n .email(UPDATED_EMAIL)\n .telefone(UPDATED_TELEFONE)\n .dataNascimento(UPDATED_DATA_NASCIMENTO)\n .cadastro(UPDATED_CADASTRO);\n return pessoa;\n }", "public static Source createUpdatedEntity(EntityManager em) {\n Source source = new Source()\n .idGloden(UPDATED_ID_GLODEN)\n .name(UPDATED_NAME)\n .description(UPDATED_DESCRIPTION)\n .updateDate(UPDATED_UPDATE_DATE)\n .creationDate(UPDATED_CREATION_DATE);\n return source;\n }", "public static Userextra createUpdatedEntity(EntityManager em) {\n Userextra userextra = new Userextra().accountype(UPDATED_ACCOUNTYPE);\n // Add required entity\n User user = UserResourceIT.createEntity(em);\n em.persist(user);\n em.flush();\n userextra.setUser(user);\n return userextra;\n }", "void create(T entity) throws Exception;", "public static ListWrkStatus createUpdatedEntity(EntityManager em) {\n ListWrkStatus listWrkStatus = new ListWrkStatus()\n .code(UPDATED_CODE)\n .name(UPDATED_NAME)\n .fullName(UPDATED_FULL_NAME)\n .isCurrentFlag(UPDATED_IS_CURRENT_FLAG)\n .description(UPDATED_DESCRIPTION)\n .dateCreate(UPDATED_DATE_CREATE)\n .dateEdit(UPDATED_DATE_EDIT)\n .creator(UPDATED_CREATOR)\n .editor(UPDATED_EDITOR);\n // Add required entity\n ListWrkKind listWrkKind;\n if (TestUtil.findAll(em, ListWrkKind.class).isEmpty()) {\n listWrkKind = ListWrkKindResourceIT.createUpdatedEntity(em);\n em.persist(listWrkKind);\n em.flush();\n } else {\n listWrkKind = TestUtil.findAll(em, ListWrkKind.class).get(0);\n }\n listWrkStatus.setIdWrkKind(listWrkKind);\n return listWrkStatus;\n }", "public static DoctorAssistant createUpdatedEntity(EntityManager em) {\n DoctorAssistant doctorAssistant = new DoctorAssistant()\n .canPrescribe(UPDATED_CAN_PRESCRIBE);\n return doctorAssistant;\n }", "public static Kpi createUpdatedEntity(EntityManager em) {\n Kpi kpi = new Kpi()\n .title(UPDATED_TITLE)\n .reward(UPDATED_REWARD)\n .rewardDistribution(UPDATED_REWARD_DISTRIBUTION)\n .gradingProcess(UPDATED_GRADING_PROCESS)\n .active(UPDATED_ACTIVE)\n .purpose(UPDATED_PURPOSE)\n .scopeOfWork(UPDATED_SCOPE_OF_WORK)\n .rewardDistributionInfo(UPDATED_REWARD_DISTRIBUTION_INFO)\n .reporting(UPDATED_REPORTING)\n .fiatPoolFactor(UPDATED_FIAT_POOL_FACTOR)\n .grading(UPDATED_GRADING);\n return kpi;\n }", "private FailingEntity createFailingEntity() {\n FailingEntity entity = app.createAndManageChild(EntitySpec.create(FailingEntity.class)\n .configure(FailingEntity.FAIL_ON_START, true));\n return entity;\n }", "public static Location createUpdatedEntity(EntityManager em) {\n Location location = new Location()\n .name(UPDATED_NAME)\n .latitude(UPDATED_LATITUDE)\n .longitude(UPDATED_LONGITUDE)\n .details(UPDATED_DETAILS)\n .activated(UPDATED_ACTIVATED);\n return location;\n }", "public static Favorite createUpdatedEntity(EntityManager em) {\n Favorite favorite = new Favorite();\n return favorite;\n }", "public static ModePassation createUpdatedEntity(EntityManager em) {\n ModePassation modePassation = new ModePassation()\n .libelle(UPDATED_LIBELLE)\n .code(UPDATED_CODE)\n .description(UPDATED_DESCRIPTION);\n return modePassation;\n }", "public static TipoObra createUpdatedEntity(EntityManager em) {\n TipoObra tipoObra = new TipoObra().descripcion(UPDATED_DESCRIPCION);\n return tipoObra;\n }", "public static LifeConstantUnit createUpdatedEntity(EntityManager em) {\n LifeConstantUnit lifeConstantUnit = new LifeConstantUnit()\n .name(UPDATED_NAME)\n .description(UPDATED_DESCRIPTION);\n return lifeConstantUnit;\n }", "public static Timbre createUpdatedEntity(EntityManager em) {\n Timbre timbre = new Timbre().timbre(UPDATED_TIMBRE);\n return timbre;\n }", "public static UserExtra createUpdatedEntity(EntityManager em) {\n UserExtra userExtra = new UserExtra().currentParkingSpot(UPDATED_CURRENT_PARKING_SPOT).timeOfParking(UPDATED_TIME_OF_PARKING);\n return userExtra;\n }", "public static MChallengeQuestWorld createUpdatedEntity(EntityManager em) {\n MChallengeQuestWorld mChallengeQuestWorld = new MChallengeQuestWorld()\n .setId(UPDATED_SET_ID)\n .number(UPDATED_NUMBER)\n .name(UPDATED_NAME)\n .imagePath(UPDATED_IMAGE_PATH)\n .backgroundImagePath(UPDATED_BACKGROUND_IMAGE_PATH)\n .description(UPDATED_DESCRIPTION)\n .stageUnlockPattern(UPDATED_STAGE_UNLOCK_PATTERN)\n .arousalBanner(UPDATED_AROUSAL_BANNER)\n .specialRewardContentType(UPDATED_SPECIAL_REWARD_CONTENT_TYPE)\n .specialRewardContentId(UPDATED_SPECIAL_REWARD_CONTENT_ID)\n .isEnableCoop(UPDATED_IS_ENABLE_COOP);\n return mChallengeQuestWorld;\n }", "public static TypeIntervention createUpdatedEntity(EntityManager em) {\n TypeIntervention typeIntervention = new TypeIntervention()\n .libelle(UPDATED_LIBELLE);\n return typeIntervention;\n }", "public static ItemSubstitution createEntity(EntityManager em) {\n ItemSubstitution itemSubstitution = new ItemSubstitution()\n .timestamp(DEFAULT_TIMESTAMP)\n .type(DEFAULT_TYPE)\n .substituteType(DEFAULT_SUBSTITUTE_TYPE)\n .substituteNo(DEFAULT_SUBSTITUTE_NO)\n .description(DEFAULT_DESCRIPTION)\n .isInterchangeable(DEFAULT_IS_INTERCHANGEABLE)\n .relationsLevel(DEFAULT_RELATIONS_LEVEL)\n .isCheckedToOriginal(DEFAULT_IS_CHECKED_TO_ORIGINAL)\n .origCheckDate(DEFAULT_ORIG_CHECK_DATE);\n // Add required entity\n Item item;\n if (TestUtil.findAll(em, Item.class).isEmpty()) {\n item = ItemResourceIT.createEntity(em);\n em.persist(item);\n em.flush();\n } else {\n item = TestUtil.findAll(em, Item.class).get(0);\n }\n itemSubstitution.getItems().add(item);\n return itemSubstitution;\n }", "public void createNewObject(Representation entity) throws ResourceException {\r\n\t\tT entry = createObjectFromHeaders(null, entity);\r\n\t\texecuteUpdate(entity, entry, createUpdateObject(entry));\r\n\r\n\t}", "public static Category createUpdatedEntity(EntityManager em) {\n Category category = new Category()\n .label(UPDATED_LABEL)\n .primaryColor(UPDATED_PRIMARY_COLOR)\n .secondaryColor(UPDATED_SECONDARY_COLOR);\n // Add required entity\n User user = UserResourceIT.createEntity(em);\n em.persist(user);\n em.flush();\n category.setOwner(user);\n return category;\n }", "public static Course createUpdatedEntity(EntityManager em) {\n Course course = new Course()\n .title(UPDATED_TITLE)\n .description(UPDATED_DESCRIPTION)\n .courseStartDate(UPDATED_COURSE_START_DATE)\n .courseEndDate(UPDATED_COURSE_END_DATE)\n .registerStartDate(UPDATED_REGISTER_START_DATE)\n .registerEndDate(UPDATED_REGISTER_END_DATE)\n .duration(UPDATED_DURATION)\n .maximumNumberOfParticipants(UPDATED_MAXIMUM_NUMBER_OF_PARTICIPANTS)\n .minimalNumberOfParticipants(UPDATED_MINIMAL_NUMBER_OF_PARTICIPANTS)\n .lecturerName(UPDATED_LECTURER_NAME)\n .lecturerSurname(UPDATED_LECTURER_SURNAME)\n .pointPerCourse(UPDATED_POINT_PER_COURSE)\n .isVisibleInApp(UPDATED_IS_VISIBLE_IN_APP);\n return course;\n }", "public static TestEntity createEntity(EntityManager em) {\n TestEntity testEntity = new TestEntity();\n // Add required entity\n User user = UserResourceIntTest.createEntity(em);\n em.persist(user);\n em.flush();\n testEntity.setUserOneToMany(user);\n return testEntity;\n }" ]
[ "0.69449216", "0.67896795", "0.67879814", "0.67179096", "0.6694456", "0.66922057", "0.66643107", "0.66368437", "0.6620929", "0.6514777", "0.6509406", "0.6446852", "0.6423282", "0.6420849", "0.6420615", "0.64165777", "0.6411613", "0.6408787", "0.6403848", "0.63932365", "0.6390863", "0.6388326", "0.6380422", "0.6361089", "0.63423973", "0.63418686", "0.6329452", "0.6323348", "0.6318211", "0.63123614", "0.6299472", "0.6275718", "0.6270781", "0.62695867", "0.62638015", "0.6261922", "0.6255796", "0.6255084", "0.6255084", "0.6237627", "0.6226772", "0.6184292", "0.6177546", "0.61727744", "0.61661196", "0.61631334", "0.6156456", "0.6135606", "0.61344534", "0.61281127", "0.6125203", "0.61175996", "0.6116743", "0.6116217", "0.61150575", "0.61132586", "0.61018944", "0.6100467", "0.609074", "0.60858434", "0.60858434", "0.6073558", "0.60682845", "0.60639805", "0.6063356", "0.60548437", "0.60496", "0.6046307", "0.60458905", "0.6031787", "0.6029104", "0.60257006", "0.60237676", "0.6014721", "0.6010872", "0.6006849", "0.6005116", "0.6005116", "0.59957474", "0.59879327", "0.59776896", "0.59688896", "0.5966096", "0.59658957", "0.5962093", "0.59518", "0.5947376", "0.59444624", "0.59443027", "0.59423697", "0.5938813", "0.59374046", "0.5935005", "0.5933881", "0.5924878", "0.59195006", "0.59129685", "0.59102505", "0.5909693", "0.5908487" ]
0.5980898
80
private ArrayList mTitlePostions = new ArrayList();
public FeedAdapter(Context context, List<DailyInfo.IssueListBean.ItemListBean> list) { super(context); this.list = list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MusicScore ()\n {\n score = new ArrayList<Note>();\n }", "private MyAlbumList() {\n albums = new ArrayList<Album>();\n }", "List<String> getAllTitles(){\n return mAllTitles;\n }", "public Post()\n {\n nachrichten = new ArrayList<Nachricht>();\n }", "public List<Post> getPosts(){return this.posts;}", "Sharks() {\n sharks = new ArrayList<Shark>(); // Initialize the ArrayList\n }", "public ArrayList<String> getPhotos() {return photos;}", "Dialogue(ArrayList<String> text){\n this.text = text;\n }", "public String getTitle(){\n return mTitle;\n }", "public ArrayList<Posto> getPostos() {\n return postos;\n }", "public PersonalityList()\n {\n pList= new ArrayList<Personality>();\n }", "public void setCamino(ArrayList<Posicion> camino)\n{\n m_camino = camino;\n}", "NewsMakerList() {\n\t\tthis.newsMakers = new ArrayList<NewsMaker>();\n\t}", "public Todoist()\n {\n tareas = new ArrayList<String>();\n }", "public Todoist()\n {\n tareas = new ArrayList<String>();\n }", "public ArrayList<Moto> getMotos()\r\n {\r\n return motos;\r\n }", "List<PostInfo> getPostList();", "@Override\n public int getCount() {\n return titles.size();\n }", "@Override\n public int getItemCount() {\n return blogArrayList.size();\n }", "@Override\n public int getCount() {\n return title.length;\n }", "public Highscore() {\n scores = new ArrayList<Score>();\n }", "ArrayListOfStrings () {\n list = new ArrayList<String>();\n }", "public ArrayList<GeoPlace> getPlaces(){\n return GeoPlaces;\n}", "public String getTitle(){\n return titlesText;\n }", "public List<Integer> getTitleList() {\n return titleList;\n }", "public LlistaPistes() {\n _llistaPistes = new ArrayList();\n }", "@Override\n\tpublic int getCount() {\n\t\treturn mTitle.length;\n\t}", "private void initializeData() {\n posts = new ArrayList<>();\n posts.add(new Posts(\"Emma Wilson\", \"23 years old\", R.drawable.logo));\n posts.add(new Posts(\"Lavery Maiss\", \"25 years old\", R.drawable.star));\n posts.add(new Posts(\"Lillie Watts\", \"35 years old\", R.drawable.profile));\n }", "@Override\n public void onLoadMore() {\n\n }", "@Override\n public int getItemCount() {\n return paragraphResults.size();\n }", "@Override\n public int getItemCount() {\n return listPhotos.size();\n }", "public Molt(){\n molt=new ArrayList<>();\n }", "@Override\n\tpublic int getCount()\n\t{\n\t\treturn TITLE.length;\n\t}", "public String[] getTitlesArray() {\n return mTitlesArray;\n }", "@Override\n\tpublic int getCount() {\n\t\treturn LIST_TITLE.size();\n\t}", "@Override\n public int getItemCount() {\n return mArrayList.size();\n }", "private void CreateStudentList() {\r\n\t\tStudentList=new ArrayList<Student>();\t\r\n}", "public TweeterAdapter (List<Tweet> tweets){\n mTweets=tweets;\n }", "@Override\n public int getCount() {\n return mArrayList == null ? 0 : mArrayList.size();\n }", "public ArrayList<Book> gettitleBook(String title);", "public void setPosts(List<Post> posts){\n this.posts = posts;\n }", "public ArrayListNotes()\n {\n // initialise instance variables\n //x = 0;\n }", "PropertyArray() {\n this.myArrayList = new ArrayList<>();\n }", "public int getCount() {\n\t return title.size(); \r\n\t }", "@Override\r\n\tpublic int getCount() {\n\t\treturn title.size();\r\n\t}", "private void fillArrayLists(){\n titlesList = new ArrayList<>();\n fragmentsList = new ArrayList<>();\n\n titlesList.add(getString(R.string.basic));\n titlesList.add(getString(R.string.easy));\n titlesList.add(getString(R.string.normal));\n titlesList.add(getString(R.string.hard));\n\n fragmentsList.add(LevelBasicFragment.newInstance(basicLevelWord, basicLevelType, language));\n fragmentsList.add(LevelEasyFragment.newInstance(easyLevelWord, easyLevelType, language));\n fragmentsList.add(LevelNormalFragment.newInstance(normalLevelWord, normalLevelType, language));\n fragmentsList.add(LevelHardFragment.newInstance(hardLevelWord, hardLevelType, language));\n }", "public void limpaPontos() {\n\t\tthis.pontos = new ArrayList<Point>();\n\t}", "@Override\n protected void onPostExecute(ArrayList<News> newsArrayList) {\n super.onPostExecute(newsArrayList);\n newsList=new ArrayList<>();\n if(textQuery.equals(\"\")){\n newsAdapter=new NewsAdapter(getContext(),newsArrayList);\n } else {\n for(int i=0;i<newsArrayList.size();i++){\n if(newsArrayList.get(i).getTitle().contains(textQuery)){\n News news=newsArrayList.get(i);\n newsList.add(new News(news.getTitle(),news.getDescription(),news.getTime(),news.getImage(),news.getLink()));\n }\n }\n newsAdapter=new NewsAdapter(getContext(),newsList);\n }\n\n LinearLayoutManager linearLayoutManager=new LinearLayoutManager(getActivity());\n rcvListNews.setHasFixedSize(true);\n rcvListNews.setLayoutManager(linearLayoutManager);\n rcvListNews.setAdapter(newsAdapter);\n\n\n\n\n }", "@Override\n public int getCount() {\n return titleA.length;//returns array length\n }", "public Pile(){\n pile = new ArrayList<Card>();\n }", "@Override\r\n\tpublic void onLoadMore() {\n\r\n\t}", "public ListProperty<Author> titlesProperty(){return authors;}", "private ArrayList<String> initList(String[] vastitems){\n return new ArrayList<>(Arrays.asList(vastitems));\n }", "@Override\n\tpublic int getCount() {\n\t\treturn title.length;\n\t}", "public void setAnimals(ArrayList<Animal> animals) { this.animals = animals; }", "@Override\n public int getItemCount() {\n return movieArray.length();\n }", "private void prepareAlbums() {\n\n Album a;\n\n for(HashMap.Entry<String,ArrayList<String>> entry : Test.subcatList.get(name).entrySet()){\n key = entry.getKey();\n value = entry.getValue();\n a = new Album(key , value.get(2));\n albumList.add(a);\n System.out.println(\"dddd : \" + key + \" \" + value.get(2));\n }\n\n adapter.notifyDataSetChanged();\n\n }", "public ArrayList<String> getMusicName_ () {\n\n /*\n ArrayList<String> musicList = new ArrayList<>();\n Collections.sort(musicName);\n\n for (String item : musicName) {\n musicList.add(item);\n }\n return musicList;\n * */\n\n return musicName;\n\n }", "@Override\n\tpublic ArrayList<BlogArticle> searchArts(String title) {\n\t\treturn blogArticleDao.searchArts(title);\n\t}", "@Override\n public int getItemCount() {\n return posts.size();\n }", "@Override\n public int getItemCount() {\n return posts.size();\n }", "public ArrayList<Paragraph> getParagraphs() {\r\n\t\treturn paragraphs;\r\n\t}", "public void setToDoListTitles() {\n\n ArrayList<String> toDoListTitlesSetter = new ArrayList<String>();\n for (int i = 0; i < myList.size(); i++) {\n toDoListTitlesSetter.add(myList.get(i).get(0));\n }\n toDoListTitlesTemp.clear();\n for(int i = 0; i < toDoListTitlesSetter.size(); i++){\n toDoListTitlesTemp.add(toDoListTitlesSetter.get(i));\n }\n\n Log.i(TAG, \"we have set the list titles\");\n }", "@Override\r\n\tpublic List<ENews> newsTitle() {\n\t\treturn new ENDaoImpl().newsTitle();\r\n\t}", "public String listTitle();", "public Playlist(ArrayList<Nummer> albumNummers) {\n this.albumNummers = albumNummers;\n }", "public void setupArticlesList();", "@Override\n public int getCount() {\n return newsModelArrayList.size();\n }", "public int getCount() {\n return Title.size();\n }", "@Override\r\n\tpublic void onLoadMore() {\n\t}", "public Player()\n {\n playerItem = new ArrayList();\n }", "public String[] getTitle() {\r\n return title;\r\n }", "@Override\n\tpublic String getListTitle() {\n\t\treturn \"Saisir des notes\";\n\t}", "@Override\n public void onLoadMore() {\n }", "private MealsList() {\n meals = new ArrayList<>();\n }", "String get_title()\n {\n return title;\n }", "@Override\r\n public int getItemCount() {\r\n return albumList.size();\r\n }", "public List getSearchList () {\nif (searchList == null) {//GEN-END:|45-getter|0|45-preInit\n // write pre-init user code here\nsearchList = new List (\"Tidigare S\\u00F6kningar\", Choice.IMPLICIT);//GEN-BEGIN:|45-getter|1|45-postInit\nsearchList.addCommand (getOkCommand1 ());\nsearchList.addCommand (getBackCommand2 ());\nsearchList.setCommandListener (this);//GEN-END:|45-getter|1|45-postInit\n // write post-init user code here\nint size = searches.size();\n for(int i = 0; i < size; i++){\n String content = (String) searches.elementAt(i);\n String title = content.substring(0,content.indexOf(\";\"));\n \n searchList.append(title, null);\n }\n}//GEN-BEGIN:|45-getter|2|\nreturn searchList;\n}", "@Override\n\tprotected void initArrayTitle() {\n\t\tthis.arrayTitle.add(\"div[class=lft] > div > h2\");\n\n\t}", "private static List<Article> createArticleList() {\n List<Article> articles = new ArrayList();\n articles.add(new Article(1l, \"Ball\", new Double(5.5), Type.TOY));\n articles.add(new Article(2l, \"Hammer\", new Double(250.0), Type.TOOL));\n articles.add(new Article(3l, \"Doll\", new Double(12.75), Type.TOY));\n return articles;\n }", "private void initList() {\n\n }", "public PersonList() {\r\n this.personList = new ArrayList<Person>();\r\n }", "@Override\n public int getCount() {\n return songsList.size();\n }", "public String getTitle(){\n return title;\n }", "public String getTitle(){\n return title;\n }", "public String getTitle(){\n return title;\n }", "public ArrayList<PlacePhoto> getPhotos() {\n return photos;\n }", "public Reviews (ArrayList<Review> list)\n\t{\n\t\tthis.list = list;\n\t}", "public ContactList()\n {\n myList = new ArrayList<>();\n }", "public Player()\r\n {\r\n playerItem = new ArrayList();\r\n }", "public void initPosPosts(){\n\t\tdbAdapter = new DBAdapter(getActivity());\n\t\tdbAdapter.open();\n\t\tCursor c = dbAdapter.getPosPosts();\n\t\tSimpleCursorAdapter cursorAdapter = new SimpleCursorAdapter(\n\t\t\t\tgetActivity(), R.layout.postitem, c, new String[] {\n\t\t\t\t\t\t\"titel\", \"dato\", \"beloeb\" }, new int[] { R.id.titel,\n\t\t\t\t\t\tR.id.dato, R.id.beloeb});\n\t\tsetListAdapter(cursorAdapter);\n\t}", "public ListItems() {\n itemList = new ArrayList();\n }", "public String getTitle() { return mTitle; }", "public String getTitle() {\n return mTitle;\n }", "private ArrayList<String> postOrder()\n\t{\n\t\tArrayList<String> rlist = new ArrayList<String>();\n\t\tpostOrder(this,rlist);\n\t\treturn rlist;\n\t}", "@Override\n public int getItemCount() {\n return mArticles.size();\n }", "public TableModelPosto(ArrayList<Posto> listPostos) {\n postos = listPostos;\n }", "@Override\n public int getItemCount() {\n return arrayList.size();\n\n }", "WordList(){\r\n\t\tm_words = new HashMap();\r\n\t}", "@Override\n public int getItemCount() {\n return movies.size();\n }", "@Override\n public int getItemCount() {\n return movies.size();\n }" ]
[ "0.6363651", "0.63118225", "0.62817776", "0.6250328", "0.61055803", "0.5981461", "0.59553814", "0.59485656", "0.5882379", "0.5863137", "0.5847231", "0.5845471", "0.5813645", "0.58076745", "0.58076745", "0.5793186", "0.576122", "0.57354856", "0.57187206", "0.5706688", "0.56853855", "0.56810796", "0.5662467", "0.56604874", "0.5644166", "0.5642056", "0.56356937", "0.5628185", "0.5606237", "0.56040615", "0.5574074", "0.55736494", "0.553722", "0.55338794", "0.5528993", "0.55276656", "0.5524566", "0.55238897", "0.5517664", "0.5515201", "0.55138284", "0.551361", "0.5497914", "0.54978055", "0.5485256", "0.54694414", "0.54513025", "0.544538", "0.54276747", "0.54201114", "0.54172385", "0.5415009", "0.5414798", "0.53968465", "0.539598", "0.5395459", "0.5394037", "0.53933483", "0.53857994", "0.53776896", "0.53776896", "0.537623", "0.5369457", "0.5369318", "0.5369035", "0.5366932", "0.53555316", "0.5348137", "0.5335584", "0.53336984", "0.53316104", "0.533072", "0.5325564", "0.5319152", "0.5313161", "0.53115356", "0.5302768", "0.5302309", "0.5294216", "0.5290555", "0.52894425", "0.5287099", "0.5281954", "0.52791464", "0.52791464", "0.52791464", "0.52783734", "0.52691144", "0.5266744", "0.5260558", "0.5259843", "0.52482885", "0.52452964", "0.5244553", "0.5237242", "0.5228298", "0.52235967", "0.52205265", "0.52192146", "0.5216154", "0.5216154" ]
0.0
-1
Player player = e.getPlayer(); ScoreboardManager manager = Bukkit.getScoreboardManager(); Scoreboard tVsK = TitansAndKings.getTVsK(); player.setScoreboard(tVsK);
@EventHandler public void onLogin(PlayerJoinEvent e){ try { File file = new File("plugins"+File.separator+"TitansAndKings"+File.separator+"users"+File.separator+e.getPlayer().getName()+".yml"); if(!(file.exists())){ file.createNewFile(); } } catch (IOException event) { event.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setScoreboard(final Player player) {\n ConfigurationSection scoreboardSettings = ConfigurationManager.getInstance().getMainConfiguration().getConfigurationSection(Strings.CONFIG_SCOREBOARD_SECTION);\n\n ScoreboardManager scoreboardManager = CustomGUIShop.getInstance().getServer().getScoreboardManager();\n final Scoreboard scoreboard = scoreboardManager.getNewScoreboard();\n addPlayerToGroup(scoreboard, player);\n final Objective objective = scoreboard.registerNewObjective(\"sb\", \"dummy\");\n objective.setDisplaySlot(DisplaySlot.SIDEBAR);\n\n final Objective objective2 = scoreboard.registerNewObjective(\"sb2\", \"dummy\");\n objective2.setDisplaySlot(DisplaySlot.PLAYER_LIST);\n\n // SERVER\n objective.getScore(ChatColor.translateAlternateColorCodes('&', scoreboardSettings.getString(Strings.CONFIG_SCOREBOARD_REPUTATION_TITLE))).setScore(15);\n final Team reputation = scoreboard.registerNewTeam(\"reputation\");\n reputation.addPlayer(Bukkit.getOfflinePlayer(\" \"));\n objective.getScore(\" \").setScore(14);\n objective.getScore(\" \").setScore(13);\n\n // COINS\n objective.getScore(ChatColor.translateAlternateColorCodes('&', scoreboardSettings.getString(Strings.CONFIG_SCOREBOARD_LEVEL_TITLE))).setScore(12);\n final Team level = scoreboard.registerNewTeam(\"level\");\n level.addPlayer(Bukkit.getOfflinePlayer(\" \"));\n objective.getScore(\" \").setScore(11);\n objective.getScore(\" \").setScore(10);\n\n // PIXELITES\n objective.getScore(ChatColor.translateAlternateColorCodes('&', scoreboardSettings.getString(Strings.CONFIG_SCOREBOARD_NEXTLEVEL_TITLE))).setScore(9);\n final Team nextLevel = scoreboard.registerNewTeam(\"nextLevel\");\n nextLevel.addPlayer(Bukkit.getOfflinePlayer(\" \"));\n objective.getScore(\" \").setScore(8);\n objective.getScore(\" \").setScore(7);\n\n // RANK\n objective.getScore(ChatColor.translateAlternateColorCodes('&', scoreboardSettings.getString(Strings.CONFIG_SCOREBOARD_BALANCE_TITLE))).setScore(6);\n final Team balance = scoreboard.registerNewTeam(\"balance\");\n balance.addPlayer(Bukkit.getOfflinePlayer(\" \"));\n objective.getScore(\" \").setScore(5);\n objective.getScore(\" \").setScore(4);\n\n final String title = ChatColor.translateAlternateColorCodes('&', scoreboardSettings.getString(Strings.CONFIG_SCOREBOARD_DISPLAY_NAME));\n\n new BukkitRunnable() {\n public void run() {\n try {\n objective.setDisplayName(title);\n reputation.setPrefix(String.valueOf(ReputationManager.getReputation(player)));\n level.setPrefix(String.valueOf(ReputationManager.getReputationLevel(player)));\n nextLevel.setPrefix(String.valueOf(ReputationManager.getReputation(player)) + \"/\" + String.valueOf(ReputationManager.getReputation(player) + ReputationManager.getNextLevel(player)));\n balance.setPrefix(String.valueOf(CustomGUIShop.getInstance().getEconomy().getBalance(player)));\n objective2.getScore(player).setScore(ReputationManager.getReputationLevel(player));\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }.runTaskTimer(CustomGUIShop.getInstance(), 0, 5);\n player.setScoreboard(scoreboard);\n }", "public static void setScoreBoard(Player p) {\n\t\n}", "private void initScoreboard() {\n // Register all events.\n Bukkit.getPluginManager().registerEvents(this, plugin);\n\n // Register new scoreboard.\n scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();\n }", "public void display (Player player) {\n player.setScoreboard(this.bukkitScoreboard);\n }", "public void updateScoreBoard() {\n Player player1 = playerManager.getPlayer(1);\n Player player2 = playerManager.getPlayer(2);\n MainActivity mainActivity = (MainActivity) this.getContext();\n\n mainActivity.updateScoreBoard(player1, player2);\n }", "public void loadScoreboard(){\n\t\tmanager = Bukkit.getScoreboardManager();\n\t\tboard = manager.getNewScoreboard();\n\t\tobj = board.registerNewObjective(\"Something\", \"Something\");\n\t}", "public void updateScoreboard() {\n\t\tif(obj != null) {\t\t\t\r\n\t\t\tobj.unregister();\r\n\t\t}\r\n\t\tobj = scoreboard.registerNewObjective(\"gui\", \"dummy\");\r\n\t\tobj.setDisplaySlot(DisplaySlot.SIDEBAR);\r\n\t\tobj.setDisplayName(\"§c§lVitality\");\r\n\t\tScore currentRank = obj.getScore(\"§e§lRank\");\r\n\t\tcurrentRank.setScore(40);\r\n\t\tScore currentRankVal = obj.getScore(\"§f\" + getRank().getName());\r\n\t\tcurrentRankVal.setScore(39);\r\n\t\tScore spacer1 = obj.getScore(\" \");\r\n\t\tspacer1.setScore(38);\r\n\t\tPrisonRank next = PrisonRank.getNextRank(rank);\r\n\t\tif(next != null) {\r\n\t\t\tScore nextRank = obj.getScore(\"§b§lProgress to \" + next.getName());\r\n\t\t\tnextRank.setScore(37);\r\n\t\t\tdouble percent = (Prison.getEco().getBalance(this) / next.getValue()) * 100;\r\n\t\t\tif(percent > 100) {\r\n\t\t\t\tpercent = 100;\r\n\t\t\t}\r\n\t\t\tScore nextRankVal = obj.getScore(\"§f\" + ((int)percent + \"%\"));\r\n\t\t\tnextRankVal.setScore(36);\r\n\t\t} else {\r\n\t\t\tScore nextRank = obj.getScore(\"§b§lNext Rank\");\r\n\t\t\tnextRank.setScore(37);\r\n\t\t\tScore nextRankVal = obj.getScore(\"§fNone\");\r\n\t\t\tnextRankVal.setScore(36);\r\n\t\t}\r\n\t\tScore spacer2 = obj.getScore(\" \");\r\n\t\tspacer2.setScore(35);\r\n\t\tScore money = obj.getScore(\"§a§lBalance\");\r\n\t\tmoney.setScore(34);\r\n\t\tScore moneyVal = obj.getScore(\"§f$\" + moneyFormat.format(Prison.getEco().getBalance(this)));\r\n\t\tmoneyVal.setScore(33);\r\n\t\tScore spacer3 = obj.getScore(\" \");\r\n\t\tspacer3.setScore(32);\r\n\t\t\r\n\t\tScore mult = obj.getScore(\"§6§lMultiplier\");\r\n\t\tmult.setScore(31);\r\n\t\t\r\n\t\tif(Multiplier.getMultiplier() > 1.0) {\r\n\t\t\tScore multVal = obj.getScore(\"§f\" + Multiplier.getMultiplier() + \"x\");\r\n\t\t\tmultVal.setScore(30);\r\n\t\t} else {\r\n\t\t\tScore multVal = obj.getScore(\"§fNone\");\r\n\t\t\tmultVal.setScore(30);\r\n\t\t}\r\n\t\tScore spacer4 = obj.getScore(\" \");\r\n\t\tspacer4.setScore(29);\r\n\t\tScore onlineStaff = obj.getScore(\"§c§lOnline Staff\");\r\n\t\tonlineStaff.setScore(28);\r\n\t\tScore onlineStaffVal = obj.getScore(\"§f\" + Prison.getStaffOnline().getCurrent());\r\n\t\tonlineStaffVal.setScore(27);\r\n\t}", "public ScoreboardManager(){\r\n\t\tscoreboard = Bukkit.getScoreboardManager().getNewScoreboard();\r\n\t\temptyScoreboard = Bukkit.getScoreboardManager().getNewScoreboard();\r\n\t\tsetupScoreboard();\r\n\t}", "public void ScoreboardHandler(SkyblockWarriors plugin)\n {\n _plugin = plugin;\n\n // Create Sidebar\n board = Bukkit.getScoreboardManager().getNewScoreboard();\n\n // Register the scoreboard\n Objective obj = board.registerNewObjective(\"Players\", \"dummy\");\n obj.setDisplaySlot(DisplaySlot.SIDEBAR);\n obj.setDisplayName(ChatColor.GOLD + \"Players\");\n\n playerTeam = board.registerNewTeam(\"player\");\n playerTeam.setAllowFriendlyFire(true);\n playerTeam.setCanSeeFriendlyInvisibles(false);\n }", "public abstract Scoreboard update(Player player);", "public void updateScore(int score){ bot.updateScore(score); }", "public int getPlayerScore();", "public void updateScoreboard() {\r\n \tif(parentActivity instanceof GameActivity) {\r\n \t\t((TextView)(((GameActivity)parentActivity).getScoreboard())).setText(\"\"+score);\r\n \t}\r\n }", "public void updatePlayerScore()\n\t{\n\t\tthis.score = (int)(getBalance() - 500) - (getNumberOfLoans()*500); \n\t}", "public static void update_scoreboard2(){\n\t\t//Update score\n\tif(check_if_wicket2){\n\t\t\n\t\twicket_2++;\n\t\tupdate_score2.setText(\"\"+team_score_2+\"/\"+wicket_2);\n\t}\n\telse{\n\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\ttempshot2=PlayArena2.usershot2;\n\t\tteam_score_2=team_score_2+PlayArena2.usershot2;\n\t\treq=req-tempshot2;\n\t\t}\n\t\telse{\n\t\t\ttempshot2=PlayArena2.compshot2;\n\t\t\tteam_score_2=team_score_2+PlayArena2.compshot2;\n\t\t\treq=req-tempshot2;\n\t\t\t}\n\t\tif(req<0)\n\t\t{\treq=0;}\n\t\t\n\t\tupdate_score2.setText(\"\"+team_score_2+\"/\"+wicket_2);\n\t}\n\t// Overs update\n\tif(over_ball_2==5){\n\t\tover_ball_2=0;\n\t\tover_overs_2++;\n\t\tover_totalballs_2--;\n\t}\n\telse{\n\t\tover_ball_2++;\n\tover_totalballs_2--;}\n\tupdate_overs2.setText(\"\"+over_overs_2+\".\"+over_ball_2+\" (\"+PlayMode.overs+\")\");\n\t\n\t//Check if_first_inning_over\n\tif(over_overs_2==Integer.parseInt(PlayMode.overs) || wicket_2==3 || PlayBrain1.team_score_1<team_score_2)\n\t\t\t{\n\t\tif_second_inning_over=true;\n\t\treference2.add(PlayArena2.viewscore2);\n\t\t\t}\n\t\n\t\n\t//Needed update\n\t\t\tupdate_runrate2.setText(\"<html>NEED<br>\"+req+\"<br>OFF<br>\"+over_totalballs_2+\" <br>BALLS</html>\");\n\t\t}", "public abstract void openScoreboard(Scoreboard scoreboard, Player player);", "@Override\n public void activatePowerUp() {\n myGame.getStatusDisplay().getMyProgress().updateScoreMultiplier(SCORE_MULTIPLIED_COUNTER);\n }", "private void showGameScore() {\n System.out.println(messageProvider.provideMessage(\"score\"));\n System.out.println(settings.getPlayers().get(0).getScore()\n + \" vs \" + settings.getPlayers().get(1).getScore());\n }", "public int getPlayerScore(){\n return this.playerScore;\n }", "private void enableJoinStats(Player player) {\n if (Config.getInstance().isScoreboardPlayerStatsEnabled()) {\n final StatsScoreboard scoreboard = new StatsScoreboard(player);\n this.statsScoreboards.put(player, scoreboard);\n this.plugin.getServer().getScheduler().runTaskLaterAsynchronously(this.plugin, () -> {\n synchronized (this.statsController) {\n final Stats stats = this.statsController.getByPlayer(player);\n if (stats != null) {\n scoreboard.updateStats(player, stats);\n }\n }\n }, 20 * 2L);\n }\n }", "public void setScore(){\n\t\t//get player's score and change it to the string\n\t\tthis.scoreLabel.setSize(scoreLabel.getPreferredSize().width, \n\t\t\t\tscoreLabel.getPreferredSize().height);\n\t\tthis.scoreLabel.setText(String.valueOf(this.player.getScore()));\n\t}", "protected void addScoreToLeaderboard() {\n\n\t\tif (onlineLeaderboard) {\n\t\t jsonFunctions = new JSONFunctions();\n\t\t jsonFunctions.setUploadScore(score);\n\t\t \n\t\t Handler handler = new Handler() {\n\t\t\t @Override\n\t\t\t\tpublic void handleMessage(Message msg) {\n\t\t\t\t @SuppressWarnings(\"unchecked\")\n\t\t\t\t ArrayList<Score> s = (ArrayList<Score>) msg.obj;\n\t\t\t\t globalScores = helper.sortScores(s);\n\t\t\t }\n\t\t };\n\t\t \n\t\t jsonFunctions.setHandler(handler);\n\t\t jsonFunctions\n\t\t\t .execute(\"http://brockcoscbrickbreakerleaderboard.web44.net/\");\n\t\t}\n\t\tsaveHighScore();\n }", "public void setNewScore(String player, int score) {\n\t\t\n\t}", "public void setPlayboard(Playboard playboard);", "public void changeLableText(int playerScore,int computerScore);", "public static Scoreboard getInstance() { return scoreboard; }", "public void displayForTeamK(int score) {\n TextView scoreView = (TextView) findViewById(R.id.team_k_score);\n scoreView.setText(String.valueOf(score));\n }", "public void scoring(){\n for (int i=0; i< players.size(); i++){\n Player p = players.get(i);\n p.setScore(10*p.getTricksWon());\n if(p.getTricksWon() < p.getBid() || p.getTricksWon() > p.getBid()){\n int diff = Math.abs(p.getTricksWon() - p.getBid());\n p.setScore(p.getScore() - (10*diff));\n }\n if(p.getTricksWon() == p.getBid()){\n p.setScore(p.getScore() + 20);\n }\n }\n }", "public int getScore(){\n\t\treturn playerScore;\n\t}", "@Override\npublic void update(int score) {\n\t\n}", "public void updatePlayerHealthUI() {\n CharSequence text = String.format(\"Score: %d\", getscore());\n scoreLabel.setText(text);\n }", "public static void setPlayerScore(int score)\r\n\t{\r\n\t\tGame.playerScore = score;\r\n\t}", "public void viewScoreboard(){\n\n Intent intent = new Intent(this, DisplayScoreBoard.class);\n startActivity(intent);\n }", "Scoreboard saveScoreboard(Scoreboard scoreboard);", "private void checkPlayerScoreboard(Player player) {\n\t\tScoreboard known = knownScoreboards.get(player);\n\t\t\n\t\tif (player.hasPermission(\"pandora.movement.nopush\")) {\n\t\t\tif (known == null || known != player.getScoreboard()) {\n\t\t\t\tknown = player.getScoreboard();\n\t\t\t\tknownScoreboards.put(player, known);\n\t\t\t\tsendFakeTeam(player);\n\t\t\t}\n\t\t} else {\n\t\t\tif (known != null) {\n\t\t\t\tdeleteFakeTeam(player);\n\t\t\t\tknownScoreboards.put(player, null);\n\t\t\t}\n\t\t}\n\t}", "public void SZTToEveryOtherPlayer(int value) {\n\t\tfor(Player p:players) {\n\t\t\tif(p!=current) {\n\t\t\t\tp.raiseScore(value);\n\t\t\t}\n\t\t}\n\t}", "public Playboard getPlayboard();", "void onScoresChanged(int scores);", "public void vytvorPanelScore() {\n this.warnPlayLabel = new JLabel(\" \");\n this.warnPlayLabel.setBackground(Color.WHITE);\n this.warnPlayLabel.setFont(this.scorePismo);\n this.warnPlayLabel.setText(\"Stlac tab a hraj :) \");\n \n this.menuButton = new JButton(\"Menu\");\n this.menuButton.setBackground(Color.lightGray);\n this.menuButton.addActionListener(new BackPosluchac());\n \n this.scoreStitok = new JLabel(\" \");\n this.scorePanel = new JPanel();\n this.scorePanel.add(this.warnPlayLabel);\n this.scorePanel.add(this.menuButton);\n this.scorePanel.setPreferredSize(new Dimension(900, 30));\n this.scorePanel.setBackground(Color.WHITE);\n this.scoreStitok.setFont(this.scorePismo);\n this.scoreStitok.setText(\"Score \" + 0);\n this.scoreStitok.setForeground(Color.red);\n this.scorePanel.add(this.scoreStitok);\n \n \n \n\n }", "public void scoringTrick(){\n wizardRule();\n winner.tricksWon++;\n winner = new Player();\n }", "public void setScore (int newScore)\n {\n this.score = newScore;\n }", "protected void setOnePlayerHumanScore(int score){\n this.humanWinsCPU_TextField.setText(Integer.toString(score));\n }", "public void setScore(int score) {this.score = score;}", "public void SZTFromEveryOtherPlayer(int value) {\n\t\tfor(Player p:players) {\n\t\t\tif(p!=current) {\n\t\t\t\tp.lowerScore(value);\n\t\t\t\tcurrent.raiseScore(value);\n\t\t\t}\n\t\t}\n\t}", "public void run()\r\n/* 29: */ {\r\n/* 30:26 */ for (Player p :HG.plugin.getServer().getOnlinePlayers()) {\r\n/* 31:28 */ if (p.getInventory().contains(Material.COMPASS))\r\n/* 32: */ {\r\n/* 33:29 */ PlayerData pd = (PlayerData)this.plugin.players.get(p.getName());\r\n/* 34:31 */ if (pd != null)\r\n/* 35: */ {\r\n/* 36:33 */ String[] st = getNearestPlayer(p, pd);\r\n/* 37:34 */ String info = \"\" + ChatColor.WHITE + ChatColor.BOLD + \"Nearest Player: \" + ChatColor.RED + st[0] + \" \" + ChatColor.WHITE + ChatColor.BOLD + \"Distance: \" + ChatColor.RED + st[1];\r\n/* 38:36 */ for (ItemStack it : p.getInventory()) {\r\n/* 39:37 */ if ((it != null) && (it.getType() == Material.COMPASS))\r\n/* 40: */ {\r\n/* 41:38 */ ItemMeta im = it.getItemMeta();\r\n/* 42:39 */ im.setDisplayName(info);\r\n/* 43:40 */ it.setItemMeta(im);\r\n/* 44: */ }\r\n/* 45: */ }\r\n/* 46: */ }\r\n/* 47: */ }\r\n/* 48: */ }\r\n/* 49: */ }", "public void updateScore(int playerScore){\n\t\tscore += playerScore;\n\t\tscoreTotalLabel.setText(\"\" + score);\n\t}", "private void setBoardData(Map<Player, Integer> scores) {\n Map<Player, Integer> sortedMap = MapUtil.sortByValueReverse(scores);\n\n for (Player player : Bukkit.getOnlinePlayers()) {\n int line = 1;\n for (Map.Entry<Player, Integer> entry : sortedMap.entrySet()) {\n if (line > scores.size() || line > 15) return;\n\n Player scoreboardEntry = entry.getKey();\n String score = Integer.toString(entry.getValue());\n\n titleManagerAPI.setScoreboardValue(player, line, score + \" \" + ChatColor.GREEN + scoreboardEntry.getDisplayName());\n\n line++;\n }\n }\n }", "public static void score() {\n\t\tSystem.out.println(\"SCORE: \");\n\t\tSystem.out.println(player1 + \": \" + score1);\n\t\tSystem.out.println(player2 + \": \" + score2);\n\t}", "public void updateScores() {\n\t\tscoreText.setText(\"Score: \" + ultraland.getScore());\n\t}", "public int getPlayerScore(){\n\t\treturn playerScore;\n\t}", "private void setPlayerScore(Player player, int newScore) {\n\t\tplayer.score = Math.max(newScore, 0);\n\t\tfor (ScoreMarker scoreMarker : playerScoreMarkers) {\n\t\t\tif (scoreMarker.getOwner() == player) {\n\t\t\t\tscoreMarker.value = String.valueOf(player.score);\n\t\t\t}\n\t\t}\n\t}", "public void setScore(int score) { this.score = score; }", "private void scoreboard() {\n Intent intent = new Intent(this, AlienPainterScoreboardActivity.class);\n intent.putExtra(SCOREBOARD_STATUS, presenter.getIsVictorious());\n intent.putExtra(POINTS, presenter.getPoints());\n intent.putExtra(NUM_MOVES, presenter.getNumMoves());\n intent.putExtra(TIME_LEFT, presenter.getTimeLeft());\n intent.putExtra(LANGUAGE, isEnglish);\n intent.putExtra(PASS_USER, currUser);\n startActivity(intent);\n finish();\n }", "@Override\n\tpublic void checkScore() {\n\t\t\n\t}", "protected void setScore(int s)\r\n\t{\r\n\t\tGame.score = s;\r\n\t}", "public void updateWithPointWonBy(Player player) {\n if(managerTennisMatch.statusTennisMatch == \"ClassicalGame\") {\n if (player == player1) {\n managerTennisMatch.checkScoreAndUpdateGame(player, player2);\n } else {\n managerTennisMatch.checkScoreAndUpdateGame(player, player1);\n }\n } else if(managerTennisMatch.statusTennisMatch == \"TieBreakInProgress\") {\n player.setScore(player.getScore() + 1);\n if((player1.getScore() >= 7 && player1.getScore() - player2.getScore() >= 2) || (player2.getScore() >= 7 && player2.getScore() - player1.getScore() >= 2)) {\n tennisSetList.get(tennisSetList.size() - 1).getBaseGameList().add(new TieBreakGame(player));\n player1.setScore(0);\n player2.setScore(0);\n }\n } else {\n return;\n }\n }", "private static void updateGame()\n {\n GameView.gameStatus.setText(\"Score: \" + computerScore + \"-\" + playerScore);\n if (computerScore + playerScore == NUM_CARDS_PER_HAND) {\n if (computerScore > playerScore) {\n GameView.gameText.setText(\"Computer Wins!\");\n Timer.stop = true;\n }\n else if (playerScore > computerScore) {\n GameView.gameText.setText(\"You win!\");\n Timer.stop = true;\n }\n else {\n GameView.gameText.setText(\"Tie game!\"); \n Timer.stop = true;\n }\n }\n }", "public void addVps(Player player) {\n }", "public void setAwayScore(int a);", "void increaseScore(){\n\t\t currentScore = currentScore + 10;\n\t\t com.triviagame.Trivia_Game.finalScore = currentScore;\n\t }", "private void refreshScore(){\n String info = players[0] + \" \"+playerScores[0]+\":\" +playerScores[1]+ \" \"+players[1];\n scoreInfo.setText(info);\n }", "public void displayForTeamV(int score) {\n TextView scoreView = (TextView) findViewById(R.id.team_v_score);\n scoreView.setText(String.valueOf(score));\n }", "public void showLobbyBoard(Player player){\n\t\tFeatherBoardAPI.showScoreboard(player,\"build-battle-lobby\");\n\t}", "@Test\n void updateScore() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n p.setTurn(true);\n p.updateScore(3);\n assertTrue(p.getScore()==3);\n\n p = new RealPlayer('b', \"ciccia\");\n p.updateScore(-1);\n assertTrue(p.getScore()==0);\n }", "public void statistics(){\n System.out.println(this.scoreboard.toString());\n }", "public void run() {\n\t\tif (timeToStart > 0 && timeToStart <= 3) {\n\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\tonline.sendMessage(Main.prefix() + \"UHC is starting in §6\" + String.valueOf(timeToStart) + \"§7.\");\n\t\t\t\tonline.playSound(online.getLocation(), Sound.SUCCESSFUL_HIT, 1, 0);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (timeToStart == 1) {\n\t\t\tMain.stopCountdown();\n\t\t\tBukkit.getServer().getScheduler().scheduleSyncDelayedTask(Main.plugin, new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.SUCCESSFUL_HIT, 1, 1);\n\t\t\t\t\t\tif (ArrayUtil.spectating.contains(online.getName())) {\n\t\t\t\t\t\t\tSpectator.getManager().set(online, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonline.setAllowFlight(false);\n\t\t\t\t\t\tonline.setFlying(false);\n\t\t\t\t\t\tonline.setHealth(20.0);\n\t\t\t\t\t\tonline.setFireTicks(0);\n\t\t\t\t\t\tonline.setSaturation(20);\n\t\t\t\t\t\tonline.setLevel(0);\n\t\t\t\t\t\tonline.setExp(0);\n\t\t\t\t\t\tif (!ArrayUtil.spectating.contains(online.getName())) {\n\t\t\t\t\t\t\tonline.showPlayer(online);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonline.awardAchievement(Achievement.OPEN_INVENTORY);\n\t\t\t\t\t\tonline.setFoodLevel(20);\n\t\t\t\t\t\tonline.getInventory().clear();\n\t\t\t\t\t\tonline.getInventory().setArmorContents(null);\n\t\t\t\t\t\tonline.setItemOnCursor(new ItemStack (Material.AIR));\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (online.getGameMode() != GameMode.SURVIVAL) {\n\t\t\t\t\t\t\tonline.setGameMode(GameMode.SURVIVAL);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (PotionEffect effect : online.getActivePotionEffects()) {\n\t\t\t\t\t\t\tonline.removePotionEffect(effect.getType());\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonline.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 250, 100));\n\t\t\t\t\t\tonline.addPotionEffect(new PotionEffect(PotionEffectType.SATURATION, 6000, 100));\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"UHC has now started, Good luck!\");\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"PvP will be enabled in §6\" + Settings.getInstance().getData().getInt(\"game.pvp\") + \" §7mins in.\");\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"Meetup at §6\" + Settings.getInstance().getData().getInt(\"game.meetup\") + \" §7mins in.\");\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"Remember to read the match post: \" + Settings.getInstance().getData().getString(\"match.post\"));\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"/helpop questions.\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tGameState.setState(GameState.INGAME);\n\t\t\t\t\tScoreboards.getManager().setScore(\"§a§lPvE\", 1);\n\t\t\t\t\tScoreboards.getManager().setScore(\"§a§lPvE\", 0);\n\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lMeetup\", Integer.parseInt(\"-\" + Settings.getInstance().getData().getInt(\"game.meetup\")));\n\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lPvP\", Integer.parseInt(\"-\" + Settings.getInstance().getData().getInt(\"game.pvp\")));\n\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lFinal heal\", -1);\n\t\t\t\t\t\n\t\t\t\t\tfor (World world : Bukkit.getWorlds()) {\n\t\t\t\t\t\tworld.setTime(0);\n\t\t\t\t\t\tworld.setDifficulty(Difficulty.HARD);\n\t\t\t\t\t\tworld.setPVP(false);\n\t\t\t\t\t\tfor (Entity mobs : world.getEntities()) {\n\t\t\t\t\t\t\tif (mobs.getType() == EntityType.BLAZE ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.CAVE_SPIDER ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.CREEPER ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.ENDERMAN ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.ZOMBIE ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.WITCH ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.WITHER ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.DROPPED_ITEM ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.GHAST ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.GIANT ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.MAGMA_CUBE ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.DROPPED_ITEM ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SKELETON ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SPIDER ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SLIME ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SILVERFISH ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SKELETON || \n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.EXPERIENCE_ORB) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tmobs.remove();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 20);\n\t\t\t\n\t\t\tBukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Main.plugin, new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tif (Scoreboards.getManager().getScoreType(\"§b§lFinal heal\") != null) {\n\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lFinal heal\") + 1) == 0) {\n\t\t\t\t\t\t\tScoreboards.getManager().resetScore(\"§b§lFinal heal\");\n\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"§6§lFinal heal!\");\n\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\n\t\t\t\t\t\t\t\tonline.setHealth(20.0);\n\t\t\t\t\t\t\t\tonline.setFireTicks(0);\n\t\t\t\t\t\t\t\tonline.setFoodLevel(20);\n\t\t\t\t\t\t\t\tonline.setSaturation(20);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lFinal heal\") + 1) < 0) {\n\t\t\t\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lFinal heal\", Scoreboards.getManager().getScore(\"§b§lFinal heal\") + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (Scoreboards.getManager().getScoreType(\"§b§lPvP\") != null) {\n\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lPvP\") + 1) == 0) {\n\t\t\t\t\t\t\tScoreboards.getManager().resetScore(\"§b§lPvP\");\n\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"PvP is now enabled, Good luck everyone.\");\n\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (World world : Bukkit.getWorlds()) {\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lPvP\") + 1) < 0) {\n\t\t\t\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lPvP\", Scoreboards.getManager().getScore(\"§b§lPvP\") + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (Scoreboards.getManager().getScore(\"§b§lPvP\") == -5) {\n\t\t\t\t\t\t\t\tBukkit.broadcastMessage(Main.prefix() + \"5 minutes to pvp, do §6/stalk §7if you think you're being stalked.\");\n\t\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (Scoreboards.getManager().getScore(\"§b§lPvP\") == -1) {\n\t\t\t\t\t\t\t\tBukkit.broadcastMessage(Main.prefix() + \"1 minute to pvp, do §6/stalk §7if you think you're being stalked.\");\n\t\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (Scoreboards.getManager().getScoreType(\"§b§lMeetup\") != null) {\n\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lMeetup\") + 1) == 0) {\n\t\t\t\t\t\t\tScoreboards.getManager().resetScore(\"§b§lMeetup\");\n\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\tonline.sendMessage(ChatColor.DARK_GRAY + \"==============================================\");\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tonline.sendMessage(ChatColor.GREEN + \" Meetup has started, start headding to 0,0.\");\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tonline.sendMessage(ChatColor.GREEN + \" Only stop for a fight, nothing else.\");\n\t\t\t\t\t\t\t\tonline.sendMessage(ChatColor.DARK_GRAY + \"==============================================\");\n\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.WITHER_DEATH, 1, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lMeetup\") + 1) < 0) {\n\t\t\t\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lMeetup\", Scoreboards.getManager().getScore(\"§b§lMeetup\") + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (Scoreboards.getManager().getScore(\"§b§lMeetup\") == -1) {\n\t\t\t\t\t\t\t\tBukkit.broadcastMessage(Main.prefix() + \"1 minute to meetup, Pack your stuff and get ready to head to 0,0.\");\n\t\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 1200, 1200);\n\t\t\t\n\t\t\tBukkit.getServer().getScheduler().runTaskLater(Main.plugin, new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tBukkit.getPlayer(Settings.getInstance().getData().getString(\"game.host\")).chat(\"/gamerule doMobSpawning true\");\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t}\n\t\t\t}, 3600);\n\t\t}\n\t\ttimeToStart -=1;\n\t}", "void setScore(long score);", "@Override\n\tpublic int getPlayerOneScore() {\n\t\treturn super.getPlayerOneScore();\n\t}", "public void addTwoForTeamK (View v) {\n kScore = kScore +2;\n displayForTeamK(kScore);\n }", "private void showScores() {\n levelNumber.setText(String.format(\"%s%d\", getResources().getString(R.string.level), level));\n Level l = Level.getLevel(level);\n for (int i = 0; i < Level.MAX_SCORES; i++) {\n Level.Player p = l.getPlayer(i);\n if (p != null) new ScoreTextView(i + 1, p.toString());\n }\n }", "public void use(Player player) {\n\n\t}", "public void updatePlayer(Player player) {\n Duration playDuration = Duration.ofMinutes(player.getStatistic(Statistic.PLAY_ONE_MINUTE) / 20 / 60);\n int hoursPlayed = Math.toIntExact(playDuration.toHours());\n this.objective.getScore(player.getName()).setScore(hoursPlayed);\n }", "public void updatescore() {\n scorelabel.setText(\"\" + score + \" points\");\n if (100 - score <= 10) win();\n }", "@Override\n\tpublic void loadScore() {\n\n\t}", "public static int getPlayerScore()\r\n\t{\r\n\t\treturn playerScore;\r\n\t}", "public PlayerScore (String name, int score)\n {\n playerName = name;\n playerScore = score;\n }", "public void loadScore() {\n for (int i = 0; i < 4; i++) {\n int[] enemyTankNum = CollisionUtility.getEnemyTankNum();\n tankNumList[i] = enemyTankNum[i];\n }\n for (int i = 0; i < 4; i++) {\n tankScoreList[i] = tankNumList[i] * 100 * (i + 1);\n }\n for (Integer score : tankScoreList) {\n totalScore += score;\n }\n for (Integer num : tankNumList) {\n totalTankNum += num;\n }\n }", "public void setObjectiveScore(String name, Player player, int value) {\n scoreboard.getObjective(name).getScore(player.getName()).setScore(value);\n }", "@Override\n\tpublic int getPlayerTwoScore() {\n\t\treturn super.getPlayerTwoScore();\n\t}", "private void scoreloss() {\n \tif (playerturn%2==0) {\n \tscoreplayer1 = scoreplayer1-1;}\n if(playerturn%2==1) {\n \tscoreplayer2 = scoreplayer2-1;\n }\n }", "public void updateScoreUI() {\n\t\tMap<Integer, Integer> scoreMap = gameLogic.getScoreboard().getTotalScore();\n\n\t\tlblScoreA.setText(String.valueOf(scoreMap.get(0)));\n lblScoreB.setText(String.valueOf(scoreMap.get(1)));\n lblScoreC.setText(String.valueOf(scoreMap.get(2)));\n lblScoreD.setText(String.valueOf(scoreMap.get(3)));\n\t}", "private void setUpScoreZone() {\n }", "@Override\n\tpublic void show() {\n\t\tTexture.setEnforcePotImages(false);\n\t\t Time t=new Time();\n\t\t t.setToNow();\n\t\t String s=t.year+\".\"+t.month+\".\"+t.monthDay+\".\"+t.hour+\".\"+t.minute+\".\"+t.second;\n\t\t SharedPreferences sp=welcome.hard;\n\t\t String score=hardMainActivity.hard.getString(\"score\",\"\");\n\t\t System.out.println(\"score=\"+score);\n\t\t if(hardJump.score>Integer.parseInt(score))\n\t\t {\n\t\t \thardMainActivity.hard.edit().putString(\"day\",s).commit();\n\t\t \thardMainActivity.hard.edit().putString(\"score\",String.valueOf(hardJump.score)).commit();\n\t\t }\n\t\t stage = new Stage(MainActivity.screenwidth,MainActivity.screenheight,false);\n\t\t label = new Label(\"\", labelStyle); \n\t\t menu=new Image(new Texture(Gdx.files.internal(\"easy/menu.png\")));\n\t\t menu.setSize(317*MainActivity.w, 103*MainActivity.h);\n\t\t menu.setPosition(480*MainActivity.w, 310*MainActivity.h);\n\t\t restart=new Image(new Texture(Gdx.files.internal(\"easy/restart.png\")));\n\t\t restart.setSize(317*MainActivity.w, 103*MainActivity.h);\n\t\t restart.setPosition(480*MainActivity.w, 480*MainActivity.h);\n\t\t image = new Image(new Texture(Gdx.files.internal(\"hard/hardback.png\")));\n\t\t image.setSize(MainActivity.screenwidth, MainActivity.screenheight);\n\t\t loading = new Label(\"\",labelStyle);\n\t\t loading.setText(\"\");\n\t\t loading.setSize(100*MainActivity.w, 100*MainActivity.h);\n\t\t loading.setPosition(480*MainActivity.w, 200*MainActivity.h);\n\t\t if(hardJump.score>=50)\n\t\t { \n\t\t \t hardMainActivity.achievement.edit().putString(\"four\",String.valueOf(1)).commit();\n\t\t \n\t\t \n\t\t }\n\t\t else if(hardJump.score>=30)\n\t\t {\n\t\t \t hardMainActivity.achievement.edit().putString(\"three\",String.valueOf(1)).commit();\n\t\t\t\t \n\t\t } \n\t\t stage.addActor(image);\n\t\t stage.addActor(menu);\n\t\t stage.addActor(restart);\n\t\t stage.addActor(label);\n\t\t stage.addActor(loading);\n\t}", "public abstract void closeScoreboard(Player player);", "@Override\n public void showScoreBoard() {\n calledMethods.add(\"showScoreBoard\");\n }", "public int getScore() {return score;}", "void updateScore () {\n scoreOutput.setText(Integer.toString(score));\n }", "public void setScoreStitok() {\n this.scoreStitok.setText(\"Score \" + this.score);\n }", "public Score getScore()\r\n { \r\n return theScore;\r\n }", "public void getScores(){\n String p1 = \"Player 1 has \" + Integer.toString(player1.getWins());\n String p2 = \"Player 2 has \" + Integer.toString(player2.getWins());\n String winner = \"tie\";\n if(player1.getWins()>player2.getWins()){\n winner = player1.getName() + \" wins!!!!\";\n }\n else if(player2.getWins()>player1.getWins()){\n winner = player2.getName() + \" Wins!!!\";\n }\n JOptionPane.showMessageDialog(null, (p1 + \"\\n\" + p2 + \"\\n\" + winner));\n }", "public void putPieceOnBoard(ChessBoardBlock b, String player) {\r\n\t\tint blackCount = getBlackCountInVector();\r\n\t\tint whiteCount = getWhiteCountInVector();\r\n\t\tif (blackCount == 12 && whiteCount == 12) {\r\n\t\t\tt.setText(\"<html>black:\" + getBlackCountInVector() + \" white:\" + getWhiteCountInVector() + \"<br>Cannot put any more pieces on</html>\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (blackCount == 12 && player.equals(\"black\")) {\r\n\t\t\tt.setText(\"<html>black:\" + getBlackCountInVector() + \" white:\" + getWhiteCountInVector() + \"<br>Black pieces are maximum</html>\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (whiteCount == 12 && player.equals(\"white\")) {\r\n\t\t\tt.setText(\"<html>black:\" + getBlackCountInVector() + \" white:\" + getWhiteCountInVector() + \"<br>White pieces are maximum</html>\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tString position = b.position;\r\n\t\tChessPiece tmpPiece;\r\n\t\tif (player.equals(\"black\")) {\r\n\t\t\ttmpPiece = blackPieces[blackCount];\r\n\t\t\tSystem.out.println(player);\r\n\r\n\t\t\t// Set 'K' label\r\n\t\t\tif (position.equals(\"A1\")||position.equals(\"B1\")||position.equals(\"C1\")||position.equals(\"D1\")||\r\n\t\t\t\tposition.equals(\"E1\")||position.equals(\"F1\")||position.equals(\"G1\")||position.equals(\"H1\")) {\r\n\t\t\t\ttmpPiece.setText(\"<html><font color=\\\"white\\\">K</font></html>\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\ttmpPiece = whitePieces[whiteCount];\r\n\r\n\t\t\t// Set 'K' label\r\n\t\t\tif (position.equals(\"A8\")||position.equals(\"B8\")||position.equals(\"C8\")||position.equals(\"D8\")||\r\n\t\t\t\tposition.equals(\"E8\")||position.equals(\"F8\")||position.equals(\"G8\")||position.equals(\"H8\")) {\r\n\t\t\t\ttmpPiece.setText(\"<html><font color=\\\"black\\\">K</font></html>\");\r\n\t\t\t}\r\n\t\t}\r\n\t\ttmpPiece.position = position;\r\n\t\tpiece.put(position, tmpPiece);\r\n\t\tbody.add(tmpPiece);\r\n\t\treFormatPieceLayer();\r\n\r\n\t\tt.setText(\"<html>black:\" + getBlackCountInVector() + \" white:\" + getWhiteCountInVector() + \"</html>\");\r\n\t}", "public void create(Player p) {\r\n\t\tAsyncCatcher.enabled = false;\r\n\t\tsboard.remove(p.getUniqueId());\r\n\t\t\r\n\t\tScoreboard sb = Bukkit.getScoreboardManager().getNewScoreboard();\r\n\t\t\r\n\t\tsboard.put(p.getUniqueId(), sb);\r\n\t\t\r\n\t\tp.setScoreboard(sb);\r\n\t\tAsyncCatcher.enabled = true;\r\n\t}", "public String getPlayerName() {\n/* 100 */ return this.scorePlayerName;\n/* */ }", "public void showGameBoard(Player player){\n\t\tFeatherBoardAPI.removeScoreboardOverride(player, \"build-battle-lobby\");\n\n\t\tFeatherBoardAPI.showScoreboard(player,\"build-battle-game\");\n\t}", "public int getOpponentScore(){\n return this.oppoScore;\n }", "public void secondLeftNeighborGivesSZTToCurrent(int value) {\n\t\tif(players.indexOf(current)<2) {\n\t\t\tplayers.get(players.size()-players.indexOf(current)-1).lowerScore(value);\n\t\t\tcurrent.raiseScore(value);\n\t\t}\n\t\telse {\n\t\t\tplayers.get(players.indexOf(current)-2).lowerScore(value);\n\t\t\tcurrent.raiseScore(value);\n\t\t}\n\t}", "public int getScore()\n {\n return currentScore;\n }", "public void scoresForGameModes() {\r\n \tCalculateScore myScore = new CalculateScore();\r\n \tthis.score = myScore.giveScore();\r\n \tif (gamemode == 1) {\r\n \t\treturn;\r\n \t}\r\n \tif (gamemode ==2 ) {\r\n \t\tthis.score = this.score - (10 * (currentGraph.getCNumber() - set.size()));\r\n \t}\r\n \tif (gamemode ==3) {\r\n \t\tthis.score = this.score - (10 * (currentGraph.getCNumber() -set.size()));\r\n \t}\r\n }", "public int getScore()\n {\n // put your code here\n return score;\n }", "@Override\n public void landedOn(Player player) {}", "@Test\r\n public void calculateScore() {\r\n board3.swapTiles(0,0,1,1);\r\n board3.getSlidingScoreBoard().setTime(2);\r\n board3.getSlidingScoreBoard().calculateScore();\r\n assertEquals(496, board3.getSlidingScoreBoard().getScore());\r\n }" ]
[ "0.76686203", "0.730005", "0.7162943", "0.7093936", "0.70646656", "0.69435316", "0.6744507", "0.6727955", "0.6501181", "0.6478074", "0.64514774", "0.64486206", "0.63764346", "0.6303643", "0.62497807", "0.6241053", "0.61931473", "0.6177258", "0.61700463", "0.6169412", "0.6168319", "0.6161073", "0.6147618", "0.6110136", "0.609833", "0.6065557", "0.60307115", "0.6029737", "0.60207933", "0.6018393", "0.6016872", "0.59860986", "0.59758484", "0.5937456", "0.59349096", "0.59235096", "0.5922967", "0.592134", "0.5921288", "0.5919921", "0.59166896", "0.5914393", "0.5914368", "0.5904087", "0.5899531", "0.58995026", "0.589381", "0.5888846", "0.58779854", "0.5876578", "0.5866248", "0.58636814", "0.58630455", "0.58549124", "0.5852606", "0.5852517", "0.58350116", "0.5823273", "0.58219516", "0.58216405", "0.5820895", "0.58195186", "0.5819025", "0.5813294", "0.5802581", "0.57942665", "0.57940716", "0.57925886", "0.57880765", "0.57848555", "0.57811016", "0.5774351", "0.5773017", "0.57726735", "0.57719886", "0.57463855", "0.57459646", "0.5740644", "0.5739869", "0.57279944", "0.57278675", "0.5711758", "0.57104784", "0.5707738", "0.57071424", "0.57054347", "0.56992126", "0.5697979", "0.56979424", "0.569504", "0.5693262", "0.56899434", "0.5678923", "0.567488", "0.56746644", "0.5671968", "0.56673175", "0.56664795", "0.56664544", "0.5656674", "0.565485" ]
0.0
-1
crxNodeEntityRepository = new AbstractEntityRepository();
@Before public void setup() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Repository() {\n\n }", "protected XMLRepositoryImpl() {\n }", "private EmployeeRepository(){\n\t\t\n\t}", "@Repository\npublic interface ItemComboRepository extends Neo4jRepository<ItemCombo, Long> {\n\n ItemRepository findByCode(String code);\n\n}", "public ProductoRepository() {}", "private ObjectRepository() {\n\t}", "public interface Repository {\n\n }", "public interface Repository {\n\n }", "public void setupEntities() {\n }", "protected void createRepository() throws Exception {\r\n\t\t\r\n\t\t//Creating MLSesame Connection object Using MarkLogicRepositoryConfig\r\n\t\t\r\n\t\tMarkLogicRepositoryConfig adminconfig = new MarkLogicRepositoryConfig();\r\n\t\tadminconfig.setHost(host);\r\n\t\tadminconfig.setAuth(\"DIGEST\");\r\n\t\tadminconfig.setUser(\"admin\");\r\n\t\tadminconfig.setPassword(\"admin\");\r\n\t\tadminconfig.setPort(restPort);\r\n\t\tRepositoryFactory factory = new MarkLogicRepositoryFactory();\r\n Assert.assertEquals(\"marklogic:MarkLogicRepository\", factory.getRepositoryType());\r\n try {\r\n\t\t\ttestAdminRepository = (MarkLogicRepository) factory.getRepository(adminconfig);\r\n\t\t} catch (RepositoryConfigException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n try {\r\n\t\t\ttestAdminRepository.initialize();\r\n\t\t\ttestAdminCon = (MarkLogicRepositoryConnection) testAdminRepository.getConnection();\r\n\t\t} catch (RepositoryException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n \r\n // Creating testAdminCon with MarkLogicRepositoryConfig constructor\r\n testAdminCon.close();\r\n testAdminRepository.shutDown();\r\n testAdminRepository = null; \r\n testAdminCon = null; \r\n \r\n adminconfig = new MarkLogicRepositoryConfig(host,restPort,\"admin\",\"admin\",\"DIGEST\");\r\n Assert.assertEquals(\"marklogic:MarkLogicRepository\", factory.getRepositoryType());\r\n testAdminRepository = (MarkLogicRepository) factory.getRepository(adminconfig);\r\n testAdminRepository.initialize();\r\n \r\n testAdminCon = testAdminRepository.getConnection();\r\n Assert.assertTrue(testAdminCon instanceof MarkLogicRepositoryConnection);\r\n \r\n Repository otherrepo = factory.getRepository(adminconfig);\r\n RepositoryConnection conn = null;\r\n try{\r\n \t //try to get connection without initializing repo, will throw error\r\n conn = otherrepo.getConnection();\r\n Assert.assertTrue(false);\r\n }\r\n catch(Exception e){\r\n \tAssert.assertTrue(e instanceof RepositoryException);\r\n \tAssert.assertTrue(conn == null);\r\n \totherrepo.shutDown();\r\n }\r\n \r\n Assert.assertTrue(testAdminCon instanceof MarkLogicRepositoryConnection);\r\n graph1 = testAdminCon.getValueFactory().createURI(\"http://marklogic.com/Graph1\");\r\n graph2 = testAdminCon.getValueFactory().createURI(\"http://marklogic.com/Graph2\");\r\n dirgraph = testAdminCon.getValueFactory().createURI(\"http://marklogic.com/dirgraph\");\r\n dirgraph1 = testAdminCon.getValueFactory().createURI(\"http://marklogic.com/dirgraph1\");\r\n \r\n \r\n //Creating MLSesame Connection object Using MarkLogicRepository overloaded constructor\r\n if(testReaderCon == null || testReaderRepository ==null){\r\n \ttestReaderRepository = new MarkLogicRepository(host, restPort, \"reader\", \"reader\", \"DIGEST\");\r\n\t try {\r\n\t\t\t\ttestReaderRepository.initialize();\r\n\t\t\t\tAssert.assertNotNull(testReaderRepository);\r\n\t\t\t\ttestReaderCon = (MarkLogicRepositoryConnection) testReaderRepository.getConnection();\r\n\t\t\t} catch (RepositoryException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t Assert.assertTrue(testReaderCon instanceof MarkLogicRepositoryConnection);\r\n\t \r\n\t }\r\n \r\n \r\n //Creating MLSesame Connection object Using MarkLogicRepository(databaseclient) constructor\r\n if (databaseClient == null){\r\n \tdatabaseClient = DatabaseClientFactory.newClient(host, restPort, \"writer\", \"writer\", DatabaseClientFactory.Authentication.valueOf(\"DIGEST\"));\r\n }\r\n \t\t\r\n\t\tif(testWriterCon == null || testWriterRepository ==null){\r\n\t\t\ttestWriterRepository = new MarkLogicRepository(databaseClient);\r\n\t\t\tqmgr = databaseClient.newQueryManager();\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\ttestWriterRepository.initialize();\r\n\t\t\t\tAssert.assertNotNull(testWriterRepository);\r\n\t\t\t\ttestWriterCon = (MarkLogicRepositoryConnection) testWriterRepository.getConnection();\r\n\t\t\t} catch (RepositoryException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public interface NodeTypeRepository extends CrudRepository<NodeType,Long> {\n}", "public interface Repository {}", "@Override\n\tpublic void initEntity() {\n\n\t}", "public interface BaseRepository<T> extends GraphRepository<T> {\n}", "public interface RoleRepository extends GraphRepository<Role> {\n\n}", "@Override\n public void rootRPClassUpdate(RPObject entity) {\n }", "void setRepository(Repository repository);", "@SuppressWarnings(\"unchecked\")\n\t public AbstractHibernateRepository() {\n\t entityClass = (Class<Entity>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];\n\t }", "public interface IRepository {\n}", "Policy_Repository createPolicy_Repository();", "public void setRepository(CollisionRepository repo) \n\t{ \n\t\tmRepo = repo; \n\t}", "protected void entityInit() {}", "@Override\r\n public void createNewEntity(String entityName) {\n\r\n }", "public interface ProductInfoRepository {\n}", "@BeforeClass\n public static void beforeAll() throws Exception {\n context = new ExecutionContext();\n\n // Create the node type manager ...\n context.getNamespaceRegistry().register(Vehicles.Lexicon.Namespace.PREFIX, Vehicles.Lexicon.Namespace.URI);\n repository = mock(JcrRepository.class);\n when(repository.getExecutionContext()).thenReturn(context);\n\n repoLockManager = mock(RepositoryLockManager.class);\n when(repository.getRepositoryLockManager()).thenReturn(repoLockManager);\n\n rntm = new RepositoryNodeTypeManager(repository, null, true, true);\n try {\n CndNodeTypeReader cndReader = new CndNodeTypeReader(context);\n cndReader.readBuiltInTypes();\n rntm.registerNodeTypes(cndReader);\n rntm.registerNodeTypes(Vehicles.getNodeTypes(context));\n } catch (RepositoryException re) {\n re.printStackTrace();\n throw new IllegalStateException(\"Could not load node type definition files\", re);\n } catch (IOException ioe) {\n ioe.printStackTrace();\n throw new IllegalStateException(\"Could not access node type definition files\", ioe);\n }\n }", "@Autowired\n public void setDomainRepository(DomainRepository domainRepo) \n {\n this.domainRepo = domainRepo;\n }", "private EntityFactory() {}", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "public AbstractEntity() {\r\n\t}", "public static void initRepository() {\n deserialize();\n if (flightRepository == null) {\n flightRepository = new FlightRepository();\n }\n }", "public EntityFactoryImpl() {\n\t\tsuper();\n\t}", "public ExcursionEntity() {\n\t}", "public EntityHierarchyItem() {\n }", "public AbstractRepositoryImplConfig() {\n\t}", "public interface Core2Repository extends SolrCrudRepository<Core2, String> {\r\n}", "interface NetworkRepository extends JpaRepository<Network, Long> {\n\n}", "abstract void initPersistance();", "public interface RepositoryFactory extends EFactory {\n /**\n * The singleton instance of the factory.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @generated\n */\n RepositoryFactory eINSTANCE = io.fixprotocol._2020.orchestra.repository.impl.RepositoryFactoryImpl.init();\n\n /**\n * Returns a new object of class '<em>Action Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Action Type</em>'.\n * @generated\n */\n ActionType createActionType();\n\n /**\n * Returns a new object of class '<em>Actors Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Actors Type</em>'.\n * @generated\n */\n ActorsType createActorsType();\n\n /**\n * Returns a new object of class '<em>Actor Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Actor Type</em>'.\n * @generated\n */\n ActorType createActorType();\n\n /**\n * Returns a new object of class '<em>Annotation</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Annotation</em>'.\n * @generated\n */\n Annotation createAnnotation();\n\n /**\n * Returns a new object of class '<em>Appinfo</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Appinfo</em>'.\n * @generated\n */\n Appinfo createAppinfo();\n\n /**\n * Returns a new object of class '<em>Block Assignment Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Block Assignment Type</em>'.\n * @generated\n */\n BlockAssignmentType createBlockAssignmentType();\n\n /**\n * Returns a new object of class '<em>Categories Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Categories Type</em>'.\n * @generated\n */\n CategoriesType createCategoriesType();\n\n /**\n * Returns a new object of class '<em>Category Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Category Type</em>'.\n * @generated\n */\n CategoryType createCategoryType();\n\n /**\n * Returns a new object of class '<em>Code Sets Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Code Sets Type</em>'.\n * @generated\n */\n CodeSetsType createCodeSetsType();\n\n /**\n * Returns a new object of class '<em>Code Set Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Code Set Type</em>'.\n * @generated\n */\n CodeSetType createCodeSetType();\n\n /**\n * Returns a new object of class '<em>Code Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Code Type</em>'.\n * @generated\n */\n CodeType createCodeType();\n\n /**\n * Returns a new object of class '<em>Component Ref Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Component Ref Type</em>'.\n * @generated\n */\n ComponentRefType createComponentRefType();\n\n /**\n * Returns a new object of class '<em>Component Rule Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Component Rule Type</em>'.\n * @generated\n */\n ComponentRuleType createComponentRuleType();\n\n /**\n * Returns a new object of class '<em>Components Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Components Type</em>'.\n * @generated\n */\n ComponentsType createComponentsType();\n\n /**\n * Returns a new object of class '<em>Component Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Component Type</em>'.\n * @generated\n */\n ComponentType createComponentType();\n\n /**\n * Returns a new object of class '<em>Concepts Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Concepts Type</em>'.\n * @generated\n */\n ConceptsType createConceptsType();\n\n /**\n * Returns a new object of class '<em>Concept Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Concept Type</em>'.\n * @generated\n */\n ConceptType createConceptType();\n\n /**\n * Returns a new object of class '<em>Datatypes Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Datatypes Type</em>'.\n * @generated\n */\n DatatypesType createDatatypesType();\n\n /**\n * Returns a new object of class '<em>Datatype Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Datatype Type</em>'.\n * @generated\n */\n DatatypeType createDatatypeType();\n\n /**\n * Returns a new object of class '<em>Documentation</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Documentation</em>'.\n * @generated\n */\n Documentation createDocumentation();\n\n /**\n * Returns a new object of class '<em>Document Root</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Document Root</em>'.\n * @generated\n */\n DocumentRoot createDocumentRoot();\n\n /**\n * Returns a new object of class '<em>Extension Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Extension Type</em>'.\n * @generated\n */\n ExtensionType createExtensionType();\n\n /**\n * Returns a new object of class '<em>Field Ref Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Field Ref Type</em>'.\n * @generated\n */\n FieldRefType createFieldRefType();\n\n /**\n * Returns a new object of class '<em>Field Rule Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Field Rule Type</em>'.\n * @generated\n */\n FieldRuleType createFieldRuleType();\n\n /**\n * Returns a new object of class '<em>Fields Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Fields Type</em>'.\n * @generated\n */\n FieldsType createFieldsType();\n\n /**\n * Returns a new object of class '<em>Field Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Field Type</em>'.\n * @generated\n */\n FieldType createFieldType();\n\n /**\n * Returns a new object of class '<em>Flow Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Flow Type</em>'.\n * @generated\n */\n FlowType createFlowType();\n\n /**\n * Returns a new object of class '<em>Group Ref Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Group Ref Type</em>'.\n * @generated\n */\n GroupRefType createGroupRefType();\n\n /**\n * Returns a new object of class '<em>Groups Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Groups Type</em>'.\n * @generated\n */\n GroupsType createGroupsType();\n\n /**\n * Returns a new object of class '<em>Group Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Group Type</em>'.\n * @generated\n */\n GroupType createGroupType();\n\n /**\n * Returns a new object of class '<em>Identifiers Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Identifiers Type</em>'.\n * @generated\n */\n IdentifiersType createIdentifiersType();\n\n /**\n * Returns a new object of class '<em>Identifier Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Identifier Type</em>'.\n * @generated\n */\n IdentifierType createIdentifierType();\n\n /**\n * Returns a new object of class '<em>Mapped Datatype</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Mapped Datatype</em>'.\n * @generated\n */\n MappedDatatype createMappedDatatype();\n\n /**\n * Returns a new object of class '<em>Message Ref Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Message Ref Type</em>'.\n * @generated\n */\n MessageRefType createMessageRefType();\n\n /**\n * Returns a new object of class '<em>Messages Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Messages Type</em>'.\n * @generated\n */\n MessagesType createMessagesType();\n\n /**\n * Returns a new object of class '<em>Message Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Message Type</em>'.\n * @generated\n */\n MessageType createMessageType();\n\n /**\n * Returns a new object of class '<em>Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Type</em>'.\n * @generated\n */\n RepositoryType createRepositoryType();\n\n /**\n * Returns a new object of class '<em>Responses Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Responses Type</em>'.\n * @generated\n */\n ResponsesType createResponsesType();\n\n /**\n * Returns a new object of class '<em>Response Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Response Type</em>'.\n * @generated\n */\n ResponseType createResponseType();\n\n /**\n * Returns a new object of class '<em>Sections Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Sections Type</em>'.\n * @generated\n */\n SectionsType createSectionsType();\n\n /**\n * Returns a new object of class '<em>Section Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Section Type</em>'.\n * @generated\n */\n SectionType createSectionType();\n\n /**\n * Returns a new object of class '<em>State Machine Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>State Machine Type</em>'.\n * @generated\n */\n StateMachineType createStateMachineType();\n\n /**\n * Returns a new object of class '<em>State Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>State Type</em>'.\n * @generated\n */\n StateType createStateType();\n\n /**\n * Returns a new object of class '<em>Structure Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Structure Type</em>'.\n * @generated\n */\n StructureType createStructureType();\n\n /**\n * Returns a new object of class '<em>Timer Schedule</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Timer Schedule</em>'.\n * @generated\n */\n TimerSchedule createTimerSchedule();\n\n /**\n * Returns a new object of class '<em>Timer Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Timer Type</em>'.\n * @generated\n */\n TimerType createTimerType();\n\n /**\n * Returns a new object of class '<em>Transition Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Transition Type</em>'.\n * @generated\n */\n TransitionType createTransitionType();\n\n /**\n * Returns a new object of class '<em>Trigger Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Trigger Type</em>'.\n * @generated\n */\n TriggerType createTriggerType();\n\n /**\n * Returns a new object of class '<em>Unique Type</em>'.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return a new object of class '<em>Unique Type</em>'.\n * @generated\n */\n UniqueType createUniqueType();\n\n /**\n * Returns the package supported by this factory.\n * <!-- begin-user-doc -->\n * <!-- end-user-doc -->\n * @return the package supported by this factory.\n * @generated\n */\n RepositoryPackage getRepositoryPackage();\n\n}", "@Override\n public void entityRPClassUpdate(RPObject entity) {\n }", "RepositoryType createRepositoryType();", "public CartRepositoryImpl() {\n\t\tsuper(Cart.class);\n\t\t// this.qf = qf;\n\t}", "public interface OrganisationRepository extends Repository<Organisation, Long> {\n}", "public void setUp() {\n entity = new Entity(BaseCareerSet.FIGHTER);\n }", "public interface INewsInfoRepository {\n}", "public interface Cr_elementSearchRepository extends ElasticsearchRepository<Cr_element, Long> {\n}", "public interface ShopMentionRepository {\n}", "public interface TrainingGeneratedSlideNodeSearchRepository extends ElasticsearchRepository<TrainingGeneratedSlideNode, Long> {\n}", "@RooJpaRepository(entity = ProductTaxRates.class)\npublic interface ProductTaxRatesRepository {\n}", "public Entity newEntity() { return newMyEntity(); }", "public Entity newEntity() { return newMyEntity(); }", "@Before\n\t@SuppressWarnings(\"unchecked\")\n\tpublic void setUp() {\n\t\tfactoryBean = new Neo4jRepositoryFactoryBean(ContactRepository.class);\n\t\tfactoryBean.setSession(session);\n\t\tfactoryBean.setMappingContext(context);\n\t}", "public HawtDBAggregationRepository() {\n }", "public ExpertiseEntity() {\n }", "public ProduktRepositoryImpl() {\n this.conn = DatabaseConnectionManager.getDatabaseConnection();\n }", "public interface Entity\n\textends Node\n{\n\n\tpublic abstract String getPublicId();\n\n\tpublic abstract String getSystemId();\n\n\tpublic abstract String getNotationName();\n}", "public interface UserCustomRepository {\n\n}", "public void initializeRepository() throws ApplicationException;", "public void setCrfRepository(CRFRepository crfRepository) {\r\n this.crfRepository = crfRepository;\r\n }", "TypeRepository createTypeRepository();", "public void setConctbRepository(ConctbRepository conctbRepository){\n this.conctbRepository = conctbRepository;\n }", "public interface TickerRepository {\n}", "TRepo createRepo();", "public interface ContactDepartmentRepository extends LookupRepository<ContactDepartment> {\n\n}", "public interface EvDiagramSearchRepository extends ElasticsearchRepository<EvDiagram, Long> {\n}", "public interface CRAccess {\n\n\t/**\n\t * Returns the node for the given path - The path must be a simple canonical path.\n\t * (No filters, relative paths, etc.)\n\t */\n\tNode getNode(String path);\n\n\t/**\n\t * Returns all nodes in the given path (e.g. /cmsblog/articles/ will return\n\t * { Node(/cmsblog), Node(/articles) }\n\t */\n\tNode[] getNodesInPath(String path);\n\t\n\tNodeType getNodeType(String path);\n\n\tNode getParentNode(Node node);\n\n\tNode resolveNode(Node currentNodeContext, String ref);\n\t\n\t/**\n\t * Returns all direct children of the current node.\n\t */\n\tNode[] getChildren(Node node);\n\t\n\t/* Node[] filterNode() */\n\t\n\t/**\n\t * close the repository/transaction, if the repository is writable this will also commit the changes\n\t */\n\tvoid close();\n\t\n\t/**\n\t * @return <code>true</code> if the repository supports transactions, otherwhise return <code>false</code>.\n\t */\n\tboolean supportsTransaction();\n\t\n\tpublic <T extends CRAdapter> T getAdapter(Class<T> adapterInterface);\n}", "public DefaultEntity(Node<A> node) {\r\n\t\tsuper(node);\r\n\t\tevents = new Vector<Event<A>>();\r\n\t}", "Repository getRepository();", "public SyncRegistrationEntity() {\n\t\tsuper();\n\t}", "@Repository\npublic interface TaxSectionDeclarationRepository {\n}", "private ReportRepository() {\n ConnectionBD BD = ConnectionBD.GetInstance();\n this.con = BD.GetConnection();\n this.itemInfoFactory = ItemInfoFactory.GetInstance();\n }", "public interface Entity {\n}", "public AccountTypeEntity() { }", "protected EmployeeRepository getEmployeeRepository() {\r\n return this.employeeRepository;\r\n }", "public ConctbRepository getConctbRepository(){\n return conctbRepository;\n }", "public interface ADSLRepository extends Repository< ADSL, String> {\n}", "public interface StyleRepository extends NamedRepository<Style> {\n}", "public NodesRepository(Connection connection) throws SQLException {\n this.connection = connection;\n var statement = connection.createStatement();\n statement.execute(\"CREATE TABLE IF NOT EXISTS nodes (identifier INTEGER PRIMARY KEY AUTOINCREMENT, x INTEGER,\" +\n \" y INTEGER, parentx INTEGER, parenty INTEGER, status TEXT, owner TEXT, description TEXT)\");\n statement.close();\n }", "public interface TResourceContentCache extends LeCrudRepository<TResourceContent, Long> {\r\n}", "public Object caseRRepository(RRepository object) {\n\t\treturn null;\n\t}", "public interface IdentityComponentsPersonRepository extends GenericRepository<IdentityComponentsPerson, Long>{\n}", "@Repository\r\npublic interface TbContentCategoryDao extends BaseTreeDao<TbContentCategory> {\r\n\r\n}", "public Repository getRepository() {\n return mRepository;\n }", "public interface ImageManagerSearchRepository extends ElasticsearchRepository<ImageManager, Long> {\n}", "public interface LocatedRepository extends GremlinRepository<Located> { }", "public interface ManualRepository extends BaseRepository<ManualBo, Long>, ManualRepositoryCustom{\n}", "public UserRepo()\n {\n }", "public interface IEventoRepository extends IRepositoryBase<Evento> {\n}", "public interface IngredientRepository {\n}", "public interface CatalogEntity {\r\n}", "SourceBuilder createRepository();", "public abstract RepoDao getRepoDao();", "public StoreOwner_Imp() {\n }", "@Override\n public void setRepository(final ModelRepository repository) throws InternalErrorException {\n }", "public interface RegistryFieldSearchRepository extends ElasticsearchRepository<RegistryField, Long> {\n}", "public Repo() {\n //this.app = Init.application;\n }", "public interface EgitmenRepo extends BaseRepo<Egitmen> {\n}", "protected abstract ENTITY createEntity();", "@Repository\npublic interface ClClassificationSchemeConRepository extends AXBootJPAQueryDSLRepository<ClClassificationSchemeCon, ClClassificationSchemeCon.ClClassificationSchemeId>\n{\n\n}", "protected CompanyJPA() {\n\t}", "public PersonsRepositoryTest() {\n }", "public interface RegistrationRepository extends Repository<Registration, Long>{\r\n}" ]
[ "0.6547328", "0.65025824", "0.64323604", "0.61989325", "0.61563456", "0.61114097", "0.59905386", "0.59905386", "0.597783", "0.59642184", "0.5955535", "0.59553933", "0.5948089", "0.5928903", "0.59260064", "0.5900419", "0.5898223", "0.585374", "0.5833617", "0.58045477", "0.57992226", "0.5794884", "0.5794523", "0.5785307", "0.57825166", "0.5760444", "0.5739892", "0.5718862", "0.5701028", "0.56988394", "0.5698593", "0.5693338", "0.56882817", "0.56651837", "0.5634465", "0.5622769", "0.56150717", "0.56080234", "0.5590352", "0.55819297", "0.5579294", "0.5569519", "0.5568722", "0.5558514", "0.55516714", "0.5549018", "0.55437636", "0.5533641", "0.5527144", "0.5527144", "0.5514591", "0.55141944", "0.5512235", "0.55102295", "0.54876524", "0.54864514", "0.5484612", "0.5479326", "0.5475296", "0.5437484", "0.54300416", "0.54263", "0.5424811", "0.5422321", "0.542016", "0.5417256", "0.5413702", "0.54097384", "0.54033005", "0.54010123", "0.5393391", "0.5391176", "0.53802615", "0.5379779", "0.5376921", "0.5373247", "0.5372473", "0.53709495", "0.5366884", "0.53639925", "0.53602576", "0.5356062", "0.5354398", "0.5353598", "0.53533846", "0.5346485", "0.5328616", "0.5325268", "0.53180295", "0.5316733", "0.5311659", "0.53072137", "0.5300816", "0.5299519", "0.5299144", "0.5297634", "0.52972317", "0.52957326", "0.52929866", "0.5291448", "0.5285137" ]
0.0
-1
Constructor for objects of class Jugador
public Jugador(int dorsal) { Random rmd = new Random(); edad = rmd.nextInt(23)+18 ; estadoForma = rmd.nextInt(11); int nom = rmd.nextInt(33); Nombres nomb = new Nombres(); nombre = nomb.getNombre(nom); this.dorsal = dorsal; this.nombre = nombre; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Clasificacion (ArrayList<Jugador> jugadores)\n\t{\n\t\tthis.jugadores = jugadores;\n\t\tthis.numJug = jugadores.size();\n\t\tthis.podio = new ArrayList<Jugador>();\n\t\tthis.ganadores = new ArrayList<Jugador>();\n\t\tthis.baraja = new Baraja();\n\t\tbaraja.barajar(); baraja.barajar();\n\t\tbarajaDeCartas = baraja.getBaraja();\n\t}", "public jugador(){\n\t\tnombre=\"Dave\";\n\t\ttipo=\"jugador\";\n\t\tpoderataque=6;\n\t\tpuntosvida=20;\n\t}", "public SlanjePoruke() {\n }", "public Arquero(Jugador jugador){\n this.propietario = jugador;\n this.vida = 75;\n this.rangoAtaque = 3;\n this.estadoAccion = new EstadoDisponible();\n }", "public Jeu(){\n Saisie.Initialiser();\n this.premierJoueur = CreationDePersonnage(\"joueur1\");\n this.secondJoueur = CreationDePersonnage(\"joueur2\");\n Combat();\n Saisie.Terminer();\n }", "public Alojamiento() {\r\n\t}", "public Jugador(String nombreJugador)\n {\n this.nombreJugador = nombreJugador;\n cartasQueTieneEnLaMano = new Carta[5];\n numeroCartasEnLaMano = 0;\n }", "public Jogador(String nome, String cor){\r\n this.nome = nome;\r\n this.cor = cor;\r\n this.contaCorrente = new ContaCorrente(1500);\r\n this.propriedadesDoJogador = new ArrayList<>();\r\n this.companhiasDoJogador = new ArrayList<>();\r\n this.posicaoNoTabuleiroIndice = 0;\r\n this.possuiCartaSairDaPrisao = false;\r\n this.reclusao = 0;\r\n this.sorteNosDados = 0;\r\n monopolioNoGrupoDeCor = new ArrayList<>();\r\n }", "public Cgg_jur_anticipo(){}", "public Pasien() {\r\n }", "public static void instanciarJugador(Jugador jugador) {\n\t\tjugadores[contSalas] = jugador;\n\t\tcontJugadores++;\n\t}", "private UsineJoueur() {}", "public Jovem(String identificador) {\n super(identificador);\n numAulas = DEFAULT_N_AULAS;\n }", "public Jugador(String nick)\n {\n nombre = nick;\n mano = new Carta[5];\n cartasDeMano = 0; \n }", "public Celula() { // Sentinela\n\t\tthis.item = new Jogador();\n\t\tproximo = null;\n\t}", "public Postoj() {}", "public Odontologo() {\n }", "public JudokaCreator() {\n\t\tsuper();\n\t\ttechniques = new Technique[]{\n\t\t\t\tTechnique.UCHI_MATA,\n\t\t\t\tTechnique.UCHI_MATA,\n\t\t\t\tTechnique.UCHI_MATA,\n\t\t\t\tTechnique.UCHI_MATA,\n\t\t\t\tTechnique.UCHI_MATA,\n\t\t\t\tTechnique.UCHI_MATA,\n\t\t\t\tTechnique.UCHI_MATA,\n\t\t\t\tTechnique.UCHI_MATA\n\t\t};\n\t}", "public Aritmetica(){ }", "public RptPotonganGaji() {\n }", "public AntrianPasien() {\r\n\r\n }", "public Kullanici() {}", "Petunia() {\r\n\t\t}", "public RamasserArtefact(Joueur j) {\r\n\t\tsuper(j);\r\n\t}", "public TebakNusantara()\n {\n }", "public Caso_de_uso () {\n }", "public Corso() {\n\n }", "public Manusia() {}", "public Oveja() {\r\n this.nombreOveja = \"Oveja\";\r\n }", "public Juego() {\n init(); // Llama al metodo init para inicializar todas las variables\n start(); // Llama al metodo start para crear el hilo\n }", "private void __sep__Constructors__() {}", "public Tarifa() {\n ;\n }", "public Venda() {\n }", "public Achterbahn() {\n }", "public Carrera(){\n }", "public JSFOla() {\n }", "public prueba()\r\n {\r\n }", "public Personaje(Juego juego,Celda c) {\r\n\t\tsuper(juego,c);\r\n\t}", "public Gasto() {\r\n\t}", "public Surgeon() {\n }", "public NhanVien()\n {\n }", "private JadTool() { }", "public Vehiculo() {\r\n }", "public Magazzino() {\r\n }", "public Curso() {\r\n }", "public God() {}", "public Jogador()\n {\n pecasValidas = new ArrayList <Peca> ();\n }", "Constructor() {\r\n\t\t \r\n\t }", "public Juego(String nombreJ1, String nombreJ2){\r\n\t\tMINATR = 3;\r\n\t\tMAXATR = 6;\r\n\t\tjugador1 = new Jugador(nombreJ1);\r\n\t\tjugador2 = new Jugador(nombreJ2);\r\n\t\tjugadorEnTurno = jugador1;\r\n\t}", "public Empleado() { }", "public Aktie() {\n }", "public YonetimliNesne() {\n }", "public DetArqueoRunt () {\r\n\r\n }", "public Perro() {\n// super(\"No define\", \"NN\", 0); en caso el constructor de animal tenga parametros\n this.pelaje = \"corto\";\n }", "public Circle(double jejari){\r\n\t\t// this();//panggil default constructor\r\n\t\t this.jejari = jejari;\r\n\t\t x = 5;\r\n\t\t// this(jejari, 59); //panggil constructor 2 parameter\r\n\t\tbilObjekWujud++;\r\n\t}", "public Pitonyak_09_02() {\r\n }", "public Rol() {}", "public Excellon ()\n {}", "public TTau() {}", "public Tigre() {\r\n }", "public Corrida(){\n\n }", "public Persona() {\n\t}", "public Busca(){\n }", "public Clade() {}", "public JuegoDragon() {\r\n//\t\tfile = new File(arg0)\r\n\t\tjugadorActual = new Jugador(\"Felipe\", 0);\r\n\t\tjugadorRaiz = null;\r\n\t\tprimerDragon = null;\r\n\t\tultimoDragon = null;\r\n\t\traizPodio = null;\r\n\t\tdatos = new ArrayList<Jugador>();\r\n\t\tnumDragones = 0;\r\n\t\tnivel = 0;\r\n\t\tfondo = \"img/fondo_P.gif\";\r\n\t\tcargarDatos();\r\n\t}", "public Orbiter() {\n }", "public Banco(){}", "public Constructor(){\n\t\t\n\t}", "public Cohete() {\n\n\t}", "public Jefatura(String nom,double sue, int agno,int mes,int dia){\r\n \r\n super(nom,sue,agno,mes,dia); \r\n \r\n }", "public Kendaraan() {\n }", "public CyanSus() {\n\n }", "public Livro() {\n\n\t}", "public MPaciente() {\r\n\t}", "public void jsContructor() {\n }", "public EnsembleLettre() {\n\t\t\n\t}", "public Jugador(String elAlias, String elNombre, int laEdad, int ganadas, int perdidas, int empatadas) {\r\n this.setAlias(elAlias);\r\n this.setNombre(elNombre);\r\n this.setEdad(laEdad);\r\n this.setPartidas(ganadas, perdidas, empatadas);\r\n }", "public Ciudad()\n {\n\n }", "public Mitarbeit() {\r\n }", "public Simulador(){\n }", "public Mueble() {\n }", "public Persona() {\n }", "public AfiliadoVista() {\r\n }", "public Chauffeur() {\r\n\t}", "void jugar(Jugada jugada);", "public MorteSubita() {\n }", "public Plato(){\n\t\t\n\t}", "public ComandosJuego() //constructor\n\t{\n\t\tlista = new ArrayList<String>();\n\t}", "public Juego()\n {\n // crea la ventana principal del juego\n generaVentana();\n \n // genera las naves y los disparos del juego\n generaNaves();\n \n // responde a los eventos de pulsar las teclas de movimiento y disparo\n addKeyListener(new Eventos());\n }", "public CatalogoJogos() {\r\n\t\tthis.listaDeJogosComprados = new ArrayList<Jogo>();\r\n\t}", "public Persona() {\n \t\n }", "public Dog() {\r\n\r\n }", "public Persona(){\n \n }", "public Persona(){\n \n }", "public Carrinho() {\n\t\tsuper();\n\t}", "public Supercar() {\r\n\t\t\r\n\t}", "defaultConstructor(){}", "public Troco() {\n }", "public RngObject() {\n\t\t\n\t}", "public CrearQuedadaVista() {\n }" ]
[ "0.73174596", "0.72974384", "0.7085698", "0.7084891", "0.69907904", "0.69615376", "0.6926507", "0.6865664", "0.6824265", "0.67827225", "0.675621", "0.6749874", "0.6748682", "0.6724667", "0.67099655", "0.67007947", "0.6697388", "0.669444", "0.66431093", "0.66301095", "0.66211784", "0.66196525", "0.6612045", "0.6579936", "0.6559244", "0.6549531", "0.6534564", "0.6513327", "0.6507017", "0.6504699", "0.6501018", "0.64980507", "0.64853024", "0.6479047", "0.64722925", "0.64463884", "0.6443238", "0.64372706", "0.643284", "0.64266735", "0.6421261", "0.64082515", "0.640206", "0.63888407", "0.63819176", "0.63701665", "0.6346773", "0.6342646", "0.6327589", "0.63254327", "0.63163894", "0.6304569", "0.63000304", "0.6299654", "0.62898177", "0.62882465", "0.62881595", "0.62785655", "0.6258459", "0.62477577", "0.62464", "0.6233998", "0.6232247", "0.6231109", "0.6222172", "0.62075704", "0.6203869", "0.6202884", "0.62018305", "0.6192832", "0.6187855", "0.6187405", "0.61862797", "0.61791736", "0.6174731", "0.6174498", "0.6171514", "0.61592156", "0.6157864", "0.6153906", "0.6150057", "0.61461234", "0.6143577", "0.61435765", "0.61411107", "0.6137735", "0.6137384", "0.61344874", "0.6132393", "0.6131117", "0.6130766", "0.61209154", "0.61164075", "0.61164075", "0.6116348", "0.6114306", "0.6112983", "0.61100924", "0.6105431", "0.610406" ]
0.6847109
8
nextInt is normally exclusive of the top value, so add 1 to make it inclusive
public void randomize() { x = ThreadLocalRandom.current().nextInt(0, 499 + 1); y = ThreadLocalRandom.current().nextInt(0, 499 + 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public int nextInt() {\n return super.nextInt();\n }", "@Override\n public int nextInt(int bound) {\n return super.nextInt(bound);\n }", "private int nextInt() {\n if (console) {\n return con.nextInt();\n }\n return scan.nextInt();\n }", "public int nextInt(int limit){\r\n\t\treturn (nextInt() & 0x7FFFFFFF) % limit;\r\n\t}", "public static int nextInt (int min, int max) {\n int x = get().nextInt(max-min+1);\n return x+min;\n }", "public int nextInt(int range) {\n int i = Math.abs(rand.nextInt());\n return (i % (range));\n }", "private static int randInt(final int min, final int max) {\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n return rand.nextInt((max - min) + 1) + min;\n }", "int nextInt(int origin, int bound);", "public static int nextInt() {\n\treturn 0;\r\n}", "private int randomInt(final int start, final int end) {\n return random.nextInt(end - start + 1) + start;\n }", "public int nextInt(int n) {\n return 0;\n }", "public int nextInt(int n) {\n return twister.nextInt(n);\n }", "public int nextInt() {\n return twister.nextInt();\n }", "public static int nextInt (int n) {\n return get().nextInt(n);\n }", "private static int getInt()\n\t{\n\t\tScanner kb;\n\t\tint Val;\n\t\tkb = new Scanner(System.in);\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Please enter a VALID POSITIVE INTEGER: \");\n\t\t\n\t\twhile (!kb.hasNextInt())\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"Your options are clearly stated. Your failure is disapointing!\");\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.print(\"Please enter a VALID POSITIVE INTEGER this time: \");\n\t\t\tkb = new Scanner(System.in);\n\t\t}\n\t\t\n\t\tVal = kb.nextInt();\n\t\t\n\t\twhile (Val < 0)\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"Fail. Try harder!\");\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.print(\"Please enter a VALID POSITIVE INTEGER: \");\n\t\t\t\n\t\t\twhile (!kb.hasNextInt())\n\t\t\t{\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.out.println(\"Your options are clearly stated. Your failure is disapointing!\");\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.out.print(\"Please enter a VALID POSITIVE INTEGER this time: \");\n\t\t\t\tkb = new Scanner(System.in);\n\t\t\t}\n\t\t\tVal = kb.nextInt();\n\t\t\t\n\n\t\t}\n\t\t\n\t\t\n\t\treturn Val;\n\t\t\n\t}", "private int getValidInteger(String msg) {\n\t\twhile (!scan.hasNextInt() || (choice = scan.nextInt()) < 1) {\n\t\t\tSystem.out\n\t\t\t\t\t.print(\"Error ---> Enter Positive Integer Value:\\n\" + msg);\n\t\t\tscan.next();\n\t\t}\n\n\t\treturn choice;\n\t}", "@Override\n\t\t\t\t\tpublic int nextInt() {\n\t\t\t\t\t\toutdegree = -1;\n\t\t\t\t\t\treturn it0.nextInt();\n\t\t\t\t\t}", "public static int inputInteger()\n\t{\n\t\treturn(sc.nextInt());\n\t}", "public int randInt(int min, int max) {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((max - min) + 1) + min;\n\n return randomNum;\n}", "private static int IntInput(){\n\t\tScanner input = new Scanner(System.in); \n\t\t// set the interger Value to less then the threshold minimum (-1)\n\t\tint Value = -1 ;\n\t\twhile (Value < 0){\n\t\t\tValue = input.nextInt();\n\t\t\tif (Value < 0){\n\t\t\t\tSystem.out.printf(\"The number must be greater than or equal to to 0 \\nPlease enter a different value: \");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn Value;\n\t}", "private static int randInt(int min, int max) {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((max - min) + 1) + min;\n\n return randomNum;\n }", "private static int randInt(int lower, int upper) {\n\t\tRandom random = new Random();\n\t\treturn random.nextInt((upper - lower) + 1) + lower;\n\t}", "private int randomInt(int lower, int upper) {\n\t\treturn (int) ((upper - lower + 1) * Math.random()) + lower;\n\t}", "private static int randomInt(int min, int max) {\n if (min >= max) {\n throw new IllegalArgumentException(\"max must be greater than min\");\n }\n\n Random r = new Random();\n return r.nextInt(max - min) + min;\n }", "public int originalgetRandomPositiveInt(int min, int max){\r\n int number = getRandomPositiveInt(); \r\n return (int)number%(max - min + 1)+min;\r\n }", "public int getRandomInt(int upper) {\n int retVal = myRandom.nextInt() % upper;\n if (retVal < 0) {\n retVal += upper;\n }\n return (retVal);\n }", "@Override\n\t\t\t\tpublic int nextInt() {\n\t\t\t\t\toutdegree = -1;\n\t\t\t\t\treturn it0.nextInt();\n\t\t\t\t}", "public int nextInt(){\r\n\t\treturn (int)nextLong();\r\n\t}", "private int getRandomInteger(int start, int end){\n\t\tif (start > end) {\n\t\t\tthrow new IllegalArgumentException(\"Start cannot exceed End.\");\n\t\t}\n\t\tRandom random = new Random();\n\t\tlong range = (long)end - (long)start + 1;\n\t\tlong fraction = (long)(range * random.nextDouble());\n\t\tint randomNumber = (int)(fraction + start); \n\t\treturn(randomNumber);\n\t}", "public static int nextInt(int minVal, int maxVal) {\n\t\treturn minVal + Utilities.rand.nextInt((maxVal - minVal));\n\t}", "private static int validateInput() {\n Scanner genericInt = new Scanner(System.in);\n int number = 0;\n if (genericInt.hasNextInt()) {\n number = genericInt.nextInt();\n return number;\n }\n else {\n validateInput();\n }\n return number;\n }", "public static int intSample(int range) throws IllegalArgumentException {\n return random_.nextInt(range);\n }", "public int getNextIntRange(int[] range) {\n\t\tint low = Math.min(range[0], range[1]);\r\n\t\tint high = Math.max(range[0], range[1]);\r\n\t\tint val = (int)((high - low)*this.rand.nextDouble() + (double)low);\r\n\t\treturn val;\r\n\t}", "public static int getInt(int lower, int upper) {\r\n return random.nextInt(upper - lower) + lower;\r\n }", "public int nextInt() {\n return mersenne.nextInt();\n }", "public static int randInt(int incMin, int incMax){\n\n int rand=incMin+rng.nextInt((incMax-incMin)-1);\n return rand;\n }", "static int getRandint(int min, int max) {\r\n\t\tRandom r = new Random();\r\n\t\treturn r.nextInt((max - min) + 1) + min;\r\n\t}", "public static int getIntInput(Scanner console, int min, int max)\n {\n if (console.hasNextInt())\n {\n int num = console.nextInt();\n console.nextLine();\n if (min <= num && num <= max)\n {\n return num;\n }\n }\n console.nextLine();\n System.out.print(\"Invalid input. Please enter an integer between \" + min + \" and \" + max +\": \");\n return getIntInput(console, min, max);\n }", "public int getInt () {\n \tif (number1 == number2)\n \t\treturn number1;\n \telse\t{\n \t\treturn r.nextInt(number2 - number1 + 1) + number1;\n \t}\t\n }", "public static int inputInt(String p) {\n String tmp;\n int i = 0;\n\n do {\n System.out.print(p);\n try {\n tmp = in.nextLine();\n if (Integer.parseInt(tmp) == Integer.parseInt(tmp)) {\n i = Integer.parseInt(tmp);\n }\n break;\n } catch (Exception e) {\n System.err.print(\"You must be enter interger number, enter again.\\n\");\n }\n } while (true);\n return i;\n }", "public int user_integer() {\n Scanner input = new Scanner(System.in);\n boolean conditional = true;\n while (conditional) {\n boolean condition = input.hasNextInt();\n if (condition) {\n int user_input = input.nextInt();\n conditional = false; \n return user_input; \n }\n else {\n System.out.println(\"Invalid Input!\");\n conditional = true;\n input.next();\n }\n }\n return 0;\n }", "protected int nextInt(int p_75902_1_) {\n/* 135 */ int var2 = (int)((this.chunkSeed >> 24) % p_75902_1_);\n/* */ \n/* 137 */ if (var2 < 0)\n/* */ {\n/* 139 */ var2 += p_75902_1_;\n/* */ }\n/* */ \n/* 142 */ this.chunkSeed *= (this.chunkSeed * 6364136223846793005L + 1442695040888963407L);\n/* 143 */ this.chunkSeed += this.worldGenSeed;\n/* 144 */ return var2;\n/* */ }", "public int nextInt(int lo, int hi) {\n return lo + (int) ((hi - lo + 1) * nextDouble());\n }", "int randInt(int n) {\r\n return _randomSource.nextInt(n);\r\n }", "public static Integer randomInt(int start, int end){\n\t\tif (start >= end) {\n\t\t\tthrow new IllegalArgumentException(\"start must be greater than end\");\n\t\t}\n\t\tRandom r = new Random();\n\t\treturn r.nextInt((end - start) ) + start;\n\t}", "private static List<Integer> nextInt() {\n\t\tRandom rnd = new Random();\n\t\tList<Integer> l = new ArrayList<Integer>();\n\t\tfor (;;) {\n\t\t\tfinal int r = rnd.nextInt(5);\n\t\t\tif (!l.contains(r)) {\n\t\t\t\tl.add(r);\n\t\t\t}\n\t\t\tif (l.size() == 5)\n\t\t\t\treturn l;\n\t\t}\n\t}", "private static int randInt(int max) {\n\t\tRandom rand = new Random(System.currentTimeMillis());\n\t\treturn rand.nextInt(max + 1);\n\t}", "int randInt(int n) {\n return _randomSource.nextInt(n);\n }", "private int getUserInput() {\n java.util.Scanner scanner = new java.util.Scanner(System.in);\n int input = scanner.nextInt();\n while(input < 1 || input > 3) {\n System.out.println(\"only enter 1 2 or 3.\");\n input = scanner.nextInt();\n }\n return input;\n }", "int getRandom(int limit){\n Random rand = new Random();\n int upperBound = limit;\n return rand.nextInt(upperBound) + 1;\n }", "private int intKeyboardInput() {\n\t\tint input = 0;\n\t\tboolean tryAgain = true;\n\t\twhile (tryAgain) {\n\t\t\ttry {\n\t\t\t\tScanner scanner = new Scanner(System.in);\n\t\t\t\tinput = scanner.nextInt();\n\t\t\t\ttryAgain = false;\n\t\t\t} catch (InputMismatchException ime) {\n\t\t\t\tSystem.out.println(\"Invalid input.\");\n\t\t\t}\n\t\t}\n\t\treturn input;\n\t}", "public int getRandomPositiveInt(){\r\n long gen = (a*seed+c)%m;\r\n seed = gen;\r\n return (int)gen;\r\n }", "public int randomInt(int min, int max) {\n\t\t\t\t // NOTE: Usually this should be a field rather than a method\n\t\t\t\t // variable so that it is not re-seeded every call.\n\t\t\t\t Random rand = new Random();\n\t\t\t\t // nextInt is normally exclusive of the top value,\n\t\t\t\t // so add 1 to make it inclusive\n\t\t\t\t int randomNum = rand.nextInt((max - min) + 1) + min;\n\t\t\t\t return randomNum;\n\t\t\t\t}", "public static int getInt()\n {\n int num=0;\n while (true)\n {\n Scanner keyboard = new Scanner(System.in);\n try{\n num = keyboard.nextInt();\n return num;\n }\n catch (java.util.InputMismatchException textException)\n {\n System.out.printf(\"result:\");\n }\n }\n }", "private int readIntWithPrompt (String prompt) {\n System.out.print(prompt); System.out.flush();\n while (!in.hasNextInt()) {\n in.nextLine();\n System.out.print(prompt); System.out.flush();\n }\n int input = in.nextInt();\n in.nextLine();\n return input;\n }", "public int nextInt() {\n\t\t\n\t\tif (numsLeft != 0) {\n\t\t\t\n\t\t\t// Generate a random index\n\t\t\tint randIndex = (int)(Math.random() * numsLeft);\n\t\t\tnumsLeft--;\n\t\t\t\n\t\t\t// Get the number at the index, then removes the number from the array\n\t\t\tint retval = listOfNums.get(randIndex);\n\t\t\tlistOfNums.remove(randIndex);\n\t\t\t\n\t\t\t// Return number\n\t\t\treturn retval;\n\t\t}\n\t\t\n\t\treturn 0;\n\t}", "private int nextIndex() {\n return ThreadLocalRandom.current().nextInt(currentIndex, tracks.size());\n }", "public int randInt(int limit) {\n\t\treturn (_generator.nextInt(limit));\n\t}", "private static int newSecretNumber(int min, int max)\n {\n Random rnd = new Random();\n return rnd.nextInt((max + 1 - min) + min);\n }", "public static int getInt(int lower, int upper)\n {\n assert lower < upper;\n\n int range = upper - lower + 1;\n\n return _random.nextInt(range) + lower;\n }", "private int getInput()\n {\n int input = 0;\n Scanner scanner = new Scanner(System.in);\n\n try {\n input = scanner.nextInt();\n }\n catch(Exception e) {\n System.out.println(\"Vælg et tal fra menuen.\");\n scanner.nextLine();\n }\n\n return input;\n }", "private static int startInt(int gridSize) {\n StringBuilder sb = new StringBuilder();\n for (int i = 1; i <= gridSize; i++) {\n sb.append(i);\n }\n return Integer.parseInt(sb.toString());\n }", "private int validateIntegerInput(int input) {\n if (input < 1 ) {\n input = -1;\n }\n return input;\n }", "public int secureInput(int min, int max) {\r\n if (estIa) {\r\n if (max - min <= 0) {\r\n return min;\r\n }\r\n return new Random().nextInt(max - min) + min;\r\n }\r\n return Constante.secureInput(min, max);\r\n }", "private int rand(int lower, int upper) {\n return lower + (int)(Math.random() * ((upper - lower) + 1));\n }", "private int generatePiece()\n\t{\n\t\tint toReturn = 0;\n\t\tint max = 1;\n\t\tint min = -1;\n\t\t\n\t\twhile(toReturn == 0)\n\t\t{\n\t\t\ttoReturn = r.nextInt((max - min) + 1) + min;\n\t\t}\n\t\tSystem.out.println(toReturn);\n\t\treturn toReturn;\n\t}", "public int pickNumber() {\n\t\t\n\t\tint max=10;\n\t\t\n\t\tint i = (int) Math.floor((Math.random()*max)+1);\n\t\treturn i;\n\t\t\n\t}", "private static int getInRangeInt(Scanner scan, int min, int max) {\n int value = -9999;\n while (value < min || value > max) {\n System.out.println(\"Must be a integer between \" + min + \" and \" + max + \" : \");\n while (!scan.hasNextInt()) {\n System.out.println(\"Must be a integer between \" + min + \" and \" + max + \" : \");\n scan.next();\n }\n value = scan.nextInt();\n }\n return value;\n }", "private int randomInteger(int n) {\n return (int) (randGen.random() * (n - 1));\n }", "public static int randInt() {\n\t\tint min = 10;\n\t\tint max = 99999999;\n\t\tRandom rand = new Random();\n\t\tint randomNum = (rand.nextInt((max - min) + 1) + rand.nextInt((max - min) + 1)) / 2;\n\t\treturn randomNum;\n\t}", "abstract int readInt(int start);", "private static int randomNumberBetween(final int start, final int end) {\n\t\treturn start + (int) Math.round(Math.random() * (end - start));\n\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n System.out.println(IntStream.generate(sc::nextInt)\n .limit(n).min().getAsInt());\n }", "private static int getSecretNum(int arg1) {\n Random rand = new Random();\n return rand.nextInt(UPPERBOUND)+1; //make range 1-100\n }", "public static int getRandomInt(int start, int end) {\n\t\tint randomInt = start + (int)((end - start) * Math.random());\n\t\treturn randomInt;\n\t}", "private int randomIntRange(int min, int max) {\r\n Random random = new Random();\r\n if (min < 0 || max < 0) {\r\n return (random.nextInt(Math.abs(max - min)) + Math.abs(min) + 1) * -1;\r\n }\r\n return random.nextInt(max - min) + min + 1;\r\n }", "public static int randInt() {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((20 - 10) + 1) + 10;\n\n return randomNum;\n }", "public int randint(int max, int min)\n {\n Random rand = new Random();\n int randomNum = rand.nextInt((max - min) + 1) + min;\n return randomNum;\n }", "private int getNumber() {\n while (!scanner.hasNextInt()) {\n scanner.nextLine();\n System.out.print(\"Please, Enter a munber : \");\n }\n return scanner.nextInt();\n }", "private int rand() {\n return (int)(Math.random()*(RAND_MAX + 1));\n }", "public int next() {\r\n\t\t// Get a random value\r\n\t\tint index = random.nextInt(values.length);\r\n\t\tint byteValue = values[index] + 128; // For an unsigned value\r\n\t\tint value = byteValue * 3;\r\n\t\t// If byteValue = 255 (max), then choose between 765000 and 799993\r\n\t\tif (byteValue == 255) {\r\n\t\t\tvalue += random.nextInt(800-765+1);\r\n\t\t}\r\n\t\t// Otherwise, choose between value and value + 2 (inc)\r\n\t\telse {\r\n\t\t\tvalue += random.nextInt(3);\r\n\t\t}\r\n\t\treturn value;\r\n\t}", "private static int randomInteger(int a, int b) {\n return (int) (Math.random() * (b - a) + a);\n }", "public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}", "protected static int easyIn() {\n // ADDITIONAL CHECKS?\n int a;\n debug(\"Please enter your selection: \");\n scanner = new Scanner(System.in);\n\t\ta = scanner.nextInt();\n return a;\n }", "public static int getValidInteger() {\n\n // This keeps looping until integer input is received.\n while (!scnr.hasNextInt()) {\n scnr.nextLine(); // clear the buffer\n System.out.print(\"Please enter an integer! \");\n }\n\n int integerNum = scnr.nextInt();\n scnr.nextLine();\n\n return integerNum;\n }", "public static int getRandomInt(int min, int max) {\n return getInstance().rand.nextInt((max - min) + 1) + min;\n }", "public int compete() {\r\n\t\tint max = 20;\r\n\t\tint min = 10;\r\n\t\tRandom Rand = new Random();\r\n\t\tint ranNum = Rand.nextInt(max - min) + min;\r\n\t\treturn ranNum;\r\n\t}", "private int read()\r\n {\r\n Scanner keyboard = new Scanner(System.in);\r\n System.out.println(\"Enter the number: \");\r\n int i = keyboard.nextInt();\r\n if (i > 999999999){\r\n System.out.println(\"The number you have introduced is too big!\");\r\n i = read();\r\n }\r\n if (i < 0){\r\n System.out.println(\"The number you have introduced is negative!\");\r\n i = read();\r\n }\r\n return i;\r\n }", "@Override\n public int getInt(String key) {\n return random.nextInt(RANDOM_INT_BOUND);\n }", "private int getRandomNumber(int limit) {\n\t\tlong seed = System.currentTimeMillis();\n\t\tRandom rand = new Random(seed);\n\t\treturn rand.nextInt(limit) + 1;\n\t}", "public static int getRandomInt(int max) {\n\t\tif (max<1){\n\t\t\tmax = 1;\n\t\t}\n\t\treturn rand.nextInt(max);\n\t}", "public int randInt(int min, int max) {\n\t Random rand = new Random();\n\n\t // nextInt is normally exclusive of the top value,\n\t // so add 1 to make it inclusive\n\t int randomNum = rand.nextInt((max - min) + 1) + min;\n\n\t return randomNum;\n\t }", "public int randomInt() {\n\t\t\t\t // NOTE: Usually this should be a field rather than a method\n\t\t\t\t // variable so that it is not re-seeded every call.\n\t\t\t\t Random rand = new Random();\n\t\t\t\t // nextInt is normally exclusive of the top value,\n\t\t\t\t // so add 1 to make it inclusive\n\t\t\t\t int randomNum = rand.nextInt();\n\t\t\t\t return randomNum;\n\t\t\t\t}", "public static int randInt(int min, int max) {\n\t\t// nextInt is normally exclusive of the top value,\n\t\t// so add 1 to make it inclusive\n\t\tint randomNum = rd.nextInt((max - min) + 1) + min;\n\n\t\treturn randomNum;\n\t}", "private static int getRandomNumber(int min, int max) \n { //generates a random number within a range\n return (min + rand.nextInt((max - min) + 1));\n }", "int getRandom(int max);", "public static int generatesRandomIntBetween(int start, int end) {\n return start + (int) Math.round(Math.random() * (end - start));\n }", "public static Integer scanInt() {\n\t\tboolean is_Nb = false; int i = 0;\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\ti = Integer.parseInt(scan.nextLine());\r\n\t\t\t\tis_Nb= true;\r\n\t\t\t}\r\n\t\t\tcatch(NumberFormatException e) {\r\n\t\t\t\tSystem.out.println(\"Enter a number\");\r\n\t\t\t}\r\n\t\t}while(!is_Nb);\r\n\t\treturn i;\r\n\t}", "int randomIntInRange(int min, int max) {\n\t\tRandom rand = new Random();\n\t\treturn rand.nextInt(max + 1 - min) + min;\n\t}", "public static int pseudo(int min, int max) {\n int value = generator.nextInt();\n return value < 0 ? (-value) % (max - min + 1) + min : value % (max - min + 1) + min;\n }", "private static int getRandomNumberInRange(int min, int max) {\n\n if (min >= max) {\n throw new IllegalArgumentException(\"max must be greater than min\");\n }\n Random r = new Random();\n return r.nextInt((max - min) + 1) + min;\n }" ]
[ "0.7536694", "0.7304919", "0.69076127", "0.6808714", "0.6789383", "0.6706691", "0.6684705", "0.6669792", "0.66365665", "0.6599863", "0.65611815", "0.65253556", "0.6514477", "0.64954185", "0.6481946", "0.64727646", "0.6462342", "0.6456103", "0.64338446", "0.64247423", "0.6409726", "0.6402971", "0.6398529", "0.6360384", "0.6355748", "0.6350008", "0.63425905", "0.6338112", "0.6326174", "0.6318522", "0.62870276", "0.62824184", "0.626624", "0.62356406", "0.62225246", "0.62193835", "0.61690503", "0.6149095", "0.6140311", "0.61388254", "0.6124925", "0.61217207", "0.6110753", "0.60864854", "0.60692734", "0.6063604", "0.60607517", "0.60548514", "0.6052228", "0.6045574", "0.6038563", "0.6014774", "0.6004708", "0.59933877", "0.5992272", "0.59775096", "0.59748334", "0.596124", "0.5959648", "0.59549075", "0.5951395", "0.5940635", "0.59391284", "0.5938312", "0.5927837", "0.5926724", "0.59249306", "0.5920835", "0.5920032", "0.5908643", "0.59023577", "0.5899335", "0.58876514", "0.58871126", "0.58738977", "0.5873676", "0.58729696", "0.5871429", "0.58659565", "0.5857405", "0.5855162", "0.58487225", "0.5848314", "0.5843835", "0.5839987", "0.5829158", "0.5806279", "0.5794382", "0.5782038", "0.577628", "0.57758254", "0.5775041", "0.57688755", "0.5767489", "0.5764304", "0.5762609", "0.5761898", "0.5759563", "0.5757927", "0.5756462", "0.5748293" ]
0.0
-1
Metodo per trovare i vicini di uno specifico vertice
public List<String> displayNeighbours(String parolaInserita) { List<String> resultString = new ArrayList<String>(); Set<DefaultEdge> result = grafo.edgesOf(parolaInserita); for(DefaultEdge tmp : result) { resultString.add(tmp.toString()); } return resultString; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void AgregarVertice(int v) {\n\t\tNodoGrafo aux = new NodoGrafo();\n\t\taux.nodo = v;\n\t\taux.arista = null;\n\t\taux.sigNodo = origen;\n\t\torigen = aux;\n\t}", "public Vertice GetExtremoInicial(){\r\n return this.Vi;\r\n }", "public boolean foiChecado(Vertice v){\n int i = v.label;\n return vertices[i];\n }", "public Vertice getvInicial() {\r\n return vInicial;\r\n }", "private NodoGrafo Vert2Nodo(int v) {\n\t\tNodoGrafo aux = origen;\n\t\twhile (aux != null && aux.nodo != v)\n\t\t\taux = aux.sigNodo;\t\t\n\t\treturn aux;\n\t}", "public Coordinates getVerHor();", "public void EliminarVertice(int v) {\n\t\tNodoGrafo aux = origen;\n\t\tif (origen.nodo == v) \n\t\t\torigen = origen.sigNodo;\t\t\t\n\t\twhile (aux != null){\n\t\t\t// remueve de aux todas las aristas hacia v\n\t\t\tthis.EliminarAristaNodo(aux, v);\n\t\t\tif (aux.sigNodo!= null && aux.sigNodo.nodo == v) {\n\t\t\t\t// Si el siguiente nodo de aux es v , lo elimina\n\t\t\t\taux.sigNodo = aux.sigNodo.sigNodo;\n\t\t\t}\n\t\t\taux = aux.sigNodo;\n\t\t}\t\t\n\t}", "public void calculaVertice(int _radio, double _giro){\r\n //npoints equivale a _lados\r\n for(int i = 0; i<npoints;i++){\r\n //asi se llama internamente a la primera array de las posiciones x\r\n xpoints[i] = (int)(x + _radio*Math.cos((2*Math.PI * i +_giro/40)/npoints));\r\n ypoints[i] = (int)(y + _radio*Math.sin((2*Math.PI * i +_giro/40)/npoints));\r\n }\r\n \r\n }", "public Enumeration inAdjacentVertice(Position vp) throws InvalidPositionException;", "public Vertix(int name, int x, int y) {\n this.name = name;\n this.x = x;\n this.y = y;\n }", "void removeVert(Pixel toRemove) {\n\n // is the given below this\n if (this.down == toRemove) {\n if (toRemove.right != null) {\n toRemove.right.left = toRemove.left;\n }\n if (toRemove.left != null) {\n toRemove.left.right = toRemove.right;\n }\n }\n\n // is the given downright to this\n else if (this.downRight() == toRemove) {\n if (toRemove.right != null) {\n toRemove.right.left = toRemove.left;\n }\n if (toRemove.left != null) {\n toRemove.left.right = toRemove.right;\n toRemove.left.up = toRemove.up;\n }\n if (toRemove.up != null) {\n toRemove.up.down = toRemove.left;\n }\n }\n\n //is the given downleft to this\n else if (this.downLeft() == toRemove) {\n if (toRemove.right != null) {\n toRemove.right.left = toRemove.left;\n }\n if (toRemove.left != null) {\n toRemove.left.right = toRemove.right;\n }\n if (toRemove.right != null) {\n toRemove.right.up = toRemove.up;\n }\n if (toRemove.up != null) {\n toRemove.up.down = toRemove.right;\n }\n }\n // if the connections were incorrect\n else {\n throw new RuntimeException(\"Illegal vertical seam\");\n }\n }", "public void setVerHor(Coordinates currentVerHor);", "public PosicionVertice[] getVertices(PosicionVertice rpv[]) {\n \n // inicializacion\n rpv = (rpv == null) ? new PosicionVertice[2] : rpv;\n for (int i=0; i<rpv.length; i++) {\n rpv[i] = (rpv[i] == null) ? new PosicionVertice() : rpv[i];\n }\n normaliza();\n \n switch(getOrientacion()) {\n case Este:\n rpv[0].setPos(getX(), getY()-1);\n rpv[0].setOrientacion(OrientacionVertice.Sur);\n rpv[1].setPos(getX()+1, getY());\n rpv[1].setOrientacion(OrientacionVertice.Norte);\n break;\n case NorEste:\n rpv[0].setPos(getX(), getY());\n rpv[0].setOrientacion(OrientacionVertice.Norte);\n rpv[1].setPos(getX(), getY()-1);\n rpv[1].setOrientacion(OrientacionVertice.Sur);\n break; \n case NorOeste:\n rpv[0].setPos(getX(), getY());\n rpv[0].setOrientacion(OrientacionVertice.Norte);\n rpv[1].setPos(getX()-1, getY());\n rpv[1].setOrientacion(OrientacionVertice.Sur);\n break; \n }\n return rpv;\n }", "public int numVertices() { return numV; }", "private static Vertice proxVertice(Vertice v1, Aresta a) {\r\n\t\tif (a.getV1() != v1) {\r\n\t\t\treturn a.getV1();\r\n\t\t} else {\r\n\t\t\treturn a.getV2();\r\n\t\t}\r\n\t}", "public Vertice getModelVertice(int i) {\n\t\treturn modelVertices.get(i);\n\t}", "public void Z_pos(MyInteger verPos, MyInteger horPos, ArrayList<ArrayList<Integer>> cur)\n {\n for (int i = 0; i < 3; i++)\n {\n for (int k = 0; k < 3; k++)\n {\n if (cur.get(i).get(k) == 0) {\n verPos.value = i;\n horPos.value = k;\n }\n }\n }\n }", "int getVertices();", "public void buildVerticies(){\n\t\tfor(Entry<HexLocation, TerrainHex> entry : hexes.entrySet()){\n\t\t\t\n\t\t\tVertexLocation vertLoc1 = new VertexLocation(entry.getKey(), VertexDirection.NorthWest);\n\t\t\tVertex v1 = new Vertex(vertLoc1);\n\t\t\tverticies.put(vertLoc1, v1);\n\t\t\t\n\t\t\tVertexLocation vertLoc2 = new VertexLocation(entry.getKey(), VertexDirection.NorthEast);\n\t\t\tVertex v2 = new Vertex(vertLoc2);\n\t\t\tverticies.put(vertLoc2, v2);\n\t\t\t\n\t\t\tVertexLocation vertLoc3 = new VertexLocation(entry.getKey(), VertexDirection.East);\n\t\t\tVertex v3 = new Vertex(vertLoc3);\n\t\t\tverticies.put(vertLoc3, v3);\n\t\t\t\n\t\t\tVertexLocation vertLoc4 = new VertexLocation(entry.getKey(), VertexDirection.SouthEast);\n\t\t\tVertex v4 = new Vertex(vertLoc4);\n\t\t\tverticies.put(vertLoc4, v4);\n\t\t\t\n\t\t\tVertexLocation vertLoc5 = new VertexLocation(entry.getKey(), VertexDirection.SouthWest);\n\t\t\tVertex v5 = new Vertex(vertLoc5);\n\t\t\tverticies.put(vertLoc5, v5);\n\t\t\t\n\t\t\tVertexLocation vertLoc6 = new VertexLocation(entry.getKey(), VertexDirection.West);\n\t\t\tVertex v6 = new Vertex(vertLoc6);\n\t\t\tverticies.put(vertLoc6, v6);\n\t\t\t\n\t\t\t\n\t\t}\n\t}", "public void moverVerticalSuave( int posicion )\n {\n brazo.moverVerticalSuave( posicion );\n }", "public abstract ArrayList<String> neighbours(String vertLabel);", "public V getVertex()\r\n/* */ {\r\n/* 198 */ return (V)this.vertex;\r\n/* */ }", "public int getVy() { return vy; }", "private int findVertIndex(T vertLabel) {\n ArrayList<T> labelRow = matrix.get(0);\n int vertIndex;\n if ((vertIndex = labelRow.indexOf(vertLabel)) == -1) {\n // System.out.println(\"Error: Vertex '\" + vertLabel + \"' does not exist in the matrix\");\n return -1;\n }\n vertIndex += 1; //Add 1 to account for the label cell\n return vertIndex;\n }", "public Vertice GetExtremoFinal(){\r\n return this.Vf;\r\n }", "private void defineVertexes(String orientation){\n if(\"down\".equals(orientation)){\n y2 = y1-height;\n y3 = y1-height;\n \n x2 = x1 - height/2;\n x3 = x1 + height/2;\n }else if(orientation.equals(\"up\")){\n y2 = y1+height;\n y3 = y1+height;\n x2 = x1 - height/2;\n x3 = x1 + height/2;\n }else if(orientation.equals(\"left\")){\n x2 = x1-height;\n y2 = y1+height/2;\n x3 = x1;\n y3 = y1+height;\n }else if(orientation.equals(\"right\")){\n x2 = x1+height;\n y2 = y1+height/2;\n x3 = x1;\n y3 = y1+height;\n }\n }", "private void MembentukListHuruf(){\n for(int i = 0; i < Panjang; i ++){\n Huruf Hrf = new Huruf();\n Hrf.CurrHrf = Kata.charAt(i);\n if(!IsVertikal){\n //horizontal\n Hrf.IdX = StartIdxX;\n Hrf.IdY = StartIdxY+i;\n }else{\n Hrf.IdX = StartIdxX+i;\n Hrf.IdY = StartIdxY;\n }\n // System.out.println(\"iniii \"+Hrf.IdX+\" \"+Hrf.IdY+\" \"+Hrf.CurrHrf+\" \"+NoSoal);\n TTS.Kolom[Hrf.IdX][Hrf.IdY].AddNoSoal(NoSoal);\n TTS.Kolom[Hrf.IdX][Hrf.IdY].Huruf=Hrf.CurrHrf;\n \n }\n }", "public void vivir(){\r\n\t\r\n\tAtacable algo42tmp;\r\n\t\r\n\tif (!(this.muerto)){\r\n\t\tfor(int i = 0; i <= this.velY; i++){\r\n\t\t\tthis.mover();\r\n\t\t}\r\n\t\t\r\n\t\talgo42tmp = zonaDeCombate.comprobarColisionAlgo42(this);\r\n\t\tif (algo42tmp != null){\r\n\t\t\talgo42tmp.recibirDanio(20); /**hacer q se muera*/\r\n\t\t\tthis.muerto = true;\r\n\t\t}\r\n\t\t\r\n\r\n\t\t}\r\n\t}", "public void mostrarVagon() {\n\t\tSystem.out.println(\"Estado actual del vagon\");\n\t\tfor (int i = 0; i < getNumeroAsientosFila(); i++) {\n\t\t\tfor (int j = 0; j < getNumeroAsientosColumna(); j++) {\n\t\t\t\tSystem.out.print(vagonVacio[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public Vertice getModelVertice(Vector3f _pos){\n\t\tint shortestIndex = -1;\n\t\tfloat shortestDistance = Float.MAX_VALUE;\n\t\tfloat dist = Float.MAX_VALUE;\n\t\tVertice pickVertice;\n\t\tfor(int i = 0; i < getModelVerticesCount(); i++){\n\t\t\tpickVertice = getModelVertice(i);\n\t\t\tdist = _pos.distance(pickVertice);\n\t\t\tif(dist < shortestDistance){\n\t\t\t\tshortestDistance = dist;\n\t\t\t\tshortestIndex = i;\n\t\t\t}\n\t\t}\n\t\treturn modelVertices.get(shortestIndex);\n\t}", "private boolean existeNegro(Vertice<T> v){\n\tif(v == null)\n\t return true;\n\tif(v.color == Color.NEGRO)\n\t return true;\n\treturn false;\n }", "public void findEdgeTo(char v) {\r\n\t\tfor (int i = 0; i < currentVertex.outList.size(); i++) {\r\n\t\t\tNeighbor neighbor = currentVertex.outList.get(i);\r\n\t\t\tif (neighbor.vertex.label == v) {\r\n\t\t\t\tSystem.out.println(neighbor.edge);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"none\");\r\n\t}", "@Override\n\tpublic boolean contieneVertice(Ciudad c1) {\n\t\tif (Objects.nonNull(getVertice(c1))) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Test\n public void testGetVertexIndex() throws GeoTessException {\n posLinear.set(8, new double[]{0., 0., -1.}, 6300.);\n assertEquals(11, posLinear.getVertexIndex());\n\n // set position to x, which does not coincide with a\n // model vertex.\n posLinear.set(8, x, R);\n assertEquals(-1, posLinear.getVertexIndex());\n }", "public void putVertexInfoToIndex(String vid, String targetIP);", "public int getvertex() {\n\t\treturn this.v;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"\\n\\n \\tVertice [label=\" + label + \"] \";\n\t}", "void calcVertSeamInfo() {\n SeamInfo tr = null;\n SeamInfo tl = null;\n SeamInfo t = null;\n if (this.topRight() != null) {\n tr = topRight().seamInfo;\n }\n if (this.topLeft() != null) {\n tl = topLeft().seamInfo;\n }\n if (this.up != null) {\n t = up.seamInfo;\n }\n\n double min = Double.MAX_VALUE;\n SeamInfo cameFrom = null;\n\n if (tr != null && min > tr.totalWeight) {\n min = tr.totalWeight;\n cameFrom = tr;\n }\n if (tl != null && min > tl.totalWeight) {\n min = tl.totalWeight;\n cameFrom = tl;\n }\n if (t != null && min > t.totalWeight) {\n min = t.totalWeight;\n cameFrom = t;\n }\n\n // for top border cases\n if (cameFrom == null) {\n min = 0;\n }\n\n this.seamInfo = new SeamInfo(this, min + this.energy(), cameFrom, true);\n }", "private void addVertexPositionConstraint(){\n for (int vertex=0; vertex < vertexCount; vertex++){\n addExactlyOne(variables[vertex]);\n }\n }", "public void mou(){\n\n this.setY(getY() + getVelocitatY());\n this.setX(getX() + getVelocitatX());\n\n }", "public void updateFlags(int fromx, int tox, int fromy, int toy, int fromz, int toz)\n {\n VoxelOctree voxels = obj.getVoxels();\n if (width != voxels.getWidth()-1)\n {\n initialize();\n return;\n }\n findBounds();\n byte cornerValues[] = new byte[8];\n if (fromx < 0)\n fromx = 0;\n if (fromy < 0)\n fromy = 0;\n if (fromz < 0)\n fromz = 0;\n if (tox >= width)\n tox = width-1;\n if (toy >= width)\n toy = width-1;\n if (toz >= width)\n toz = width-1;\n int ysize = toy-fromy+3;\n int zsize = toz-fromz+3;\n\n // Look up the values for the x==fromx plane.\n\n byte values[][] = new byte[2][ysize*zsize];\n for (int j = 0; j < ysize; j++)\n for (int k = 0; k < zsize; k++)\n values[0][j*zsize+k] = voxels.getValue(fromx, j+fromy, k+fromz);\n for (int i = fromx; i <= tox; i++)\n {\n // Look up the values for the next plane.\n\n for (int j = 0; j < ysize; j++)\n for (int k = 0; k < zsize; k++)\n values[1][j*zsize+k] = voxels.getValue(i+1, j+fromy, k+fromz);\n for (int j = fromy; j <= toy; j++)\n {\n for (int k = fromz; k <= toz; k++)\n {\n int numBelow = 0;\n int numZero = 0;\n for (int corner = 0; corner < 8; corner++)\n {\n // Record the values at the four corners of this cell, and see how many are outside.\n\n cornerValues[corner] = values[vertexOffset[corner][0]][(j-fromy+vertexOffset[corner][1])*zsize+k-fromz+vertexOffset[corner][2]];\n if (cornerValues[corner] < 0)\n numBelow++;\n else if (cornerValues[corner] == 0)\n numZero++;\n }\n int index = i*width*width+j*width+k;\n if ((numBelow != 0 && numBelow != 8) || numZero > 0)\n flags[index/32] |= 1<<(index%32);\n else\n flags[index/32] &= 0xFFFFFFFF-(1<<(index%32));\n }\n }\n\n // Swap the value arrays so the values for x==i+1 will be in values[0].\n\n byte temp[] = values[0];\n values[0] = values[1];\n values[1] = temp;\n }\n }", "private void cazaFantasma(Vertice<T> v){\n\tif(v.padre == null){\n\t if(v == this.raiz){\n\t\tthis.raiz = null;\n\t\treturn;\n\t }\n\t return;\n\t}else{\n\t Vertice<T> padre = v.padre;\n\t if(v == padre.izquierdo){\n\t\tif(v.hayIzquierdo()){\n\t\t padre.izquierdo = v.izquierdo;\n\t\t v.izquierdo.padre = padre;\n\t\t}else if(v.hayDerecho()){\n\t\t padre.izquierdo = v.derecho;\n\t\t v.derecho.padre = padre;\n\t\t}else{\n\t\t padre.izquierdo = null;\n\t\t}\t\t\n\t }else{\n\t\tif(v.hayIzquierdo()){\n\t\t padre.derecho = v.izquierdo;\n\t\t v.izquierdo.padre = padre;\n\t\t}else if(v.hayDerecho()){\n\t\t padre.derecho = v.derecho;\n\t\t v.derecho.padre = padre;\n\t\t}else{\n\t\t padre.derecho = null;\n\t\t}\n\t }\n\t}\n }", "public createVertice_args(createVertice_args other) {\n __isset_bitfield = other.__isset_bitfield;\n this.nome = other.nome;\n this.cor = other.cor;\n this.peso = other.peso;\n if (other.isSetDescricao()) {\n this.descricao = other.descricao;\n }\n }", "public abstract Vector2[] getVertices();", "public int vecinos(){\n int v=0;\n if(fila<15 && columna<15 && fila>0 && columna>0){\n if(automata.getElemento(fila,columna-1)!=null && automata.getElemento(fila,columna-1).isVivo()){v++;}\n if(automata.getElemento(fila+1,columna-1)!=null && automata.getElemento(fila+1,columna-1).isVivo()){v++;}\n if(automata.getElemento(fila+1,columna)!=null && automata.getElemento(fila+1,columna).isVivo()){v++;} \n if(automata.getElemento(fila+1,columna+1)!=null && automata.getElemento(fila+1,columna+1).isVivo()){v++;}\n if(automata.getElemento(fila,columna+1)!=null && automata.getElemento(fila,columna+1).isVivo()){v++;}\n if(automata.getElemento(fila-1,columna+1)!=null && automata.getElemento(fila-1,columna+1).isVivo()){v++;}\n if(automata.getElemento(fila-1,columna)!=null && automata.getElemento(fila-1,columna).isVivo()){v++;}\n if(automata.getElemento(fila-1,columna-1)!=null && automata.getElemento(fila-1,columna-1).isVivo()){v++;}\n }\n else{v=limitesX();}\n return v;\n }", "@Override\r\n public void moverAyuda() {\n System.out.println(\"La reina puede mover hacia cualquier dirección en linea recta / diagonal\");\r\n }", "private void setUpVAO() {\n\t\tfloat[] vertices = { -1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, 1 };\n\t\tquad = Loader.loadToVAO(vertices, 2);\n\t}", "void method0() {\nprivate double edgeCrossesIndicator = 0;\n/** counter for additions to the edgeCrossesIndicator\n\t\t */\nprivate int additions = 0;\n/** the vertical level where the cell wrapper is inserted\n\t\t */\nint level = 0;\n/** current position in the grid\n\t\t */\nint gridPosition = 0;\n/** priority for movements to the barycenter\n\t\t */\nint priority = 0;\n/** reference to the wrapped cell\n\t\t */\nVertexView vertexView = null;\n}", "public Vertice getvTerminal() {\r\n return vTerminal;\r\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 Pattern getVertPattern() {\n\t\treturn vertPattern;\n\t}", "public void CrearArco(String Identificador, E Dato, Double peso, Vertice Verticei, Vertice Verticef){\r\n this.Vi = Verticei;\r\n this.Vf = Verticef;\r\n this.id = Identificador;\r\n this.Dato = Dato;\r\n this.p = peso;\r\n }", "public Rettangolo(Punto[] vertici)\n\t{\n\t\tsuper(vertici);\n\n\t\tif(this.direzioneLati[0] != -1.0 / this.direzioneLati[1] && (this.direzioneLati[0] != Double.POSITIVE_INFINITY || this.direzioneLati[1] != 0.0))\n\t\t{\n\t\t\tthis.vertici = null;\n\t\t\tthis.direzioneLati = this.lunghezzaLati = null; // TODO: eccezioni\n\t\t\tSystem.out.println(\"Errore: i quattro punti non individuano un rettangolo.\");\n\t\t}\n\t}", "public String getV(int nIndex) {\n\treturn null;\n}", "protected final void parseV() {\n current = read();\n skipSpaces();\n\n for (;;) {\n switch (current) {\n case '+': case '-': case '.':\n case '0': case '1': case '2': case '3': case '4':\n case '5': case '6': case '7': case '8': case '9':\n float y = parseNumber();\n smoothQCenterX = currentX;\n smoothCCenterX = currentX;\n\n currentY = y;\n smoothQCenterY = y;\n smoothCCenterY = y;\n p.lineTo(smoothCCenterX, smoothCCenterY);\n break;\n default:\n return;\n }\n skipCommaSpaces();\n }\n }", "public Vector2d getVve() {\n return vve;\n }", "private void Visitar(Vertice v, int p) {\n\t\t\n\t\tv.setVisited(true);\n\t\tv.setPredecessor(p);\n\t\t\n\t\tLinkedList<ListaAdjacencia> L = v.getAdjList();\n\t\t\n\t\tfor (ListaAdjacencia node : L) {\n\t\t\tint n = node.getverticeNumero();\n\t\t\tif (!vertices[n].getVisited()) {\n\t\t\t\tVisitar(vertices[n], v.getIndex());\n\t\t\t}\n\t\t}\n\t\t\n\t}", "@Override // Métodos que fazem a anulação\n\tpublic void vota() {\n\t\t\n\t}", "public abstract void updateVertices();", "@Override\r\n\tprotected void initVentajas() {\n\r\n\t}", "protected void processVertex(Vertex w){\n\t}", "void buildCity(VertexLocation vert);", "@Override\n\tpublic void vInv() {\n\t\t\n\t}", "private int getIndex(int u) {\n int ind = -1;\n for (int i = 0; i < getGraphRep().size(); i++) {\n ArrayList subList = getGraphRep().get(i);\n String temp = (String) subList.get(0);\n int vert = Integer.parseInt(temp);\n if (vert == u) {\n ind = i;\n }\n }\n return ind;\n }", "@Override \n public Vector getLocation() {\n return this.getR();\n }", "int addVertex(Vector position);", "private void addVertexVisitConstraint(){\n\n for (int vertex=0; vertex < vertexCount; vertex++){\n Integer[] pos = new Integer[variables.length];\n for (int position =0; position < positionCount; position++){\n pos[position] = variables[position][vertex];\n }\n addExactlyOne(pos);\n }\n }", "public abstract void mo102585a(VH vh, int i);", "public void findEdgeFrom(char v) {\r\n\t\tfor (int i = 0; i < currentVertex.inList.size(); i++) {\r\n\t\t\tNeighbor neighbor = currentVertex.inList.get(i);\r\n\t\t\tif (neighbor.vertex.label == v) {\r\n\t\t\t\tSystem.out.println(neighbor.edge);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"none\");\r\n\t}", "public updateVertice_args(updateVertice_args other) {\n __isset_bitfield = other.__isset_bitfield;\n this.nome = other.nome;\n this.cor = other.cor;\n this.peso = other.peso;\n if (other.isSetDescricao()) {\n this.descricao = other.descricao;\n }\n }", "public char controlloVerticale(char[][] scacchiera)\n {\n for (int w=0;w<3;w++)\n {\n if (scacchiera[0][w]==scacchiera[1][w]&&scacchiera[1][w]==scacchiera[2][w]) return scacchiera[0][w];\n }\n return ' ';\n }", "Vaisseau_positionner createVaisseau_positionner();", "public void VuforiaOrientator() {\n }", "public CPointer<SDefVert> getVerts() throws IOException\n\t{\n\t\tlong __dna__targetAddress;\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__dna__targetAddress = __io__block.readLong(__io__address + 136);\n\t\t} else {\n\t\t\t__dna__targetAddress = __io__block.readLong(__io__address + 108);\n\t\t}\n\t\tClass<?>[] __dna__targetTypes = new Class[]{SDefVert.class};\n\t\treturn new CPointer<SDefVert>(__dna__targetAddress, __dna__targetTypes, __io__blockTable.getBlock(__dna__targetAddress, SDefVert.__DNA__SDNA_INDEX), __io__blockTable);\n\t}", "public void vreflect() {\n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n int h= 0;\n int k= cols-1;\n //invariant: columns 0..h-1 and k+1.. have been inverted\n while (h < k) {\n // Swap column h with column k\n // invariant: pixels 0..c-1 of columns h and k have been swapped\n for (int c= 0; c != rows; c= c+1) {\n currentIm.swapPixels(c, h, c, k);\n }\n \n h= h+1; k= k-1;\n }\n \n }", "double getVz() { return vel[2]; }", "public int other(int vertex) {\n if (vertex == v) return w;\n else if (vertex == w) return v;\n else throw new IllegalArgumentException(\"Illegal endpoint\");\n }", "public void setVelocidad(int vel)\r\n\t{\r\n\t\tvelocidad=vel;\r\n\t}", "public void setTo(Vertex<VV> vertex)\r\n { this.to = vertex; }", "public Vertex<VV> getTo()\r\n { return to; }", "private String vylozZvieraZVozidla() {\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 index zvierata\");\r\n if (pozicia == null) return \"\";\r\n\r\n try {\r\n Zivocich ziv = zoo.vylozZivocicha(pozicia-1);\r\n if (ziv == null) {\r\n return \"Zviera c. \" + pozicia + \" nie je na vozidle\\n\\t\";\r\n }\r\n zoo.pridajZivocicha(ziv);\r\n return \"Zviera \" + ziv\r\n + \"\\n\\tbolo vylozene z prepravneho vozidla\";\r\n } catch (ClassCastException exCC) {\r\n return \"Zviera c. \" + pozicia + \" nie je na vozidle\\n\\t\";\r\n } catch (Exception ex) {\r\n return \"Neznama chyba:\\n\\t\" + ex;\r\n }\r\n }", "public abstract int getNumberOfVertices();", "@Override\r\n\tpublic void voar() {\n\t\t\r\n\t}", "private int getVInfoIndex(Object v) {\n Integer indexObj = vtxMap.get(v);\n\n // if value is null, there is not entry in\n // the map; return -1; otherwise, convert\n // object to an int\n if (indexObj == null) {\n return -1;\n } else {\n return indexObj;\n }\n }", "public void vignette() {\n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n \n int middleRow = rows/2; //Height of the right angle\n int middleCol = cols/2; //Width of the right angle\n double hfD = (Math.sqrt(Math.pow(rows,2)+Math.pow(cols,2)))/2;\n \n //Outer: Rows, Inner: Columns\n for(int rr = 0; rr < rows; rr++){\n \n for(int cc = 0; cc < cols; cc++){\n \n int rgb= currentIm.getPixel(rr,cc);\n double red= DM.getRed(rgb);\n double blue= DM.getBlue(rgb);\n double green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double currentDistance = Math.sqrt(Math.pow(Math.abs(middleRow-rr),2)+\n Math.pow(Math.abs(middleCol-cc),2));\n \n double vigValue = 1-Math.pow((currentDistance/hfD),2);\n \n red = red * vigValue;\n green = green * vigValue;\n blue = blue * vigValue;\n \n currentIm.setPixel(rr, cc,\n (alpha << 24) | ((int)red << 16) | ((int)green << 8) | \n (int)blue);\n }\n \n }\n \n }", "private int vertexIndex(T obj){\n for (int i = 0; i < n; i++){\n if (obj.equals(vertices[i])){\n return i;\n }\n }\n return NOT_FOUND;\n }", "public int getRayonV(){\r\n\t\treturn rayonV;\r\n\t}", "public Object getVertex(){\r\n return this.vertex;\r\n }", "@Override\n\tpublic String getInformeVendedor() {\n\t\treturn \"Informe trimestre 3\";\n\t}", "public Vector get_vTo() {\n\t\treturn _vTo;\n\t}", "private void parseVertex(String line) {\n\n String first_float = line.substring(2);\n first_float = first_float.trim();\n int second_space_index = first_float.indexOf(' ') + 1;\n String second_float = first_float.substring(second_space_index);\n second_float = second_float.trim();\n int third_space_index = second_float.indexOf(' ') + 1;\n String third_float = second_float.substring(third_space_index);\n third_float = third_float.trim();\n\n float vx = parseFloat(first_float.substring(0, second_space_index - 1));\n float vy = parseFloat(second_float.substring(0, third_space_index - 1));\n float vz = parseFloat(third_float);\n\n mMaxX = Math.max(mMaxX, vx);\n mMaxY = Math.max(mMaxY, vy);\n mMaxZ = Math.max(mMaxZ, vz);\n\n mMinX = Math.min(mMinX, vx);\n mMinY = Math.min(mMinY, vy);\n mMinZ = Math.min(mMinZ, vz);\n\n mVertices.add(vx);\n mVertices.add(vy);\n mVertices.add(vz);\n mLastVertexNumber++;\n\n if (mHaveMaterialColor) {\n mColors.add(mMaterialColor[0]);\n mColors.add(mMaterialColor[1]);\n mColors.add(mMaterialColor[2]);\n }\n }", "public int other(int vertex) {\n if (vertex == v) return w;\n else if (vertex == w) return v;\n else throw new IllegalArgumentException(\"Illegal endpoint\");\n }", "@Override\n public void affiche(){\n System.out.println(\"Loup : \\n points de vie : \"+this.ptVie+\"\\n pourcentage d'attaque : \"+this.pourcentageAtt+\n \"\\n dégâts d'attaque : \"+this.degAtt+\"\\n pourcentage de parade :\"+this.pourcentagePar+\n \"\\n position : \"+this.pos.toString());\n\n }", "private void connectWithVirtualSites(int row, int col) {\n if (row == 1) {\n UF.union(0, getIndex(row, col));\n } else {\n UF.union(getSize() * getSize() + 1, getIndex(row, col));\n }\n }", "public void setVector(int[] paramArrayOfInt)\n/* */ {\n/* 370 */ enterEvi(this.downNode, paramArrayOfInt);\n/* */ }", "public V getVertex(int index);", "public void setModelVertice(int i, float x, float y, float z) {\n\t\t(modelVertices.get(i)).set(x, y, z);\n\t}", "@Override\n\tpublic void acomodaVista() {\n\n\t}", "public void setOrigen(Vertex origen) {\n this.origen = origen;\n }", "@Override\n public void interagit() {\n super.interagit();\n ArrayList<EtreVivant> cibles = this.ciblesPotentiellesAdjacentes(this.getPosition(),this.nombreVoisins);\n cibles.stream().filter((vivants) -> (vivants.getEtat().equals(EtatEtreVivant.MALADE))).forEach((vivants) -> {\n this.soigne(vivants);\n });\n }", "@Test\n public void testCheckPlaceValideVerticale() throws BateauxMembreInvalide, BateauxStartPointInvalide {\n Player p = new Player();\n List<Player> pL = new ArrayList<>();\n pL.add(p);\n Jeux j = new Jeux(ModeDeJeux.MONO_JOUEUR, pL);\n Grille g = new Grille(15, 15, j, p);\n\n Place[] pl = j.checkPlace(\"A6\", g, 5, false);\n Place[] att = new Place[]{new Place(\"A6\"), new Place(\"A7\"), new Place(\"A8\"), new Place(\"A9\"), new Place(\"A10\")};\n\n assertArrayEquals(\"Les places ne sont pas bonne\", att, pl);\n }" ]
[ "0.65846854", "0.65671766", "0.63920873", "0.620815", "0.6205552", "0.61822325", "0.6154753", "0.605989", "0.6047458", "0.60207886", "0.5944882", "0.5927921", "0.5897734", "0.56807876", "0.56515783", "0.56381345", "0.56185067", "0.56172305", "0.5612151", "0.560175", "0.55948347", "0.5584937", "0.5566358", "0.55614907", "0.5559629", "0.5556794", "0.5530444", "0.5520425", "0.5484066", "0.54799217", "0.5479574", "0.5461178", "0.54456663", "0.5429838", "0.540804", "0.54025036", "0.53982943", "0.53810066", "0.53801715", "0.53761905", "0.5372924", "0.5372218", "0.5366409", "0.53563815", "0.53521556", "0.5352114", "0.53391254", "0.5337061", "0.5331359", "0.53242093", "0.5318678", "0.53158164", "0.5315305", "0.53101856", "0.5302009", "0.5294159", "0.52812415", "0.5267788", "0.52626675", "0.5262253", "0.5253696", "0.525301", "0.52508914", "0.5249368", "0.52488405", "0.52440625", "0.5228858", "0.52278966", "0.5220791", "0.52203935", "0.5216576", "0.52163976", "0.52149653", "0.5213694", "0.52066857", "0.5206007", "0.5198762", "0.51970357", "0.5195042", "0.51923925", "0.5190616", "0.5189596", "0.5178249", "0.5177766", "0.5176908", "0.51765", "0.51619774", "0.51605636", "0.51590735", "0.5158505", "0.51572865", "0.5153403", "0.51489735", "0.51417863", "0.5139483", "0.51372856", "0.5132937", "0.51304734", "0.5125373", "0.5123621", "0.5123036" ]
0.0
-1
Metodo per trovare il massimo grado tra tutti i vertici
public int findMaxDegree() { int gradoMax = 0; for(String s : grafo.vertexSet()) { int grado = grafo.degreeOf(s); if(grado > gradoMax) { gradoMax = grado; verticeGradoMax = s; } } return gradoMax; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int grado() {\n \t//Paso 1: almacenar en un array los grados de todos los vertices\n \t//Paso 2: sacar el maximo grado de los vertices\n \t\n \tint[] v = getArrayGrados();\n \treturn maximo(v);\n \t\n \t\n }", "public int getGradoMinimo() {\n\t\treturn grMin;\n\t}", "public void calcularGrados() {\n\t\tgrMax = 1;\n\t\tint temp;\n\t\tfor (int f = 0; f < cantNodos; f++) {\n\t\t\ttemp = 0;\n\t\t\tfor (int c = 0; c < cantNodos; c++) {\n\t\t\t\tif (getValor(f, c) == true)\n\t\t\t\t\ttemp++;\n\t\t\t}\n\t\t\tif (temp > grMax)\n\t\t\t\tgrMax = temp;\n\t\t}\n\t\tgrMin = grMax;\n\t\tfor (int f = 0; f < cantNodos; f++) {\n\t\t\ttemp = 0;\n\t\t\tfor (int c = 0; c < cantNodos; c++) {\n\t\t\t\tif (getValor(f, c) == true)\n\t\t\t\t\ttemp++;\n\t\t\t}\n\t\t\tif (temp < grMin)\n\t\t\t\tgrMin = temp;\n\t\t}\n\t\t\n\t}", "public int gradoAlt() {\n \tint[] gradosEntr = new int[numV];\n \tint[] gradosSal = new int[numV];\n \tfor(int i = 0; i<numV; i++) {\n \t\tgradosEntr[i] = gradoEntrada(i);\n \t\tgradosSal[i] = gradoSalida(i);\n \t}\n \tint[] contGrado = new int[numV];\n \tfor(int i = 0; i<numV; i++) {\n \t\tcontGrado[i] = gradosEntr[i] + gradosSal[i];\n \t}\n \t return maximo(contGrado); \n }", "@Override\n\tpublic double mangeLegumes() {\n\t\treturn quantiteLegumes*this.getPoids();\n\t}", "public void mezclarPorGrado() {\n\t\tint i = 0;\n\t\tint inicio = 0;\n\t\tint fin = 0;\n\t\tint grado = 0;\n\t\tNodo aux;\n\t\tRandom r = new Random();\n\t\tboolean[] mezclado = new boolean[cantNodos];\n\n\t\twhile (i < cantNodos) {\n\t\t\tinicio = i;\n\t\t\tgrado = nodos.get(i).getGrado();\n\t\t\twhile (i < cantNodos && nodos.get(i).getGrado() == grado)\n\t\t\t\ti++;\n\n\t\t\tfin = i;\n\n\t\t\tfor (int k = inicio; k < (fin - inicio); k++) {\n\t\t\t\tint res = r.nextInt(fin - inicio);\n\t\t\t\tif (mezclado[k])\n\t\t\t\t\tres = r.nextInt(fin - inicio);\n\t\t\t\taux = nodos.get(k);\n\t\t\t\tmezclado[k] = true;\n\t\t\t\tnodos.set(k, nodos.get(inicio + res));\n\t\t\t\tnodos.set(inicio + res, aux);\n\t\t\t}\n\t\t}\n\t\tvalidarMezcla();\n\t}", "public int getGrado() {\n\t\treturn grado;\n\t}", "int getMines() {return mines;}", "public int gradoEntrada() {\n \tint[] cont = new int[numV];//crear e inicializar el array de contadores\n \tfor(int i = 0; i<numV; i++) {\n \t\t//actualizaar el contador del grado de Entrada de cada vertice\n \t\t//de la lista adyacenteDe(i)\n \t\tListaConPI<Adyacente> a = elArray[i];\n \t\tfor(a.inicio(); !a.esFin(); a.siguiente()) {\n \t\tcont[a.recuperar().getDestino()]++;\n \t\t}\n \t}\n \treturn maximo(cont);\n }", "public double Baricentro() {\n if (puntos.size() <= 2) {\n return 0;\n } else {\n // Inicializacion de las areas\n double areaPonderada = 0;\n double areaTotal = 0;\n double areaLocal;\n // Recorrer la lista conservando 2 puntos\n Punto2D antiguoPt = null;\n for (Punto2D pt : puntos) {\n if (antiguoPt != null) {\n // Cálculo deñ baricentro local\n if (antiguoPt.y == pt.y) {\n // Es un rectángulo, el baricentro esta en\n // centro\n areaLocal = pt.y * (pt.x - antiguoPt.x);\n areaTotal += areaLocal;\n areaPonderada += areaLocal * ((pt.x - antiguoPt.x) / 2.0 + antiguoPt.x);\n } else {\n // Es un trapecio, que podemos descomponer en\n // un reactangulo con un triangulo\n // rectangulo adicional\n // Separamos ambas formas\n // Primer tiempo: rectangulo\n areaLocal = Math.min(pt.y, antiguoPt.y) + (pt.x - antiguoPt.x);\n areaTotal += areaLocal;\n areaPonderada += areaLocal * ((pt.x - antiguoPt.x) / 2.0 + antiguoPt.x);\n //Segundo tiempo: triangulo rectangulo\n areaLocal = (pt.x - antiguoPt.x) * Math.abs(pt.y - antiguoPt.y) / 2.0;\n areaTotal += areaLocal;\n if (pt.y > antiguoPt.y) {\n // Baricentro a 1/3 del lado pt\n areaPonderada += areaLocal * (2.0 / 3.0 * (pt.x - antiguoPt.x) + antiguoPt.x);\n } else {\n // Baricentro a 1/3 dek lado antiguoPt\n areaPonderada += areaLocal * (1.0 / 3.0 * (pt.x - antiguoPt.x) + antiguoPt.x);\n }\n }\n }\n antiguoPt = pt;\n }\n // Devolvemos las coordenadas del baricentro\n return areaPonderada / areaTotal;\n }\n }", "public void setGiro( double gradosGiro ) {\r\n\t\t// De grados a radianes...\r\n\t\tmiGiro += gradosGiro;\r\n\t}", "public void calculaVertice(int _radio, double _giro){\r\n //npoints equivale a _lados\r\n for(int i = 0; i<npoints;i++){\r\n //asi se llama internamente a la primera array de las posiciones x\r\n xpoints[i] = (int)(x + _radio*Math.cos((2*Math.PI * i +_giro/40)/npoints));\r\n ypoints[i] = (int)(y + _radio*Math.sin((2*Math.PI * i +_giro/40)/npoints));\r\n }\r\n \r\n }", "@Override\n public void calcularIntGanado() {\n intGanado = saldo;\n for(int i = 0; i < plazoInv; i++){\n intGanado += inve * 12;\n intGanado += intGanado * (intAnual / 100);\n }\n intGanado = intGanado - (inve + saldo);\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 int fondMagasin(){\n\tint total =this.jeton;\n\tfor(Caisse c1 : this.lesCaisses){\n\ttotal = c1.getTotal()+total;\n\t}\n\treturn total;\n}", "public void gagne()\r\n\t{\r\n\t\tthis.nbVictoires++;\r\n\t}", "public int gradoSalida() {\n \t//crear e inicializar el array de contadores\n \tint[] cont = new int[numV];\n \tfor(int i = 0; i<numV; i++) {\n \t\t//actualizar el contador de grados con la talla de cada elemento del array \n \t\tListaConPI<Adyacente> v = elArray[i];\n \t\tcont[i] = v.talla();\n \t}\n \treturn maximo(cont);\n }", "@Override\n public void cantidad_Punteria(){\n punteria=69.5+05*nivel+aumentoP;\n }", "public int getminutoStamina(){\n return tiempoReal;\n }", "public void buscarGrado() {\n \tGrado grado = new Grado();\n \tgrado.setDescripcionSeccion(\"Primaria\");\n \tgrado.setNumGrado(4);\n \tgrado.setDescripcionUltimoGrado(\"NO\");\n \tString respuesta = negocio.buscarGrado(\"\", grado);\n \tSystem.out.println(respuesta);\n }", "public void dividirDineroGobierno() {\n\n double dineroDividible = super.getMundo().getGobierno().getCapitalEconomico() / 2;\n double dineroPorPersona = super.getMundo().contarPersonas();\n\n if (dineroDividible > 0) {\n\n super.getMundo().gobiernoDarDinero(dineroDividible);\n\n for (Persona p : super.getMundo().getListaDoctores())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaCocineros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaAlbaniles())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaHerreros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaCocineros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaDoctores())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaCocineros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaAlbaniles())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaHerreros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaCocineros())\n p.ganarDinero(dineroPorPersona);\n }\n }", "private double hitungG_pelukis(){\r\n return Math.sqrt(Math.pow(super.getRadius(),2)+Math.pow(tinggi,2));\r\n }", "public void majAffichage() {\n this.grid.getChildren().clear(); // vide tout le gridpane\n for (int i = 0; i < this.matrice.getNbLigne(); i++) {\n for (int j = 0; j < this.matrice.getNbColonne(); j++) {\n Node n = this.matrice.getCell(i, j); // recupère les imgViews de la matrice\n this.grid.setHalignment(n, HPos.CENTER); // place les labels au centre des cases\n this.grid.add(this.matrice.getCell(i, j), j, i);\n }\n }\n }", "void calcVertSeamInfo() {\n SeamInfo tr = null;\n SeamInfo tl = null;\n SeamInfo t = null;\n if (this.topRight() != null) {\n tr = topRight().seamInfo;\n }\n if (this.topLeft() != null) {\n tl = topLeft().seamInfo;\n }\n if (this.up != null) {\n t = up.seamInfo;\n }\n\n double min = Double.MAX_VALUE;\n SeamInfo cameFrom = null;\n\n if (tr != null && min > tr.totalWeight) {\n min = tr.totalWeight;\n cameFrom = tr;\n }\n if (tl != null && min > tl.totalWeight) {\n min = tl.totalWeight;\n cameFrom = tl;\n }\n if (t != null && min > t.totalWeight) {\n min = t.totalWeight;\n cameFrom = t;\n }\n\n // for top border cases\n if (cameFrom == null) {\n min = 0;\n }\n\n this.seamInfo = new SeamInfo(this, min + this.energy(), cameFrom, true);\n }", "@Override\n public int getRent() {\n int total = 0;\n for (Property P : this.owner.getProperties()) {\n if (P.group_color.equals(this.group_color)) {\n total++;\n }\n }\n if (total == 2) {\n return RENT * 2;\n }\n else if (total == 3) {\n return RENT * 3;\n }\n else if (total == 4) {\n return RENT * 4;\n }\n else {\n return RENT;\n }\n }", "public void sauvegarderPointPartie (){\n\t\t\n\t\tint menage = (Integer) pointPartieEnCours.get(THEMES.MENAGE);\n\t\tint maths = (Integer) pointPartieEnCours.get(THEMES.MATHS);\n\t\tint francais = (Integer) pointPartieEnCours.get(THEMES.FRANCAIS);\n\t\t\n\t\tmenage += (Integer) level.get(THEMES.MENAGE);\n\t\tmaths += (Integer) level.get(THEMES.MATHS);\n\t\tfrancais += (Integer) level.get(THEMES.FRANCAIS);\n\t\t\n\t\tlevel.remove(THEMES.MENAGE); \n\t\tlevel.remove(THEMES.MATHS); \n\t\tlevel.remove(THEMES.FRANCAIS); \n\t\t\n\t\t\n\t\tlevel.put(THEMES.MENAGE ,menage); \n\t\tlevel.put(THEMES.MATHS ,maths); \n\t\tlevel.put(THEMES.FRANCAIS ,francais); \n\t\t\n\t}", "public int getVgap() {\n/* */ return this.vgap;\n/* */ }", "public void calcularIndicePlasticidad(){\r\n\t\tindicePlasticidad = limiteLiquido - limitePlastico;\r\n\t}", "public int getNumGruppoPacchetti();", "private Map<Vertice<T>, Integer> caminosMinimoDikstra(Vertice<T> origen) {\n \tMap<Vertice<T>, Integer> distancias = new HashMap<Vertice<T>, Integer>();\n \tfor(Vertice<T> unVertice : this.vertices) {\n \t\tdistancias.put(unVertice, Integer.MAX_VALUE);\n \t}\n \tdistancias.put(origen, 0);\n \t\n \t// guardo visitados y pendientes de visitar\n \tSet<Vertice<T>> visitados = new HashSet<Vertice<T>>();\n \tTreeMap<Integer,Vertice<T>> aVisitar= new TreeMap<Integer,Vertice<T>>();\n\n \taVisitar.put(0,origen);\n \t \n \twhile (!aVisitar.isEmpty()) {\n \t\tEntry<Integer, Vertice<T>> nodo = aVisitar.pollFirstEntry();\n \t\tvisitados.add(nodo.getValue());\n \t\t\n \tint nuevaDistancia = Integer.MIN_VALUE;\n \tList<Vertice<T>> adyacentes = this.getAdyacentes(nodo.getValue());\n \t\n \tfor(Vertice<T> unAdy : adyacentes) {\n if(!visitados.contains(unAdy)) {\n Arista<T> enlace = this.buscarArista(nodo.getValue(), unAdy);\n if(enlace !=null) {\n nuevaDistancia = enlace.getValor().intValue();\n }\n int distanciaHastaAdy = distancias.get(nodo.getValue()).intValue();\n int distanciaAnterior = distancias.get(unAdy).intValue();\n if(distanciaHastaAdy + nuevaDistancia < distanciaAnterior ) {\n distancias.put(unAdy, distanciaHastaAdy + nuevaDistancia);\n aVisitar.put(distanciaHastaAdy + nuevaDistancia,unAdy);\n }\n }\n } \t\t\n \t}\n \tSystem.out.println(\"DISTANCIAS DESDE \"+origen);\n \tSystem.out.println(\"Resultado: \"+distancias);\n \treturn distancias;\n }", "@Override\r\n protected Double g(Point from, Point to) {\r\n if (from.equals(to))\r\n return 0.0;\r\n\r\n if (field.isFree(new Point(to.x, to.y)) || to.equals(finish))\r\n return 1.0;\r\n\r\n return Double.MAX_VALUE;\r\n }", "public double getG();", "public GrapheIndicateursProjet (Projet p) {\n seuils = p.getSeuilFixes() ;\n \n // pour l'echelle, on determine les mesures max de toutes les iterations\n \n \n iterations = p.getListeIt() ; \n nbIt = iterations.size() ;\n \n // calcul des maximums\n Iteration tempIt = null ;\n IndicateursIteration tempIndIt = null ;\n for (int i = 0 ; i < nbIt ; i++)\n {\n if (iterations.get(i) instanceof Iteration)\n {\n tempIt = (Iteration)iterations.get(i) ;\n tempIndIt = tempIt.getIndicateursIteration() ;\n // charges\n if (tempIndIt.getTotalCharges() > chargesMax) { chargesMax = tempIndIt.getTotalCharges() ; }\n\t\tif (tempIndIt.getChargeMoyenneParticipants() > moyenneChargesMax) { moyenneChargesMax = tempIndIt.getChargeMoyenneParticipants() ; }\n\t\tif (tempIndIt.getNombreParticipants() > participantsMax) { participantsMax = tempIndIt.getNombreParticipants() ; }\n\t\tif (tempIndIt.getNombreTachesTerminees() > tachesTermineesMax) { tachesTermineesMax = tempIndIt.getNombreTachesTerminees() ; }\n\t\tif (tempIndIt.getNombreMoyenTachesParticipants() > tachesParticipantsMax) { tachesParticipantsMax = tempIndIt.getNombreMoyenTachesParticipants() ; }\n\t\tif (tempIndIt.getDureeMoyenneTaches() > dureeMoyenneTacheMax) { dureeMoyenneTacheMax = tempIndIt.getDureeMoyenneTaches() ; }\n }\n }\n setPreferredSize(new Dimension(ITERATION_WIDTH * nbIt,440));\n\t//setBorder(new TitledBorder(new EtchedBorder(), \"toto\", 5, TitledBorder.ABOVE_TOP)) ;\n }", "@Override\n\tpublic double mencariGajiKotor() {\n\t\treturn super.mencariGajiKotor()+mencariBonus();\n\t}", "Gruppo getGruppo();", "public void balayer()\r\n {\r\n int tot=0;\r\n for (int i=0;i<LONGUEUR;i++ )\r\n {\r\n for (int j=0; j<LARGEUR; j++ )\r\n {\r\n tot=0;\r\n Haut = lignesHor[i][j];\r\n Droite = lignesVert[i+1][j];\r\n Bas = lignesHor[i][j+1];\r\n Gauche = lignesVert[i][j];\r\n\r\n if (Haut)\r\n {\r\n tot++;\r\n Vision[i][j][1]=1;\r\n }\r\n\r\n if (Droite)\r\n {\r\n tot++;\r\n Vision[i][j][2]=1;\r\n }\r\n\r\n if (Bas)\r\n {\r\n tot++;\r\n Vision[i][j][3]=1;\r\n }\r\n\r\n\r\n if (Gauche)\r\n {\r\n tot++;\r\n Vision[i][j][4]=1;\r\n }\r\n\r\n Vision[i][j][0]=Vision[i][j][1]+Vision[i][j][2]+Vision[i][j][3]+Vision[i][j][4];\r\n }\r\n }\r\n }", "public static void main(String[] args) {\n\t\tGrupoNumeros mi_grupo=new GrupoNumeros(10);\r\n\t\t\r\n\t\tmi_grupo.imprimirVector();\r\n\t\t\r\n\t\tSystem.out.println(\"Desviacion media: \" \r\n\t\t\t\t\t+mi_grupo.calcularDesviacionMedia());\r\n\t\t\r\n\t\tSystem.out.println(\"Desviacion típica: \" \r\n\t\t\t\t+mi_grupo.calcularDesviacionTipica());\r\n\t}", "double getPerimetro(){\n return 2 * 3.14 * raggio;\n }", "public void gastarDinero(double cantidad){\r\n\t\t\r\n\t}", "private int pasarMilisegundoASegundo( long milisegundos )\n {\n return (int)(milisegundos/MILISEGUNDOS_EN_SEGUNDO);\n }", "public int getNUMARGEO() {\n return numargeo;\n }", "public logicaEnemigos(){\n\t\t//le damos una velocidad inicial al enemigo\n\t\tsuVelocidad = 50;\n\t\tsuDireccionActual = 0.0;\n\t\tposX = 500 ;\n\t\tposY = 10;\n\t}", "public float calcularPerimetro(){\n return baseMayor+baseMenor+(medidaLado*2);\n }", "protected abstract void narisi(Graphics2D g, double wPlatno, double hPlatno);", "public MonticuloSVG(Lista<Integer> elementos) {\n ordenada = Lista.mergeSort(elementos);\n while (!ordenada.esVacia()) {\n arbol.agrega(ordenada.eliminaPrimero());\n }\n altura = arbol.altura();\n ancho = 100 * ((int) Math.pow(2, altura)) + (100 * ((int) Math.pow(2, altura) - 1)) + 300;\n alto = 100 * altura + 100 * (altura - 1) + 300;\n }", "@Override\n public double calculaTributos() {\n // TODO Auto-generated method stub\n return 10;\n }", "public double getTotalGastos(MESDELANIO mes) {\n\t\tint posicion;\n\t\tdouble gastoDeEseMes;\n\t\t\n\t\tposicion= this.ObtenerPosicionDelMes(mes);\n\t\tgastoDeEseMes= this.gastosPorMes[posicion];\n\t\treturn gastoDeEseMes;\n\t\t\n\t}", "public void carroPulando() {\n\t\tpulos++;\n\t\tpulo = (int) (PULO_MAXIMO/10);\n\t\tdistanciaCorrida += pulo;\n\t\tif (distanciaCorrida > distanciaTotalCorrida) {\n\t\t\tdistanciaCorrida = distanciaTotalCorrida;\n\t\t}\n\t}", "public int vecinos(){\n int v=0;\n if(fila<15 && columna<15 && fila>0 && columna>0){\n if(automata.getElemento(fila,columna-1)!=null && automata.getElemento(fila,columna-1).isVivo()){v++;}\n if(automata.getElemento(fila+1,columna-1)!=null && automata.getElemento(fila+1,columna-1).isVivo()){v++;}\n if(automata.getElemento(fila+1,columna)!=null && automata.getElemento(fila+1,columna).isVivo()){v++;} \n if(automata.getElemento(fila+1,columna+1)!=null && automata.getElemento(fila+1,columna+1).isVivo()){v++;}\n if(automata.getElemento(fila,columna+1)!=null && automata.getElemento(fila,columna+1).isVivo()){v++;}\n if(automata.getElemento(fila-1,columna+1)!=null && automata.getElemento(fila-1,columna+1).isVivo()){v++;}\n if(automata.getElemento(fila-1,columna)!=null && automata.getElemento(fila-1,columna).isVivo()){v++;}\n if(automata.getElemento(fila-1,columna-1)!=null && automata.getElemento(fila-1,columna-1).isVivo()){v++;}\n }\n else{v=limitesX();}\n return v;\n }", "public void ganarDineroPorAutomoviles() {\n for (Persona p : super.getMundo().getListaDoctores()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaCocineros()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaAlbaniles()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaHerreros()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaCocineros()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n }", "public int asignacionMemoriaFlotanteDim(float value, int size){\n int i = 0;\n while(i<size){\n memoriaFlotante[flotanteActual] = value;\n flotanteActual++;\n i++;\n }\n return inicioMem + tamMem + flotanteActual - size;\n }", "@Override\n\tpublic double perimetro() {\n\t\treturn getBase()*4;\n\t}", "public int geomDim();", "public void AgregarVertice(int v) {\n\t\tNodoGrafo aux = new NodoGrafo();\n\t\taux.nodo = v;\n\t\taux.arista = null;\n\t\taux.sigNodo = origen;\n\t\torigen = aux;\n\t}", "public int asignacionMemoriaFlotante(float value){\n memoriaFlotante[flotanteActual] = value;\n flotanteActual++;\n return inicioMem + tamMem + flotanteActual - 1;\n }", "public int getG();", "double getArea(){\n return 3.14 * raggio * raggio;\n }", "public void primerPunto() {\n\t\tp = new PuntoAltaPrecision(this.xCoord, this.yCoord);\n\t\t// Indicamos la trayectoria por la que va la pelota\n\t\tt = new TrayectoriaRecta(1.7f, p, false);\n\t}", "long getPlaneSize();", "private void posicionePosicoes() {\n\t\tGroupLayout gl = new GroupLayout(this);\n\n\t\tgl.setAutoCreateContainerGaps(true);\n\t\tgl.setAutoCreateGaps(true);\n\n\t\tsetLayout(gl);\n\n\t\t// Horizontal\n\t\t{\n\t\t\tSequentialGroup sgDados = gl.createSequentialGroup();\n\t\t\tSequentialGroup sgProgresso = gl.createSequentialGroup();\n\n\t\t\tParallelGroup pg = gl.createParallelGroup(Alignment.LEADING);\n\n\t\t\tsgDados.addComponent(lQntDados).addComponent(tfQntDados)\n\t\t\t\t\t.addComponent(btCadastrar).addComponent(barraProgresso);\n\t\t\tsgProgresso.addComponent(lresultado).addComponent(tfResultado);\n\t\t\tpg.addGroup(sgDados).addGroup(sgProgresso);\n\t\t\tgl.setHorizontalGroup(pg);\n\n\t\t}\n\n\t\t// Vertical\n\t\t{\n\t\t\tParallelGroup pgDados = gl.createParallelGroup(Alignment.CENTER);\n\t\t\tParallelGroup pgResultado = gl\n\t\t\t\t\t.createParallelGroup(Alignment.LEADING);\n\n\t\t\tSequentialGroup sg = gl.createSequentialGroup();\n\n\t\t\tpgDados.addComponent(lQntDados).addComponent(tfQntDados)\n\t\t\t\t\t.addComponent(btCadastrar).addComponent(barraProgresso);\n\t\t\tpgResultado.addComponent(lresultado).addComponent(tfResultado);\n\n\t\t\tsg.addGroup(pgDados).addGroup(pgResultado);\n\n\t\t\tgl.setVerticalGroup(sg);\n\n\t\t}\n\n\t}", "public int getMines()\n {\n return mines;\n }", "public abstract int getCntGrnd();", "public int gradoEntrada(int i) {\n \tint grado = 0;\n \tfor(int j = 0; j < numV; j++) {\n \t\tif(existeArista(j, i)) grado ++;\n \t}\n \treturn grado; //el grado es el valor del grado de entrada de i\n }", "public int getG() {\r\n\t\treturn g;\r\n\t}", "public void asignarPedido(Pedido pedido){\n\t\tdouble costeMin=100000;\n\t\tint pos=0;\n\t\t\n\t\tif (pedido.getPeso()<PESOMAXMOTO) {\n\t\tif(motosDisponibles.size()!=0){\n\t\t \n\t\t\tpos=0;\n\t\t\t//Damos como primer valor el de primera posición\n\t\t\t\n\t\t\tcosteMin=pedido.coste(motosDisponibles.get(0));\n\t\t\t\n\t\t\t//Ahora vamos a calcular el min yendo uno por uno\n\t\t\t\n\t\t\tfor(int i=0; i<motosDisponibles.size(); i++){\n\t\t\t\tif(costeMin>pedido.coste(motosDisponibles.get(i))){\n\t\t\t\t\tcosteMin=pedido.coste(motosDisponibles.get(i));\n\t\t\t\t\tpos=i;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Una vez hallada la moto de menor coste la asignamos\n\t\t\tpedido.setTransporte(motosDisponibles.get(pos));\n\t\t\tmotosDisponibles.removeElementAt(pos);\n\t\t\t\n\t\t \n\t\t}\n\t\telse {\n\t\t\tpedidosEsperandoMoto.add(pedidosEsperandoMoto.size(),pedido);\n\t\t}\n\t\t}\n\t\t\n\t\telse {\n\t\t\tif (furgonetasDisponibles.size()!=0){\n\t\t\tcosteMin = pedido.coste(furgonetasDisponibles.get(0));\n\t\t\tfor(int i=0; i<furgonetasDisponibles.size(); i++){\n\t\t\t\tif(costeMin>pedido.coste(furgonetasDisponibles.get(i))){\n\t\t\t\t\tcosteMin=pedido.coste(furgonetasDisponibles.get(i));\n\t\t\t\t\tpos=i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpedido.setTransporte(furgonetasDisponibles.get(pos));\n\t\t\tfurgonetasDisponibles.removeElementAt(pos);\n\t\t}\n\t\t\telse{\n\t\t\t\tpedidosEsperandoFurgoneta.add(pedidosEsperandoFurgoneta.size(),pedido);\n\t\t\t}\n\t\t}\n\t}", "public void solucioInicial2() {\n int grupsRecollits = 0;\n for (int i=0; i<numCentres*helisPerCentre; ++i) {\n Helicopter hel = new Helicopter();\n helicopters.add(hel);\n }\n int indexHelic = 0;\n int indexGrup = 0;\n int places = 15;\n while (indexGrup < numGrups) {\n int trajecte[] = {-1,-1,-1};\n for (int i=0; i < 3 && indexGrup<numGrups; ++i) {\n Grupo grup = grups.get( indexGrup );\n if (places - grup.getNPersonas() >= 0) {\n places -= grup.getNPersonas();\n trajecte[i] = indexGrup;\n indexGrup++;\n\n }\n else i = 3;\n }\n Helicopter helicopter = helicopters.get( indexHelic );\n helicopter.addTrajecte( trajecte, indexHelic/helisPerCentre );\n places = 15;\n indexHelic++;\n if (indexHelic == numCentres*helisPerCentre) indexHelic = 0;\n }\n }", "public void cambiarABarreraTotal() {\n mRect = new Rect(0, y, centroPantallaX * 2, y + ALTO_PALA);\n }", "void MontaValores(){\r\n // 0;0;-23,3154166666667;-51,1447783333333;0 // Extrai os valores e coloca no objetos\r\n // Dis;Dir;Lat;Long;Velocidade\r\n // Quebra de Rota lat=-999.999 long=-999.999 ==> Marca ...\r\n \r\n int ind=0;\r\n NMEAS=NMEA.replace(\",\" , \".\");\r\n \r\n //1)\r\n dists=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind));\r\n Distancia=Double.valueOf(dists);\r\n ind=ind+dists.length()+1;\r\n \r\n //2)\r\n dirs=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind+1));\r\n Direcao=Double.valueOf(dirs);\r\n ind=ind+dirs.length()+1;\r\n \r\n //3)\r\n lats=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind+1));\r\n Lat=Double.valueOf(lats);\r\n ind=ind+lats.length()+1;\r\n \r\n //4)\r\n longs=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind+1));\r\n Long=Double.valueOf(longs);\r\n ind=ind+longs.length()+1;\r\n \r\n //5)\r\n vels=NMEAS.substring(ind,NMEAS.length());\r\n // Transforma de Knots para Km/h\r\n Velocidade=Double.valueOf(vels)/100*1.15152*1.60934;\r\n vels=String.valueOf(Velocidade);\r\n ind=ind+vels.length()+1;\r\n \r\n }", "public Number getSizeratio() {\n return (Number)getAttributeInternal(SIZERATIO);\n }", "@Override\r\n public void paint(Graphics g) {\n super.paint(g);\r\n Color col = new Color(255, 255, 255);//color gris\r\n g.drawLine(0, 20, 245, 20);//pinta una linea en la parte superior de la ventana\r\n Dimension size = getSize();//encapsula el tamñao de un objeto\r\n int parteSuperiorTablero = (int) size.getHeight() - altoTablero * alturaPieza();\r\n\r\n for (int i = 0; i < altoTablero; ++i) {\r\n for (int j = 0; j < anchoTablero; ++j) {\r\n PiezasTetris pieza = dimensionar(j, altoTablero - i - 1);\r\n if (pieza != PiezasTetris.NoPieza) {\r\n pintarPiezas(g, 0 + j * anchoPieza(),\r\n parteSuperiorTablero + i * alturaPieza(), pieza);\r\n }\r\n }\r\n }\r\n\r\n if (piezaActual.getPieza() != PiezasTetris.NoPieza) {\r\n for (int i = 0; i < 4; ++i) {\r\n int x = posicionX + piezaActual.x(i);\r\n int y = posicionY - piezaActual.y(i);\r\n pintarPiezas(g, 0 + x * anchoPieza(),\r\n parteSuperiorTablero + (altoTablero - y - 1) * alturaPieza(),\r\n piezaActual.getPieza());\r\n }\r\n }\r\n }", "public double getMass();", "public int grHeight() { return height; }", "private int obliczDowoz() {\n int x=this.klient.getX();\n int y=this.klient.getY();\n double odl=Math.sqrt((Math.pow((x-189),2))+(Math.pow((y-189),2)));\n int kilometry=(int)(odl*0.5); //50 gr za kilometr\n return kilometry;\n }", "private static void setQui(){\n int mX, mY;\n for (Integer integer : qList) {\n mY = (int) (Math.floor(1.f * integer / Data.meshRNx));\n mX = integer - Data.meshRNx * mY;\n if (Data.densCells[mX][mY] > Data.gwCap[mX][mY] * .75) {\n for (int j = 0; j < Data.densCells[mX][mY]; j++) {\n Cell cell = (Cell) cells.get(Data.idCellsMesh[mX][mY][j]);\n cell.vState = true;\n cell.quiescent = Data.densCells[mX][mY] >= Data.gwCap[mX][mY];\n }\n }\n }\n }", "@Override\n\tpublic double getMassaInterna()\n\t{\n\t\treturn 0.0;\n\t}", "public void aumentarMinas(){\n\r\n if(espM==false){\r\n minascerca++;\r\n }\r\n }", "@Override\n\tpublic double percentualeGruppiCompletati () throws DAOException{\n\t\tConnection connection = null;\n\t\tPreparedStatement statement = null;\n\t\tResultSet resultSet = null;\n\t\tdouble numeroGruppiCompletati = 0.0;\n\t\ttry {\n\t\t\tconnection = DataSource.getInstance().getConnection();\n\t\t\tstatement = connection.prepareStatement(\"SELECT COUNT (GRUPPO.ID)*100/(SELECT COUNT(ID) FROM GRUPPO) FROM GRUPPO WHERE COMPLETO = 1 GROUP BY(GRUPPO.COMPLETO)\");\n\t\t\tresultSet = statement.executeQuery();\n\t\t\tif (resultSet.next()) {\n\t\t\t\tnumeroGruppiCompletati = BigDecimal.valueOf(resultSet.getDouble(1)).setScale(2, RoundingMode.HALF_UP).doubleValue();\n\t\t\t}\n\t\t} catch (SQLException | DAOException e) {\n\t\t\tthrow new DAOException(\"ERRORE percentualeGruppiCompletati utenteAdmin\" + e.getMessage(), e);\n\t\t} finally {\n\t\t\tDataSource.getInstance().close(resultSet);\n\t\t\tDataSource.getInstance().close(statement);\n\t\t\tDataSource.getInstance().close(connection);\n\t\t}\n\t\treturn numeroGruppiCompletati;\n\t}", "public int calculerKgsNourritureParJour(){\r\n\t\treturn noms.size() * 10;\r\n\t}", "public void stampa() {\n GridPane matrice = new GridPane();\n buildGriglia(matrice);\n Text scritta;\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n if (getElementAt(griglia, i, j).cerchio.isVisible()) {\n scritta = new Text(\"1\");\n }\n else {\n scritta = new Text(\"0\");\n }\n matrice.add(scritta, j, i);\n }\n }\n Scene scene3 = new Scene(matrice, N * 100, N * 100);\n Stage stage3 = new Stage();\n stage3.setTitle(\"Matrice di occupazione:\");\n stage3.setScene(scene3);\n stage3.show();\n }", "public double getMaxGs()\n {\n return this.max_gs;\n }", "public int getProteksi(){\n\t\treturn (getTotal() - getPromo()) * protectionCost / 100;\n\t}", "public Exo2_Editeurpolylignes() {\n valeur_maximum = 5;\n initComponents();\n Tools.windowsInit(this);\n Tools.setIcone(\"./src/Icones/Icone_Lines.bmp\", this);\n this.setTitle(\"Editeur de poly-Lignes\");\n etat = Etat.Init;\n //rien\n initNombrePoints();\n\n }", "public int getLargeur() {\r\n return largeur;\r\n }", "private int obstaculos() {\n\t\treturn this.quadricula.length * this.quadricula[0].length - \n\t\t\t\tthis.ardiveis();\n\t}", "private int sumOfGDegrees() {\n\n\t\tint total = 0;\n\n\t\tfor (int i = 0; i < this.vertices.size(); i++) {\n\t\t\ttotal += this.vertices.get(i).getVertexDegree();\n\t\t}\n\n\t\treturn total;\n\t}", "@Override\n public double getMiterLimit() {\n return graphicsEnvironmentImpl.getMiterLimit(canvas);\n }", "private void displayGCreation() {\n\t\tSystem.out.println(\"Number of vertices in G: \" + (this.numNVertices + this.numWVertices));\n\t\tSystem.out.println(\"Number of targeted vertices in G (W Vertices): \" + this.numWVertices);\n\t\tSystem.out.println(\"Total Edges in G: \" + this.actualTotalEdges);\n\t\tSystem.out.println(\n\t\t\t\t\"Average Degree per vertex in G: \" + (this.sumOfGDegrees() / (this.numNVertices + this.numWVertices)));\n\t}", "double getStepSize();", "public boolean tieneRepresentacionGrafica();", "public float getMinAlturaCM();", "public int masVendido(int cantidad){\r\n \r\n return cantidad;\r\n }", "public void nourrir() {\n if (!autoriseOperation()) {\n return;\n }\n\n incrFaim(-2);\n incrPoids(1);\n incrHumeur(1);\n incrXp(1);\n\n System.out.println(tamagoStats.getXp());\n setChanged();\n notifyObservers();\n\n }", "public JPanel graficarMem (){\r\n\t\tJPanel panel = new JPanel(){\r\n\t\t\t@Override\r\n\t\t\tpublic void paint(Graphics g) {\r\n\t\t\t\t// dibujo la memoria\r\n\t\t\t\tint xpoints[] = { 20, 20, 140, 140};\r\n\t\t\t\tint ypoints[] = { 0, 15 * tamaņo,15 * tamaņo, 0 };\r\n\t\t\t\tint npoints = 4;\r\n\t\t\t\tg.drawPolygon(xpoints, ypoints, npoints);\r\n\t\t\t\t\r\n\t\t\t\t// dibujo las lineas de separacion de los espacios de la memoria\r\n\t\t\t\tint altura = 0;\r\n\t\t\t\tint sumaEspacios = 0;\r\n\t\t\t\tg.drawString(sumaEspacios + \"\", 0, 15);\r\n\t\t\t\tfor(int i = 0; i < numEspacios; i++){\r\n\t\t\t\t\taltura += espacios[i].getTamaņo() * 15;\r\n\t\t\t\t\tsumaEspacios += espacios[i].getTamaņo();\r\n\t\t\t\t\tg.drawString(sumaEspacios + \"\", 0, altura);\r\n\t\t\t\t\tg.drawString(espacios[i].getTamaņo() + \"\", 140, altura - (espacios[i].getTamaņo() * 15) / 2);\r\n\t\t\t\t\tg.drawLine(20, altura, 140, altura);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// dibujo las variables de los espacios\r\n\t\t\t\tint altura1 = 0;\r\n\t\t\t\tBasicStroke Bs = new BasicStroke(2f);\r\n\t\t\t\tGraphics2D g2D = (Graphics2D) g;\r\n\t\t\t\tg2D.setStroke(Bs);\r\n\t\t\t\tfor (int i = 0; i < numEspacios; i++) {\r\n\t\t\t\t\tint tamV = 0;\r\n\t\t\t\t\tint tamE = espacios[i].getTamaņo() * 15;\r\n\t\t\t\t\tint alturaV = altura1; \r\n\t\t\t\t\tfor (int j = 0; j < espacios[i].getVarEnMem().size(); j++) {\r\n\t\t\t\t\t\ttamV = espacios[i].getVarEnMem().get(j).getTamaņo() * 15;\r\n\t\t\t\t\t\tint puntosY[] = { alturaV, alturaV + tamV, alturaV + tamV, alturaV};\r\n\t\t\t\t\t\tg2D.setColor(espacios[i].getVarEnMem().get(j).getColor());\r\n\t\t\t\t\t\tif (espacios[i].getVarEnMem().get(j).getTamaņo() > 1) {\r\n\t\t\t\t\t\t\tg2D.drawString(espacios[i].getVarEnMem().get(j).getNombre() + \" \" + espacios[i].getVarEnMem().get(j).getTamaņo() + \"M\", 90, alturaV + (tamV / 2));\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tg2D.drawString(espacios[i].getVarEnMem().get(j).getNombre() + \" \" + espacios[i].getVarEnMem().get(j).getTamaņo() + \"M\", 90, alturaV + tamV);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tg2D.drawPolygon(xpoints, puntosY, npoints);\r\n\t\t\t\t\t\talturaV += tamV; \r\n\t\t\t\t\t}\r\n\t\t\t\t\taltura1 += tamE;\r\n\t\t\t\t}\r\n\t\t\t\tg2D.setColor(Color.BLACK);\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\tpanel.setPreferredSize(new Dimension(160, 15*this.getTamaņo() + 10));\r\n\t\t\r\n\t\treturn panel;\r\n\t}", "public float carga(){\n return (this.capacidade/this.tamanho);\n }", "int getM();", "public void sumaPuntos() {\r\n int rojo = 0;\r\n int azul = 0;\r\n for (int i = 1; i < 10; i++) {\r\n\r\n if (tablero[1][i].getTipo().equals(\"Rojo\")) {\r\n rojo += tablero[1][i].getValor();\r\n }\r\n\r\n if (tablero[8][i].getTipo().equals(\"Azul\")) {\r\n azul += tablero[8][i].getValor();\r\n }\r\n\r\n }\r\n if (rojo > azul) {\r\n this.setResultado(\"Rojo\");\r\n this.agregarVictoria(jugadorRojo);\r\n }\r\n if (azul > rojo) {\r\n this.setResultado(\"Azul\");\r\n this.agregarVictoria(jugadorAzul);\r\n }\r\n \r\n this.setReplay(true);\r\n }", "private static void statistique(){\n\t\tfor(int i = 0; i<7; i++){\n\t\t\tfor(int j = 0; j<7; j++){\n\t\t\t\tfor(int l=0; l<jeu.getJoueurs().length; l++){\n\t\t\t\t\tif(jeu.cases[i][j].getCouleurTapis() == jeu.getJoueurs()[l].getNumJoueur()){\n\t\t\t\t\t\tjeu.getJoueurs()[l].setTapis(jeu.getJoueurs()[l].getTapisRest()+1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tJoueur j;\n\t\tSystem.out.println(\"// Fin de la partie //\");\n\t\tfor(int i=0; i<jeu.getJoueurs().length; i++) {\n\t\t\tj =jeu.getJoueurs()[i];\n\t\t\tSystem.out.println(\"Joueur \"+ (j.getNumJoueur()+1) + \" a obtenue \"+j.getTapisRest()+j.getMonnaie()+\" points\" );\n\t\t}\n\t}", "public int numVertices() { return numV; }", "protected void calcMinMax() {\n }", "public double getLimiteCorrente () {\r\n\t\treturn limiteCorrente;\r\n\t}" ]
[ "0.6936103", "0.62807524", "0.61965245", "0.619453", "0.5985954", "0.5962495", "0.58740836", "0.58438236", "0.5790203", "0.57490027", "0.57432425", "0.57382715", "0.5731872", "0.5730673", "0.5698088", "0.56783617", "0.5674286", "0.5672753", "0.5658088", "0.564901", "0.56461173", "0.56261647", "0.5619646", "0.56112546", "0.55786496", "0.55689615", "0.5548602", "0.5548078", "0.5546329", "0.55374", "0.5536118", "0.55162096", "0.55095273", "0.5487869", "0.5480226", "0.5478952", "0.5474118", "0.5472928", "0.54683524", "0.54663783", "0.5461383", "0.5447576", "0.5443203", "0.544029", "0.5433674", "0.542511", "0.5424749", "0.54131925", "0.541049", "0.54059625", "0.53963935", "0.53849614", "0.5379006", "0.53697735", "0.53654474", "0.53531665", "0.5353088", "0.5340596", "0.5336654", "0.5330343", "0.5328651", "0.5328644", "0.5325423", "0.5324227", "0.5317368", "0.5314969", "0.53144765", "0.53133684", "0.5313363", "0.53122044", "0.5311211", "0.53049266", "0.5304775", "0.5301856", "0.5301363", "0.5290426", "0.5286958", "0.52850676", "0.52788246", "0.5275361", "0.5274751", "0.52675325", "0.52638096", "0.52637225", "0.5263495", "0.52629495", "0.52607644", "0.5258048", "0.52553016", "0.525044", "0.5249615", "0.5246594", "0.5235693", "0.52331495", "0.52326447", "0.52317816", "0.52306104", "0.5229007", "0.52263206", "0.5224089" ]
0.5223899
100
Gets an elementary file. Hangs if there is already an open request.
public Promise<byte[]> readFile(ElementaryFileID id) { try { getFileLock.acquire(); } catch (InterruptedException e) { return Promise.reject(e); } return this.presentationLayer.selectDF(this.appId).then((res) -> { return openApduFile(id).then((file) -> this.resolveApduFile(file)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RandomAccessFile getFile()\n {\n \treturn f;\n }", "public File getFile() {\n // some code goes here\n return m_f;\n }", "File getFile();", "File getFile();", "public File getFile() {\n // some code goes here\n return f;\n }", "public File getFile();", "public File getFile();", "public File getFile() {\n // some code goes here\n return this.f;\n }", "private File getFile() {\n\t\t// retornamos el fichero a enviar\n\t\treturn this.file;\n\t}", "public File getFile()\r\n \t{\r\n \t\tFile result = null;\r\n \t\t\r\n \t\tString hostName = getAuthority();\r\n \t\t\r\n \t\tif((hostName == null) || hostName.equals(\"\") || hostName.equalsIgnoreCase(\"localhost\"))\r\n \t\t{\r\n \t\t\tString filePath = getPath();\r\n \t\t\tresult = new File(filePath);\r\n \t\t}\r\n \t\telse\r\n \t\t{\r\n \t\t\tthrow new RuntimeException(\"Can't resolve files on remote host machines\");\r\n \t\t}\r\n \t\t\r\n \t\treturn result;\r\n \t}", "public File getFile() {\n return this.path != null ? this.path.toFile() : null;\n }", "FileObject getFile();", "FileObject getFile();", "public File getFile ();", "public int getFile() {\n validify();\n return Client.INSTANCE.pieceGetFile(ptr);\n }", "public WebFile getFile() { return _file; }", "private Promise<ApduFile> openApduFile(ElementaryFileID fileID) {\n Promise<byte[]> firstChunk;\n if (fileID.isShortIDAvailable()) {\n firstChunk = this.presentationLayer.readBinary(fileID, (byte)0);//If short file id is available, a read will also instantly select the file.\n } else {\n firstChunk = this.presentationLayer.selectEF(fileID).then((v) -> this.presentationLayer.readBinary((byte)0));//Select and read the first part.\n }\n return firstChunk.then((data) -> {\n try {\n ApduFile result = new ApduFile(data);\n return Promise.resolve(result);\n }catch (Exception e) {\n return Promise.reject(e);\n }\n });\n }", "private File getFile(String filename) throws Exception {\n\t\tFile file = new File(filename);\n\t\tif (file.exists()) {\n\t\t\treturn file;\n\t\t} else if (!file.isAbsolute()) {\n\t\t\tfinal Resource r = context.getThisInstance().eResource();\n\t\t\tfinal Path p = new Path(r.getURI().segment(1) + File.separator + filename);\n\t\t\tfinal IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(p);\n\t\t\tif (f.exists()) {\n\t\t\t\treturn f.getRawLocation().makeAbsolute().toFile();\n\t\t\t}\n\t\t}\n\n\t\tthrow new Exception(\"Filename \" + filename + \" not found\");\n\n\t}", "public File getFile() {\r\n \t\treturn file;\r\n \t}", "public File getFile() { return file; }", "public File getFile() {\n\t\treturn new File(filepath);\n\t}", "public String getFile() {\n \n // return it\n return theFile;\n }", "File getFile() { return user_file; }", "public File getFile() {\n return new File(this.filePath);\n }", "private File getIOFile() {\n \t\tIPath location = resource.getLocation();\n \t\tif(location!=null) {\n \t\t\treturn location.toFile();\n \t\t}\n \t\treturn null;\n \t}", "public FileObject getFile() {\n return file;\n }", "public FileObject getFile() {\n return file;\n }", "private static Optional<InputStream> openFile(Path name) {\n try {\n return Optional.of(Files.newInputStream(name, StandardOpenOption.READ));\n } catch (IOException e) {\n System.err.printf(\"Unable to open file %s for reading: %s\\n\", name, e.toString());\n }\n\n return Optional.empty();\n }", "public File getFile()\n {\n return file;\n }", "@Get\r\n\tpublic Representation getFile() throws Exception {\n\r\n\t\tString remainPart = StringUtil.split(getRequest().getResourceRef().getRemainingPart(), \"?\")[0];\r\n\t\tFile file = getAradon().getGlobalConfig().plugin().findPlugInFile(MyConstants.PLUGIN_ID, \"jminix/js/\" + remainPart ) ;\r\n\t\t\r\n\t\tif (! file.exists()) throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND, getRequest().getResourceRef().getPath()) ; \r\n\r\n\t\tMediaType mtype = getMetadataService().getMediaType(StringUtil.substringAfterLast(file.getName(), \".\")) ;\r\n\t\tif (mtype == null) mtype = MediaType.ALL ; \r\n\t\t\r\n\t\tfinal FileRepresentation result = new FileRepresentation(file, mtype);\r\n\t\treturn result;\r\n\t}", "public File getFile() {\n return _file;\n }", "alluxio.proto.journal.File.CompleteFileEntry getCompleteFile();", "protected InputStream getURLInputStream() throws Exception\n\t {\n\n\t URL url = new URL(file, fFilename);\n\t InputStream fin = url.openStream();\n\t BufferedInputStream bin = new BufferedInputStream(fin);\n\t return bin;\n\t }", "public File getFile() {\n return file;\n }", "private Object getFile(String path) throws Exception {\t\t\t\n\t\t \n\t\t FileInputStream fileIn = new FileInputStream(path);\n ObjectInputStream objectIn = new ObjectInputStream(fileIn);\n\n Object obj = objectIn.readObject();\n objectIn.close();\n \n return obj;\t\t\n\t}", "public byte[] getFile() {\n return file;\n }", "public File getFile() {\n return file;\n }", "public File getFile() {\n\t\treturn file;\n\t}", "public PDFileSpecification getFile() throws IOException {\n/* 398 */ COSBase f = this.stream.getDictionaryObject(COSName.F);\n/* 399 */ return PDFileSpecification.createFS(f);\n/* */ }", "@Override\n\tpublic File getFile() {\n\t\treturn file;\n\t}", "String getFile();", "String getFile();", "String getFile();", "public final File getFile() {\n return file;\n }", "@java.lang.Deprecated com.google.apps.drive.activity.v2.DriveItem.File getFile();", "public File getFile() {\n return file;\n }", "public File getFile() {\n return file;\n }", "public File getFile() {\n return file;\n }", "public File getFile() {\n return file;\n }", "public File getFile() {\n\t\treturn this.file;\n\t}", "protected InputStream getInputStream() throws IOException\n\t {\n\t FileInputStream fin = new FileInputStream(fFilename);\n\t BufferedInputStream bin = new BufferedInputStream(fin);\n\t return bin;\n\t }", "@RequestMapping(value=\"/files/{id}\", method = RequestMethod.GET) \n\tpublic File getFileById(@PathVariable(\"id\") final int id, HttpServletResponse response) throws InvalidInputException{\n\t\tFile temp = fileService.getFileById(id);\n\t\tif(temp==null) {\n\t\t\tthrow new InvalidInputException(id);\n\t\t}\n\t\treturn temp;\n\t}", "public IFile getIFile ();", "private RandomAccessFile getDataFile(int eIndex, int tIndex) throws IOException {\n\n String dataFilePath = gradsDDF.getFileName(eIndex, tIndex);\n if (!gradsDDF.isTemplate()) { // we only have one file\n if (dataFile != null) {\n return dataFile;\n }\n }\n if (dataFile != null) {\n String path = dataFile.getLocation();\n if (path.equals(dataFilePath)) {\n return dataFile;\n } else {\n dataFile.close();\n }\n }\n dataFile = RandomAccessFile.acquire(dataFilePath);\n dataFile.order(getByteOrder());\n return dataFile;\n }", "public File openInputFile() throws Exception{\n\t\t// Open the input file\n\t\tinputFile = new File(PLEIADEAN_FILE);\n\t\t\n\t\t// return to the caller\n\t\treturn(inputFile);\n\t}", "FileReference getFile(String fileName);", "public FileManagerFile getFile(int id) throws Exception {\n\n if (files == null) { // defer loading files list until requested.\n cacheFoldersFiles();\n }\n for (FileManagerFile file : files) {\n if (file.getId() == id) {\n return file;\n }\n }\n return null;\n }", "alluxio.proto.journal.File.InodeFileEntry getInodeFile();", "edu.usfca.cs.dfs.StorageMessages.RetrieveFile getRetrieveFile();", "public InputStream getInputStream() throws IOException {\n return new FileInputStream(_file);\n }", "File retrieveFile(String absolutePath);", "@Override\n\tpublic byte[] get()\n\t{\n\t\tif (isInMemory())\n\t\t{\n\t\t\tif (cachedContent == null)\n\t\t\t{\n\t\t\t\tcachedContent = dfos.getData();\n\t\t\t}\n\t\t\treturn cachedContent;\n\t\t}\n\n\t\tFile file = dfos.getFile();\n\n\t\ttry\n\t\t{\n\t\t\treturn Files.readBytes(file);\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\tlog.debug(\"failed to read content of file: \" + file.getAbsolutePath(), e);\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\n public InputStream openStream() throws IOException\n {\n return new FileInputStream(temp);\n }", "public File get( String url, String suffix ) throws MojoExecutionException\n {\n if ( m_wagon == null )\n {\n m_log.error( \"must be connected first!\" );\n return null;\n }\n\n File file = null;\n try\n {\n file = File.createTempFile( String.valueOf( System.currentTimeMillis() ), suffix );\n }\n catch ( IOException e )\n {\n throw new MojoExecutionException( \"I/O problem\", e );\n }\n\n try\n {\n m_wagon.get( url, file );\n }\n catch ( TransferFailedException e )\n {\n file.delete(); // cleanup on failure\n throw new MojoExecutionException( \"Transfer failed\", e );\n }\n catch ( AuthorizationException e )\n {\n file.delete(); // cleanup on failure\n throw new MojoExecutionException( \"Authorization failed\", e );\n }\n catch ( ResourceDoesNotExistException e )\n {\n file.delete(); // return non-existent file\n }\n\n return file;\n }", "public File getFile() {\n return resultsFile;\n }", "public PDFileSpecification getFile() throws IOException\n {\n COSBase f = stream.getDictionaryObject(COSName.F);\n return PDFileSpecification.createFS(f);\n }", "public File getFileForPicture() {\r\n\t\tif(!isReady) prepare();\r\n\t\tif(!isReady) {\r\n\t\t\tLog.e(TAG,\"Not ready when taking picture\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tcurrentFile = new File(directory,getFileName());\r\n\t\treturn currentFile;\r\n\t}", "public final ZipFile getFile()\n\t{\n\t\treturn file_;\n\t}", "File getWorkfile();", "public InputStream getInputStream() throws IOException {\r\n return mFile.getInputStream();\r\n }", "public File getObject() {\n return _objects;\n }", "public UploadedFileDTO getFile() {\r\n\t\ttype(ConfigurationItemType.FILE);\r\n\t\treturn fileValue;\r\n\t}", "public File getFile(String key) {\n \tif( fileMap.containsKey(key) )\n \t\treturn fileMap.get(key);\n \t\n \treturn null;\n }", "public Path getOpenedFile() {\r\n\t\treturn openedFile;\r\n\t}", "@Generated(hash = 1451855236)\n public FileItemInfo getFileItemInfo() {\n long __key = this.fileId;\n if (fileItemInfo__resolvedKey == null || !fileItemInfo__resolvedKey.equals(__key)) {\n final DaoSession daoSession = this.daoSession;\n if (daoSession == null) {\n throw new DaoException(\"Entity is detached from DAO context\");\n }\n FileItemInfoDao targetDao = daoSession.getFileItemInfoDao();\n FileItemInfo fileItemInfoNew = targetDao.load(__key);\n synchronized (this) {\n fileItemInfo = fileItemInfoNew;\n fileItemInfo__resolvedKey = __key;\n }\n }\n return fileItemInfo;\n }", "@RequestMapping(value = \"**\", method = {RequestMethod.GET})\r\n public ResponseEntity<?> getFileResponse(HttpServletRequest request, @RequestHeader HttpHeaders headers)\r\n throws WapException {\r\n return super.getFileResponse(request, headers);\r\n }", "protected File getFile(HttpServletRequest request) {\n String path = request.getPathInfo();\n\n // we want to extract everything after /spa/spaResources/ from the path info. This should cater for sub-directories\n String extractedFile = path.substring(path.indexOf('/', BASE_URL.length() - 1) + 1);\n File folder = SpaModuleUtils.getSpaStaticFilesDir();\n\n //Resolve default index.html\n if (extractedFile.endsWith(\"index.htm\") || !extractedFile.contains(\".\")) {\n extractedFile = \"index.html\";\n }\n\n File file = folder.toPath().resolve(extractedFile).toFile();\n if (!file.exists()) {\n log.warn(\"File with path '{}' doesn't exist\", file.toString());\n return null;\n }\n return file;\n }", "File openFile();", "byte[] getFile(String filename) throws NoSuchFileException;", "FileStore getFile(String fileRefId);", "public InputStream getInputStream() throws IOException;", "public InputStream getInputStream() throws IOException;", "public com.google.protobuf.ByteString getFile() {\n return file_;\n }", "String getFile() {\n\t\treturn file;\n\t}", "public FilesInputStreamLoad readFile() throws ArcException {\r\n\tFile dir = new File(this.archiveChargement + \".dir\");\r\n\tString fileName = ManipString.substringAfterFirst(this.idSource, \"_\");\r\n\tFile toRead = new File(dir + File.separator + ManipString.redoEntryName(fileName));\r\n\tFilesInputStreamLoad filesInputStreamLoadReturned = null;\r\n\ttry {\r\n\t\tfilesInputStreamLoadReturned = new FilesInputStreamLoad (toRead);\r\n\t} catch (IOException ioReadException) {\r\n\t\tthrow new ArcException(ioReadException, ArcExceptionMessage.FILE_READ_FAILED, toRead);\r\n\t}\r\n\treturn filesInputStreamLoadReturned;\r\n }", "public com.google.protobuf.ByteString getFile() {\n return file_;\n }", "public MultipartFile getFile() {\n\t\treturn file;\n\t}", "@Transient\n\tpublic File getFileObj() {\n\t\treturn fileObj;\n\t}", "private File getArtifactFile(Artifact artifactQuery)\n\t\t\tthrows MojoExecutionException {\n\n\t\tArtifactRequest request = new ArtifactRequest(artifactQuery,\n\t\t\t\tprojectRepos, null);\n\t\tList<ArtifactRequest> arts = new ArrayList<ArtifactRequest>();\n\t\tarts.add(request);\n\t\ttry {\n\t\t\tArtifactResult a = repoSystem.resolveArtifact(repoSession, request);\n\t\t\treturn a.getArtifact().getFile();\n\t\t} catch (ArtifactResolutionException e) {\n\t\t\tthrow new MojoExecutionException(\n\t\t\t\t\t\"could not resolve artifact to compare with\", e);\n\t\t}\n\n\t}", "@VisibleForTesting\n public File getBlockFile() {\n return new File(getDir(), getBlockName());\n }", "abstract public InputStream retrieveContent( String path )\r\n throws Exception;", "public void get(String file) {\n\n }", "@Override\n public GEMFile getFile(String filename, String directory) {\n Object o = gemFileDb.get(Paths.get(directory, filename).toString());\n if (o instanceof GEMFile) {\n return (GEMFile) o;\n }\n return null;\n }", "public String getFile()\n\t{\n\t\treturn file;\n\t}", "public String getFile()\n\t{\n\t\treturn file;\n\t}", "public E peek() throws FileQueueClosedException;", "InputStream getInputStream() throws IOException;", "InputStream getInputStream() throws IOException;", "InputStream getInputStream() throws IOException;", "public File getFileValue();" ]
[ "0.65446585", "0.6480885", "0.64564687", "0.64564687", "0.6407899", "0.62929684", "0.62929684", "0.6284081", "0.62837666", "0.6210387", "0.61460936", "0.6139084", "0.6139084", "0.6132655", "0.6063939", "0.6056273", "0.6023862", "0.6019602", "0.5990793", "0.59686124", "0.59289294", "0.5918524", "0.5910492", "0.5841779", "0.58251035", "0.58243674", "0.58243674", "0.5815615", "0.5796528", "0.57905066", "0.5764882", "0.5764423", "0.5738969", "0.5733413", "0.57331073", "0.5722369", "0.5722317", "0.57212085", "0.57129514", "0.570959", "0.5703992", "0.5703992", "0.5703992", "0.57026374", "0.57025707", "0.56917024", "0.56917024", "0.56917024", "0.56917024", "0.56775236", "0.5671988", "0.5646402", "0.5644172", "0.56108326", "0.5599905", "0.5591148", "0.55722857", "0.5539626", "0.55333704", "0.5528023", "0.55273795", "0.5520671", "0.55165744", "0.55095994", "0.54903376", "0.5489568", "0.5476077", "0.54580027", "0.5446169", "0.5445129", "0.54156756", "0.54049754", "0.5399403", "0.5387883", "0.5383385", "0.53807724", "0.5376554", "0.5375267", "0.53699446", "0.5369857", "0.53697604", "0.53697604", "0.5362854", "0.53550315", "0.5353079", "0.53468555", "0.5344216", "0.53436154", "0.5332804", "0.5323253", "0.5313595", "0.5312423", "0.5303398", "0.53003496", "0.53003496", "0.529956", "0.5298087", "0.5298087", "0.5298087", "0.52974194" ]
0.5430243
70
Creates the initial part of a APDU file by selecting the ElementaryFileID on at the holder and read a few initial bytes. This is done to know how large the file is. As all APDU files are TLV (tag, length, value). We'll know what to expect size wise. Then the resolveApduFile method can download any remaining bytes left.
private Promise<ApduFile> openApduFile(ElementaryFileID fileID) { Promise<byte[]> firstChunk; if (fileID.isShortIDAvailable()) { firstChunk = this.presentationLayer.readBinary(fileID, (byte)0);//If short file id is available, a read will also instantly select the file. } else { firstChunk = this.presentationLayer.selectEF(fileID).then((v) -> this.presentationLayer.readBinary((byte)0));//Select and read the first part. } return firstChunk.then((data) -> { try { ApduFile result = new ApduFile(data); return Promise.resolve(result); }catch (Exception e) { return Promise.reject(e); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void selectByFileIdentifier(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// receive the data to see which file needs to be selected\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc != 2) || (byteRead != 2))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// get the file identifier out of the APDU\r\n\t\tshort fid = Util.makeShort(buffer[ISO7816.OFFSET_CDATA], buffer[ISO7816.OFFSET_CDATA + 1]);\r\n\t\tJCSystem.beginTransaction();\r\n\t\t//@ open valid(); // todo (implement patterns as arguments to rules instead of terms )\r\n\t\t//@ assert selected_file_types(_, ?f1, ?f2, ?f3, ?f4, ?f5, ?f6, ?f7, ?f8, ?f9, ?f10, ?f11, ?f12, ?f13, ?f14, ?f15, ?f16, ?f17, ?f18, ?f19, ?f20, ?f21, _);\r\n\t\t// if file identifier is the master file, select it immediately\r\n\t\tif (fid == MF)\r\n\t\t\tselectedFile = masterFile;\t\t\r\n\t\telse {\r\n\t\t\t// check if the requested file exists under the current DF\r\n\t\t\t////@ close masterFile.DedicatedFile();\r\n\t\t\t////@ MasterFile theMasterFile = masterFile; // auto\r\n\t\t\t////@ assert theMasterFile.MasterFile(16128, null, ?x1, ?x2, ?x3); // auto\r\n\t\t\t////@ close theMasterFile.DedicatedFile(16128, null, x1, x2, x3); // auto\r\n\t\t\tFile s = ((DedicatedFile) masterFile).getSibling(fid);\r\n\t\t\t////@ open theMasterFile.DedicatedFile(16128, null, x1, x2, x3); // auto\r\n\t\t\t//VF /bug\r\n\t\t\tif (s != null) {\r\n\t\t\t\tselectedFile = s;\r\n\t\t\t//the fid is an elementary file:\r\n\t\t\t} else {\r\n\t\t\t\ts = belpicDirectory.getSibling(fid);\r\n\t\t\t\tif (s != null) {\r\n\t\t\t\t\tselectedFile = s;\r\n\t\t\t\t} else {\r\n\t\t\t\t\ts = idDirectory.getSibling(fid);\r\n\t\t\t\t\tif (s != null) {\r\n\t\t\t\t\t\tselectedFile = s;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tISOException.throwIt(ISO7816.SW_FILE_NOT_FOUND);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t//@ close selected_file_types(s, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17, f18, f19, f20, f21, _);\t\r\n\t\t}\t\r\n\t\t\r\n\t\t// //@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}", "private void readBinary(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// check if access to this file is allowed\r\n\t\tif (!fileAccessAllowed(READ_BINARY))\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// use P1 and P2 as offset\r\n\t\tshort offset = Util.makeShort(buffer[ISO7816.OFFSET_P1], buffer[ISO7816.OFFSET_P2]);\r\n\t\tif (offset < 0)\r\n\t\t\tISOException.throwIt(ISO7816.SW_INCORRECT_P1P2);\r\n\t\t// inform the JCRE that the applet has data to return\r\n\t\tshort le = apdu.setOutgoing();\r\n\t\t// impossible to start reading from offset large than size of file\t\t\t\t\r\n\t\tif (selectedFile == masterFile)\r\n\t\t\tISOException.throwIt(ISO7816.SW_FILE_INVALID); //~allow_dead_code Dead because fileAccessAllowed() checks that selectedFile instanceof ElementaryFile and masterFile is not an ElementaryFile.\r\n\t\t//@ open selected_file_types(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _);\r\n\t\tshort size = ((ElementaryFile) selectedFile).getCurrentSize();\r\n\t\tif (offset > size)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t// number of bytes in file starting from offset\r\n\t\tshort remaining = (short) (size - offset);\r\n\t\tif (le == 0) {\r\n\t\t\tif (remaining < 256) {\r\n\t\t\t\t// wrong Le field\r\n\t\t\t\t// SW2 encodes the exact number of available data bytes\r\n\t\t\t\tshort sw = (short) (ISO7816.SW_CORRECT_LENGTH_00 | remaining);\r\n\t\t\t\tISOException.throwIt(sw);\r\n\t\t\t} else\r\n\t\t\t\t// Le = 0 is interpreted as 256 bytes\r\n\t\t\t\tle = 256;\r\n\t\t}\r\n\t\t// only read out the remaining bytes\r\n\t\tif (le > remaining) {\r\n\t\t\tle = remaining;\r\n\t\t}\r\n\t\t// set the actual number of outgoing data bytes\r\n\t\tapdu.setOutgoingLength(le);\r\n\t\t// write selected file in APDU\r\n\t\t//VF bug; was apdu.sendBytesLong(((ElementaryFile) selectedFile).getData(), offset, le);\r\n\t\t//VF probleem: originele lijn was apdu.sendBytesLong(ef.getData(), offset, le);\r\n\t\t// het probleem hiermee is dat de getData()-methode een ElementaryFile nodig heeft, en dat\r\n\t\t// sendBytesLong vereist dat het resultaat niet null is. De niet-null vereiste zit geencodeerd\r\n\t\t// in ElementaryFile, dus als je dat predicaat opent, dan weet VF dat de data niet-null is, maar\r\n\t\t// dan werkt de call op getData niet. Als je de ElementaryFile gesloten laat, dan lukt de call naar\r\n\t\t// getData, maar weet je niet dat het niet-null is.\r\n\t\tElementaryFile ef = (ElementaryFile)selectedFile;\r\n\t\tbyte[] bf = ef.getData();\r\n\t\t//@ open [1/2]ef.ElementaryFile(?d1, ?d2, ?d3, ?d4, ?d5, ?info); // hard to eliminate\r\n\t\tapdu.sendBytesLong(bf, offset, le);\r\n\t\t////@ close [1/2]ef.ElementaryFile(d1, d2, d3, d4, d5, info); // auto\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t}", "private void getCardData(APDU apdu, byte[] buffer) \r\n \t //@ requires [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check P1 and P2\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x00 || buffer[ISO7816.OFFSET_P2] != (byte) 0x00)\r\n\t\t\tISOException.throwIt(ISO7816.SW_INCORRECT_P1P2);\r\n\t\t// inform the JCRE that the applet has data to return\r\n\t\tapdu.setOutgoing();\r\n\t\t\r\n\t\t////@ open [1/2]valid();\r\n\t\t\t\t\t\t\t\t\r\n\t\tbyte[] data = identityFile.getData(); \r\n\t\t// Only the chip number is of importance: get this at tag position 2\r\n\t\tshort pos = 1;\r\n\t\t//@ open [1/2]identityFile.ElementaryFile(_, _, ?identityFileData, _, _, ?info); // todo (integrate with array_element search)\r\n\t\tshort dataLen = (short) data[pos];\r\n\t\tpos = (short) (pos + 1 + dataLen + 1);\r\n\t\t////@ close [1/2]identityFile.ElementaryFile(_, _, identityFileData, _, _, info); // auto\r\n\t\tif (dataLen <= 0 || dataLen + pos + 2 >= identityFile.getCurrentSize())\r\n\t\t\tISOException.throwIt(ISO7816.SW_DATA_INVALID);\r\n\t\t//@ open [1/2]identityFile.ElementaryFile(_, _, identityFileData, _, _, info);\r\n\t\tdataLen = (short) data[pos];\r\n\t\tpos = (short) (pos + 1);\r\n\t\t////@ close [1/2]identityFile.ElementaryFile(_, _, identityFileData, _, _, info); // auto\r\n\t\tif (dataLen < 0 || pos + dataLen >= identityFile.getCurrentSize())\r\n\t\t\tISOException.throwIt(ISO7816.SW_DATA_INVALID);\r\n\t\t//@ open [1/2]identityFile.ElementaryFile(_, _, identityFileData, _, _, info);\r\n\t\t// check Le\r\n\t\t// if (le != dataLen)\r\n\t\t// ISOException.throwIt((short)(ISO7816.SW_WRONG_LENGTH));\r\n\t\t/*VF*byte version[] = { (byte) 0xA5, (byte) 0x03, (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x11, (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0x01, (byte) 0x01, (byte) 0x0F };*/\r\n\t\tbyte version[] = new byte[] { (byte) 0xA5, (byte) 0x03, (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x11, (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0x01, (byte) 0x01, (byte) 0x0F };\r\n\t\tbyte chipNumber[] = new byte[(short) (dataLen + 12)];\r\n\t\tUtil.arrayCopy(data, pos, chipNumber, (short) 0, dataLen);\r\n\t\tUtil.arrayCopy(version, (short) 0, chipNumber, dataLen, (short) 12);\r\n\t\t// //Set serial number\r\n\t\t// Util.arrayCopy(tokenInfo.getData(), (short) 7, tempBuffer, (short) 0,\r\n\t\t// (short) 16);\r\n\t\t//\t\t\r\n\t\t// //Set component code: TODO\r\n\t\t//\t\t\r\n\t\t//\t\t\r\n\t\t// //Set OS number: TODO\r\n\t\t//\t\t\r\n\t\t//\t\t\r\n\t\t// //Set OS version: TODO\r\n\t\t// JCSystem.getVersion();\r\n\t\t//\t\t\r\n\t\t// //Set softmask number: TODO\r\n\t\t//\t\t\r\n\t\t// //Set softmask version: TODO\r\n\t\t//\t\t\r\n\t\t// //Set applet version: TODO : 4 bytes in file system\r\n\t\t//\t\t\r\n\t\t//\t\t\r\n\t\t// //Set Interface version: TODO\r\n\t\t//\t\t\r\n\t\t// //Set PKCS#15 version: TODO\r\n\t\t//\t\t\r\n\t\t// //Set applet life cycle\r\n\t\t// tempBuffer[(short)(le-1)] = GPSystem.getCardState();\r\n\t\t// set the actual number of outgoing data bytes\r\n\t\tapdu.setOutgoingLength((short) chipNumber.length);\r\n\t\t// send content of buffer in apdu\r\n\t\tapdu.sendBytesLong(chipNumber, (short) 0, (short) chipNumber.length);\r\n\t\t\t\t\t\t\t\t\r\n\t\t////@ close [1/2]identityFile.ElementaryFile(_, _, identityFileData, _, _, info); // auto\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t}", "private void updateBinary(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check if access to this file is allowed\r\n\t\tif (!fileAccessAllowed(UPDATE_BINARY))\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// use P1 and P2 as offset\r\n\t\tshort offset = Util.makeShort(buffer[ISO7816.OFFSET_P1], buffer[ISO7816.OFFSET_P2]);\r\n\t\t// impossible to start updating from offset larger than max size of file\r\n\t\t// this however does not imply that the file length can not change\r\n\t\tJCSystem.beginTransaction();\r\n\t\t//@ open valid();\r\n\t\tif (selectedFile == masterFile)\r\n\t\t\tISOException.throwIt(ISO7816.SW_FILE_INVALID); //~allow_dead_code Dead because fileAccessAllowed() checks that selectedFile instanceof ElementaryFile and masterFile is not an ElementaryFile.\r\n\t\t//@ open selected_file_types(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _);\r\n\t\tshort size = ((ElementaryFile) selectedFile).getMaxSize();\r\n\t\tif (offset > size)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t// number of bytes in file starting from offset\r\n\t\t// short remaining = (short) (size - offset);\r\n\t\t// get the new data\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc == 0) || (byteRead == 0))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// update file\r\n\t\tif (offset < 0 || ISO7816.OFFSET_CDATA + lc > buffer.length || offset + lc > size)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t((ElementaryFile) selectedFile).updateData(offset, buffer, ISO7816.OFFSET_CDATA, lc);\r\n\t\t// //@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}", "private void activateFile(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check P2\r\n\t\tif (buffer[ISO7816.OFFSET_P2] != (byte) 0x0C)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t// P1 determines the select method\r\n\t\tswitch (buffer[ISO7816.OFFSET_P1]) {\r\n\t\tcase (byte) 0x02:\r\n\t\t\tselectByFileIdentifier(apdu, buffer);\r\n\t\t\tbreak;\r\n\t\tcase (byte) 0x08:\r\n\t\t\tselectByPath(apdu, buffer);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tISOException.throwIt(ISO7816.SW_INCORRECT_P1P2);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}\r\n\t\t// check if activating this file is allowed\r\n\t\tif (!fileAccessAllowed(UPDATE_BINARY))\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\tJCSystem.beginTransaction();\r\n\t\t//@ open valid(); // hard to eliminate\r\n\t\t//@ open selected_file_types(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, ?sf2);\r\n\t\t//@ sf2.castElementaryToFile();\r\n\t\tselectedFile.setActive(true);\r\n\t\t//@ sf2.castFileToElementary();\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}", "private Promise<byte[]> resolveApduFile(ApduFile file) {\n return new Promise<>(settlement -> {\n while (!file.isComplete()) {\n try {\n chunkWaitingLock.acquire();\n } catch (InterruptedException e) {\n Promise.reject(e);\n }\n short offset = file.getCurrentSize();\n Promise<byte[]> promise = this.presentationLayer.readBinary(offset);\n try {\n byte[] data = promise.getValue();\n file.appendValue(data);\n } catch (Throwable e) {\n settlement.reject(e);\n }\n chunkWaitingLock.release();\n }\n settlement.resolve(file.getData());\n getFileLock.release();\n });\n }", "public void initializeFullRead() {\r\n\r\n try {\r\n bPtr = 0;\r\n\r\n if (raFile != null) {\r\n fLength = raFile.length();\r\n } else {\r\n return;\r\n }\r\n\r\n if (tagBuffer == null) {\r\n tagBuffer = new byte[(int) fLength];\r\n } else if (fLength > tagBuffer.length) {\r\n tagBuffer = new byte[(int) fLength];\r\n }\r\n\r\n raFile.readFully(tagBuffer);\r\n } catch (final IOException ioE) {}\r\n }", "private void initializeEmptyLargeFiles() \r\n\t /*@ requires belpicDirectory |-> ?bpd &*& bpd != null &*& bpd.DedicatedFile(_, _, _, ?belpic_sibs, _) &*& \r\n\t \t\tlength(belpic_sibs) < 6 &*&\r\n\t \t\tidDirectory |-> ?idd &*& idd != null &*& idd.DedicatedFile(_, _, _, ?iddir_sibs, _) &*& \r\n\t \t\tlength(iddir_sibs) < 7 &*&\r\n\t \t\tcaCertificate |-> _ &*& rrnCertificate |-> _ &*& rootCaCertificate |-> _ &*& \r\n\t \t\tphotoFile |-> _ &*& authenticationCertificate |-> _ &*& nonRepudiationCertificate |-> _; @*/\r\n \t /*@ ensures belpicDirectory |-> bpd &*& \r\n\t \t\tidDirectory |-> idd &*&\r\n\t \t\tcaCertificate |-> ?cac &*& cac.ElementaryFile(CA_CERTIFICATE, bpd, ?d1, true, 0, _) &*& d1 != null &*& d1.length == 1200 &*&\r\n\t \t\trrnCertificate |-> ?rrnc &*& rrnc.ElementaryFile(RRN_CERTIFICATE, bpd, ?d2, true, 0, _) &*& d2 != null &*& d2.length == 1200 &*&\r\n\t \t\trootCaCertificate |-> ?rootcac &*& rootcac.ElementaryFile(ROOT_CA_CERTIFICATE, bpd, ?d3, true, 0, _) &*& d3 != null &*& d3.length == 1200 &*&\r\n\t \t\tphotoFile |-> ?pf &*& pf.ElementaryFile(PHOTO, idd, ?d4, true, 0, _) &*& d4 != null &*& d4.length == 3584 &*&\r\n\t \t\tauthenticationCertificate |-> ?ac &*& ac.ElementaryFile(AUTH_CERTIFICATE, bpd, ?d5, true, 0, _) &*& d5 != null &*& d5.length == 1200 &*&\r\n\t \t\tnonRepudiationCertificate |-> ?nrc &*& nrc.ElementaryFile(NONREP_CERTIFICATE, bpd, ?d6, true, 0, _) &*& d6 != null &*& d6.length == 1200 &*&\r\n\t \t\tidd.DedicatedFile(_, _, _, append(iddir_sibs, cons(pf, nil)), _) &*& \r\n\t \t\tbpd.DedicatedFile(_, _, _, append(append(append(append(append(belpic_sibs, cons(cac, nil)), cons(rrnc, nil)), cons(rootcac, nil)), cons(ac, nil)), cons(nrc, nil)), _); @*/\r\n\t{\r\n\t\t/*\r\n\t\t * these 3 certificates are the same for all sample eid card applets\r\n\t\t * therefor they are made static and the data is allocated only once\r\n\t\t */\r\n\t\tcaCertificate = new ElementaryFile(CA_CERTIFICATE, belpicDirectory, (short) 1200);\r\n\t\trrnCertificate = new ElementaryFile(RRN_CERTIFICATE, belpicDirectory, (short) 1200);\r\n\t\t\r\n\t\trootCaCertificate = new ElementaryFile(ROOT_CA_CERTIFICATE, belpicDirectory, (short) 1200);\r\n\t\t/*\r\n\t\t * to save some memory we only support 1 photo for all subclasses\r\n\t\t * ideally this should be applet specific and have max size 3584 (3.5K)\r\n\t\t */\r\n\t\tphotoFile = new ElementaryFile(PHOTO, idDirectory, (short) 3584);\r\n\t\t/*\r\n\t\t * certificate #2 and #3 are applet specific allocate enough memory\r\n\t\t */\r\n\t\tauthenticationCertificate = new ElementaryFile(AUTH_CERTIFICATE, belpicDirectory, (short) 1200);\r\n\t\tnonRepudiationCertificate = new ElementaryFile(NONREP_CERTIFICATE, belpicDirectory, (short) 1200);\r\n\t}", "private void selectFile(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check P2\r\n\t\tif (buffer[ISO7816.OFFSET_P2] != (byte) 0x0C)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t// P1 determines the select method\r\n\t\tswitch (buffer[ISO7816.OFFSET_P1]) {\r\n\t\tcase (byte) 0x02:\r\n\t\t\tselectByFileIdentifier(apdu, buffer);\r\n\t\t\tbreak;\r\n\t\tcase (byte) 0x08:\r\n\t\t\tselectByPath(apdu, buffer);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tISOException.throwIt(ISO7816.SW_INCORRECT_P1P2);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}\r\n\t}", "private void personalize(APDU apdu) {\r\n\t\tcheckState(STATE_INSTALLED);\r\n\t\t// Rough check to determine if we can process command as transaction\r\n\t\tif (image.getPersonalizationCapacity() > JCSystem\r\n\t\t\t\t.getUnusedCommitCapacity())\r\n\t\t\tISOException.throwIt(SW_OUT_OF_COMMIT_MEMORY);\r\n\t\t// start transaction\r\n\t\tJCSystem.beginTransaction();\r\n\t\t// security check inside\r\n\t\treadPortion(apdu, true);\r\n\t\t// Assumption for sake of time - blocks always come in full with sector\r\n\t\t// number\r\n\t\twhile (readSectorTrailer(apdu))\r\n\t\t\t;\r\n\t\timage.init();\r\n\t\tstate = STATE_PERSONALIZED;\r\n\t\tJCSystem.commitTransaction();\r\n\t}", "private void selectByPath(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// receive the path name\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\t////@ masking_and(buffer[ISO7816.OFFSET_LC], 0x00FF);\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\t// it must be a multiple of 2\r\n\t\tif (((lc & 1) == 1) || ((byteRead & 1) == 1))\r\n\t\t\tISOException.throwIt(SW_INCONSISTENT_P1P2);\r\n\t\tif (buffer.length < ISO7816.OFFSET_CDATA + lc + 1)\r\n\t\t\tISOException.throwIt(ISO7816.SW_INCORRECT_P1P2);\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// use the path name in the APDU data to select a file\r\n\t\tFile f = masterFile;\r\n\t\t////@ assert [1/2]masterFile |-> ?theMasterFile;\r\n\t\tfor (byte i = 0; i < lc; i += 2) \r\n\t\t /*@ invariant array_slice(buffer, 0, buffer.length, _) &*& i >= 0 &*& i < (lc + 2) &*& \r\n\t\t \t\t\t[1/2]randomBuffer |-> ?theRandomBuffer &*& theRandomBuffer != null &*& [1/2]array_slice(theRandomBuffer, 0, theRandomBuffer.length, _) &*& theRandomBuffer.length == 256 &*&\r\n\t\t\t\t [1/2]responseBuffer |-> ?theResponseBuffer &*& theResponseBuffer != null &*& [1/2]array_slice(theResponseBuffer, 0, theResponseBuffer.length, _) &*& theResponseBuffer.length == 128 &*&\r\n\t\t\t\t [1/2]randomData |-> ?theRandomData &*& theRandomData != null &*&\r\n\t\t\t\t [1/2]cipher |-> ?theCipher &*& theCipher != null &*&\r\n\t\t\t\t [1/2]messageBuffer |-> ?theMessageBuffer &*& theMessageBuffer != null &*& theMessageBuffer.length == 128 &*& is_transient_byte_array(theMessageBuffer) == true &*&\r\n\t\t\t\t [1/2]previousApduType |-> ?thePreviousApduType &*& thePreviousApduType != null &*& thePreviousApduType.length == 1 &*& is_transient_byte_array(thePreviousApduType) == true &*&\r\n\t\t\t\t [1/2]signatureType |-> ?theSignatureType &*& theSignatureType != null &*& theSignatureType.length == 1 &*& is_transient_byte_array(theSignatureType) == true &*&\r\n\t\t\t\t [1/2]masterFile |-> ?theMasterFile &*& [1/2]theMasterFile.MasterFile(0x3F00, null, _, ?masterSibs, _) &*& theMasterFile != null &*& theMasterFile.getClass() == MasterFile.class &*&\r\n\t\t\t\t [1/2]cardholderPin |-> ?theCardholderPin &*& [1/2]OwnerPIN(theCardholderPin, _, _) &*& theCardholderPin != null &*& \r\n\t\t\t\t [1/2]resetPin |-> ?theResetPin &*& [1/2]OwnerPIN(theResetPin, _, _) &*& theResetPin != null &*&\r\n\t\t\t\t [1/2]unblockPin |-> ?theUnblockPin &*& [1/2]OwnerPIN(theUnblockPin, _, _) &*& theUnblockPin != null &*&\r\n\t\t\t\t [1/2]activationPin |-> ?theActivationPin &*& [1/2]OwnerPIN(theActivationPin, _, _) &*& theActivationPin != null &*&\r\n\t\t\t\t [1/2]identityFile |-> ?theIdentityFile &*& [1/2]theIdentityFile.ElementaryFile(_, _, ?identityData, _, _, _) &*& theIdentityFile != null &*& identityData != null &*& identityData.length == 0xD0 &*& theIdentityFile.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t [1/2]identityFileSignature |-> ?theIdentityFileSignature &*& [1/2]theIdentityFileSignature.ElementaryFile(_, _, ?theIdentityFileSignatureData, _, _, _) &*& theIdentityFileSignature != null &*& theIdentityFileSignatureData != null &*& theIdentityFileSignatureData.length == 0x80 &*& theIdentityFileSignature.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t [1/2]addressFile |-> ?theAddressFile &*& [1/2]theAddressFile.ElementaryFile(_, _, ?theAddressFileData, _, _, _) &*& theAddressFile != null &*& theAddressFileData != null &*& theAddressFileData.length == 117 &*& theAddressFile.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t [1/2]addressFileSignature |-> ?theAddressFileSignature &*& [1/2]theAddressFileSignature.ElementaryFile(_, _, ?theAddressFileSignatureData, _, _, _) &*& theAddressFileSignature != null &*& theAddressFileSignatureData != null &*& theAddressFileSignatureData.length == 128 &*& theAddressFileSignature.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t [1/2]photoFile |-> ?thePhotoFile &*& [1/2]thePhotoFile.ElementaryFile(_, _, _, _, _, _) &*& thePhotoFile != null &*& thePhotoFile.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t [1/2]caRoleIDFile |-> ?thecaRoleIDFile &*& [1/2]thecaRoleIDFile.ElementaryFile(_, _, ?theCaRoleIDFileData, _, _, _) &*& thecaRoleIDFile != null &*& theCaRoleIDFileData != null &*& theCaRoleIDFileData.length == 0x20 &*& thecaRoleIDFile.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t [1/2]dirFile |-> ?theDirFile &*& [1/2]theDirFile.ElementaryFile(_, _, ?theDirFileData, _, _, _) &*& theDirFile != null &*& theDirFileData != null &*& theDirFileData.length == 0x25 &*& theDirFile.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t [1/2]tokenInfo |-> ?theTokenInfo &*& [1/2]theTokenInfo.ElementaryFile(_, _, ?theTokenInfoData, _, _, _) &*& theTokenInfo != null &*& theTokenInfoData != null &*& theTokenInfoData.length == 0x30 &*& theTokenInfo.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t [1/2]objectDirectoryFile |-> ?theObjectDirectoryFile &*& [1/2]theObjectDirectoryFile.ElementaryFile(_, _, ?theObjectDirectoryFileData, _, _, _) &*& theObjectDirectoryFile != null &*& theObjectDirectoryFileData != null &*& theObjectDirectoryFileData.length == 40 &*& theObjectDirectoryFile.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t [1/2]authenticationObjectDirectoryFile |-> ?theAuthenticationObjectDirectoryFile &*& [1/2]theAuthenticationObjectDirectoryFile.ElementaryFile(_, _, ?theAuthenticationObjectDirectoryFileData, _, _, _) &*& theAuthenticationObjectDirectoryFile != null &*& theAuthenticationObjectDirectoryFileData != null &*& theAuthenticationObjectDirectoryFileData.length == 0x40 &*& theAuthenticationObjectDirectoryFile.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t [1/2]privateKeyDirectoryFile |-> ?thePrivateKeyDirectoryFile &*& [1/2]thePrivateKeyDirectoryFile.ElementaryFile(_, _, ?thePrivateKeyDirectoryFileData, _, _, _) &*& thePrivateKeyDirectoryFile != null &*& thePrivateKeyDirectoryFileData != null &*& thePrivateKeyDirectoryFileData.length == 0xB0 &*& thePrivateKeyDirectoryFile.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t [1/2]certificateDirectoryFile |-> ?theCertificateDirectoryFile &*& [1/2]theCertificateDirectoryFile.ElementaryFile(_, _, ?theCertificateDirectoryFileData, _, _, _) &*& theCertificateDirectoryFile != null &*& theCertificateDirectoryFileData != null &*& theCertificateDirectoryFileData.length == 0xB0 &*& theCertificateDirectoryFile.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t [1/2]belpicDirectory |-> ?theBelpicDirectory &*& [1/2]theBelpicDirectory.DedicatedFile(_, _, _, ?belpicSibs, _) &*& theBelpicDirectory != null &*& theBelpicDirectory.getClass() == DedicatedFile.class &*&\r\n\t\t\t\t [1/2]idDirectory |-> ?theIdDirectory &*& [1/2]theIdDirectory.DedicatedFile(_, _, _, ?idSibs, _) &*& theIdDirectory != null &*& theIdDirectory.getClass() == DedicatedFile.class &*&\r\n\t\t\t\t [1/2]caCertificate |-> ?theCaCertificate &*& [1/2]theCaCertificate.ElementaryFile(_, _, _, _, _, _) &*& theCaCertificate.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t [1/2]selectedFile |-> ?theSelectedFile &*& theSelectedFile != null &*&\r\n\t\t\t\t masterSibs == cons<File>(theDirFile, cons(theBelpicDirectory, cons(theIdDirectory, nil))) &*&\r\n\t\t\t\t [1/2]rootCaCertificate |-> ?theRootCaCertificate &*& [1/2]theRootCaCertificate.ElementaryFile(_, _, _, _, _, _) &*& theRootCaCertificate.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t [1/2]rrnCertificate |-> ?theRrnCertificate &*& [1/2]theRrnCertificate.ElementaryFile(_, _, _, _, _, _) &*& theRrnCertificate.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t [1/2]authenticationCertificate |-> ?theAuthenticationCertificate &*& [1/2]theAuthenticationCertificate.ElementaryFile(_, _, _, _, _, _) &*& theAuthenticationCertificate.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t [1/2]nonRepudiationCertificate |-> ?theNonRepudiationCertificate &*& [1/2]theNonRepudiationCertificate.ElementaryFile(_, _, _, _, _, _) &*& theNonRepudiationCertificate.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t [1/2]preferencesFile |-> ?thePreferencesFile &*& thePreferencesFile != theCaCertificate &*& thePreferencesFile != theRrnCertificate &*& [1/2]thePreferencesFile.ElementaryFile(_, _, ?thePreferencesFileData, _, _, _) &*& thePreferencesFile != null &*& thePreferencesFileData != null &*& thePreferencesFileData.length == 100 &*& thePreferencesFile.getClass() == ElementaryFile.class &*&\r\n\t\t\t\t belpicSibs == cons<File>(theTokenInfo, cons(theObjectDirectoryFile, cons(theAuthenticationObjectDirectoryFile, cons(thePrivateKeyDirectoryFile, cons(theCertificateDirectoryFile, cons(theCaCertificate, cons(theRrnCertificate, cons(theRootCaCertificate, cons(theAuthenticationCertificate, cons(theNonRepudiationCertificate, nil)))))))))) &*&\r\n\t\t\t\t idSibs == cons<File>(theIdentityFile, cons(theIdentityFileSignature, cons(theAddressFile, cons(theAddressFileSignature, cons(thecaRoleIDFile, cons(thePreferencesFile, cons(thePhotoFile, nil))))))) &*&\r\n\t\t\t\t [1/2]selected_file_types(theSelectedFile, theMasterFile, theBelpicDirectory, theIdDirectory, theIdentityFile, theIdentityFileSignature, theAddressFile, theAddressFileSignature, thePhotoFile, thecaRoleIDFile, theDirFile, theTokenInfo, theObjectDirectoryFile, theAuthenticationObjectDirectoryFile, thePrivateKeyDirectoryFile, theCaCertificate, theCertificateDirectoryFile, theRrnCertificate, theRootCaCertificate, theAuthenticationCertificate, theNonRepudiationCertificate, thePreferencesFile, _) &*&\r\n\t\t\t \t (theSelectedFile.getClass() == ElementaryFile.class || theSelectedFile.getClass() == MasterFile.class || theSelectedFile.getClass() == DedicatedFile.class) &*&\r\n\t\t\t \t /*internalAuthenticateCounter |-> ?theInternalAuthenticateCounter &*&*/\r\n\t\t\t\t [1/2]signatureAlgorithm |-> ?theSignatureAlgorithm &*&\r\n\t\t\t\t [1/2]nonRepKeyPair |-> ?theNonRepKeyPair &*& theNonRepKeyPair != null &*&\r\n\t\t\t\t [1/2]authKeyPair |-> ?theAuthKeyPair &*& theAuthKeyPair != null &*&\r\n\t\t\t\t [1/2]basicKeyPair |-> ?theBasicKeyPair &*&\r\n\t\t\t\t [1/2]PKCS1_HEADER |-> ?thePKCS1HEADER &*& thePKCS1HEADER != null &*& [1/2]array_slice(thePKCS1HEADER, 0, thePKCS1HEADER.length, _) &*& thePKCS1HEADER.length == 1 &*&\r\n\t\t\t\t [1/2]PKCS1_SHA1_HEADER |-> ?thePKCS1SHA1HEADER &*& thePKCS1SHA1HEADER != null &*& [1/2]array_slice(thePKCS1SHA1HEADER, 0, thePKCS1SHA1HEADER.length, _) &*& thePKCS1SHA1HEADER.length == 16 &*&\r\n\t\t\t\t [1/2]PKCS1_MD5_HEADER |-> ?thePKCS1MD5HEADER &*& thePKCS1MD5HEADER != null &*& [1/2]array_slice(thePKCS1MD5HEADER, 0, thePKCS1MD5HEADER.length, _) &*& thePKCS1MD5HEADER.length == 19 &*&\r\n\t\t\t\t theDirFile != thePreferencesFile &*& theTokenInfo != thePreferencesFile &*& thePreferencesFile != theObjectDirectoryFile &*& thePreferencesFile != theAuthenticationObjectDirectoryFile &*& thePreferencesFile != thePrivateKeyDirectoryFile &*&\r\n\t\t\t\t (f == null ? \r\n\t\t\t\t true \r\n\t\t\t\t : \r\n\t\t\t\t selected_file_types(f, theMasterFile, theBelpicDirectory, theIdDirectory, theIdentityFile, theIdentityFileSignature, theAddressFile, theAddressFileSignature, thePhotoFile, thecaRoleIDFile, theDirFile, theTokenInfo, theObjectDirectoryFile, theAuthenticationObjectDirectoryFile, thePrivateKeyDirectoryFile, theCaCertificate, theCertificateDirectoryFile, theRrnCertificate, theRootCaCertificate, theAuthenticationCertificate, theNonRepudiationCertificate, thePreferencesFile, _) &*&\r\n\t\t\t\t f.getClass() == ElementaryFile.class || f.getClass() == MasterFile.class || f.getClass() == DedicatedFile.class\t\t\t \r\n\t\t\t\t ) &*&\r\n\t\t\t\t (i == 0 ? \r\n\t\t\t\t f == theMasterFile \r\n\t\t\t\t :\r\n\t\t\t\t (i <= 2 ?\r\n\t\t\t\t f == null || f == theMasterFile || mem(f, masterSibs) \r\n\t\t\t\t :\r\n\t\t\t\t (i <= 4 ?\r\n\t\t\t\t f == null || mem(f, masterSibs) || mem(f, belpicSibs) || mem(f, idSibs)\r\n\t\t\t\t :\r\n\t\t\t\t (i <= 6 ?\r\n\t\t\t\t f == null || mem(f, belpicSibs) || mem(f, idSibs)\r\n\t\t\t\t :\r\n\t\t\t\t false\r\n\t\t\t\t )\r\n\t\t\t\t )\r\n\t\t\t\t )\r\n\t\t\t\t ); @*/\r\n\t\t{\r\n\t\t\tshort fid = Util.makeShort(buffer[(short) (ISO7816.OFFSET_CDATA + i)], buffer[(short) (ISO7816.OFFSET_CDATA + i + 1)]);\r\n\t\t\t// MF can be explicitely or implicitely in the path name\r\n\t\t\tif ((i == 0) && (fid == MF))\r\n\t\t\t\tf = masterFile;\r\n\t\t\telse {\r\n\t\t\t \r\n\t\t\t\tif ((f instanceof ElementaryFile) || f == null)\r\n\t\t\t\t\tISOException.throwIt(ISO7816.SW_FILE_NOT_FOUND);\r\n\t\t\t\t//@ open selected_file_types(f, theMasterFile, theBelpicDirectory, theIdDirectory, theIdentityFile, theIdentityFileSignature, theAddressFile, theAddressFileSignature, thePhotoFile, thecaRoleIDFile, theDirFile, theTokenInfo, theObjectDirectoryFile, theAuthenticationObjectDirectoryFile, thePrivateKeyDirectoryFile, theCaCertificate, theCertificateDirectoryFile, theRrnCertificate, theRootCaCertificate, theAuthenticationCertificate, theNonRepudiationCertificate, thePreferencesFile, _);\r\n\t\t\t\t//@ File oldf = f;\r\n\t\t\t\t/*@ \r\n\t\t\t\tif(f == masterFile) \r\n\t\t\t\t{} else if (f == idDirectory) {} else {}\r\n\t\t\t\t@*/\r\n\t\t\t\t/*@\r\n\t\t\t\tif(f == masterFile) {\r\n\t\t\t\t masterFile.castMasterToDedicated();\r\n\t\t \t\t}\t \t\t\r\n\t\t \t\t@*/\r\n\t\t\t\tf = ((DedicatedFile) f).getSibling(fid);\r\n\t\t\t\t/*@ if(oldf == masterFile) {\r\n\t\t\t \t masterFile.castDedicatedToMaster();\r\n\t\t\t \t assert f == null || (f == idDirectory && f.getClass() == DedicatedFile.class) || (f == belpicDirectory && f.getClass() == DedicatedFile.class)|| (f == dirFile && f.getClass() == ElementaryFile.class);\r\n\t\t\t\t } \r\n\t\t\t\t@*/\r\n\t\t\t\t/*@\r\n\t\t\t\t if(f != null) {\r\n\t\t\t\t close selected_file_types(f, theMasterFile, theBelpicDirectory, theIdDirectory, theIdentityFile, theIdentityFileSignature, theAddressFile, theAddressFileSignature, thePhotoFile, thecaRoleIDFile, theDirFile, theTokenInfo, theObjectDirectoryFile, theAuthenticationObjectDirectoryFile, thePrivateKeyDirectoryFile, theCaCertificate, theCertificateDirectoryFile, theRrnCertificate, theRootCaCertificate, theAuthenticationCertificate, theNonRepudiationCertificate, thePreferencesFile, _);\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}\r\n\t\tif (f == null)\r\n\t\t\tISOException.throwIt(ISO7816.SW_FILE_NOT_FOUND);\r\n\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t////@ open selected_file_types(f, ?g1, ?g2, ?g3, ?g4, ?g5, ?g6, ?g7, ?g8, ?g9, ?g10, ?g11, ?g12, ?g13, ?g14, ?g15, ?g16, ?g17, ?g18, ?g19, ?g20, ?g21, _);\r\n\t\tselectedFile = f;\r\n\t\t////@ close selected_file_types(f, g1, g2, g3, g4, g5, g6, g7, g8, g9, g10, g11, g12, g13, g14, g15, g16, g17, g18, g19, g20, g21, _);\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}\r\n\r\n\t/*VF* END COPY */\r\n\t\r\n\r\n\t/**\r\n\t * initialize all the PINs\r\n\t * \r\n\t * PINs are set to the same values as the sample eID card\r\n\t */\r\n\tprivate void initializePins() \r\n \t /*@ requires this.cardholderPin |-> _ &*& this.resetPin |-> _\r\n \t \t\t\t&*& this.unblockPin |-> _ &*& this.activationPin |-> _;\r\n \t @*/\r\n \t /*@ ensures this.cardholderPin |-> ?theCardholderPin &*& OwnerPIN(theCardholderPin, _, _) &*& theCardholderPin != null \r\n\t\t\t&*& this.resetPin |-> ?theResetPin &*& OwnerPIN(theResetPin, _, _) &*& theResetPin != null\r\n\t\t\t&*& this.unblockPin |-> ?theUnblockPin &*& OwnerPIN(theUnblockPin, _, _) &*& theUnblockPin != null\r\n\t\t\t&*& this.activationPin |-> ?theActivationPin &*& OwnerPIN(theActivationPin, _, _) &*& theActivationPin != null;\r\n \t @*/\r\n \t //this.cardholderPin |-> ?theCardholderPin &*& \r\n\t{\r\n\t\t/*\r\n\t\t * initialize cardholder PIN (hardcoded to fixed value)\r\n\t\t * \r\n\t\t * PIN header is \"24\" (length of PIN = 4) PIN itself is \"1234\" (4\r\n\t\t * digits) fill rest of PIN data with F\r\n\t\t */\r\n\t\t/*VF*byte[] cardhold = { (byte) 0x24, (byte) 0x12, (byte) 0x34, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF }; */\r\n\t\tbyte cardhold[] = new byte[] { (byte) 0x24, (byte) 0x12, (byte) 0x34, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF };\r\n\t\tcardholderPin = new OwnerPIN(CARDHOLDER_PIN_TRY_LIMIT, PIN_SIZE);\r\n\t\tcardholderPin.update(cardhold, (short) 0, PIN_SIZE);\r\n\t\t/*\r\n\t\t * initialize unblock PUK (hardcoded to fixed value)\r\n\t\t * \r\n\t\t * PUK header is \"2c\" (length of PUK = 12) PUK itself consists of 2\r\n\t\t * parts PUK2 is \"222222\" (6 digits) PUK1 is \"111111\" (6 digits) so in\r\n\t\t * total the PUK is \"222222111111\" (12 digits) fill last bye of PUK data\r\n\t\t * with \"FF\"\r\n\t\t */\r\n\t\t/*VF* byte[] unblock = { (byte) 0x2c, (byte) 0x22, (byte) 0x22, (byte) 0x22, (byte) 0x11, (byte) 0x11, (byte) 0x11, (byte) 0xFF }; */\r\n\t\tbyte unblock[] = new byte[] { (byte) 0x2c, (byte) 0x22, (byte) 0x22, (byte) 0x22, (byte) 0x11, (byte) 0x11, (byte) 0x11, (byte) 0xFF };\r\n\t\tunblockPin = new OwnerPIN(UNBLOCK_PIN_TRY_LIMIT, PIN_SIZE);\r\n\t\tunblockPin.update(unblock, (short) 0, PIN_SIZE);\r\n\t\t/*\r\n\t\t * activation PIN is same as PUK\r\n\t\t */\r\n\t\tactivationPin = new OwnerPIN(ACTIVATE_PIN_TRY_LIMIT, PIN_SIZE);\r\n\t\tactivationPin.update(unblock, (short) 0, PIN_SIZE);\r\n\t\t/*\r\n\t\t * initialize reset PIN (hardcoded to fixed value)\r\n\t\t * \r\n\t\t * PUK header is \"2c\" (length of PUK = 12) PIN itself consists of 2\r\n\t\t * parts PUK3 is \"333333\" (6 digits) PUK1 is \"111111\" (6 digits) so in\r\n\t\t * total the PIN is \"333333111111\" (12 digits) fill last bye of PIN data\r\n\t\t * with \"FF\"\r\n\t\t */\r\n\t\t/*VF* byte[] reset = { (byte) 0x2c, (byte) 0x33, (byte) 0x33, (byte) 0x33, (byte) 0x11, (byte) 0x11, (byte) 0x11, (byte) 0xFF }; */\r\n\t\tbyte reset[] = new byte[] { (byte) 0x2c, (byte) 0x33, (byte) 0x33, (byte) 0x33, (byte) 0x11, (byte) 0x11, (byte) 0x11, (byte) 0xFF };\r\n\t\tresetPin = new OwnerPIN(RESET_PIN_TRY_LIMIT, PIN_SIZE);\r\n\t\tresetPin.update(reset, (short) 0, PIN_SIZE);\r\n\t}\r\n\t\r\n\t/**\r\n\t * private constructor - called by the install method to instantiate a\r\n\t * EidCard instance\r\n\t * \r\n\t * needs to be protected so that it can be invoked by subclasses\r\n\t */\r\n\tprotected EidCard() \r\n \t/*@ requires class_init_token(EidCard.class) &*& system(); @*/\r\n \t//@ ensures true;\r\n\t{\r\n\t\t//@ init_class();\r\n\t\t//internalAuthenticateCounter = 5000;\r\n\r\n\t\trandomBuffer = new byte[256];\r\n\t\tresponseBuffer = new byte[128];\r\n\t\t// initialize these objects once for the superclass\r\n\t\t// otherwise we have RAM problems when running multiple EidCard applets\r\n\t\tif (EidCard.randomData == null)\r\n\t\t\tEidCard.randomData = RandomData.getInstance(RandomData.ALG_SECURE_RANDOM);\r\n\t\tif (EidCard.cipher == null)\r\n\t\t\tEidCard.cipher = Cipher.getInstance(Cipher.ALG_RSA_NOPAD, false);\r\n\t\tCipher c = Cipher.getInstance(Cipher.ALG_RSA_NOPAD, false);\r\n\t\tif (EidCard.messageBuffer == null)\r\n\t\t\tEidCard.messageBuffer = JCSystem.makeTransientByteArray((short) 128, JCSystem.CLEAR_ON_DESELECT);\r\n\t\t// make these transient objects so that they are stored in RAM\r\n\t\tpreviousApduType = JCSystem.makeTransientByteArray((short) 1, JCSystem.CLEAR_ON_DESELECT);\r\n\t\tsignatureType = JCSystem.makeTransientByteArray((short) 1, JCSystem.CLEAR_ON_DESELECT);\r\n\t\t// register the applet instance with the JCRE\r\n\r\n\t\t/*VF* COPIED FROM EmptyEidCard */\r\n\t\t// initialize PINs to fixed value\r\n\t\tinitializePins();\r\n\t\t// initialize file system\r\n\t\tinitializeFileSystem();\r\n\t\t// initialize place holders for large files (certificates + photo)\r\n\t\tinitializeEmptyLargeFiles();\r\n\t\t// initialize basic keys pair\r\n\t\tinitializeKeyPairs();\r\n\t\t/*VF* END COPY */\r\n \t\t//@ preferencesFile.neq(caCertificate);\r\n \t\t//@ preferencesFile.neq(rrnCertificate);\r\n \t\t//@ preferencesFile.neq(dirFile);\r\n \t\t//@ preferencesFile.neq(tokenInfo);\r\n \t\t//@ preferencesFile.neq(objectDirectoryFile);\r\n \t\t//@ preferencesFile.neq(authenticationObjectDirectoryFile);\r\n \t\t//@ preferencesFile.neq(privateKeyDirectoryFile);\r\n\t\t////@ close valid(); // auto\r\n\t\tregister();\r\n\t}\r\n\t/**\r\n\t * initialize the applet when it is selected\r\n\t * \r\n\t * select always has to happen after a reset\r\n\t */\r\n\tpublic boolean select() \r\n //@ requires current_applet(this) &*& [1/2]valid();\r\n //@ ensures current_applet(this) &*& [1/2]valid();\r\n\t{\r\n\t\t// Clear data and set default selectedFile to masterFile\r\n\t\tclear();\r\n\t\treturn true;\r\n\t}\r\n\t/**\r\n\t * perform any cleanup and bookkeeping tasks before the applet is deselected\r\n\t */\r\n\tpublic void deselect() \r\n \t //@ requires current_applet(this) &*& [1/2]valid();\r\n \t //@ ensures current_applet(this) &*& [1/2]valid();\r\n\t{\r\n\t\tclear();\r\n\t\treturn;\r\n\t}\r\n\t/**\r\n\t * process APDUs\r\n\t */\r\n\tpublic void process(APDU apdu) \r\n //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, ?buffer_) &*& array_slice(buffer_, 0, buffer_.length, _);\r\n //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer_) &*& array_slice(buffer_, 0, buffer_.length, _);\r\n\t{\r\n\t\tbyte[] buffer = apdu.getBuffer();\r\n\t\t/*\r\n\t\t * - non repudiation signatures can only be generated if the previous\r\n\t\t * APDU verified the cardholder PIN - administrator PIN change is only\r\n\t\t * possible if the previous APDU verified the reset PIN\r\n\t\t * \r\n\t\t * so only the \"generate signature\" and PIN Change APDU needs to check\r\n\t\t * the previous APDU type; in all other cases overwrite the previous\r\n\t\t * APDU type, because this information is not needed; we do this as\r\n\t\t * early as possible to cope with exceptions being thrown during\r\n\t\t * processing of APDU\r\n\t\t * \r\n\t\t * IMPORTANT : we have to set the previous APDU type in the processing\r\n\t\t * of a PIN Verify APDU (because the type gets overwritten to a wrong\r\n\t\t * value) and at the end of a \"generate signature\" and PIN Change APDU\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\tif ((buffer[ISO7816.OFFSET_INS] != INS_GENERATE_SIGNATURE) && (buffer[ISO7816.OFFSET_INS] != INS_CHANGE_PIN) && (buffer[ISO7816.OFFSET_INS] != INS_GET_KEY))\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t// return if the APDU is the applet SELECT command\r\n\t\tif (selectingApplet()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (buffer[ISO7816.OFFSET_CLA] == EIDCARD_CLA_1)\r\n\t\t\t// check the INS byte to decide which service method to call\r\n\t\t\tswitch (buffer[ISO7816.OFFSET_INS]) {\r\n\t\t\t// case INS_CHANGE_ATR :\r\n\t\t\t// changeATR(apdu);\r\n\t\t\t// break;\r\n\t\t\tcase INS_VERIFY_PIN:\r\n\t\t\t\tverifyPin(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_CHANGE_PIN:\r\n\t\t\t\tchangePin(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_UNBLOCK:\r\n\t\t\t\tunblock(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_GET_CHALLENGE:\r\n\t\t\t\tgetChallenge(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_PREPARE_SIGNATURE:\r\n\t\t\t\tprepareForSignature(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_GENERATE_SIGNATURE:\r\n\t\t\t\tgenerateSignature(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_GENERATE_KEYPAIR:\r\n\t\t\t\tgenerateKeyPair(apdu);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_INTERNAL_AUTHENTICATE:\r\n\t\t\t\tinternalAuthenticate(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_GET_RESPONSE:\r\n\t\t\t\t// if only T=0 supported: remove\r\n\t\t\t\t// not possible in case of T=0 protocol\r\n\t\t\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1)\r\n\t\t\t\t\tgetResponse(apdu, buffer);\r\n\t\t\t\telse\r\n\t\t\t\t\tISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_SELECT_FILE:\r\n\t\t\t\tselectFile(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_ACTIVATE_FILE:\r\n\t\t\t\tactivateFile(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_DEACTIVATE_FILE:\r\n\t\t\t\tdeactivateFile(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_READ_BINARY:\r\n\t\t\t\treadBinary(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_UPDATE_BINARY:\r\n\t\t\t\tupdateBinary(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_ERASE_BINARY:\r\n\t\t\t\teraseBinary(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);\r\n\t\t\t\tbreak; //~allow_dead_code\r\n\t\t\t}\r\n\t\telse if (buffer[ISO7816.OFFSET_CLA] == EIDCARD_CLA_2)\r\n\t\t\tswitch (buffer[ISO7816.OFFSET_INS]) {\r\n\t\t\tcase INS_GET_KEY:\r\n\t\t\t\tgetPublicKey(apdu);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_PUT_KEY:\r\n\t\t\t\tputPublicKey(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_ERASE_KEY:\r\n\t\t\t\teraseKey(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_ACTIVATE_KEY:\r\n\t\t\t\tactivateKey(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_DEACTIVATE_KEY:\r\n\t\t\t\tdeactivateKey(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_GET_CARD_DATA:\r\n\t\t\t\tgetCardData(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\tcase INS_LOG_OFF:\r\n\t\t\t\tlogOff(apdu, buffer);\r\n\t\t\t\tbreak;\r\n\t\t\t// case INS_BLOCK :\r\n\t\t\t// blockCard(apdu, buffer);\r\n\t\t\t// break;\r\n\t\t\t}\r\n\t\telse\r\n\t\t\tISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);\r\n\t}\r\n\t/**\r\n\t * verify the PIN\r\n\t */\r\n\tprivate void verifyPin(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t\r\n\t\t// check P1\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x00)\r\n\t\t\tISOException.throwIt(ISO7816.SW_INCORRECT_P1P2);\r\n\t\t// receive the PIN data for validation\r\n\t\tapdu.setIncomingAndReceive();\r\n\t\t// check PIN depending on value of P2\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\tswitch (buffer[ISO7816.OFFSET_P2]) {\r\n\t\tcase CARDHOLDER_PIN:\r\n\t\t\t// overwrite previous APDU type\r\n\t\t\tsetPreviousApduType(VERIFY_CARDHOLDER_PIN);\r\n\t\t\t// check the cardholder PIN\r\n\t\t\tcheckPin(cardholderPin, buffer);\r\n\t\t\tbreak;\r\n\t\tcase ACTIVATE_PIN:\r\n\t\t\t// check the activation PIN\r\n\t\t\tcheckPin(activationPin, buffer);\r\n\t\t\t// if the activation PIN was entered correctly\r\n\t\t\tif (GPSystem.getCardContentState() == GPSystem.APPLICATION_SELECTABLE)\r\n\t\t\t\t// set the applet status to personalized\r\n\t\t\t\tGPSystem.setCardContentState(GPSystem.CARD_SECURED);\r\n\t\t\t// reset internal authenticate counter\r\n\t\t\t//internalAuthenticateCounter = 5000;\r\n\t\t\tbreak;\r\n\t\tcase RESET_PIN:\r\n\t\t\t// overwrite previous APDU type\r\n\t\t\tsetPreviousApduType(VERIFY_RESET_PIN);\r\n\t\t\t// check the reset PIN\r\n\t\t\tcheckPin(resetPin, buffer);\r\n\t\t\tbreak;\r\n\t\tcase UNBLOCK_PIN:\r\n\t\t\t// check the unblock PIN: after this, the pin will be 'activated'\r\n\t\t\tcheckPin(unblockPin, buffer);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t}\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}\r\n\t/**\r\n\t * check the PIN\r\n\t */\r\n\tprivate void checkPin(OwnerPIN pin, byte[] buffer) \r\n \t //@ requires [1/2]cardholderPin |-> ?theCardholderPin &*& [1/2]OwnerPIN(pin, _, _) &*& pin != null &*& buffer != null &*& array_slice(buffer, 0, buffer.length, _) &*& buffer.length >= 13;\r\n \t //@ ensures [1/2]cardholderPin |-> theCardholderPin &*& [1/2]OwnerPIN(pin, _, _) &*& pin != null &*& array_slice(buffer, 0, buffer.length, _) &*& buffer != null &*& buffer.length >= 13;\r\n\t{\r\n\t\tif (pin.check(buffer, OFFSET_PIN_HEADER, PIN_SIZE) == true)\r\n\t\t\treturn;\r\n\t\tshort tries = pin.getTriesRemaining();\r\n\t\t// the eID card throws this exception, SW=0x63C0 would make more sense\r\n\t\tif (tries == 0) {\r\n\t\t\t// if the cardholder PIN is no longer valid (too many tries)\r\n\t\t\tif (pin == cardholderPin)\r\n\t\t\t\t// set the applet status to blocked\r\n\t\t\t\tGPSystem.setCardContentState(GPSystem.CARD_LOCKED);\r\n\t\t\tISOException.throwIt(ISO7816.SW_FILE_INVALID);\r\n\t\t}\r\n\t\t/*\r\n\t\t * create the correct exception the status word is of the form 0x63Cx\r\n\t\t * with x the number of tries left\r\n\t\t */\r\n\t\tshort sw = (short) (SW_WRONG_PIN_0_TRIES_LEFT | tries);\r\n\t\tISOException.throwIt(sw);\r\n\t}\r\n\t/**\r\n\t * change the PIN\r\n\t */\r\n\tprivate void changePin(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for administrator PIN change\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P2\r\n\t\tif (buffer[ISO7816.OFFSET_P2] != (byte) 0x01) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_INCORRECT_P1P2);\r\n\t\t}\r\n\t\t// P1 determines whether it is user or administrator PIN change\r\n\t\tswitch (buffer[ISO7816.OFFSET_P1]) {\r\n\t\tcase (byte) 0x00:\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\tuserChangePin(apdu, buffer);\r\n\t\t\tbreak;\r\n\t\tcase (byte) 0x01:\r\n\t\t\t// //@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\tadministratorChangePin(apdu, buffer);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\t// //@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\tISOException.throwIt(ISO7816.SW_INCORRECT_P1P2);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t/**\r\n\t * user changes the PIN\r\n\t */\r\n\tprivate void userChangePin(APDU apdu, byte[] buffer) \r\n \t //@ requires [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _) &*& buffer.length > OFFSET_SECOND_PIN_HEADER + PIN_SIZE;\r\n \t //@ ensures [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _) &*& buffer.length > OFFSET_SECOND_PIN_HEADER + PIN_SIZE;\r\n\t{\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// receive the PIN data\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc != 16) || (byteRead != 16))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// first check old cardholder PIN\r\n\t\tcheckPin(cardholderPin, buffer);\r\n\t\t// do some checks on the new PIN header and data\r\n\t\tif (!isNewPinFormattedCorrectly(buffer, OFFSET_SECOND_PIN_HEADER))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t// include header as well in PIN object\r\n\t\tcardholderPin.update(buffer, OFFSET_SECOND_PIN_HEADER, PIN_SIZE);\r\n\t\t// validate cardholder PIN immediately after change PIN\r\n\t\t// so that cardholder access rights are immediately granted\r\n\t\tcardholderPin.check(buffer, OFFSET_SECOND_PIN_HEADER, PIN_SIZE);\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t}\r\n\t/**\r\n\t * administrator changes the PIN\r\n\t */\r\n\tprivate void administratorChangePin(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// The previous getChallenge() should ask for at least the length of the\r\n\t\t// new administrator pin. Otherwise exception is thrown\r\n\t\t/*\r\n\t\t * IMPORTANT: the previous APDU type has to be overwritten in every\r\n\t\t * possible exit path out of this function; therefore we check the\r\n\t\t * security conditions as early as possible\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// previous APDU must have checked the reset PIN\r\n\t\tif ((!resetPin.isValidated()) || (getPreviousApduType() != VERIFY_RESET_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\t\t// receive the PIN data\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc != 8) || (byteRead != 8))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// do some checks on the new PIN header and data\r\n\t\tif (!isNewPinFormattedCorrectly(buffer, OFFSET_PIN_HEADER))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t// compare the new PIN with the last generated random challenge\r\n\t\tif (!isNewPinCorrectValue(buffer))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t// include header as well in PIN object\r\n\t\tcardholderPin.update(buffer, OFFSET_PIN_HEADER, PIN_SIZE);\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}\r\n\t/**\r\n\t * check if new PIN conforms to internal format\r\n\t * \r\n\t * returns false if new PIN is not formatted correctly\r\n\t */\r\n\tprivate boolean isNewPinFormattedCorrectly(byte[] buffer, byte offset) \r\n \t //@ requires buffer != null &*& array_slice(buffer, 0, buffer.length, _) &*& offset >= 0 &*& offset < buffer.length - PIN_SIZE &*& offset + PIN_SIZE <= Byte.MAX_VALUE;\r\n \t //@ ensures array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// 1st nibble of new PIN header should be 2\r\n\t\tif ((buffer[offset] >> 4) != 2)\r\n\t\t\treturn false;\r\n\t\t// 2nd nibble of new PIN header is the length (in digits)\r\n\t\t//@ and_limits(buffer[offset], 0x0F, nat_of_pos(p1(p1(p1_))));\r\n\t\tbyte pinLength = (byte) (buffer[offset] & 0x0F);\r\n\t\t// the new PIN should be between 4 and 12 digits\r\n\t\tif (pinLength < 4 || pinLength > 12)\r\n\t\t\treturn false;\r\n\t\t// divide PIN length by 2 to get the length in bytes\r\n\t\t//@ shr_limits(pinLength, 1, nat_of_pos(p1(p1(p1_))));\r\n\t\tbyte pinLengthInBytes = (byte) (pinLength >> 1);\r\n\t\t\r\n\t\t// check if PIN length is odd\r\n\t\tif ((pinLength & (byte) 0x01) == (byte) 0x01)\r\n\t\t\tpinLengthInBytes++;\r\n\t\t// check if PIN data is padded with 0xFF\r\n\t\tbyte i = (byte) (offset + PIN_SIZE - 1);\r\n\t\tfor (; i > offset + pinLengthInBytes; i--) \r\n\t\t\t/*@ invariant array_slice(buffer, 0, buffer.length, _) &*& i >= offset + pinLengthInBytes\r\n\t\t\t\t&*& i <= offset + PIN_SIZE - 1;\r\n\t\t\t@*/\r\n\t\t{\r\n\t\t\tif (buffer[i] != (byte) 0xFF)\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\t// if PIN length is odd, check if last PIN data nibble is F\r\n\t\tif ((pinLength & (byte) 0x01) == (byte) 0x01) {\r\n\t\t\tif (/*@truncating@*/ (byte) (buffer[i] << 4) != (byte) 0xF0)\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\t/**\r\n\t * check if new PIN is based on the last generated random challenge\r\n\t */\r\n\tprivate boolean isNewPinCorrectValue(byte[] buffer) \r\n \t /*@ requires buffer != null &*& array_slice(buffer, 0, buffer.length, _) &*& buffer.length >= OFFSET_PIN_DATA + 8\r\n \t \t &*& randomBuffer |-> ?theRandomBuffer &*& theRandomBuffer != null &*& array_slice(theRandomBuffer, 0, theRandomBuffer.length, _) &*& theRandomBuffer.length == 256;\r\n \t @*/\r\n \t //@ ensures array_slice(buffer, 0, buffer.length, _) &*& randomBuffer |-> theRandomBuffer &*& array_slice(theRandomBuffer, 0, theRandomBuffer.length, _);\r\n\t{\r\n\t\t// 2nd nibble of the PIN header is the length (in digits)\r\n\t\tint tmp = buffer[OFFSET_PIN_HEADER];\r\n\t\tif(tmp < 0) { // BUG\r\n\t\t return false;\r\n\t\t}\r\n\t\tbyte pinLength = (byte) (buffer[OFFSET_PIN_HEADER] & 0x0F);\r\n\t\t// check if PIN length is odd\r\n\t\tbyte oldLength = (byte) (pinLength & 0x01);\r\n\t\t// divide PIN length by 2 to get the length in bytes\r\n\t\tbyte pinLengthInBytes = (byte) (pinLength >> 1);\r\n\t\t//@ assert 0 <= pinLengthInBytes && pinLengthInBytes < 8;\r\n\t\tbyte i;\r\n\t\tfor (i = 0; i < pinLengthInBytes; i++) \r\n\t\t\t/*@ invariant array_slice(buffer, 0, buffer.length, _) &*& i >= 0 &*& i <= pinLengthInBytes \r\n\t\t\t &*& randomBuffer |-> ?theRandomBuffer2 &*& theRandomBuffer == theRandomBuffer2 &*& theRandomBuffer2 != null &*& array_slice(theRandomBuffer2, 0, theRandomBuffer2.length, _) &*& theRandomBuffer2.length >= pinLengthInBytes;\r\n\t\t\t@*/\r\n\t\t{\r\n\t\t\tif (buffer[OFFSET_PIN_DATA + i] != (randomBuffer[i] & 0x77))\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\tif (oldLength == (byte) 0x01) {\r\n\t\t\tif ((buffer[OFFSET_PIN_DATA + pinLengthInBytes] >> 4) != ((randomBuffer[i] & 0x7F) >> 4))\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\t/**\r\n\t * Discard current fulfilled access conditions\r\n\t */\r\n\tprivate void logOff(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check P1 and P2\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x00 || buffer[ISO7816.OFFSET_P2] != (byte) 0x00)\r\n\t\t\tISOException.throwIt(ISO7816.SW_INCORRECT_P1P2);\r\n\t\t// remove previous access conditions:\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\tsetPreviousApduType(OTHER);\r\n\t\tsetSignatureType(NO_SIGNATURE);\r\n\t\tcardholderPin.reset();\r\n\t\tresetPin.reset();\r\n\t\tunblockPin.reset();\r\n\t\tactivationPin.reset();\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}\r\n\t/**\r\n\t * unblock card\r\n\t */\r\n\tprivate void unblock(APDU apdu, byte[] buffer) \r\n \t //@ requires [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check P1 and P2\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x00 || buffer[ISO7816.OFFSET_P2] != (byte) 0x01)\r\n\t\t\tISOException.throwIt(ISO7816.SW_INCORRECT_P1P2);\r\n\t\t// receive the PUK data for validation\r\n\t\tapdu.setIncomingAndReceive();\r\n\t\t// check PUK\r\n\t\t////@ open valid(); // auto\r\n\t\tcheckPin(unblockPin, buffer);\r\n\t\t// if PUK is correct, then unblock cardholder PINs\r\n\t\tcardholderPin.resetAndUnblock();\r\n\t\t// set the applet status back to personalized\r\n\t\tGPSystem.setCardContentState(GPSystem.CARD_SECURED);\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t}\r\n\t/**\r\n\t * prepare for authentication or non repudiation signature\r\n\t */\r\n\tprivate void prepareForSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check P1 and P2\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x41 || buffer[ISO7816.OFFSET_P2] != (byte) 0xB6)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t// receive the data to see which kind of signature\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc != 5) || (byteRead != 5))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// the first 2 bytes of the data part should be 0x04 0x80\r\n\t\t// the fourth byte should be 0x84\r\n\t\tif ((buffer[ISO7816.OFFSET_CDATA] != (byte) 0x04) || (buffer[ISO7816.OFFSET_CDATA + 1] != (byte) 0x80) || (buffer[ISO7816.OFFSET_CDATA + 3] != (byte) 0x84))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t// initialize signature object depending on hash function type\r\n\t\t\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\tswitch (buffer[ISO7816.OFFSET_CDATA + 2]) {\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\tsignatureAlgorithm = ALG_SHA1_PKCS1;\r\n\t\t\tbreak;\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\tsignatureAlgorithm = ALG_MD5_PKCS1;\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\tsignatureAlgorithm = ALG_PKCS1;\r\n\t\t\tbreak;\r\n\t\tdefault: // algorithm not supported (SW=9484)\r\n\t\t\tISOException.throwIt(SW_ALGORITHM_NOT_SUPPORTED);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}", "public Promise<byte[]> readFile(ElementaryFileID id) {\n try {\n getFileLock.acquire();\n } catch (InterruptedException e) {\n return Promise.reject(e);\n }\n return this.presentationLayer.selectDF(this.appId).then((res) -> {\n return openApduFile(id).then((file) -> this.resolveApduFile(file));\n });\n }", "public ISOCommandAPDU(int size, byte classByte, byte instruction, byte p1, byte p2) {\n this(size, classByte, instruction, p1, p2, null, -1);\n }", "public ISOCommandAPDU(byte classByte, byte instruction, byte p1, byte p2) {\n this(4, classByte, instruction, p1, p2, null, -1); // size = header length\n }", "public ISOCommandAPDU(int size, byte classByte, byte instruction, byte p1, byte p2, byte[] data) {\n this(size, classByte, instruction, p1, p2, data, -1);\n }", "public ISOCommandAPDU(byte classByte, byte instruction, byte p1, byte p2, int le) {\n this(4+2, classByte, instruction, p1, p2, null, le); // size = header length + le\n }", "private void eraseBinary(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check if access to this file is allowed\r\n\t\tif (!fileAccessAllowed(ERASE_BINARY))\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// use P1 and P2 as offset\r\n\t\tshort offset = Util.makeShort(buffer[ISO7816.OFFSET_P1], buffer[ISO7816.OFFSET_P2]);\r\n\t\tJCSystem.beginTransaction();\r\n\t\t//@ open valid(); // hard to eliminate as the conjunct selectedFile.ElementaryFile depends on non-input parameters\r\n\t\tif (selectedFile == masterFile)\r\n\t\t\tISOException.throwIt(ISO7816.SW_FILE_INVALID); //~allow_dead_code Dead because fileAccessAllowed() checks that selectedFile instanceof ElementaryFile and masterFile is not an ElementaryFile.\r\n\t\t// impossible to start erasing from offset large than size of file\r\n\t\t//@ open selected_file_types(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _);\r\n\t\tshort size = ((ElementaryFile)selectedFile).getCurrentSize();\r\n\t\t\r\n\t\tif (offset > size || offset < 0)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t((ElementaryFile) selectedFile).eraseData(offset);\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}", "private void getExtractWithFiles(){\n\t\ttry{\n\t\t\t\n\t\t\tFileInputStream fStream = new FileInputStream(tfile);\n\t\t\tfileBytes = new byte[(int)tfile.length()];\n\t\t\t\n\t\t\tfStream.read(fileBytes, 0, fileBytes.length);\n\t\t\tfileSize = fileBytes.length;\n\t\t}catch(Exception ex){\n\t\t\tSystem.err.println(\"File Packet \"+ex.getMessage());\n\t\t}\n\t}", "private void deactivateFile(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check P2\r\n\t\tif (buffer[ISO7816.OFFSET_P2] != (byte) 0x0C)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t// P1 determines the select method\r\n\t\tswitch (buffer[ISO7816.OFFSET_P1]) {\r\n\t\tcase (byte) 0x02:\r\n\t\t\tselectByFileIdentifier(apdu, buffer);\r\n\t\t\tbreak;\r\n\t\tcase (byte) 0x08:\r\n\t\t\tselectByPath(apdu, buffer);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tISOException.throwIt(ISO7816.SW_INCORRECT_P1P2);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}\r\n\t\t// check if deactivating this file is allowed\r\n\t\tif (!fileAccessAllowed(UPDATE_BINARY))\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\tJCSystem.beginTransaction();\r\n\t\t//@ open valid(); // todo\r\n\t \t//@ open selected_file_types(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, ?sf2);\r\n\t\t//@ sf2.castElementaryToFile();\r\n\t\tselectedFile.setActive(false);\r\n\t\t//@ sf2.castFileToElementary();\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}", "private void getPublicKey(APDU apdu) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, ?theBuffer) &*& array_slice(theBuffer, 0, theBuffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, theBuffer) &*& array_slice(theBuffer, 0, theBuffer.length, _);\r\n\t{\r\n\t\t\r\n\t\t\r\n\t\tbyte[] buffer = apdu.getBuffer();\r\n\t\t// if this is thrown: problem accesses getPreviousapdu\r\n\t\t// check P1\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x00)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t// inform the JCRE that the applet has data to return\r\n\t\tshort le = apdu.setOutgoing();\r\n\t\t// Le = 0 is not allowed\r\n\t\tif (le != (short) (5 + 8 + 128))\r\n\t\t\tISOException.throwIt((short) (SW_WRONG_LENGTH_00 + (5 + 8 + 128)));\r\n\t\tbyte[] tempBuffer = new byte[le];\r\n\t\ttempBuffer[(short) 0] = (byte) 0x02;\r\n\t\ttempBuffer[(short) 1] = (byte) 0x08;\r\n\t\ttempBuffer[(short) 10] = (byte) 0x03;\r\n\t\ttempBuffer[(short) 11] = (byte) 0x81;\r\n\t\ttempBuffer[(short) 12] = (byte) 0x80;\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tif (buffer[ISO7816.OFFSET_P2] == AUTHENTICATION){\r\n\t\t\tif (getPreviousApduType() != GENERATE_KEY_PAIR) {\r\n\t\t\t\tauthKeyPair.getPublic().clearKey();\r\n\t\t\t ////@ close [1/2]valid(); // auto\r\n\t\t\t\tJCSystem.beginTransaction();\r\n\t\t\t ////@ open valid(); // auto\r\n\t\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\t ////@ close valid(); // auto\r\n\t\t\t\tJCSystem.commitTransaction();\r\n\t\t\t ////@ open [1/2]valid(); // auto\r\n\t\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t\t}\r\n\t\t\t((RSAPublicKey) authKeyPair.getPublic()).getExponent(tempBuffer, (short) 7);\r\n\t\t\t((RSAPublicKey) authKeyPair.getPublic()).getModulus(tempBuffer, (short) 13);\r\n\t\t}else if (buffer[ISO7816.OFFSET_P2] == NON_REPUDIATION) { \r\n\t\t\tif (getPreviousApduType() != GENERATE_KEY_PAIR) {\r\n\t\t\t\tnonRepKeyPair.getPublic().clearKey();\r\n\t\t\t ////@ close [1/2]valid(); // auto\r\n\t\t\t\tJCSystem.beginTransaction();\r\n\t\t\t ////@ open valid(); // auto\r\n\t\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\t\t////@ close valid(); // auto\r\n\t\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t\t}\t\t\t\r\n\t\t\t((RSAPublicKey) nonRepKeyPair.getPublic()).getExponent(tempBuffer, (short) 7);\r\n\t\t\t((RSAPublicKey) nonRepKeyPair.getPublic()).getModulus(tempBuffer, (short) 13);\r\n\t\t}else if (buffer[ISO7816.OFFSET_P2] == BASIC) {\t\t\r\n\t\t\tif (basicKeyPair == null)\r\n\t\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\t((RSAPublicKey) basicKeyPair.getPublic()).getExponent(tempBuffer, (short) 7);\r\n\t\t\t((RSAPublicKey) basicKeyPair.getPublic()).getModulus(tempBuffer, (short) 13);\r\n\t\t} else {\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t}\r\n\t ////@ close [1/2]valid(); // auto\r\n\t\tJCSystem.beginTransaction();\r\n\t ////@ open valid(); // auto\r\n\t\tsetPreviousApduType(OTHER);\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tauthKeyPair.getPublic().clearKey();\r\n\t\tnonRepKeyPair.getPublic().clearKey();\r\n\t\t// set the actual number of outgoing data bytes\r\n\t\tapdu.setOutgoingLength(le);\r\n\t\t// send content of buffer in apdu\r\n\t\tapdu.sendBytesLong(tempBuffer, (short) 0, le);\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t}", "public ISOCommandAPDU(int size, byte classByte, byte instruction, byte p1, byte p2, int le) {\n this(size, classByte, instruction, p1, p2, null, le);\n }", "private void internalAuthenticate(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check P1 and P2\r\n\t\tif ((buffer[ISO7816.OFFSET_P1] != ALG_SHA1_PKCS1) || buffer[ISO7816.OFFSET_P2] != BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t// receive the data that needs to be signed\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\t// we do not support Lc=0x97, only Lc=0x16\r\n\t\tif ((lc == 0x97) || (byteRead == 0x97))\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\tif ((lc != 0x16) || (byteRead != 0x16))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// the first data byte must be \"94\" and the second byte is the length\r\n\t\t// (20 bytes)\r\n\t\tif ((buffer[ISO7816.OFFSET_CDATA] != (byte) 0x94) || (buffer[ISO7816.OFFSET_CDATA + 1] != (byte) 0x14))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t// use the basic private key\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as);\r\n\t\t//@ foreachp_remove(messageBuffer, as);\r\n\t\t//@ open transient_byte_array(messageBuffer);\r\n\r\n\t\tif (basicKeyPair == null)\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\r\n\t\t//VF: bovenstaande is mogelijk bug in programma!\r\n\t\tcipher.init(basicKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t// prepare the message buffer to the PKCS#1 (v1.5) structure\r\n\t\tpreparePkcs1ClearText(messageBuffer, ALG_SHA1_PKCS1, lc);\r\n\t\t// copy the challenge (SHA1 hash) from the APDU to the message buffer\r\n\t\tUtil.arrayCopy(buffer, (short) (ISO7816.OFFSET_CDATA + 2), messageBuffer, (short) 108, (short) 20);\r\n\t\t// generate signature\r\n\t\tcipher.doFinal(messageBuffer, (short) 0, (short) 128, buffer, (short) 0);\r\n\t\t// if T=0, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t// in case T=1 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t\t// decrement internal authenticate counter\r\n\t\t//internalAuthenticateCounter--;\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}", "public ISOCommandAPDU(byte classByte, byte instruction, byte p1, byte p2, byte[] data) {\n this(data.length+5+4, classByte, instruction, p1, p2, data, -1); // 5 = max overhead for coding data; 4 = header bytes\n }", "private void generateKeyPair(APDU apdu) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, ?theBuffer) &*& array_slice(theBuffer, 0, theBuffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, theBuffer) &*& array_slice(theBuffer, 0, theBuffer.length, _);\r\n\t{\r\n\t\tapdu.setIncomingAndReceive();// If this was removed, function will not\r\n\t\t// work: no data except for command will be read\r\n\t\tbyte[] buffer = apdu.getBuffer();\r\n\t\t// check if access to this method is allowed\r\n\t\tif (GPSystem.getCardContentState() != GPSystem.APPLICATION_SELECTABLE)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check P1 and P2\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x00)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif (lc != (short) 11)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\tbyte offset = (ISO7816.OFFSET_CDATA + 0x01);\r\n\t\t//byte offset = (byte)(ISO7816.OFFSET_CDATA + 0x01);\r\n\t\t// create keypair using parameters given:\r\n\t\t// short keyLength = Util.makeShort(buffer[ISO7816.OFFSET_CDATA],\r\n\t\t// buffer[offset]);\r\n\t\tif (buffer[offset] != (byte) 0x80)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// This is commented out as changing exponent makes getting modulus\r\n\t\t// impossible on some java cards\r\n\t\t// ((RSAPublicKey)tempkp.getPublic()).setExponent(buffer, (short)(13),\r\n\t\t// (short)3);\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\tsetPreviousApduType(GENERATE_KEY_PAIR);\r\n\t\tswitch (buffer[ISO7816.OFFSET_P2]) {\r\n\t\tcase BASIC:\r\n\t\t\tbasicKeyPair = new KeyPair(KeyPair.ALG_RSA_CRT, (short) (1024));\r\n\t\t\tbasicKeyPair.genKeyPair();\r\n\t\t\t\r\n\t\t\tbreak;\r\n\t\tcase AUTHENTICATION: // use authentication private key\r\n\t\t\tauthKeyPair = new KeyPair(KeyPair.ALG_RSA_CRT, (short) (1024));\r\n\t\t\tauthKeyPair.genKeyPair();\r\n\t\t\t\r\n\t\t\tbreak;\r\n\t\tcase NON_REPUDIATION: // use non repudiation private key\r\n\t\t\tnonRepKeyPair = new KeyPair(KeyPair.ALG_RSA_CRT, (short) (1024));\r\n\t\t\tnonRepKeyPair.genKeyPair();\r\n\t\t\t\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\t\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}", "public ISOCommandAPDU(byte classByte, byte instruction, byte p1, byte p2, byte[] data, int le) {\n this(data.length+5+4, classByte, instruction, p1, p2, data, le); // 5 = max overhead for coding data; 4 = header bytes\n }", "private void activate(APDU apdu) {\r\n\t\tcheckState(STATE_PERSONALIZED);\r\n\t\t// Already active\r\n\t\tif (image.isActive())\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\tif (!mPIN.isValidated())\r\n\t\t\tISOException.throwIt(SW_PIN_VERIFICATION_REQUIRED);\r\n\t\t// for each personalized sector\r\n\t\tfor (byte sector = 0x00; sector < image.getSectorsNumber(); sector++)\r\n\t\t\tif (image.isSectorPersonalized(sector))\r\n\t\t\t\tfor (block = 0x00; block < (image.getBlocksNumber(sector) - 0x01); block++) {\r\n\t\t\t\t\t// (sector 0: block 0) and (sector k : trailer block) cannot\r\n\t\t\t\t\t// be read.\r\n\t\t\t\t\tif (sector == 0x00 && block == 0x00)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tmiFareAccess.readData(image.getImage(),\r\n\t\t\t\t\t\t\timage.getBlockOffset(sector, block),\r\n\t\t\t\t\t\t\timage.getPassword(),\r\n\t\t\t\t\t\t\timage.getPasswordOffset(sector),\r\n\t\t\t\t\t\t\tMiFareImage.PASSWORD_LENGTH, sector, block,\r\n\t\t\t\t\t\t\tMiFareImage.BLOCK_LENGTH);\r\n\t\t\t\t}\r\n\t\timage.setActive(true);\r\n\t}", "@Test(timeout = 4000)\n public void test31() throws Throwable {\n FileUtil fileUtil0 = new FileUtil();\n FileInputStream fileInputStream0 = fileUtil0.fetchASINFile(\"\", \"yZL[{3\", \"}*]Brf}>keea3q5#\", \"9<#s%7P.sU/In~q\");\n assertNull(fileInputStream0);\n }", "public void process( APDU apdu ) throws ISOException\n {\n //A reference to the buffer, where the APDU data is stored, is retrieved.\n byte[] buffer = apdu.getBuffer();\n\n //If the APDU selects the applet, no further processing is required.\n if ( this.selectingApplet() )\n return;\n\n //Check whether the indicated class of instructions is compatible with this applet.\n if ( buffer[ ISO7816.OFFSET_CLA ] != IDENTITY_CARD_CLA ) ISOException.throwIt( ISO7816.SW_CLA_NOT_SUPPORTED );\n //A switch statement is used to select a method depending on the instruction\n switch ( buffer[ ISO7816.OFFSET_INS ] )\n {\n case SHOULD_UPDATE_TIME_INS:\n shouldUpdateTime( apdu );\n break;\n case UPDATE_TIME_INS:\n updateTime( apdu );\n break;\n case CLEAR_INPUT_BUFFER_INS:\n currentInBufferOffset = 0;\n apdu.setOutgoing();\n apdu.setOutgoingLength( ( short ) 1 );\n apdu.sendBytesLong( new byte[]{ 0 }, ( short ) 0, ( short ) 1 );\n break;\n case UPDATE_INPUT_BUFFER_INS:\n updateBuffer( apdu );\n break;\n case GET_OUTPUT_BUFFER_INS:\n getOutputBufferChunk( apdu );\n break;\n case AUTHENTICATE_SP_INS:\n authenticateSP( apdu );\n break;\n case CONFIRM_CHALLENGE_INS:\n confirmChallenge( apdu );\n break;\n case AUTHENTICATE_CARD_INS:\n authenticateCard( apdu );\n break;\n case ATTRIBUTE_QUERY_INS:\n attributeQuery( apdu );\n break;\n //If no matching instructions are found it is indicated in the status word of the response.\n //This can be done by using this method. As an argument a short is given that indicates\n //the type of warning. There are several predefined warnings in the 'ISO7816' class.\n default:\n ISOException.throwIt( ISO7816.SW_INS_NOT_SUPPORTED );\n }\n }", "private void initializeFileSystem() \r\n \t /*@ requires identityFile |-> _ &*& identityFileSignature |-> _ &*& addressFile |-> _ &*& addressFileSignature |-> _\r\n\t\t\t &*& caRoleIDFile |-> _ &*& preferencesFile |-> _ &*& idDirectory |-> _\r\n\t\t\t &*& certificateDirectoryFile |-> _ &*& privateKeyDirectoryFile |-> _ &*& authenticationObjectDirectoryFile |-> _ &*& objectDirectoryFile |-> _\r\n\t\t\t &*& tokenInfo |-> _ &*& belpicDirectory |-> _ &*& dirFile |-> _\r\n\t\t\t &*& masterFile |-> _ &*& selectedFile |-> _;\r\n\t @*/\r\n \t/*@ ensures dirFile |-> ?theDirFile &*& theDirFile.ElementaryFile(_, _, ?dirFileData, _, _, _) &*& theDirFile != null \r\n \t &*& dirFileData != null &*& dirFileData.length == 0x25\r\n\t &*& belpicDirectory |-> ?theBelpicDirectory &*& theBelpicDirectory.DedicatedFile(_, _, _, ?belpic_siblings, _) &*& theBelpicDirectory != null\r\n\t &*& tokenInfo |-> ?theTokenInfo &*& theTokenInfo.ElementaryFile(_, _, ?tokenInfoData, _, _, _) &*& theTokenInfo != null\r\n\t &*& tokenInfoData != null &*& tokenInfoData.length == 0x30\r\n\t &*& objectDirectoryFile |-> ?theObjectDirectoryFile &*& theObjectDirectoryFile.ElementaryFile(_, _, ?objectDirectoryFileData, _, _, _) &*& theObjectDirectoryFile != null\r\n\t &*& objectDirectoryFileData != null &*& objectDirectoryFileData.length == 40\r\n\t &*& authenticationObjectDirectoryFile |-> ?theAuthenticationObjectDirectoryFile &*& theAuthenticationObjectDirectoryFile.ElementaryFile(_, _, ?authenticationObjectDirectoryFileData, _, _, _) &*& theAuthenticationObjectDirectoryFile != null\r\n\t &*& authenticationObjectDirectoryFileData != null &*& authenticationObjectDirectoryFileData.length == 0x40\r\n\t &*& privateKeyDirectoryFile |-> ?thePrivateKeyDirectoryFile &*& thePrivateKeyDirectoryFile.ElementaryFile(_, _, ?privateKeyDirectoryFileData, _, _, _) &*& thePrivateKeyDirectoryFile != null\r\n\t &*& privateKeyDirectoryFileData != null &*& privateKeyDirectoryFileData.length == 0xB0\r\n\t &*& certificateDirectoryFile |-> ?theCertificateDirectoryFile &*& theCertificateDirectoryFile.ElementaryFile(_, _, ?certificateDirectoryFileData, _, _, _) &*& theCertificateDirectoryFile != null\r\n\t &*& certificateDirectoryFileData != null &*& certificateDirectoryFileData.length == 0xB0\r\n\t &*& idDirectory |-> ?theIdDirectory &*& theIdDirectory.DedicatedFile(_, _, _, ?idDirectory_siblings, _) &*& theIdDirectory != null\r\n\t &*& identityFile |-> ?theIdentityFile &*& theIdentityFile.ElementaryFile(_, _, ?identityData, _, _, _) &*& theIdentityFile != null\r\n\t &*& identityData != null &*& identityData.length == 0xD0\r\n\t &*& identityFileSignature |-> ?theIdentityFileSignature &*& theIdentityFileSignature.ElementaryFile(_, _, ?identitySignatureData, _, _, _) &*& theIdentityFileSignature != null\r\n\t &*& identitySignatureData != null &*& identitySignatureData.length == 0x80\r\n\t &*& addressFile |-> ?theAddressFile &*& theAddressFile.ElementaryFile(_, _, ?addressFileData, _, _, _) &*& theAddressFile != null\r\n\t &*& addressFileData != null &*& addressFileData.length == 117\r\n\t &*& addressFileSignature |-> ?theAddressFileSignature &*& theAddressFileSignature.ElementaryFile(_, _, ?addressFileSignatureData, _, _, _) &*& theAddressFileSignature != null\r\n\t &*& addressFileSignatureData != null &*& addressFileSignatureData.length == 128\r\n\t &*& caRoleIDFile |-> ?theCaRoleIDFile &*& theCaRoleIDFile.ElementaryFile(_, _, ?caRoldIDFileData, _, _, _) &*& theCaRoleIDFile != null\r\n\t &*& caRoldIDFileData != null &*& caRoldIDFileData.length == 0x20\r\n\t &*& preferencesFile |-> ?thePreferencesFile &*& thePreferencesFile.ElementaryFile(_, _, ?preferencesFileData, _, _, _) &*& thePreferencesFile != null\r\n\t &*& preferencesFileData != null &*& preferencesFileData.length == 100\r\n\t &*& masterFile |-> ?theMasterFile &*& theMasterFile.MasterFile(0x3F00, null, _, ?master_siblings, _) &*& theMasterFile != null\r\n\t &*& master_siblings == cons<File>(theDirFile, cons(theBelpicDirectory, cons(theIdDirectory, nil)))\r\n\t &*& belpic_siblings == cons<File>(theTokenInfo, cons(theObjectDirectoryFile, cons(theAuthenticationObjectDirectoryFile, cons(thePrivateKeyDirectoryFile, cons(theCertificateDirectoryFile,nil)))))\r\n\t &*& idDirectory_siblings == cons<File>(theIdentityFile, cons(theIdentityFileSignature, cons(theAddressFile, cons(theAddressFileSignature, cons(theCaRoleIDFile, cons(thePreferencesFile, nil))))))\r\n\t &*& selectedFile |-> theMasterFile &*& theBelpicDirectory.getClass() == DedicatedFile.class &*& theIdDirectory.getClass() == DedicatedFile.class;\r\n\t @*/\r\n\t{\r\n\t\tmasterFile = new MasterFile();\r\n\t\t/*\r\n\t\t * initialize PKCS#15 data structures see\r\n\t\t * \"5. PKCS#15 information details\" for more info\r\n\t\t */\r\n\t\t\r\n\t\t//@ masterFile.castMasterToDedicated();\r\n\t\t\r\n\t\tdirFile = new ElementaryFile(EF_DIR, masterFile, (short) 0x25);\r\n\t\tbelpicDirectory = new DedicatedFile(DF_BELPIC, masterFile);\r\n\t\ttokenInfo = new ElementaryFile(TOKENINFO, belpicDirectory, (short) 0x30);\r\n\t\tobjectDirectoryFile = new ElementaryFile(ODF, belpicDirectory, (short) 40);\r\n\t\tauthenticationObjectDirectoryFile = new ElementaryFile(AODF, belpicDirectory, (short) 0x40);\r\n\t\tprivateKeyDirectoryFile = new ElementaryFile(PRKDF, belpicDirectory, (short) 0xB0);\r\n\t\tcertificateDirectoryFile = new ElementaryFile(CDF, belpicDirectory, (short) 0xB0);\r\n\t\tidDirectory = new DedicatedFile(DF_ID, masterFile);\r\n\t\t/*\r\n\t\t * initialize all citizen data stored on the eID card copied from sample\r\n\t\t * eID card 000-0000861-85\r\n\t\t */\r\n\t\t// initialize ID#RN EF\r\n\t\tidentityFile = new ElementaryFile(IDENTITY, idDirectory, (short) 0xD0);\r\n\t\t// initialize SGN#RN EF\r\n\t\tidentityFileSignature = new ElementaryFile(SGN_IDENTITY, idDirectory, (short) 0x80);\r\n\t\t// initialize ID#Address EF\r\n\t\t// address is 117 bytes, and should be padded with zeros\r\n\t\taddressFile = new ElementaryFile(ADDRESS, idDirectory, (short) 117);\r\n\t\t// initialize SGN#Address EF\r\n\t\taddressFileSignature = new ElementaryFile(SGN_ADDRESS, idDirectory, (short) 128);\r\n\t\t// initialize PuK#7 ID (CA Role ID) EF\r\n\t\tcaRoleIDFile = new ElementaryFile(CA_ROLE_ID, idDirectory, (short) 0x20);\r\n\t\t// initialize Preferences EF to 100 zero bytes\r\n\t\tpreferencesFile = new ElementaryFile(PREFERENCES, idDirectory, (short) 100);\r\n\t\t\r\n\t\tselectedFile = masterFile;\r\n\t\t//@ masterFile.castDedicatedToMaster();\r\n\t}", "public ISOCommandAPDU(int size, byte classByte, byte instruction, byte p1, byte p2, byte[] data, int le) {\n super(size);\n // initialize properly for encoding\n this.le = le;\n this.lc = (data == null ? 0 : data.length);\n // encode\n byte[] body = this.encode(data);\n int L = (body == null ? 0 : body.length);\n // fill buffer\n this.apdu_buffer[CLASS] = classByte;\n this.apdu_buffer[INSTRUCTION] = instruction;\n this.apdu_buffer[P1] = p1;\n this.apdu_buffer[P2] = p2;\n if (body != null)\n System.arraycopy(body, 0, this.apdu_buffer, 4, L);\n\n this.apdu_length = 4+L;\n }", "public static byte[] getAPDUBuffer() {\n return getAPDUBuffer(currentTI.getAPDUBuffer());\n }", "@Test\n public void readFullFile() throws Exception {\n long checksumExpected = populateInputFile(((ReadHandlerTest.CHUNK_SIZE) * 10), 0, (((ReadHandlerTest.CHUNK_SIZE) * 10) - 1));\n mReadHandler.onNext(buildReadRequest(0, ((ReadHandlerTest.CHUNK_SIZE) * 10)));\n checkAllReadResponses(mResponses, checksumExpected);\n }", "@Test(timeout = 4000)\n public void test32() throws Throwable {\n FileUtil fileUtil0 = new FileUtil();\n File file0 = fileUtil0.getASINFile(\"\", \"v<B(aXlp#d/?cL2Q??\", \"i@\", \"g_\");\n assertNull(file0);\n }", "private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}", "public void process(APDU apdu) {\n byte []buffer = apdu.getBuffer();\n byte numBytes = buffer[ISO7816.OFFSET_LC];\n \n // 0X9000 status\n if(selectingApplet()){\n if ( pin.getTriesRemaining() == 0 ){\n ISOException.throwIt(SW_PIN_VERIFICATION_REQUIRED);\n }\n ISOException.throwIt(ISO7816.SW_NO_ERROR);\n }\n \n // Handle incorrect value of CLA\n if(buffer[ISO7816.OFFSET_CLA] != PENAZENKA_CLA){\n ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);\n }\n \n switch(buffer[ISO7816.OFFSET_INS]){\n \n case RETURN_NAME: return_name(apdu); \n return;\n \n case ACCEPT: accept(apdu); \n return;\n \n case SEND_BACK: send_back(apdu); \n return;\n \n case VERIFY_PIN: verify_pin(apdu);\n return;\n \n case HASH_DATA: hash_data(apdu);\n return;\n \n case RETURN_HASH: return_hash(apdu);\n return;\n \n case SIGN_DATA: sign_data(apdu);\n return;\n \n case VERIFY_SIGN: verify_signature(apdu);\n return;\n \n // Handle an incorrect value of INS \n default:\n ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);\n }\n }", "protected void migrateOnDemand () {\n\t\ttry {\n\t\t\tif (fso.fileExists(prefix+\".fat\") && !fso.fileExists(prefix+EXTENSIONS[UBM_FILE])) {\n\t\t\t\tRandomAccessFile ubm, meta, ctr, rbm;\n\t\t\t\tInputStream inputStream;\n\t\t\t\tOutputStream outputStream;\n\n\t\t\t\tfso.renameFile(prefix+\".fat\",prefix+EXTENSIONS[UBM_FILE]);\n\n\t\t\t\tubm = fso.openFile(prefix+EXTENSIONS[UBM_FILE], \"rw\");\n\t\t\t\tmeta = fso.openFile(prefix+EXTENSIONS[MTD_FILE], \"rw\");\n\t\t\t\tctr = fso.openFile(prefix+EXTENSIONS[CTR_FILE], \"rw\");\n\t\t\t\tubm.seek(ubm.length()-16);\n\t\t\t\tmeta.writeInt(blockSize = ubm.readInt());\n\t\t\t\tmeta.writeInt(size = ubm.readInt());\n\t\t\t\tctr.setLength(ubm.readLong()+blockSize);\t// maxOffset\n\t\t\t\tctr.close();\n\t\t\t\tmeta.close();\n\t\t\t\tubm.setLength(ubm.length()-16);\n\n\t\t\t\tubm.seek(0);\n\t\t\t\trbm = fso.openFile(prefix+EXTENSIONS[UBM_FILE], \"rw\");\n\t\t\t\tinputStream = new BufferedInputStream(new RandomAccessFileInputStream(ubm));\n\t\t\t\toutputStream = new BufferedOutputStream(new RandomAccessFileOutputStream(rbm));\n\t\t\t\tfor (int b; (b = inputStream.read())!=-1;)\n\t\t\t\t\toutputStream.write(b);\n\t\t\t\toutputStream.close();\n\t\t\t\tinputStream.close();\n\t\t\t\trbm.close();\n\t\t\t\tubm.close();\n\t\t\t}\n\t\t}\n\t\tcatch (IOException ie) {\n\t\t\tthrow new WrappingRuntimeException(ie);\n\t\t}\n\t}", "@Test\n public void readPartialFile() throws Exception {\n long start = 3;\n long end = ((ReadHandlerTest.CHUNK_SIZE) * 10) - 99;\n long checksumExpected = populateInputFile(((ReadHandlerTest.CHUNK_SIZE) * 10), start, end);\n mReadHandler.onNext(buildReadRequest(start, ((end + 1) - start)));\n checkAllReadResponses(mResponses, checksumExpected);\n }", "protected void initFile(String id) throws FormatException, IOException {\n // normalize file name\n super.initFile(normalizeFilename(null, id));\n id = currentId;\n String dir = new File(id).getParent();\n\n // parse and populate OME-XML metadata\n String fileName = new Location(id).getAbsoluteFile().getAbsolutePath();\n RandomAccessInputStream ras = new RandomAccessInputStream(fileName);\n String xml;\n IFD firstIFD;\n try {\n TiffParser tp = new TiffParser(ras);\n firstIFD = tp.getFirstIFD();\n xml = firstIFD.getComment();\n }\n finally {\n ras.close();\n }\n\n if (service == null) setupService();\n OMEXMLMetadata meta;\n try {\n meta = service.createOMEXMLMetadata(xml);\n }\n catch (ServiceException se) {\n throw new FormatException(se);\n }\n\n hasSPW = meta.getPlateCount() > 0;\n\n for (int i=0; i<meta.getImageCount(); i++) {\n int sizeC = meta.getPixelsSizeC(i).getValue().intValue();\n service.removeChannels(meta, i, sizeC);\n }\n\n // TODO\n //Hashtable originalMetadata = meta.getOriginalMetadata();\n //if (originalMetadata != null) metadata = originalMetadata;\n\n LOGGER.trace(xml);\n\n if (meta.getRoot() == null) {\n throw new FormatException(\"Could not parse OME-XML from TIFF comment\");\n }\n\n String[] acquiredDates = new String[meta.getImageCount()];\n for (int i=0; i<acquiredDates.length; i++) {\n acquiredDates[i] = meta.getImageAcquiredDate(i);\n }\n\n String currentUUID = meta.getUUID();\n service.convertMetadata(meta, metadataStore);\n\n // determine series count from Image and Pixels elements\n int seriesCount = meta.getImageCount();\n core = new CoreMetadata[seriesCount];\n for (int i=0; i<seriesCount; i++) {\n core[i] = new CoreMetadata();\n }\n info = new OMETiffPlane[seriesCount][];\n\n tileWidth = new int[seriesCount];\n tileHeight = new int[seriesCount];\n\n // compile list of file/UUID mappings\n Hashtable<String, String> files = new Hashtable<String, String>();\n boolean needSearch = false;\n for (int i=0; i<seriesCount; i++) {\n int tiffDataCount = meta.getTiffDataCount(i);\n for (int td=0; td<tiffDataCount; td++) {\n String uuid = null;\n try {\n uuid = meta.getUUIDValue(i, td);\n }\n catch (NullPointerException e) { }\n String filename = null;\n if (uuid == null) {\n // no UUID means that TiffData element refers to this file\n uuid = \"\";\n filename = id;\n }\n else {\n filename = meta.getUUIDFileName(i, td);\n if (!new Location(dir, filename).exists()) filename = null;\n if (filename == null) {\n if (uuid.equals(currentUUID) || currentUUID == null) {\n // UUID references this file\n filename = id;\n }\n else {\n // will need to search for this UUID\n filename = \"\";\n needSearch = true;\n }\n }\n else filename = normalizeFilename(dir, filename);\n }\n String existing = files.get(uuid);\n if (existing == null) files.put(uuid, filename);\n else if (!existing.equals(filename)) {\n throw new FormatException(\"Inconsistent UUID filenames\");\n }\n }\n }\n\n // search for missing filenames\n if (needSearch) {\n Enumeration en = files.keys();\n while (en.hasMoreElements()) {\n String uuid = (String) en.nextElement();\n String filename = files.get(uuid);\n if (filename.equals(\"\")) {\n // TODO search...\n // should scan only other .ome.tif files\n // to make this work with OME server may be a little tricky?\n throw new FormatException(\"Unmatched UUID: \" + uuid);\n }\n }\n }\n\n // build list of used files\n Enumeration en = files.keys();\n int numUUIDs = files.size();\n HashSet fileSet = new HashSet(); // ensure no duplicate filenames\n for (int i=0; i<numUUIDs; i++) {\n String uuid = (String) en.nextElement();\n String filename = files.get(uuid);\n fileSet.add(filename);\n }\n used = new String[fileSet.size()];\n Iterator iter = fileSet.iterator();\n for (int i=0; i<used.length; i++) used[i] = (String) iter.next();\n\n // process TiffData elements\n Hashtable<String, IFormatReader> readers =\n new Hashtable<String, IFormatReader>();\n for (int i=0; i<seriesCount; i++) {\n int s = i;\n LOGGER.debug(\"Image[{}] {\", i);\n LOGGER.debug(\" id = {}\", meta.getImageID(i));\n\n String order = meta.getPixelsDimensionOrder(i).toString();\n\n PositiveInteger samplesPerPixel = null;\n if (meta.getChannelCount(i) > 0) {\n samplesPerPixel = meta.getChannelSamplesPerPixel(i, 0);\n }\n int samples = samplesPerPixel == null ? -1 : samplesPerPixel.getValue();\n int tiffSamples = firstIFD.getSamplesPerPixel();\n\n boolean adjustedSamples = false;\n if (samples != tiffSamples) {\n LOGGER.warn(\"SamplesPerPixel mismatch: OME={}, TIFF={}\",\n samples, tiffSamples);\n samples = tiffSamples;\n adjustedSamples = true;\n }\n\n if (adjustedSamples && meta.getChannelCount(i) <= 1) {\n adjustedSamples = false;\n }\n\n int effSizeC = meta.getPixelsSizeC(i).getValue().intValue();\n if (!adjustedSamples) {\n effSizeC /= samples;\n }\n if (effSizeC == 0) effSizeC = 1;\n if (effSizeC * samples != meta.getPixelsSizeC(i).getValue().intValue()) {\n effSizeC = meta.getPixelsSizeC(i).getValue().intValue();\n }\n int sizeT = meta.getPixelsSizeT(i).getValue().intValue();\n int sizeZ = meta.getPixelsSizeZ(i).getValue().intValue();\n int num = effSizeC * sizeT * sizeZ;\n\n OMETiffPlane[] planes = new OMETiffPlane[num];\n for (int no=0; no<num; no++) planes[no] = new OMETiffPlane();\n\n int tiffDataCount = meta.getTiffDataCount(i);\n boolean zOneIndexed = false;\n boolean cOneIndexed = false;\n boolean tOneIndexed = false;\n\n // pre-scan TiffData indices to see if any of them are indexed from 1\n\n for (int td=0; td<tiffDataCount; td++) {\n NonNegativeInteger firstC = meta.getTiffDataFirstC(i, td);\n NonNegativeInteger firstT = meta.getTiffDataFirstT(i, td);\n NonNegativeInteger firstZ = meta.getTiffDataFirstZ(i, td);\n int c = firstC == null ? 0 : firstC.getValue();\n int t = firstT == null ? 0 : firstT.getValue();\n int z = firstZ == null ? 0 : firstZ.getValue();\n\n if (c >= effSizeC) cOneIndexed = true;\n if (z >= sizeZ) zOneIndexed = true;\n if (t >= sizeT) tOneIndexed = true;\n }\n\n for (int td=0; td<tiffDataCount; td++) {\n LOGGER.debug(\" TiffData[{}] {\", td);\n // extract TiffData parameters\n String filename = null;\n String uuid = null;\n try {\n filename = meta.getUUIDFileName(i, td);\n } catch (NullPointerException e) {\n LOGGER.debug(\"Ignoring null UUID object when retrieving filename.\");\n }\n try {\n uuid = meta.getUUIDValue(i, td);\n } catch (NullPointerException e) {\n LOGGER.debug(\"Ignoring null UUID object when retrieving value.\");\n }\n NonNegativeInteger tdIFD = meta.getTiffDataIFD(i, td);\n int ifd = tdIFD == null ? 0 : tdIFD.getValue();\n NonNegativeInteger numPlanes = meta.getTiffDataPlaneCount(i, td);\n NonNegativeInteger firstC = meta.getTiffDataFirstC(i, td);\n NonNegativeInteger firstT = meta.getTiffDataFirstT(i, td);\n NonNegativeInteger firstZ = meta.getTiffDataFirstZ(i, td);\n int c = firstC == null ? 0 : firstC.getValue();\n int t = firstT == null ? 0 : firstT.getValue();\n int z = firstZ == null ? 0 : firstZ.getValue();\n\n // NB: some writers index FirstC, FirstZ and FirstT from 1\n if (cOneIndexed) c--;\n if (zOneIndexed) z--;\n if (tOneIndexed) t--;\n\n int index = FormatTools.getIndex(order,\n sizeZ, effSizeC, sizeT, num, z, c, t);\n int count = numPlanes == null ? 1 : numPlanes.getValue();\n if (count == 0) {\n core[s] = null;\n break;\n }\n\n // get reader object for this filename\n if (filename == null) {\n if (uuid == null) filename = id;\n else filename = files.get(uuid);\n }\n else filename = normalizeFilename(dir, filename);\n IFormatReader r = readers.get(filename);\n if (r == null) {\n r = new MinimalTiffReader();\n readers.put(filename, r);\n }\n\n Location file = new Location(filename);\n if (!file.exists()) {\n // if this is an absolute file name, try using a relative name\n // old versions of OMETiffWriter wrote an absolute path to\n // UUID.FileName, which causes problems if the file is moved to\n // a different directory\n filename =\n filename.substring(filename.lastIndexOf(File.separator) + 1);\n filename = dir + File.separator + filename;\n\n if (!new Location(filename).exists()) {\n filename = currentId;\n }\n }\n\n // populate plane index -> IFD mapping\n for (int q=0; q<count; q++) {\n int no = index + q;\n planes[no].reader = r;\n planes[no].id = filename;\n planes[no].ifd = ifd + q;\n planes[no].certain = true;\n LOGGER.debug(\" Plane[{}]: file={}, IFD={}\",\n new Object[] {no, planes[no].id, planes[no].ifd});\n }\n if (numPlanes == null) {\n // unknown number of planes; fill down\n for (int no=index+1; no<num; no++) {\n if (planes[no].certain) break;\n planes[no].reader = r;\n planes[no].id = filename;\n planes[no].ifd = planes[no - 1].ifd + 1;\n LOGGER.debug(\" Plane[{}]: FILLED\", no);\n }\n }\n else {\n // known number of planes; clear anything subsequently filled\n for (int no=index+count; no<num; no++) {\n if (planes[no].certain) break;\n planes[no].reader = null;\n planes[no].id = null;\n planes[no].ifd = -1;\n LOGGER.debug(\" Plane[{}]: CLEARED\", no);\n }\n }\n LOGGER.debug(\" }\");\n }\n\n if (core[s] == null) continue;\n\n // verify that all planes are available\n LOGGER.debug(\" --------------------------------\");\n for (int no=0; no<num; no++) {\n LOGGER.debug(\" Plane[{}]: file={}, IFD={}\",\n new Object[] {no, planes[no].id, planes[no].ifd});\n if (planes[no].reader == null) {\n LOGGER.warn(\"Image ID '{}': missing plane #{}. \" +\n \"Using TiffReader to determine the number of planes.\",\n meta.getImageID(i), no);\n TiffReader r = new TiffReader();\n r.setId(currentId);\n try {\n planes = new OMETiffPlane[r.getImageCount()];\n for (int plane=0; plane<planes.length; plane++) {\n planes[plane] = new OMETiffPlane();\n planes[plane].id = currentId;\n planes[plane].reader = r;\n planes[plane].ifd = plane;\n }\n num = planes.length;\n }\n finally {\n r.close();\n }\n }\n }\n LOGGER.debug(\" }\");\n\n // populate core metadata\n info[s] = planes;\n try {\n if (!info[s][0].reader.isThisType(info[s][0].id)) {\n info[s][0].id = currentId;\n }\n for (int plane=0; plane<info[s].length; plane++) {\n if (!info[s][plane].reader.isThisType(info[s][plane].id)) {\n info[s][plane].id = info[s][0].id;\n }\n }\n\n info[s][0].reader.setId(info[s][0].id);\n tileWidth[s] = info[s][0].reader.getOptimalTileWidth();\n tileHeight[s] = info[s][0].reader.getOptimalTileHeight();\n\n core[s].sizeX = meta.getPixelsSizeX(i).getValue().intValue();\n int tiffWidth = (int) firstIFD.getImageWidth();\n if (core[s].sizeX != tiffWidth) {\n LOGGER.warn(\"SizeX mismatch: OME={}, TIFF={}\",\n core[s].sizeX, tiffWidth);\n }\n core[s].sizeY = meta.getPixelsSizeY(i).getValue().intValue();\n int tiffHeight = (int) firstIFD.getImageLength();\n if (core[s].sizeY != tiffHeight) {\n LOGGER.warn(\"SizeY mismatch: OME={}, TIFF={}\",\n core[s].sizeY, tiffHeight);\n }\n core[s].sizeZ = meta.getPixelsSizeZ(i).getValue().intValue();\n core[s].sizeC = meta.getPixelsSizeC(i).getValue().intValue();\n core[s].sizeT = meta.getPixelsSizeT(i).getValue().intValue();\n core[s].pixelType = FormatTools.pixelTypeFromString(\n meta.getPixelsType(i).toString());\n int tiffPixelType = firstIFD.getPixelType();\n if (core[s].pixelType != tiffPixelType) {\n LOGGER.warn(\"PixelType mismatch: OME={}, TIFF={}\",\n core[s].pixelType, tiffPixelType);\n core[s].pixelType = tiffPixelType;\n }\n core[s].imageCount = num;\n core[s].dimensionOrder = meta.getPixelsDimensionOrder(i).toString();\n\n // hackish workaround for files exported by OMERO that have an\n // incorrect dimension order\n String uuidFileName = \"\";\n try {\n if (meta.getTiffDataCount(i) > 0) {\n uuidFileName = meta.getUUIDFileName(i, 0);\n }\n }\n catch (NullPointerException e) { }\n if (meta.getChannelCount(i) > 0 && meta.getChannelName(i, 0) == null &&\n meta.getTiffDataCount(i) > 0 &&\n uuidFileName.indexOf(\"__omero_export\") != -1)\n {\n core[s].dimensionOrder = \"XYZCT\";\n }\n\n core[s].orderCertain = true;\n PhotoInterp photo = firstIFD.getPhotometricInterpretation();\n core[s].rgb = samples > 1 || photo == PhotoInterp.RGB;\n if ((samples != core[s].sizeC && (samples % core[s].sizeC) != 0 &&\n (core[s].sizeC % samples) != 0) || core[s].sizeC == 1 ||\n adjustedSamples)\n {\n core[s].sizeC *= samples;\n }\n\n if (core[s].sizeZ * core[s].sizeT * core[s].sizeC >\n core[s].imageCount && !core[s].rgb)\n {\n if (core[s].sizeZ == core[s].imageCount) {\n core[s].sizeT = 1;\n core[s].sizeC = 1;\n }\n else if (core[s].sizeT == core[s].imageCount) {\n core[s].sizeZ = 1;\n core[s].sizeC = 1;\n }\n else if (core[s].sizeC == core[s].imageCount) {\n core[s].sizeT = 1;\n core[s].sizeZ = 1;\n }\n }\n\n if (meta.getPixelsBinDataCount(i) > 1) {\n LOGGER.warn(\"OME-TIFF Pixels element contains BinData elements! \" +\n \"Ignoring.\");\n }\n core[s].littleEndian = firstIFD.isLittleEndian();\n core[s].interleaved = false;\n core[s].indexed = photo == PhotoInterp.RGB_PALETTE &&\n firstIFD.getIFDValue(IFD.COLOR_MAP) != null;\n if (core[s].indexed) {\n core[s].rgb = false;\n }\n core[s].falseColor = true;\n core[s].metadataComplete = true;\n }\n catch (NullPointerException exc) {\n throw new FormatException(\"Incomplete Pixels metadata\", exc);\n }\n }\n\n // remove null CoreMetadata entries\n\n Vector<CoreMetadata> series = new Vector<CoreMetadata>();\n Vector<OMETiffPlane[]> planeInfo = new Vector<OMETiffPlane[]>();\n for (int i=0; i<core.length; i++) {\n if (core[i] != null) {\n series.add(core[i]);\n planeInfo.add(info[i]);\n }\n }\n core = series.toArray(new CoreMetadata[series.size()]);\n info = planeInfo.toArray(new OMETiffPlane[0][0]);\n\n MetadataTools.populatePixels(metadataStore, this, false, false);\n for (int i=0; i<acquiredDates.length; i++) {\n if (acquiredDates[i] != null) {\n metadataStore.setImageAcquiredDate(acquiredDates[i], i);\n }\n }\n metadataStore = getMetadataStoreForConversion();\n }", "public void process(APDU apdu) {\n\n byte[] buffer = apdu.getBuffer();\n // check SELECT APDU command\n if ((buffer[ISO7816.OFFSET_CLA] == 0) &&\n (buffer[ISO7816.OFFSET_INS] == (byte)(0xA4)) )\n return;\n // verify the reset of commands have the\n // correct CLA byte, which specifies the\n // command structure\n if (buffer[ISO7816.OFFSET_CLA] != Wallet_CLA)\n ISOException.throwIt\n(ISO7816.SW_CLA_NOT_SUPPORTED);\n switch (buffer[ISO7816.OFFSET_INS]) {\n case GET_BALANCE: getBalance(apdu);\n return;\n case DEBIT: debit(apdu);\n return;\n case CREDIT: credit(apdu);\n return;\n case VERIFY: verify(apdu);\n return;\n default: ISOException.throwIt\n (ISO7816.SW_INS_NOT_SUPPORTED);\n }\n\n }", "private void setInitialSourceFile()\n\t{\n\t\tint largestAuthoredId = -1;\n\t\tSourceFile[] files = m_fileInfo.getFileList();\n\t\tfor (int i=0; i<files.length; ++i)\n\t\t{\n\t\t\tSourceFile sf = files[i];\n\t\t\tif (sf.getId() > largestAuthoredId && getFileType(sf) == AUTHORED_FILE)\n\t\t\t\tlargestAuthoredId = sf.getId();\n\t\t}\n\t\tif (largestAuthoredId != -1)\n\t\t\tsetListingPosition(largestAuthoredId, 1);\n\t}", "public static byte[] BuildSelectApdu(String aid) {\r\n // Format: [CLASS | INSTRUCTION | PARAMETER 1 | PARAMETER 2 | LENGTH | DATA]\r\n return APDU.HexStringToByteArray(SELECT_APDU_HEADER + String.format(\"%02X\",\r\n aid.length() / 2) + aid);\r\n }", "private String initialFileSetup(String file_path, String user_id) {\n\n String[] path_components = file_path.split(\"/\");\n String desired_filename = path_components[path_components.length - 1];\n String absolute_path = new File(\"\").getAbsolutePath();\n absolute_path = absolute_path.concat(\"/Final\");\n new File(absolute_path).mkdirs();\n absolute_path = absolute_path.concat(\"/Pause\");\n new File(absolute_path).mkdirs();\n\n absolute_path = absolute_path.concat(\"/\".concat(user_id));\n new File(absolute_path).mkdirs();\n\n absolute_path = absolute_path.concat(\"/Pause_\".concat(desired_filename));\n\n return absolute_path;\n }", "public CardCommandAPDU(byte[] commandAPDU) {\n\tSystem.arraycopy(commandAPDU, 0, header, 0, 4);\n\tsetBody(ByteUtils.copy(commandAPDU, 4, commandAPDU.length - 4));\n }", "public byte getN_OF_FILE() throws CardException {\n\n if (!this.IC_ALREADY_SUBMIT) {\n this.SubmitIC();\n }\n\n //byte[] id = {(byte)0xFF, (byte)0x02};\n this.SelectFF02();\n\n byte n_of_file = this.__ReadRecord((byte)0, (byte)4)[2];\n System.out.println(\"Card contains \" + n_of_file + \" file.\");\n this.N_OF_FILE = n_of_file;\n return n_of_file;\n }", "public static void setAPDUBuffer(short length) {\n setAPDUBuffer(currentTI.getAPDUBuffer(), length);\n }", "alluxio.proto.journal.File.CompleteFileEntry getCompleteFile();", "public static void install( byte bArray[], short bOffset, byte bLength )\n throws ISOException\n {\n new IdentityCard();\n }", "private void generatePkcs1Md5Signature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// receive the data that needs to be signed\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc != 16) || (byteRead != 16))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// use the correct key\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t\r\n\t\tif (getSignatureType() == NON_REPUDIATION) {\t\t\r\n\t\t\tcipher.init((RSAPrivateCrtKey)nonRepKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\tif (getSignatureType() == AUTHENTICATION) {\r\n\t\t\tcipher.init((RSAPrivateCrtKey)authKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\tJCSystem.beginTransaction();\r\n\t\t\r\n\t\t////@ open valid(); // todo\r\n\t\t\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as);\r\n\t\t//@ foreachp_remove(messageBuffer, as);\r\n\t\t////@ open transient_byte_array(messageBuffer); // auto\r\n\t\t\r\n\t\t// prepare the message buffer to the PKCS#1 (v1.5) structure\r\n\t\t////@ open [1/2]valid();\r\n\t\tpreparePkcs1ClearText(messageBuffer, ALG_MD5_PKCS1, lc);\r\n\t\t// copy the MD5 hash from the APDU to the message buffer\r\n\t\tUtil.arrayCopy(buffer, (short) (ISO7816.OFFSET_CDATA), messageBuffer, (short) (128 - lc), lc);\r\n\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as);\r\n\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// generate signature\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as1);\r\n\t\t//@ foreachp_remove(messageBuffer, as1);\r\n\t\t//@ open transient_byte_array(messageBuffer);\r\n\t\tcipher.doFinal(messageBuffer, (short) 0, (short) 128, buffer, (short) 0);\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as1);\r\n\r\n\t\t////@ close [1/2]valid(); // auto\r\n\r\n\r\n\t}", "public static byte[] BuildSelectApdu(String aid) {\n // Format: [CLASS | INSTRUCTION | PARAMETER 1 | PARAMETER 2 | LENGTH | DATA]\n return HexStringToByteArray(SELECT_APDU_HEADER + String.format(\"%02X\", aid.length() / 2) + aid);\n }", "@Test(timeout = 4000)\n public void test28() throws Throwable {\n EvoSuiteFile evoSuiteFile0 = new EvoSuiteFile(\"/NULL__Z?WOZ.XML\");\n byte[] byteArray0 = new byte[9];\n FileSystemHandling.appendDataToFile(evoSuiteFile0, byteArray0);\n FileUtil fileUtil0 = new FileUtil();\n FileInputStream fileInputStream0 = fileUtil0.fetchBNFile((String) null, \"\", \"z?woZ\");\n assertEquals(9, fileInputStream0.available());\n }", "private void setKeys(APDU apdu) {\r\n\t\tcheckState(STATE_PERSONALIZED);\r\n\t\t// Can't set keys while in active state\r\n\t\tif (image.isActive())\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\tapdu.setIncomingAndReceive();\r\n\t\t// must be secured\r\n\t\tif (!apdu.isSecureMessagingCLA())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// Secured\r\n\t\tprocessSecureMessage(apdu);\r\n\t\t// buffer contains unwrapped and decrypted data\r\n\t\tbyte buffer[] = apdu.getBuffer();\r\n\t\t// Data field should contain number of sector (1 byte), type of key (1\r\n\t\t// byte)\r\n\t\t// and key itself (KEY_LENGTH)\r\n\t\tif (apdu.getIncomingLength() < (byte) (MiFareImage.KEY_LENGTH + 0x02))\r\n\t\t\tISOException.throwIt(ISO7816.SW_DATA_INVALID);\r\n\t\toffset = apdu.getOffsetCdata();\r\n\t\t// Setting key\r\n\t\timage.setKey(buffer, (short) (offset + 0x02), buffer[offset],\r\n\t\t\t\tbuffer[(byte) (offset + 0x01)]);\r\n\t}", "@Override\r\n public void completeElementContent() {\r\n numBytes = 0;\r\n String theElementValue = this.getText();\r\n this.mySequenceFragment = theElementValue;\r\n myByteSpecifierSequence = new ArrayList<ByteSeqSpecifier>();\r\n StringBuffer allSpecifiers = new StringBuffer(theElementValue);\r\n while (allSpecifiers.length() > 0) {\r\n try {\r\n ByteSeqSpecifier bss = new ByteSeqSpecifier(allSpecifiers);\r\n myByteSpecifierSequence.add(bss);\r\n numBytes += bss.getNumBytes();\r\n } catch (Exception e) {\r\n }\r\n }\r\n\r\n }", "public void initiate(Map<File, SummaryEntry> inputFilesBySelection, File outputFolder, FileType outputFileType, int totalNumberOfFiles) {\n assertDecryptionState(DecryptionState.INITIAL);\r\n\r\n this.inputFilesBySelection = inputFilesBySelection;\r\n this.outputFolder = outputFolder;\r\n this.totalNumberOfFiles = totalNumberOfFiles;\r\n this.totalNumberOfFilesStr = String.valueOf(totalNumberOfFiles);\r\n\r\n updateCurrentState(DecryptionState.PREPARED, totalNumberOfFilesStr);\r\n\r\n // and start the decryption process\r\n startDecryption(outputFileType);\r\n }", "private void getChallenge(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check P1 and P2\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x00 || buffer[ISO7816.OFFSET_P2] != (byte) 0x00)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t// inform the JCRE that the applet has data to return\r\n\t\tshort le = apdu.setOutgoing();\r\n\t\t// Le = 0 is not allowed\r\n\t\tif (le == 0)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\tRandomData random = EidCard.randomData;\r\n\t\t// generate random data and put it into buffer\r\n\t\trandom.generateData(randomBuffer, (short) 0, le);\r\n\t\t// set the actual number of outgoing data bytes\r\n\t\tapdu.setOutgoingLength(le);\r\n\t\t// send content of buffer in apdu\r\n\t\tapdu.sendBytesLong(randomBuffer, (short) 0, le);\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}", "private void createFiOrDi(Directory root, String type, int freeBlock) {\n\t\tif(Constants.DIRECTORY_FILE.equals(type)) {\n\t\t\tsector.put(freeBlock, new Directory());\n\t\t} else {\n\t\t\tsector.put(freeBlock, new Data());\n\t\t}\n\t}", "private int fillBuffer() throws IOException {\r\n int n = super.read(buffer, 0, BUF_SIZE);\r\n if (n >= 0) {\r\n file_pos +=n;\r\n buf_end = n;\r\n buf_pos = 0;\r\n }\r\n return n;\r\n }", "public void process(APDU apdu) {\n\t\t\n\t\tbyte[] buf = apdu.getBuffer();\n\t\t\n\t\t// Good practice: Return 9000 on SELECT\n\t\t// Returns control to JCRE when another SELECT comes\n\t\tif ((buf[ISO7816.OFFSET_CLA] == (byte) 0x00) &&\n\t\t\t(buf[ISO7816.OFFSET_INS] == (byte) 0xA4)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// If command APDU has wrong class of command\n\t\tif(buf[ISO7816.OFFSET_CLA] != Smartcard_CLA){\n\t\t\tISOException.throwIt(SW_CLA_NOT_SUPPORTED);\n\t\t}\n\t\t\t\n\t\t\n\t\t\n\t\tswitch (buf[ISO7816.OFFSET_INS]) {\n\t\tcase VERIFY_PIN:\n\t\t\tverifyPIN(apdu);\n\t\t\tbreak;\n\t\tcase GET_ALLOWANCE:\n\t\t\tgetAllowance(apdu);\n\t\t\tbreak;\n\t\tcase REFRESH_ALLOWANCE:\n\t\t\trefreshAllowance();\n\t\t\tbreak;\n\t\tcase DEBIT_ALLOWANCE:\n\t\t\tdebitAllowance(apdu);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// good practice: If you don't know the instruction, say so:\n\t\t\tISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);\n\t\t}\n\t}", "protected void openFiles() {\n\t\tthis.container = fso.openFile(prefix+EXTENSIONS[CTR_FILE],\"rw\");\n\t\tthis.metaData = fso.openFile(prefix+EXTENSIONS[MTD_FILE], \"rw\");\n\t\tthis.reservedBitMap = fso.openFile(prefix+EXTENSIONS[RBM_FILE], \"rw\");\n\t\tthis.updatedBitMap = fso.openFile(prefix+EXTENSIONS[UBM_FILE], \"rw\");\n\t\tthis.freeList = fso.openFile(prefix+EXTENSIONS[FLT_FILE], \"rw\");\n\t}", "public void loadTagBuffer() {\r\n\r\n try {\r\n bPtr = 0;\r\n\r\n if (raFile != null) {\r\n fLength = raFile.length();\r\n }\r\n\r\n if (fLength < FileDicomBaseInner.BUFFER_SIZE) {\r\n\r\n if (tagBuffer == null) {\r\n tagBuffer = new byte[(int) fLength];\r\n } else if (fLength > tagBuffer.length) {\r\n tagBuffer = new byte[(int) fLength];\r\n }\r\n } else if (tagBuffer == null) {\r\n tagBuffer = new byte[FileDicomBaseInner.BUFFER_SIZE];\r\n } else if (tagBuffer.length < FileDicomBaseInner.BUFFER_SIZE) {\r\n tagBuffer = new byte[FileDicomBaseInner.BUFFER_SIZE];\r\n }\r\n\r\n raFile.readFully(tagBuffer);\r\n } catch (final IOException ioE) {}\r\n }", "protected RecordHeader allocateRecord(String key, int dataLength) throws IOException {\n // search for empty space\n RecordHeader newRecord = null;\n\n for (RecordHeader next : getMemIndex().values()) {\n int free = next.getFreeSpace();\n if (dataLength <= next.getFreeSpace()) {\n newRecord = next.split();\n writeRecordHeaderToIndex(next);\n break;\n }\n }\n if (newRecord == null) {\n // append record to end of file - grows file to allocate space\n long fp = getFileLength();\n setFileLength(fp + dataLength);\n newRecord = new RecordHeader(fp, dataLength);\n }\n return newRecord;\n }", "private void fetch(byte[] target) throws IOException {\n\t\tint actuallyRead=0;\n\t\tint required=target.length;\n\t\tlog.debug(\"Need to read \"+required+\" to fill buffer\");\n\t\twhile(actuallyRead<required) {\n\t\t\tactuallyRead+=fromDevice.read(target,actuallyRead,required-actuallyRead);\n\t\t\tlog.debug(\"Now read \"+actuallyRead);\n\t\t}\n\t}", "public DocumentData parseData(byte[] data) throws Exception {\n if (data.length < 30) {\n throw new Exception(\"Unsupported barcode encoding\");\n }\n byte complianceIndicator = data[0];\n if (complianceIndicator == 0x40) {\n // May be AAMVA\n byte elementSeparator = data[1];\n byte recordSeparator = data[2];\n byte segmentTerminator = data[3];\n byte[] fileType = Arrays.copyOfRange(data, 4, 9);\n byte[] iin = Arrays.copyOfRange(data, 9, 15);\n int aamvaVersionNumber = dataToInt(Arrays.copyOfRange(data, 15, 17));\n AAMVASubfileParser subfileParser = new AAMVASubfileParser(aamvaVersionNumber, elementSeparator);\n byte[] jurisdictionVersionNumber = Arrays.copyOfRange(data, 17, 19);\n int numberOfEntries = dataToInt(Arrays.copyOfRange(data, 19, 21));\n int index = 21;\n AAMVADocumentData documentData = null;\n for (int i=0; i<numberOfEntries; i++) {\n String subfileType = new String(Arrays.copyOfRange(data, index, index+2), UTF8);\n int offset = dataToInt(Arrays.copyOfRange(data, index+2, index+6));\n int length = dataToInt(Arrays.copyOfRange(data, index+6, index+10));\n int start = Math.min(offset, data.length);\n int end = Math.min(offset+length, data.length);\n if (numberOfEntries == 1 && offset == 0) {\n start = data.length - length;\n end = data.length;\n }\n AAMVADocumentData subData = subfileParser.parseFields(Arrays.copyOfRange(data, start, end));\n if (documentData == null) {\n documentData = subData;\n } else {\n documentData.appendFieldsFrom(subData);\n }\n index += 10;\n }\n if (documentData == null || documentData.isEmpty()) {\n throw new Exception(\"Empty document\");\n }\n return documentData;\n } else if (data[0] == 0x25) {\n MagStripeDocumentData documentData = new MagStripeDocumentData();\n String track = new String(data, StandardCharsets.US_ASCII);\n String jurisdiction = track.substring(1, 3);\n documentData.setValue(new DataField(\"State/Province\", jurisdiction, jurisdiction), \"State/Province\");\n track = track.substring(3);\n String city = getStringToDelimiter(track, \"^\", 13);\n documentData.setValue(new DataField(\"City\", city, city), \"City\");\n track = track.substring(city.length());\n track = leftTrimString(track, \"^\");\n String name = getStringToDelimiter(track, \"^\", 35);\n String[] names = name.split(\"\\\\$\");\n if (names.length > 2) {\n documentData.setValue(new DataField(\"Title\", names[2], names[2].trim()), \"Title\");\n }\n if (names.length > 1) {\n documentData.setValue(new DataField(\"First name\", names[1], StringUtils.strip(names[1], \"/, \")), \"First name\");\n }\n if (names.length > 0) {\n documentData.setValue(new DataField(\"Last name\", names[0], StringUtils.strip(names[0], \"/, \")), \"Last name\");\n }\n track = track.substring(name.length());\n track = leftTrimString(track, \"^\");\n String address = getStringToDelimiter(track, \"^\", 77 - city.length() - name.length());\n address = getStringToDelimiter(address, \"?\", address.length());\n String[] addressFields = address.split(\"\\\\$\");\n address = TextUtils.join(\"\\n\", addressFields);\n documentData.setValue(new DataField(\"Address\", address, address), \"Address\");\n if (track.substring(0, 1).equals(\"?\")) {\n track = track.substring(1);\n }\n int delimiterIndex = track.indexOf(\";\");\n if (delimiterIndex > -1) {\n track = track.substring(delimiterIndex+1);\n String iin = track.substring(0, 6);\n documentData.setValue(new DataField(\"IIN\", iin, iin), \"IIN\");\n track = track.substring(6);\n String dlNo = getStringToDelimiter(track, \"=\", 13);\n track = track.substring(dlNo.length());\n track = leftTrimString(track, \"=\");\n String expiryYear = \"20\"+track.substring(0, 2);\n String expiryMonth = track.substring(2, 4);\n track = track.substring(4);\n String birthYear = track.substring(0, 4);\n String birthMonth = track.substring(4, 6);\n String birthDate = track.substring(6, 8);\n track = track.substring(8);\n String expiryDate = null;\n if (expiryMonth.equals(\"77\")) {\n expiryDate = \"non-expiring\";\n } else if (expiryMonth.equals(\"88\")) {\n Calendar calendar = Calendar.getInstance();\n calendar.set(Integer.parseInt(\"20\" + expiryYear) + 1, Integer.parseInt(birthMonth), 1);\n expiryDate = Integer.toString(calendar.getActualMaximum(Calendar.DAY_OF_MONTH));\n expiryDate = expiryDate + \"/\" + birthMonth + \"/\" + expiryYear;\n } else if (expiryMonth.equals(\"99\")) {\n expiryDate = birthDate + \"/\" + birthMonth + \"/\" + expiryYear;\n } else {\n Calendar calendar = Calendar.getInstance();\n calendar.set(Integer.parseInt(\"20\" + expiryYear), Integer.parseInt(expiryMonth), 1);\n expiryDate = Integer.toString(calendar.getActualMaximum(Calendar.DAY_OF_MONTH));\n expiryDate = expiryDate + \"/\" + expiryMonth + \"/\" + expiryYear;\n }\n documentData.setValue(new DataField(\"Date of expiry\", expiryDate, expiryDate), \"Date of expiry\");\n documentData.setValue(new DataField(\"Date of birth\", birthDate+birthMonth+birthYear, birthDate+\"/\"+birthMonth+\"/\"+birthYear), \"Date of birth\");\n if (track.length() > 0) {\n String dlNoOverflow = getStringToDelimiter(track, \"=\", 5);\n if (!dlNoOverflow.isEmpty()) {\n dlNo += dlNoOverflow;\n }\n }\n documentData.setValue(new DataField(\"DL/ID#\", dlNo, dlNo), \"DL/ID#\");\n delimiterIndex = track.indexOf(\"%\");\n }\n if (delimiterIndex > -1) {\n track = track.substring(delimiterIndex+1);\n String versionNumber = track.substring(0, 1);\n documentData.setValue(new DataField(\"Version #\", versionNumber, versionNumber), \"Version #\");\n track = track.substring(1);\n String securityVersionNumber = track.substring(0, 1);\n documentData.setValue(new DataField(\"Security v. #\", securityVersionNumber, securityVersionNumber), \"Security v. #\");\n track = track.substring(1);\n String postalCode = StringUtils.strip(track.substring(0, 11), \"/, \");\n documentData.setValue(new DataField(\"Postal code\", postalCode, postalCode), \"Postal code\");\n track = track.substring(11);\n String dlClass = track.substring(0, 2).trim();\n if (!dlClass.isEmpty()) {\n documentData.setValue(new DataField(\"Class\", dlClass, dlClass), \"Class\");\n }\n track = track.substring(2);\n String restrictions = track.substring(0, 10).trim();\n if (!restrictions.isEmpty()) {\n documentData.setValue(new DataField(\"Restrictions\", restrictions, restrictions), \"Restrictions\");\n }\n track = track.substring(10);\n String endorsements = track.substring(0, 4).trim();\n if (!endorsements.isEmpty()) {\n documentData.setValue(new DataField(\"Endorsements\", endorsements, endorsements), \"Endorsements\");\n }\n track = track.substring(4);\n String sex = track.substring(0, 1);\n documentData.setValue(new DataField(\"Sex\", sex, sex), \"Sex\");\n track = track.substring(1);\n String height = track.substring(0, 3).trim();\n if (!height.isEmpty()) {\n documentData.setValue(new DataField(\"Height\", height, height), \"Height\");\n }\n track = track.substring(3);\n String weight = track.substring(0, 3).trim();\n if (!weight.isEmpty()) {\n documentData.setValue(new DataField(\"Weight\", weight, weight), \"Weight\");\n }\n track = track.substring(3);\n String hairColour = track.substring(0, 3).trim();\n if (!hairColour.isEmpty()) {\n documentData.setValue(new DataField(\"Hair color\", hairColour, getHairColour(hairColour)), \"Hair color\");\n }\n track = track.substring(3);\n String eyeColour = track.substring(0, 3).trim();\n if (!eyeColour.isEmpty()) {\n documentData.setValue(new DataField(\"Eye color\", eyeColour, getEyeColour(eyeColour)), \"Eye color\");\n }\n }\n return documentData;\n }\n throw new Exception(\"Nothing decoded\");\n }", "abstract Function<Multipart.FileInfo, play.libs.streams.Accumulator<ByteString, Http.MultipartFormData.FilePart<A>>> createFilePartHandler();", "@Override\n public void prepare() {\n //Caching as file resource.\n File file = this.getResource().file;\n logger.info(\"Preparing {} streams for file: {}\", this.getTransferType(), file.getName());\n\n if (this.getTransferType() == ResourceTransferType.OUTBOUND) {\n //Sending\n try {\n buffer = new byte[BUFFER_SIZE];\n sent = 0;\n inputChannel = new FileInputStream(file).getChannel();\n inputBuffer = inputChannel.map(FileChannel.MapMode.READ_ONLY, 0, inputChannel.size());\n } catch (FileNotFoundException e) { //File doesn't exist.\n //Calling a transfer error.\n callError(e);\n } catch (IOException e) {\n e.printStackTrace();\n }\n } else {\n //Receiving\n //Checking if file already exists.\n written = 0;\n saved = 0;\n if (getResource().isLocal()) {\n getResource().calcNetworkId();\n if (getResource().getNetworkID().equals(getTunnel().getDestination())) {\n //The file is already stored locally.\n getTunnel().sendMessage(new ResourceTransferControlMessage(this.getTransferId(), -2));\n this.close();\n return;\n }\n }\n\n //Creating or replacing the file.\n buffer = new byte[BUFFER_SIZE * 16];\n if (file.exists()) {\n file.delete();\n }\n try { //Creating new file.\n file.createNewFile();\n outputStream = new FileOutputStream(file);\n } catch (IOException e) {\n //Calling a transfer error.\n callError(e);\n return;\n }\n\n //Requesting the first chunk.\n getTunnel().sendMessage(new ResourceTransferControlMessage(this.getTransferId(), 0));\n }\n }", "@Test\n\tpublic void incompleteDownloadTest() {\n\t\tSystem.out.println(\"TestSFTPDownloader \"+ \"incompleteDownloadTest\");\n\n\t\tDMCache.updateCacheMap(\"sftp.buffer.size\", \"4096\");\n\t\tSFTPDownloader sftpDownloader = new SFTPDownloader();\n\t\tString downloadUrl = \"sftp://demo-user:[email protected]:2222/download/manual_en.pdf\";\n\t\tString location = TEST_SAVE_PATH + \"incompleteFile.pdf\";\n\n\t\ttry {\n\t\t\tsftpDownloader.initiateDownload(downloadUrl, location, 10, 10, 22);\n\t\t} catch (IOException e) {\n\t\t\tValidationServiceImpl validationServiceImpl = new ValidationServiceImpl();\n\t\t\tAssert.assertFalse(validationServiceImpl.validateUrl(location));\n\t\t}\n\t}", "public DatabaseFileInformation(byte[] aFileBytes)\n {\n mTables = new LinkedList<>();\n\n mHeader = (short) (((0xFF) & aFileBytes[1]) | (((0xFF) & aFileBytes[0]) << 8));\n mVersion = (short) (((0xFF) & aFileBytes[3]) | (((0xFF) & aFileBytes[2]) << 8));\n mUnknown1 = ((0xFF) & aFileBytes[7]) | (((0xFF) & aFileBytes[6]) << 8) | (((0xFF) & aFileBytes[5]) <<\n 16) | (((0xFF) & aFileBytes[4]) << 24);\n mDatabaseSize = ((0xFF) & aFileBytes[11]) | (((0xFF) & aFileBytes[10]) << 8) | (((0xFF) & aFileBytes[9]) <<\n 16) | (((0xFF) & aFileBytes[8]) << 24);\n mZero = ((0xFF) & aFileBytes[15]) | (((0xFF) & aFileBytes[14]) << 8) | (((0xFF) & aFileBytes[13]) <<\n 16) | (((0xFF) & aFileBytes[12]) << 24);\n mTableCount = ((0xFF) & aFileBytes[19]) | (((0xFF) & aFileBytes[18]) << 8) | (((0xFF) & aFileBytes[17]) <<\n 16) | (((0xFF) & aFileBytes[16]) << 24);\n mUnknown2 = ((0xFF) & aFileBytes[23]) | (((0xFF) & aFileBytes[22]) << 8) | (((0xFF) & aFileBytes[21]) <<\n 16) | (((0xFF) & aFileBytes[20]) << 24);\n\n int lTableDefinitionPosition = 24;\n int lTableDataStart = lTableDefinitionPosition + (mTableCount * 8);\n\n // Read the table definitions.\n for (int i = 0; i < mTableCount; i++)\n {\n DatabaseTable lDatabaseTable = new DatabaseTable();\n lDatabaseTable.readTableDefinition(aFileBytes, lTableDefinitionPosition);\n lDatabaseTable.readTableHeader(aFileBytes, lTableDataStart);\n mTables.add(lDatabaseTable);\n lTableDefinitionPosition += 8;\n }\n }", "public PaMessageHeaderBuilderIetf() {\n this.version = SUPPORTED_VERSION;\n this.identifier = 0L;\n this.length = PaAttributeTlvFixedLengthEnum.MESSAGE.length();\n }", "public final byte[] toByteArray() {\n\tByteArrayOutputStream baos = new ByteArrayOutputStream();\n\n\ttry {\n\t // Write APDU header\n\t baos.write(header);\n\t // Write APDU LC field.\n\t if (lc > 255 || (le > 256 && lc > 0)) {\n\t\t// Encoded extended LC field in three bytes.\n\t\tbaos.write(x00);\n\t\tbaos.write((byte) (lc >> 8));\n\t\tbaos.write((byte) lc);\n\t } else if (lc > 0) {\n\t\t// Write short LC field\n\t\tbaos.write((byte) lc);\n\t }\n\t // Write APDU data field\n\t baos.write(data);\n\t // Write APDU LE field.\n\t if (le > 256) {\n\t\t// Write extended LE field.\n\t\tif (lc == 0 || lc == -1) {\n\t\t // Encoded extended LE field in three bytes.\n\t\t baos.write(x00);\n\t\t}\n\t\t// Encoded extended LE field in two bytes if extended LC field is present.\n\t\t// If more bytes are requested than possible, assume the maximum.\n\t\tif (le >= 65536) {\n\t\t baos.write(x00);\n\t\t baos.write(x00);\n\t\t} else {\n\t\t baos.write((byte) (le >> 8));\n\t\t baos.write((byte) le);\n\t\t}\n\t } else if (le > 0) {\n\t\tif (lc > 255) {\n\t\t // Write extended LE field in two bytes because extended LC field is present.\n\t\t baos.write((byte) (le >> 8));\n\t\t baos.write((byte) le);\n\t\t} else {\n\t\t // Write short LE field\n\t\t baos.write((byte) le);\n\t\t}\n\t }\n\t} catch (IOException ex) {\n\t LOG.error(\"Failed to create APDU in memory.\", ex);\n\t}\n\n\treturn baos.toByteArray();\n }", "public String initializeChunk() {\n\t\ttry {\n\t\t\t// request \n\t\t\t// write payload size (2 ints, 4 + 4)\n\t\t\toos.writeInt(8);\n\t\t\t// write command identifier \n\t\t\toos.writeInt(ChunkServer.InitializeChunk);\n\t\t\toos.flush();\n\t\t\t// parse response \n\t\t\tint chunkHandleSize = getPayloadInt(ois);\n\t\t\t// reduce size by payload size int \n\t\t\tchunkHandleSize -= 4; \n\t\t\tbyte[] handle = getPayload(ois, chunkHandleSize);\n\t\t\treturn (new String(handle).toString());\n\t\t\t\n\t\t} catch (IOException ioe) {\n\t\t\tSystem.out.println(\"ioe in initialize chunk \" + ioe.getMessage());\n\t\t}\n\t\treturn null; \n\t}", "private void createFile() {\n if (mDriveServiceHelper != null) {\n Log.d(\"error\", \"Creating a file.\");\n\n mDriveServiceHelper.createFile()\n .addOnSuccessListener(fileId -> readFile(fileId))\n .addOnFailureListener(exception ->\n Log.e(\"error\", \"Couldn't create file.\", exception));\n }\n }", "protected void initFile(String id) throws FormatException, IOException {\n super.initFile(id);\n in = new RandomAccessFile(id, \"r\");\n \n // initialize an array containing tag offsets, so we can\n // use an O(1) search instead of O(n) later.\n // Also determine whether we will be reading color or grayscale\n // images\n \n //in.seek(0);\n byte[] toRead = new byte[4];\n in.read(toRead);\n long order = batoi(toRead); // byte ordering\n little = toRead[2] != 0xff || toRead[3] != 0xff;\n \n toRead = new byte[4];\n Vector v = new Vector(); // a temp vector containing offsets.\n \n // Get first offset.\n in.seek(16);\n in.read(toRead);\n int nextOffset = batoi(toRead);\n int nextOffsetTemp;\n \n boolean first = true;\n while(nextOffset != 0) {\n in.seek(nextOffset + 4);\n in.read(toRead);\n // get next tag, but still need this one\n nextOffsetTemp = batoi(toRead);\n in.read(toRead);\n if ((new String(toRead)).equals(\"PICT\")) {\n boolean ok = true;\n if (first) {\n // ignore first image if it is called \"Original Image\" (pure white)\n first = false;\n in.skipBytes(47);\n byte[] layerNameBytes = new byte[127];\n in.read(layerNameBytes);\n String layerName = new String(layerNameBytes);\n if (layerName.startsWith(\"Original Image\")) ok = false;\n }\n if (ok) v.add(new Integer(nextOffset)); // add THIS tag offset\n }\n if (nextOffset == nextOffsetTemp) break;\n nextOffset = nextOffsetTemp;\n }\n \n in.seek(((Integer) v.firstElement()).intValue());\n \n // create and populate the array of offsets from the vector\n numBlocks = v.size();\n offsets = new int[numBlocks];\n for (int i = 0; i < numBlocks; i++) {\n offsets[i] = ((Integer) v.get(i)).intValue();\n }\n \n // populate the imageTypes that the file uses\n toRead = new byte[2];\n imageType = new int[numBlocks];\n for (int i = 0; i < numBlocks; i++) {\n in.seek(offsets[i]);\n in.skipBytes(40);\n in.read(toRead);\n imageType[i] = batoi(toRead);\n }\n \n initMetadata();\n }", "private void requestFile(NapFile file, Client fileOwner) {\r\n\t\ttry {\r\n\r\n\t\t\tFile localCopy = new File(\"./SharedFiles1/\" + file.FILE_NAME);\r\n\r\n\t\t\tif (localCopy.createNewFile()) {\r\n\t\t\t\tcmdDisplay.setText(cmdDisplay.getText() + \"\\n\" + \"Connecting to \" + fileOwner.IP.toString().substring(1)\r\n\t\t\t\t\t\t+ \":\" + fileOwner.PORT_NUM);\r\n\t\t\t\tSocket OwnerSocket = Net_Util.connectToServer(fileOwner.IP.toString().substring(1), fileOwner.PORT_NUM);\r\n\t\t\t\tNet_Util.send(OwnerSocket, file.FILE_NAME);\r\n\t\t\t\tString[] contents = Net_Util.recStrArr(OwnerSocket);\r\n\r\n\t\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(localCopy));\r\n\t\t\t\tfor (String lineContent : contents) {\r\n\t\t\t\t\twriter.write(lineContent + \"\\n\");\r\n\t\t\t\t}\r\n\t\t\t\twriter.close();\r\n\t\t\t\twriter = new BufferedWriter(new FileWriter(\"./SharedFiles1/FileList.txt\", true));\r\n\t\t\t\twriter.newLine();\r\n\t\t\t\twriter.write(file.FILE_NAME + \"::\" + file.DESCRIPTION);\r\n\t\t\t\twriter.close();\r\n\r\n\t\t\t\tNet_Util.send(serverSocket, \"register \" + file.FILE_NAME);\r\n\r\n\t\t\t\tcmdDisplay.setText(cmdDisplay.getText() + \"\\n\" + \"File \" + file.FILE_NAME + \" retrieved sucessfully\");\r\n\t\t\t} else {\r\n\t\t\t\tcmdDisplay.setText(cmdDisplay.getText() + \"\\n\" + \"You already have a file with this name\");\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\tcmdDisplay.setText(cmdDisplay.getText() + \"\\n\" + \"Couldn't send connect to file owner\");\r\n\t\t}\r\n\t}", "public void testGetFileSizeSuccess() throws Exception {\r\n assertNotNull(\"setup fails\", filePersistence);\r\n String fileCreationId = filePersistence.createFile(VALID_FILELOCATION, FILENAME);\r\n assertTrue(\"fileCreationId shouldn't be null or empty\", fileCreationId != null\r\n && fileCreationId.trim().length() != 0);\r\n filePersistence.appendBytes(fileCreationId, new byte[10]);\r\n filePersistence.closeFile(fileCreationId);\r\n assertEquals(\"should be size of 10 bytes\", filePersistence.getFileSize(VALID_FILELOCATION, FILENAME), 10);\r\n filePersistence.deleteFile(VALID_FILELOCATION, FILENAME);\r\n }", "private void createEntry4(final long overallocation,\n final boolean failSetLength,\n final boolean failAddCacheLocation,\n final boolean cancel,\n final boolean keep,\n final EntryState transferState,\n final EntryState finalState)\n throws Throwable\n {\n new CellStubHelper() {\n @Message(required=true,step=1,cell=\"pnfs\")\n public Object message(PnfsSetLengthMessage msg)\n {\n assertEquals(size4, msg.getLength());\n if (failSetLength) {\n msg.setFailed(1, null);\n } else {\n msg.setSucceeded();\n }\n return msg;\n }\n \n @Message(required=true,step=1,cell=\"pnfs\")\n public Object message(PnfsAddCacheLocationMessage msg)\n {\n if (failAddCacheLocation) {\n msg.setFailed(1, null);\n } else {\n msg.setSucceeded();\n }\n return msg;\n }\n \n @Message(required=false,step=0,cell=\"pnfs\")\n public Object message(PnfsClearCacheLocationMessage msg)\n {\n msg.setSucceeded();\n return msg;\n }\n \n protected void run()\n throws FileInCacheException,\n CacheException,\n InterruptedException,\n IOException\n {\n WriteHandle handle =\n repository.createEntry(id4, info4, transferState,\n finalState, null);\n try {\n handle.allocate(size4 + overallocation);\n createFile(handle.getFile(), size4);\n if (cancel)\n handle.cancel(keep);\n assertStep(\"No messages received yet\", 0);\n } finally {\n handle.close();\n }\n }\n };\n }", "@Override\n public StreamInitiation parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment)\n throws IOException, XmlPullParserException, SmackParsingException\n {\n boolean done = false;\n\n // si\n String id = parser.getAttributeValue(\"\", \"id\");\n String mimeType = parser.getAttributeValue(\"\", \"mime-type\");\n StreamInitiation initiation = new StreamInitiation();\n\n // file\n String name = null;\n String size = null;\n String hash = null;\n String date = null;\n String desc = null;\n Thumbnail thumbnail = null;\n boolean isRanged = false;\n\n // feature\n DataForm form = null;\n DataFormProvider dataFormProvider = new DataFormProvider();\n\n XmlPullParser.Event eventType;\n String elementName;\n String namespace;\n while (!done) {\n eventType = parser.next();\n elementName = parser.getName();\n namespace = parser.getNamespace();\n if (eventType == XmlPullParser.Event.START_ELEMENT) {\n if (elementName.equals(\"file\")) {\n name = parser.getAttributeValue(\"\", \"name\");\n size = parser.getAttributeValue(\"\", \"size\");\n hash = parser.getAttributeValue(\"\", \"hash\");\n date = parser.getAttributeValue(\"\", \"date\");\n }\n else if (elementName.equals(\"desc\")) {\n desc = parser.nextText();\n }\n else if (elementName.equals(\"range\")) {\n isRanged = true;\n }\n else if (elementName.equals(\"x\") && namespace.equals(\"jabber:x:data\")) {\n form = dataFormProvider.parse(parser);\n }\n else if (elementName.equals(\"thumbnail\")) {\n thumbnail = new Thumbnail(parser);\n }\n }\n else if (eventType == XmlPullParser.Event.END_ELEMENT) {\n if (elementName.equals(\"si\")) {\n done = true;\n }\n // The name-attribute is required per XEP-0096, so ignore the IQ if the name is not\n // set to avoid exceptions. Particularly,\n // the SI response of Empathy contains an invalid, empty file-tag.\n else if (elementName.equals(\"file\") && (name != null)) {\n long fileSize = 0;\n size = StringUtils.returnIfNotEmptyTrimmed(size);\n if (size != null) {\n try {\n fileSize = Long.parseLong(size);\n } catch (NumberFormatException e) {\n Timber.w(e, \"Received an invalid file size, continuing with fileSize set to 0\");\n }\n }\n ThumbnailFile file = new ThumbnailFile(name, fileSize);\n file.setHash(hash);\n\n if (date != null) {\n try {\n file.setDate(XmppDateTime.parseDate(date));\n } catch (ParseException e) {\n Timber.w(\"Unknown dateformat on incoming file transfer: %s\", date);\n }\n }\n else {\n file.setDate(new Date());\n }\n\n if (thumbnail != null)\n file.setThumbnail(thumbnail);\n\n file.setDesc(desc);\n file.setRanged(isRanged);\n initiation.setFile(file);\n }\n }\n }\n initiation.setSessionID(id);\n initiation.setMimeType(mimeType);\n initiation.setFeatureNegotiationForm(form);\n return initiation;\n }", "public static final Optional A01(OculusFileDownloader oculusFileDownloader, Cursor cursor) {\n long j;\n int i;\n int i2;\n String string;\n long j2;\n long j3;\n String string2;\n Extras A02;\n Optional present;\n synchronized (oculusFileDownloader.mExtrasLock) {\n int columnIndex = cursor.getColumnIndex(LinkedAccountsSQLiteContract.Columns._ID);\n int columnIndex2 = cursor.getColumnIndex(\"status\");\n int columnIndex3 = cursor.getColumnIndex(\"reason\");\n int columnIndex4 = cursor.getColumnIndex(\"local_uri\");\n int columnIndex5 = cursor.getColumnIndex(\"total_size\");\n int columnIndex6 = cursor.getColumnIndex(\"bytes_so_far\");\n int columnIndex7 = cursor.getColumnIndex(\"description\");\n j = cursor.getLong(columnIndex);\n i = cursor.getInt(columnIndex2);\n i2 = cursor.getInt(columnIndex3);\n string = cursor.getString(columnIndex4);\n j2 = cursor.getLong(columnIndex5);\n j3 = cursor.getLong(columnIndex6);\n string2 = cursor.getString(columnIndex7);\n if (!Strings.isNullOrEmpty(string) && string.contains(DownloaderContract.EXTERNAL_DOWNLOAD_SUB_DIRECTORY)) {\n string = string.substring(string.indexOf(DownloaderContract.EXTERNAL_DOWNLOAD_SUB_DIRECTORY));\n }\n A02 = A02(oculusFileDownloader, j);\n }\n if (string == null) {\n present = Absent.INSTANCE;\n } else {\n present = new Present(string);\n }\n return Optional.of(new DownloadInfo(j, i, i2, j2, j3, present, Optional.of(string2), A02));\n }", "public void expandFile()\n throws IOException\n {\n file.seek(FILE_SIZE);\n for (int i = 0; i < BLOCK_SIZE; i++)\n {\n file.write(0);\n }\n FILE_SIZE += BLOCK_SIZE;\n }", "private void getResponse(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// use P1 and P2 as offset\r\n\t\tshort offset = Util.makeShort(buffer[ISO7816.OFFSET_P1], buffer[ISO7816.OFFSET_P2]);\r\n\t\tif (offset > responseBuffer.length)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t// inform the JCRE that the applet has data to return\r\n\t\tshort le = apdu.setOutgoing();\r\n\t\t// if Le = 0, then return the complete signature (128 bytes = 1024 bits)\r\n\t\t// Le = 256 possible on real card\r\n\t\tif ((le == 0) || (le == 256))\r\n\t\t\tle = 128;\r\n\t\t// set the actual number of outgoing data bytes\r\n\t\tapdu.setOutgoingLength(le);\r\n\t\t// send content of sigBuffer in apdu\r\n\t\tif (offset + le > 128 || offset < 0)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\tapdu.sendBytesLong(responseBuffer, offset, le);\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t}", "public void prepareData() throws Exception {\n for (int i = 0; i < this.f4804b.length; i++) {\n try {\n byte[] readFile = FileUtil.readFile(this.f4804b[i]);\n addPart(new String[]{String.format(\"Content-Disposition: form-data; name=\\\"%s_%d\\\"; filename=\\\"%s_%d.jpg\\\"\", new Object[]{this.f4803a, Integer.valueOf(i), this.f4803a, Integer.valueOf(i)}), \"Content-Type: image/webp\", String.format(\"Content-Length: %d\", new Object[]{Integer.valueOf(readFile.length)})}, readFile);\n } catch (IOException e) {\n }\n }\n }", "public DatagramPacket readyPacket() throws IOException {\n\t\tbyte[] data = new byte[PACKET_SIZE];\n\t\tint bytesRead;\n\t\tboolean ready = false;\n\t\tDatagramPacket dp = null;\n\t\tif (!doneReading && (bytesRead = this.fp.read(data, 2, DATA_BUF)) > 0) {\n\t\t\tdata[0] = (byte) this.packetNumber; // set the packet number\n\t\t\tdata[1] = (byte) bytesRead; //send number of bytes read\n\t\t\tthis.totalBytesRead += bytesRead; // update for output info\n\t\t\tdp = new DatagramPacket(data, data.length, this.ia, receiverPort);\n\t\t\tready = true;\n\t\t} else {\n\t\t\tthis.doneReading = true;\n\t\t}\n\t\treturn dp;\n\t}", "@Test(timeout = 4000)\n public void test10() throws Throwable {\n FileUtil fileUtil0 = new FileUtil();\n EvoSuiteFile evoSuiteFile0 = new EvoSuiteFile(\"/A_.XML\");\n FileSystemHandling.appendStringToFile(evoSuiteFile0, \"\");\n ArrayList<Object> arrayList0 = new ArrayList<Object>();\n FileInputStream fileInputStream0 = fileUtil0.fetchAccessories(\"\", arrayList0);\n assertEquals(0, fileInputStream0.available());\n }", "private void initializeFile() {\n\t\twriter.println(\"name \\\"advcalc\\\"\");\n\t\twriter.println(\"org 100h\");\n\t\twriter.println(\"jmp start\");\n\t\tdeclareArray();\n\t\twriter.println(\"start:\");\n\t\twriter.println(\"lea si, \" + variables);\n\t}", "public PrimaryFile clonePrimaryFile()\n {\n ExtractedTargetFile pf = new ExtractedTargetFile();\n pf.setInternalBaseHref(getInternalBaseHref());\n pf.setExternalBaseHref(getExternalBaseHref());\n return pf;\n }", "public Id5320DataFile()\n\t{\n\t\tlineLength = OFF_CUSTOMER_NAME + LEN_CUSTOMER_NAME;\n\t}", "protected void open () {\n\t\tif (this.container==null)\n\t\t\ttry {\n\t\t\t\tmigrateOnDemand();\n\t\t\t\topenFiles();\n\t\t\t\tthis.blockSize = metaData.readInt();\n\t\t\t\tthis.size = metaData.readInt();\n\t\t\t}\n\t\t\tcatch (IOException ie) {\n\t\t\t\tthrow new WrappingRuntimeException(ie);\n\t\t\t}\n\t}", "@Test(timeout = 4000)\n public void test05() throws Throwable {\n EvoSuiteFile evoSuiteFile0 = new EvoSuiteFile(\"/__.XML\");\n byte[] byteArray0 = new byte[2];\n FileSystemHandling.appendDataToFile(evoSuiteFile0, byteArray0);\n FileUtil fileUtil0 = new FileUtil();\n File file0 = fileUtil0.getBrowseNodeFile(\"\", \"\", \"\");\n assertNotNull(file0);\n assertEquals(2L, file0.length());\n }", "private void getBalance(APDU apdu) {\n\n byte[] buffer = apdu.getBuffer();\n\n // inform system that the applet has finished\n // processing the command and the system should\n // now prepare to construct a response APDU\n // which contains data field\n short le = apdu.setOutgoing();\n\n if ( le < 2 )\n ISOException.throwIt\n (ISO7816.SW_WRONG_LENGTH);\n\n //informs the CAD the actual number of bytes\n //returned\n apdu.setOutgoingLength((byte)2);\n\n // move the balance data into the APDU buffer\n // starting at the offset 0\n buffer[0] = (byte)(balance >> 8);\n buffer[1] = (byte)(balance & 0xFF);\n\n // send the 2-byte balance at the offset\n // 0 in the apdu buffer\n apdu.sendBytes((short)0, (short)2);\n\n }", "private StringBuffer readFileStart(Reader pReader, int pMinimumLength) {\n\t\tBufferedReader in = null;\n\t\tStringBuffer buffer = new StringBuffer();\n\t\ttry {\n\t\t\t// get the file start into the memory:\n\t\t\tin = new BufferedReader(pReader);\n\t\t\tString str;\n\t\t\twhile ((str = in.readLine()) != null) {\n\t\t\t\tbuffer.append(str);\n\t\t\t\tif (buffer.length() >= pMinimumLength)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\tfreemind.main.Resources.getInstance().logException(e);\n\t\t\treturn new StringBuffer();\n\t\t}\n\t\treturn buffer;\n\t}", "public IndexedFile(Disk disk, int recordSize, int keySize,\n\t\t\tint firstAllocated, int indexStart, int indexSectors,\n\t\t\tint indexRoot, int indexLevels) {\n\t\tthis.disk = disk;\n\t\tthis.indexRoot = indexRoot;\n\t\tthis.indexStart = indexStart;\n\t\tthis.overflowStart = indexRoot + 1;\n\t\tthis.overflowSectors = 0;\n\t}", "public IniFile(String name) {\r\n this.filename = name;\r\n isavailable = parse(name);\r\n }", "private static void createFileUmidade() throws IOException {\r\n\t\tInteger defaultUmidade = 30;\r\n\t\tarqUmidade = new File(pathUmidade);\r\n\t\tif(!arqUmidade.exists()) {\r\n\t\t\tarqUmidade.createNewFile();\r\n\t\t\tFileWriter fw = new FileWriter(getArqUmidade());\r\n\t\t\tBufferedWriter buffWrite = new BufferedWriter(fw);\r\n\t\t\tbuffWrite.append(defaultUmidade.toString() + String.valueOf('\\n'));/*Inicializa o arquivo com uma umidade Inicial*/\r\n\t\t\tbuffWrite.close();\r\n\t\t}else {\r\n\t\t\tFileReader fr = new FileReader(getArqUmidade());\r\n\t\t\tBufferedReader buffRead = new BufferedReader(fr);\r\n\t\t\tif(!buffRead.ready()) {/*Se o arquivo se encontar criado mas estiver vazio*/\r\n\t\t\t\tFileWriter fw = new FileWriter(arqUmidade);\r\n\t\t\t\tBufferedWriter buffWrite = new BufferedWriter(fw);\r\n\t\t\t\tbuffWrite.append(defaultUmidade.toString() + String.valueOf('\\n'));/*Inicializa o arquivo com uma umidade Inicial*/\r\n\t\t\t\tbuffWrite.close();\r\n\t\t\t}\r\n\t\t\tbuffRead.close();\r\n\t\t}\r\n\t}", "String prepareFile();", "private static byte[] createNameBA() {\n\t\t//Creating byte[]\n\t\tbyte[] data = new byte[SIZE_PACKET];\n\t\tByteBuffer b = ByteBuffer.wrap(data);\n\t\tb.clear();\n\n\t\t//Adding of file name bytes to the byte[]\n\t\tbyte[] nameBytes = outputFileName.getBytes();\n\t\tfor(int i = 0; i < nameBytes.length; i++) {\n\t\t\tdata[i + INDEX_CONTENT] = nameBytes[i];\t\n\t\t}\n\n\t\t//Adding headers to the byte[]\n\t\tb.rewind();\n\t\tb.putLong(0); //Save 8 bytes for checksum\n\t\tb.putInt(seqNumber); //should be 0\n\t\tb.putInt(PACKET_NAME); //should be 1 since packet type is name\n\t\tb.putInt(nameBytes.length); //number of bytes that name takes\n\n\t\t//Calculating checksum and adding to byte[]\n\t\tchecksum = new CRC32();\n\t\tchecksum.reset();\n\t\tchecksum.update(data, INDEX_SEQ, data.length - INDEX_SEQ);\n\t\tlong chksum = checksum.getValue();\n\t\tb.rewind(); //move pointer back to 0\n\t\tb.putLong(chksum); //contains checksum of INDEX_SEQ to end of packet\n\n\t\t//Return byte[]\n\t\treturn data;\n\t}", "@Test(timeout = 4000)\n public void test36() throws Throwable {\n FileUtil fileUtil0 = new FileUtil();\n EvoSuiteFile evoSuiteFile0 = new EvoSuiteFile(\"/CGGSK_9<#S%7P.SU/IN~Q__NULL.XML\");\n FileSystemHandling.appendStringToFile(evoSuiteFile0, \"9<#s%7P.sU/In~q\");\n EvoSuiteURL evoSuiteURL0 = new EvoSuiteURL(\"http://xml.amazon.net/onca/xml3?t=popcornmonste2-20&dev-t=DSB0XDDW1GQ3S&AsinSearch=CGgsK&type=&offerpage=null&offer=9<#s%7P.sU/In~q&f=xml\");\n NetworkHandling.createRemoteTextFile(evoSuiteURL0, \"\");\n FileInputStream fileInputStream0 = fileUtil0.fetchASINFile(\"CGgsK\", \"\", \"9<#s%7P.sU/In~q\", (String) null);\n assertEquals(16, fileInputStream0.available());\n }", "public void initLoadingFileEnviroment() {\n // file init\n try {\n DiskFileItemFactory fileFactory = new DiskFileItemFactory();\n File filepath = new File(DATA_PATH);\n fileFactory.setRepository(filepath);\n this._uploader = new ServletFileUpload(fileFactory);\n\n } catch (Exception ex) {\n System.err.println(\"Error init new file environment. \" + ex.getMessage());\n }\n }", "private void generatePkcs1Sha1Signature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// receive the data that needs to be signed\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\t\r\n\t\t\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc != 20) || (byteRead != 20))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t\r\n\t\t\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// use the correct key\r\n\t\tif (getSignatureType() == NON_REPUDIATION) {\r\n\t\t\t////cipher.init(nonRepPrivateKey, Cipher.MODE_ENCRYPT); // stond al in comments\r\n\t\t\tcipher.init((RSAPrivateCrtKey)nonRepKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\t\r\n\t\tif (getSignatureType() == AUTHENTICATION) {\r\n\t\t\tcipher.init((RSAPrivateCrtKey)authKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\t\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as);\r\n\t\t//@ foreachp_remove(messageBuffer, as);\r\n\t\t////@ open transient_byte_array(messageBuffer); // auto\r\n\r\n\t\t// prepare the message buffer to the PKCS#1 (v1.5) structure\r\n\t\tpreparePkcs1ClearText(messageBuffer, ALG_SHA1_PKCS1, lc);\r\n\t\t// copy the SHA1 hash from the APDU to the message buffer\r\n\t\tUtil.arrayCopy(buffer, (short) (ISO7816.OFFSET_CDATA), messageBuffer, (short) (128 - lc), lc);\r\n\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as);\r\n\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// generate signature\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as1);\r\n\t\t//@ foreachp_remove(messageBuffer, as1);\r\n\t\t////@ open transient_byte_array(messageBuffer); // auto\r\n\t\tcipher.doFinal(messageBuffer, (short) 0, (short) 128, buffer, (short) 0);\r\n\t\t//@ close transient_byte_array(messageBuffer); // todo\r\n\t\t//@ foreachp_unremove(messageBuffer, as1);\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t}", "public int setUp() throws IOException {\r\n\t\tint kSz = 0;\r\n\t\tkeys = ByteBuffer.allocate(size * FREE.length);\r\n\t\tvalues = ByteBuffer.allocate(size * 8);\r\n\t\tclaims = ByteBuffer.allocate(size);\r\n\r\n\t\tfor (int i = 0; i < size; i++) {\r\n\t\t\tkeys.put(FREE);\r\n\t\t\tvalues.putLong(-1);\r\n\t\t\tclaims.put((byte) 0);\r\n\t\t\tkSz++;\r\n\t\t}\r\n\t\treturn size;\r\n\t}", "private void summbitBlank() {\n\t\tMyFile fileToUpload = new MyFile(ClientUI.clientHandler.myDetails.getId(), examID, \"manual\");\n\t\tfileToUpload.setUserType(\"student\");\n\t\tClientUI.clientHandler.handleMessageFromClientUI(fileToUpload);\n\n\t}", "private void parseHeader() throws IOException {\n\n\t\t// ////////////////////////////////////////////////////////////\n\t\t// Administrative header info\n\t\t// ////////////////////////////////////////////////////////////\n\n\t\t// First 10 bytes reserved for preamble\n\t\tbyte[] sixBytes = new byte[6];\n\t\tkeyBuffer.get(sixBytes, 0, 6);\n\t\tlogger.log(new String(sixBytes) + \"\\n\"); // says adac01\n\n\t\ttry {\n\n\t\t\tshort labels = keyBuffer.getShort();\n\t\t\tlogger.log(Integer.toString(labels)); // Number of labels in header\n\t\t\tlogger.log(Integer.toString(keyBuffer.get())); // Number of\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// sub-headers\n\t\t\tlogger.log(Integer.toString(keyBuffer.get())); // Unused byte\n\n\t\t\t// For each header field available.. get them\n\t\t\tfor (short i = 0; i < labels; i++) {\n\n\t\t\t\t// Attempt to find the next key...\n\t\t\t\t// ...the keynum (description)\n\t\t\t\t// ...the offset to the value\n\t\t\t\tADACKey key = getKeys();\n\t\t\t\tswitch (key.getDataType()) {\n\n\t\t\t\tcase ADACDictionary.BYTE:\n\n\t\t\t\t\tkeyList.add(new ByteKvp(this, key));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ADACDictionary.SHORT:\n\n\t\t\t\t\tkeyList.add(new ShortKvp(this, key));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ADACDictionary.INT:\n\n\t\t\t\t\tkeyList.add(new IntKvp(this, key));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ADACDictionary.FLOAT:\n\n\t\t\t\t\tkeyList.add(new FloatKvp(this, key));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ADACDictionary.EXTRAS:\n\n\t\t\t\t\tkeyList.add(new ExtrasKvp(this, key));\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"ADAC Decoder\", \"Failed to retrieve ADAC image file header. \" + \"Is this an ADAC image file?\");\n\t\t}\n\t}", "public MainframeFile (String name, byte[] buffer)\n // ---------------------------------------------------------------------------------//\n {\n this.name = name;\n this.buffer = buffer;\n }" ]
[ "0.61040646", "0.60836005", "0.58613026", "0.5642861", "0.55860305", "0.53996223", "0.5318007", "0.530141", "0.529741", "0.52957124", "0.5150561", "0.48917672", "0.48837897", "0.48821312", "0.4863961", "0.48252723", "0.47529075", "0.47368568", "0.47343194", "0.4722294", "0.47069314", "0.46962517", "0.4690363", "0.46830156", "0.46751013", "0.45828658", "0.45360637", "0.4533", "0.45251477", "0.4525123", "0.45104164", "0.4480706", "0.44768193", "0.44487363", "0.44403327", "0.44395638", "0.44304562", "0.44242358", "0.44071344", "0.4395002", "0.43831763", "0.43794253", "0.4373896", "0.43510625", "0.4336546", "0.43290547", "0.43270123", "0.43256068", "0.4309464", "0.42976066", "0.42893064", "0.4285972", "0.4279934", "0.42673302", "0.42668265", "0.4265637", "0.42611334", "0.4217799", "0.42019156", "0.41971493", "0.41938198", "0.4190196", "0.41848195", "0.41817182", "0.41727453", "0.41675687", "0.41648284", "0.41612205", "0.4154879", "0.41529182", "0.41514897", "0.41476145", "0.41289192", "0.41268945", "0.4125946", "0.41255298", "0.41236115", "0.41077846", "0.41062334", "0.4102766", "0.40970448", "0.4095843", "0.40956283", "0.40865317", "0.40857226", "0.40833977", "0.40821704", "0.40783924", "0.4076022", "0.40747762", "0.40709603", "0.40681323", "0.40659523", "0.40629563", "0.40598217", "0.40577447", "0.40507886", "0.404968", "0.4041021", "0.40365022" ]
0.6649243
0
This method will take a complete or incomplete APDu file and keeps reading until it is complete. Then return the bytes.
private Promise<byte[]> resolveApduFile(ApduFile file) { return new Promise<>(settlement -> { while (!file.isComplete()) { try { chunkWaitingLock.acquire(); } catch (InterruptedException e) { Promise.reject(e); } short offset = file.getCurrentSize(); Promise<byte[]> promise = this.presentationLayer.readBinary(offset); try { byte[] data = promise.getValue(); file.appendValue(data); } catch (Throwable e) { settlement.reject(e); } chunkWaitingLock.release(); } settlement.resolve(file.getData()); getFileLock.release(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static byte[] m136428a(File file) throws IOException {\n FileInputStream fileInputStream = new FileInputStream(file);\n byte[] bArr = new byte[((int) file.length())];\n int i = 0;\n while (i < bArr.length) {\n int read = fileInputStream.read(bArr, i, bArr.length - i);\n if (read < 0) {\n break;\n }\n i += read;\n }\n if (i >= bArr.length) {\n fileInputStream.close();\n return bArr;\n }\n StringBuilder sb = new StringBuilder(\"Could not completely read file \");\n sb.append(file.getName());\n throw new IOException(sb.toString());\n }", "private void readBinary(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// check if access to this file is allowed\r\n\t\tif (!fileAccessAllowed(READ_BINARY))\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// use P1 and P2 as offset\r\n\t\tshort offset = Util.makeShort(buffer[ISO7816.OFFSET_P1], buffer[ISO7816.OFFSET_P2]);\r\n\t\tif (offset < 0)\r\n\t\t\tISOException.throwIt(ISO7816.SW_INCORRECT_P1P2);\r\n\t\t// inform the JCRE that the applet has data to return\r\n\t\tshort le = apdu.setOutgoing();\r\n\t\t// impossible to start reading from offset large than size of file\t\t\t\t\r\n\t\tif (selectedFile == masterFile)\r\n\t\t\tISOException.throwIt(ISO7816.SW_FILE_INVALID); //~allow_dead_code Dead because fileAccessAllowed() checks that selectedFile instanceof ElementaryFile and masterFile is not an ElementaryFile.\r\n\t\t//@ open selected_file_types(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _);\r\n\t\tshort size = ((ElementaryFile) selectedFile).getCurrentSize();\r\n\t\tif (offset > size)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t// number of bytes in file starting from offset\r\n\t\tshort remaining = (short) (size - offset);\r\n\t\tif (le == 0) {\r\n\t\t\tif (remaining < 256) {\r\n\t\t\t\t// wrong Le field\r\n\t\t\t\t// SW2 encodes the exact number of available data bytes\r\n\t\t\t\tshort sw = (short) (ISO7816.SW_CORRECT_LENGTH_00 | remaining);\r\n\t\t\t\tISOException.throwIt(sw);\r\n\t\t\t} else\r\n\t\t\t\t// Le = 0 is interpreted as 256 bytes\r\n\t\t\t\tle = 256;\r\n\t\t}\r\n\t\t// only read out the remaining bytes\r\n\t\tif (le > remaining) {\r\n\t\t\tle = remaining;\r\n\t\t}\r\n\t\t// set the actual number of outgoing data bytes\r\n\t\tapdu.setOutgoingLength(le);\r\n\t\t// write selected file in APDU\r\n\t\t//VF bug; was apdu.sendBytesLong(((ElementaryFile) selectedFile).getData(), offset, le);\r\n\t\t//VF probleem: originele lijn was apdu.sendBytesLong(ef.getData(), offset, le);\r\n\t\t// het probleem hiermee is dat de getData()-methode een ElementaryFile nodig heeft, en dat\r\n\t\t// sendBytesLong vereist dat het resultaat niet null is. De niet-null vereiste zit geencodeerd\r\n\t\t// in ElementaryFile, dus als je dat predicaat opent, dan weet VF dat de data niet-null is, maar\r\n\t\t// dan werkt de call op getData niet. Als je de ElementaryFile gesloten laat, dan lukt de call naar\r\n\t\t// getData, maar weet je niet dat het niet-null is.\r\n\t\tElementaryFile ef = (ElementaryFile)selectedFile;\r\n\t\tbyte[] bf = ef.getData();\r\n\t\t//@ open [1/2]ef.ElementaryFile(?d1, ?d2, ?d3, ?d4, ?d5, ?info); // hard to eliminate\r\n\t\tapdu.sendBytesLong(bf, offset, le);\r\n\t\t////@ close [1/2]ef.ElementaryFile(d1, d2, d3, d4, d5, info); // auto\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t}", "byte[] readBytes();", "public static byte[] readBytesFromFile(File f) {\r\n byte[] bytes = null;\r\n try {\r\n int filesize = (int) f.length();\r\n bytes = new byte[filesize];\r\n DataInputStream in = new DataInputStream(new FileInputStream(f));\r\n in.readFully(bytes);\r\n in.close();\r\n } catch (Exception e) {\r\n System.out.println(\"Error reading byte[] from file: \"\r\n + e.getMessage());\r\n return null;\r\n }\r\n return bytes;\r\n }", "@Test\n public void readFullFile() throws Exception {\n long checksumExpected = populateInputFile(((ReadHandlerTest.CHUNK_SIZE) * 10), 0, (((ReadHandlerTest.CHUNK_SIZE) * 10) - 1));\n mReadHandler.onNext(buildReadRequest(0, ((ReadHandlerTest.CHUNK_SIZE) * 10)));\n checkAllReadResponses(mResponses, checksumExpected);\n }", "public byte[] readBytes() {\n try {\n int len = available();\n if (len > 0) {\n byte bytes[] = new byte[len];\n m_DataInputStream.read(bytes);\n\n return bytes;\n }\n else {\n return new byte[0];\n }\n }\n catch (IOException e) {\n return new byte[0];\n }\n }", "private Promise<ApduFile> openApduFile(ElementaryFileID fileID) {\n Promise<byte[]> firstChunk;\n if (fileID.isShortIDAvailable()) {\n firstChunk = this.presentationLayer.readBinary(fileID, (byte)0);//If short file id is available, a read will also instantly select the file.\n } else {\n firstChunk = this.presentationLayer.selectEF(fileID).then((v) -> this.presentationLayer.readBinary((byte)0));//Select and read the first part.\n }\n return firstChunk.then((data) -> {\n try {\n ApduFile result = new ApduFile(data);\n return Promise.resolve(result);\n }catch (Exception e) {\n return Promise.reject(e);\n }\n });\n }", "public int readBytes(FileChannel out, long position, int length)\r\n/* 903: */ throws IOException\r\n/* 904: */ {\r\n/* 905:910 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 906:911 */ return super.readBytes(out, position, length);\r\n/* 907: */ }", "public static byte[] getBytesFromFile(File file) {\r\n byte[] bytes;\r\n try (InputStream is = new FileInputStream(file)) {\r\n long length = file.length();\r\n if (length > Integer.MAX_VALUE) {\r\n LOG.log(Level.SEVERE, \"File {0} is too large\", file.getName());\r\n bytes = new byte[0];\r\n return bytes;\r\n }\r\n bytes = new byte[(int) length];\r\n int offset = 0;\r\n int numRead = 0;\r\n while (offset < bytes.length\r\n && (numRead = is.read(bytes, offset, bytes.length - offset)) >= 0) {\r\n offset += numRead;\r\n }\r\n if (offset < bytes.length) {\r\n LOG.log(Level.SEVERE, \"Could not completely read file {0}\", file.getName());\r\n bytes = new byte[0];\r\n return bytes;\r\n }\r\n }\r\n catch (IOException ioex) {\r\n LOG.log(Level.SEVERE, \"{0} {1}\", new Object[]{ioex.getMessage(), file.getName()});\r\n bytes = new byte[0];\r\n return bytes;\r\n }\r\n\r\n return bytes;\r\n }", "public static byte[] ReadFileSync(String filePath)\n {\n byte[] bytes = new byte[0];\n try\n {\n //Instantiate the file object\n File file = new File(filePath);\n //Instantiate the input stread\n InputStream insputStream = new FileInputStream(file);\n long length = file.length();\n bytes = new byte[(int) length];\n \n insputStream.read(bytes);\n insputStream.close();\n\n }\n catch(Exception e)\n {\n Log.e(\"IO\", \"Failed to load file async: \"+filePath+e.toString());\n }\n return bytes;\n }", "byte[] readBytes(File f) throws Exception {\n\n byte[] b_total = new byte[actualSize];\n int step = actualSize / N;\n\n byte[] b = new byte[step];\n ByteBuffer bb = ByteBuffer.allocate(step);\n\n for (int i = 0; i < N; ++i) {\n \n // READ NEXT PORTION OF BYTES VIA FIS:\n\n fis.read(b);\n System.arraycopy(b, 0, b_total, i * step, b.length);\n\n ++i;\n \n if (i < N) {\n\n bb.clear(); // needed to prepare ByteBuffer for channel read / put operations \n\n // READ NEXT PORTION OF BYTES VIA CHANNEL:\n\n inChannel.read(bb);\n byte[] arr = bb.array();\n System.arraycopy(arr, 0, b_total, i * step, arr.length);\n }\n }\n\n return b_total;\n }", "public byte[] read();", "private String readFully(String filename) throws IOException{\n\t\tBufferedReader reader = new BufferedReader(new FileReader(filename));\n\t\tStringBuilder buf=new StringBuilder();\n\t\tchar[] data=new char[8192];\n\t\tint num=reader.read(data);\n\t\twhile(num>-1){\n\t\t\tbuf.append(data,0,num);\n\t\t\tnum=reader.read(data);\n\t\t}\n\t\treturn buf.toString();\n\t}", "public Promise<byte[]> readFile(ElementaryFileID id) {\n try {\n getFileLock.acquire();\n } catch (InterruptedException e) {\n return Promise.reject(e);\n }\n return this.presentationLayer.selectDF(this.appId).then((res) -> {\n return openApduFile(id).then((file) -> this.resolveApduFile(file));\n });\n }", "public static byte[] getBytesFromFile(File file) throws IOException {\r\n\r\n InputStream is = new FileInputStream(file);\r\n\r\n // Get the size of the file\r\n long length = file.length();\r\n\r\n /*\r\n * You cannot create an array using a long type. It needs to be an int\r\n * type. Before converting to an int type, check to ensure that file is\r\n * not loarger than Integer.MAX_VALUE;\r\n */\r\n if (length > Integer.MAX_VALUE) {\r\n System.out.println(\"File is too large to process\");\r\n return null;\r\n }\r\n\r\n // Create the byte array to hold the data\r\n byte[] bytes = new byte[(int) length];\r\n\r\n // Read in the bytes\r\n int offset = 0;\r\n int numRead = 0;\r\n while ((offset < bytes.length) &&\r\n ((numRead = is.read(bytes, offset, bytes.length - offset)) >= 0)) {\r\n\r\n offset += numRead;\r\n\r\n }\r\n\r\n // Ensure all the bytes have been read in\r\n if (offset < bytes.length) {\r\n throw new IOException(\"Could not completely read file \" + file.getName());\r\n }\r\n\r\n is.close();\r\n return bytes;\r\n\r\n }", "private int readFdocaOneByte() {\n checkForSplitRowAndComplete(1);\n //return dataBuffer_[position_++] & 0xff;\n return dataBuffer_.readUnsignedByte();\n }", "public byte[] readFile(RAFFileEntry fileEntry) throws IOException {\n\t\tarchiveFile.setPosition(fileEntry.getDataOffset());\n\t\tif (fileEntry.getDataSize() > 0xFFFFFFFFL) throw new IOException(\"File too big.\");\n\t\tbyte[] data = archiveFile.readBytes((int) fileEntry.getDataSize());\n\t\treturn data;\n\t}", "public static byte[] readFileToByteArray(String aFileName) {\n byte[] res;\n try {\n res = org.apache.commons.io.FileUtils.readFileToByteArray(new File(aFileName));\n } catch (IOException e) {\n res = null;\n }\n return res;\n }", "public byte[] bytes() throws IOException {\n try(FileInputStream fis = new FileInputStream(file)) {\n return ByteStreams.toByteArray(fis);\n }\n }", "private static ByteBuffer internalReadFileAsByteArray(String path) throws IOException {\n ByteBuffer byteBuffer = null;\n Path filePath = FileSystems.getDefault().getPath(path);\n try (\n FileChannel fileChannel = FileChannel.open(filePath, StandardOpenOption.READ);) {\n Long size = fileChannel.size();\n if (size > Integer.MAX_VALUE) {\n throw new IOException(MessageFormat.format(\n \"File {0} is too large. Its size is {1,number,integer} bytes which is larger \" +\n \"then this method could handle ( {2,number,integer})\", path, size, Integer.MAX_VALUE));\n }\n byteBuffer = ByteBuffer.allocate(size.intValue());\n int readBytes = 0;\n int totalReadBytes = 0;\n int failureCounter = 0;\n while ((readBytes = fileChannel.read(byteBuffer)) >= 0 && totalReadBytes < size.intValue()) {\n if (readBytes > 0) {\n totalReadBytes += readBytes;\n if (failureCounter > 0) {\n failureCounter = 0;\n }\n } else {\n if (++failureCounter >= MAX_READ_FAILURES) {\n throw new IOException(MessageFormat.format(\"File {0} could not be read for unknown reason\", path));\n }\n }\n }\n }\n return (ByteBuffer) byteBuffer.flip();\n }", "protected final int readBytes()\n throws IOException\n {\n _inputPtr = 0;\n _inputEnd = 0;\n if (_inputSource != null) {\n int count = _inputSource.read(_inputBuffer, 0, _inputBuffer.length);\n if (count > 0) {\n _inputEnd = count;\n }\n return count;\n }\n return -1;\n }", "@Test\n public void readPartialFile() throws Exception {\n long start = 3;\n long end = ((ReadHandlerTest.CHUNK_SIZE) * 10) - 99;\n long checksumExpected = populateInputFile(((ReadHandlerTest.CHUNK_SIZE) * 10), start, end);\n mReadHandler.onNext(buildReadRequest(start, ((end + 1) - start)));\n checkAllReadResponses(mResponses, checksumExpected);\n }", "public byte[] file2byte() {\n\t\tbyte[] result = null;\n\t\t\n\t\tif (this.isFile()) {\n\t\t\tBufferedInputStream bufferedInputStream = null;\n\t\t\tByteArrayOutputStream byteArrayOutputStream = null;\n\t\t\t\n\t\t\ttry {\n\t\t\t\tbufferedInputStream = new BufferedInputStream(new FileInputStream(this));\n\t\t\t\tbyteArrayOutputStream = new ByteArrayOutputStream(1024);\n\n\t\t\t\tbyte[] buffer = new byte[1024];\n\t\t\t\tint size = 0;\n\t\t\t\twhile ((size = bufferedInputStream.read(buffer)) != -1) {\n\t\t\t\t\tbyteArrayOutputStream.write(buffer, 0, size);\n\t\t\t\t}\n\t\t\t\tbufferedInputStream.close();\n\n\t\t\t\tresult = byteArrayOutputStream.toByteArray();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (bufferedInputStream != null) bufferedInputStream.close();\n\t\t\t\t\tif (byteArrayOutputStream != null) byteArrayOutputStream.close();\n\t\t\t\t} catch (Exception exception) {\n\t\t\t\t\tbufferedInputStream = null;\n\t\t\t\t\tbyteArrayOutputStream = null;\n\t\t\t\t\texception.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "private byte[] readFdocaBytes(int length) {\n\n checkForSplitRowAndComplete(length);\n\n byte[] b = new byte[length];\n dataBuffer_.readBytes(b);\n// System.arraycopy(dataBuffer_, position_, b, 0, length);\n// position_ += length;\n//\n return b;\n }", "public byte[] readBytes() throws IOException {\n int length = in.readInt();\n byte[] bytes = new byte[length];\n in.readFully(bytes);\n return bytes;\n }", "@Override\n public int read() throws IOException {\n if (pos >= count) {\n fill();\n if (pos >= count) {\n return -1;\n }\n }\n checkIfClosed();\n return buf[pos++] & 0xFF;\n }", "public static byte[] readBytes(String file) throws IOException\n {\n try(InputStream in = getInputStream(file))\n {\n byte[] buffer = new byte[512];\n int size = 0;\n int read;\n while((read = in.read(buffer, size, buffer.length - size)) > 0)\n {\n size += read;\n if(size == buffer.length)\n buffer = Arrays.copyOf(buffer, size * 2);\n }\n\n if(size < buffer.length)\n buffer = Arrays.copyOf(buffer, size);\n\n return buffer;\n }\n }", "public static byte[] readAllBytes(String filename) {\n return readAllBytes(filename, true);\n }", "alluxio.proto.journal.File.CompleteFileEntry getCompleteFile();", "public static byte[] readFileFully(File source) {\n DataInputStream raf = null;\n int length = (int)source.length();\n if(length <= 0)\n return null;\n\n byte[] data = new byte[length];\n try {\n raf = new DataInputStream(new BufferedInputStream(new FileInputStream(source)));\n raf.readFully(data);\n } catch(IOException ioe) {\n return null;\n } finally {\n IOUtils.close(raf);\n }\n \n return data;\n }", "public static byte[] getBytesFromFile(File file) throws IOException {\n\t\tlong length = file.length();\r\n\r\n\t\t// You cannot create an array using a long type.\r\n\t\t// It needs to be an int type.\r\n\t\t// Before converting to an int type, check\r\n\t\t// to ensure that file is not larger than Integer.MAX_VALUE.\r\n\t\tif (length > Integer.MAX_VALUE) {\r\n\t\t\t// File is too large\r\n\t\t\tthrow new IOException(\"File is too large!\");\r\n\t\t}\r\n\r\n\t\t// Create the byte array to hold the data\r\n\t\tbyte[] bytes = new byte[(int)length];\r\n\r\n\t\t// Read in the bytes\r\n\t\tint offset = 0;\r\n\t\tint numRead = 0;\r\n\r\n\t\tInputStream is = new FileInputStream(file);\r\n\t\ttry {\r\n\t\t\twhile (offset < bytes.length\r\n\t\t\t\t\t&& (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {\r\n\t\t\t\toffset += numRead;\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tis.close();\r\n\t\t}\r\n\r\n\t\t// Ensure all the bytes have been read in\r\n\t\tif (offset < bytes.length) {\r\n\t\t\tthrow new IOException(\"Could not completely read file \"+file.getName());\r\n\t\t}\r\n\t\treturn bytes;\r\n\t}", "public int readBytes(FileChannel out, long position, int length)\r\n/* 228: */ throws IOException\r\n/* 229: */ {\r\n/* 230:248 */ checkReadableBytes(length);\r\n/* 231:249 */ int readBytes = getBytes(this.readerIndex, out, position, length, true);\r\n/* 232:250 */ this.readerIndex += readBytes;\r\n/* 233:251 */ return readBytes;\r\n/* 234: */ }", "private static int readFully(InputStream in, byte[] buf, int off, int len) throws IOException {\n/* 1144 */ if (len == 0)\n/* 1145 */ return 0; \n/* 1146 */ int total = 0;\n/* 1147 */ while (len > 0) {\n/* 1148 */ int bsize = in.read(buf, off, len);\n/* 1149 */ if (bsize <= 0)\n/* */ break; \n/* 1151 */ off += bsize;\n/* 1152 */ total += bsize;\n/* 1153 */ len -= bsize;\n/* */ } \n/* 1155 */ return (total > 0) ? total : -1;\n/* */ }", "public static byte[] readBytes(File file) throws IOException {\n FileInputStream is = new FileInputStream(file);\n byte[] bytes = new byte[(int) file.length()];\n int read = is.read(bytes);\n for (int totalRead = read; read > 0; ) {\n read = is.read(bytes, totalRead, bytes.length - totalRead);\n }\n is.close();\n return bytes;\n }", "private byte[] readFile(String fileLocation){\n File myFile = new File(fileLocation);\n byte myByteArray[] = new byte[(int) myFile.length()];\n try {\n BufferedInputStream reader = new BufferedInputStream(new FileInputStream(myFile));\n reader.read(myByteArray,0,myByteArray.length);\n reader.close();\n }catch(FileNotFoundException e){\n System.out.println(\"The file has not been found: \"+e.getMessage());\n }catch(IOException e){\n System.out.println(\"problem with reading the file: \"+e.getMessage());\n }\n return myByteArray;\n }", "public static byte[] readBytes(File file) throws IOException {\n InputStream is = null;\n try {\n is = new FileInputStream(file);\n byte[] result = new byte[(int) file.length()];\n is.read(result);\n return result;\n } finally {\n close(is);\n }\n }", "public byte[] readfile(int pos) throws IOException\n {\n byte[] bytes = new byte[1024];\n f.seek(1024*pos);\n f.read(bytes);\n return bytes;\n }", "private void getCardData(APDU apdu, byte[] buffer) \r\n \t //@ requires [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check P1 and P2\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x00 || buffer[ISO7816.OFFSET_P2] != (byte) 0x00)\r\n\t\t\tISOException.throwIt(ISO7816.SW_INCORRECT_P1P2);\r\n\t\t// inform the JCRE that the applet has data to return\r\n\t\tapdu.setOutgoing();\r\n\t\t\r\n\t\t////@ open [1/2]valid();\r\n\t\t\t\t\t\t\t\t\r\n\t\tbyte[] data = identityFile.getData(); \r\n\t\t// Only the chip number is of importance: get this at tag position 2\r\n\t\tshort pos = 1;\r\n\t\t//@ open [1/2]identityFile.ElementaryFile(_, _, ?identityFileData, _, _, ?info); // todo (integrate with array_element search)\r\n\t\tshort dataLen = (short) data[pos];\r\n\t\tpos = (short) (pos + 1 + dataLen + 1);\r\n\t\t////@ close [1/2]identityFile.ElementaryFile(_, _, identityFileData, _, _, info); // auto\r\n\t\tif (dataLen <= 0 || dataLen + pos + 2 >= identityFile.getCurrentSize())\r\n\t\t\tISOException.throwIt(ISO7816.SW_DATA_INVALID);\r\n\t\t//@ open [1/2]identityFile.ElementaryFile(_, _, identityFileData, _, _, info);\r\n\t\tdataLen = (short) data[pos];\r\n\t\tpos = (short) (pos + 1);\r\n\t\t////@ close [1/2]identityFile.ElementaryFile(_, _, identityFileData, _, _, info); // auto\r\n\t\tif (dataLen < 0 || pos + dataLen >= identityFile.getCurrentSize())\r\n\t\t\tISOException.throwIt(ISO7816.SW_DATA_INVALID);\r\n\t\t//@ open [1/2]identityFile.ElementaryFile(_, _, identityFileData, _, _, info);\r\n\t\t// check Le\r\n\t\t// if (le != dataLen)\r\n\t\t// ISOException.throwIt((short)(ISO7816.SW_WRONG_LENGTH));\r\n\t\t/*VF*byte version[] = { (byte) 0xA5, (byte) 0x03, (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x11, (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0x01, (byte) 0x01, (byte) 0x0F };*/\r\n\t\tbyte version[] = new byte[] { (byte) 0xA5, (byte) 0x03, (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x11, (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0x01, (byte) 0x01, (byte) 0x0F };\r\n\t\tbyte chipNumber[] = new byte[(short) (dataLen + 12)];\r\n\t\tUtil.arrayCopy(data, pos, chipNumber, (short) 0, dataLen);\r\n\t\tUtil.arrayCopy(version, (short) 0, chipNumber, dataLen, (short) 12);\r\n\t\t// //Set serial number\r\n\t\t// Util.arrayCopy(tokenInfo.getData(), (short) 7, tempBuffer, (short) 0,\r\n\t\t// (short) 16);\r\n\t\t//\t\t\r\n\t\t// //Set component code: TODO\r\n\t\t//\t\t\r\n\t\t//\t\t\r\n\t\t// //Set OS number: TODO\r\n\t\t//\t\t\r\n\t\t//\t\t\r\n\t\t// //Set OS version: TODO\r\n\t\t// JCSystem.getVersion();\r\n\t\t//\t\t\r\n\t\t// //Set softmask number: TODO\r\n\t\t//\t\t\r\n\t\t// //Set softmask version: TODO\r\n\t\t//\t\t\r\n\t\t// //Set applet version: TODO : 4 bytes in file system\r\n\t\t//\t\t\r\n\t\t//\t\t\r\n\t\t// //Set Interface version: TODO\r\n\t\t//\t\t\r\n\t\t// //Set PKCS#15 version: TODO\r\n\t\t//\t\t\r\n\t\t// //Set applet life cycle\r\n\t\t// tempBuffer[(short)(le-1)] = GPSystem.getCardState();\r\n\t\t// set the actual number of outgoing data bytes\r\n\t\tapdu.setOutgoingLength((short) chipNumber.length);\r\n\t\t// send content of buffer in apdu\r\n\t\tapdu.sendBytesLong(chipNumber, (short) 0, (short) chipNumber.length);\r\n\t\t\t\t\t\t\t\t\r\n\t\t////@ close [1/2]identityFile.ElementaryFile(_, _, identityFileData, _, _, info); // auto\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t}", "@Override\n\tpublic long bytesRead() {\n\t\treturn 0;\n\t}", "private void readMoreBytesFromStream() throws IOException {\n if (!innerStreamHasMoreData) {\n return;\n }\n\n int bufferSpaceAvailable = buffer.length - bytesInBuffer;\n if (bufferSpaceAvailable <= 0) {\n return;\n }\n\n int bytesRead =\n stream.read(buffer, bytesInBuffer, bufferSpaceAvailable);\n\n if (bytesRead == -1) {\n innerStreamHasMoreData = false;\n } else {\n bytesInBuffer += bytesRead;\n }\n }", "public static byte[] getBytesFromFile(File file) throws IOException {\n InputStream is = new FileInputStream(file);\n\n // Get the size of the file\n long length = file.length();\n\n // You cannot create an array using a long type.\n // It needs to be an int type.\n // Before converting to an int type, check\n // to ensure that file is not larger than Integer.MAX_VALUE.\n if (length > Integer.MAX_VALUE) {\n // File is too large\n }\n\n // Create the byte array to hold the data\n byte[] bytes = new byte[(int)length];\n\n // Read in the bytes\n int offset = 0;\n int numRead = 0;\n while (offset < bytes.length\n && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {\n offset += numRead;\n }\n\n // Ensure all the bytes have been read in\n if (offset < bytes.length) {\n throw new IOException(\"Could not completely read file \"+file.getName());\n }\n\n // Close the input stream and return bytes\n is.close();\n return bytes;\n }", "public byte[] readByteArrayFromFile(String fileName)\r\n\tthrows FileNotFoundException, IOException {\r\n\t\tFileInputStream theSourceInputStream = new FileInputStream(fileName);\r\n\t\tByteArrayOutputStream theSourceOutputStream = new ByteArrayOutputStream(\r\n\t\t\t\tBUFFER_SIZE);\r\n\t\tcopyStreamContent(theSourceInputStream, theSourceOutputStream);\r\n\t\tbyte[] theResult = theSourceOutputStream.toByteArray();\r\n\t\ttheSourceInputStream.close();\r\n\t\ttheSourceOutputStream.close();\r\n\t\treturn theResult;\r\n\t}", "public byte[] getNextInput(byte[] buffer) throws IOException {\r\n // byte[] buffer = new byte[8192];\r\n file.seek(currOffset);\r\n file.read(buffer);\r\n currOffset += buffer.length;\r\n return buffer;\r\n }", "public byte[] readBytes(int len) throws IOException {\n if (len > 1024) {\n throw new RuntimeException(String.format(\"Attempted to read %d bytes at once, file is probably corrupted.\", len));\n }\n byte[] buf = new byte[len];\n int n = 0;\n while (n < len) {\n int count = inputStream.read(buf, n, len - n);\n if (count < 0) {\n throw new EOFException();\n }\n n += count;\n }\n return buf;\n }", "public byte[] getBytes() throws IOException {\r\n return mFile.getBytes();\r\n }", "private static byte[] getFileAsByte(String pathFile) {\n\t\tFile file = new File(pathFile);\n\n\t\ttry {\n\t\t\tFileInputStream fin = new FileInputStream(file);\n\t\t\tbyte fileContent[] = new byte[(int) file.length()];\n\t\t\tfin.read(fileContent);\n\t\t\tfin.close();\n\n\t\t\treturn fileContent;\n\t\t} catch (FileNotFoundException e) {\n\t\t\tLOGGER.error(\"File not found: \" + e);\n\t\t} catch (IOException e) {\n\t\t\tLOGGER.error(\"Exception while reading the file: \" + e);\n\t\t}\n\t\treturn null;\n\t}", "private void updateBinary(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check if access to this file is allowed\r\n\t\tif (!fileAccessAllowed(UPDATE_BINARY))\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// use P1 and P2 as offset\r\n\t\tshort offset = Util.makeShort(buffer[ISO7816.OFFSET_P1], buffer[ISO7816.OFFSET_P2]);\r\n\t\t// impossible to start updating from offset larger than max size of file\r\n\t\t// this however does not imply that the file length can not change\r\n\t\tJCSystem.beginTransaction();\r\n\t\t//@ open valid();\r\n\t\tif (selectedFile == masterFile)\r\n\t\t\tISOException.throwIt(ISO7816.SW_FILE_INVALID); //~allow_dead_code Dead because fileAccessAllowed() checks that selectedFile instanceof ElementaryFile and masterFile is not an ElementaryFile.\r\n\t\t//@ open selected_file_types(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _);\r\n\t\tshort size = ((ElementaryFile) selectedFile).getMaxSize();\r\n\t\tif (offset > size)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t// number of bytes in file starting from offset\r\n\t\t// short remaining = (short) (size - offset);\r\n\t\t// get the new data\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc == 0) || (byteRead == 0))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// update file\r\n\t\tif (offset < 0 || ISO7816.OFFSET_CDATA + lc > buffer.length || offset + lc > size)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t((ElementaryFile) selectedFile).updateData(offset, buffer, ISO7816.OFFSET_CDATA, lc);\r\n\t\t// //@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}", "private byte[] readSampleData(String filePath) {\n File sampleFile = new File(filePath);\n byte[] buffer = new byte[(int) sampleFile.length()];\n FileInputStream fis = null;\n try {\n fis = new FileInputStream(sampleFile);\n readFill(fis, buffer);\n } catch (IOException e) {\n throw new RuntimeException(e);\n } finally {\n try {\n fis.close();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return buffer;\n }", "@Override\n public int readUnsignedByte() throws IOException\n {\n if (!hasRemaining())\n {\n throw new IOException(\"End off buffer reached\");\n }\n return randomAccessRead.read();\n }", "private long readUntil(long pos) throws IOException {\n/* 86 */ if (pos < this.length) {\n/* 87 */ return pos;\n/* */ }\n/* */ \n/* 90 */ if (this.foundEOS) {\n/* 91 */ return this.length;\n/* */ }\n/* */ \n/* 94 */ int sector = (int)(pos >> 9L);\n/* */ \n/* */ \n/* 97 */ int startSector = this.length >> 9;\n/* */ \n/* */ \n/* 100 */ for (int i = startSector; i <= sector; i++) {\n/* 101 */ byte[] buf = new byte[512];\n/* 102 */ this.data.add(buf);\n/* */ \n/* */ \n/* 105 */ int len = 512;\n/* 106 */ int off = 0;\n/* 107 */ while (len > 0) {\n/* 108 */ int nbytes = this.src.read(buf, off, len);\n/* */ \n/* 110 */ if (nbytes == -1) {\n/* 111 */ this.foundEOS = true;\n/* 112 */ return this.length;\n/* */ } \n/* 114 */ off += nbytes;\n/* 115 */ len -= nbytes;\n/* */ \n/* */ \n/* 118 */ this.length += nbytes;\n/* */ } \n/* */ } \n/* */ \n/* 122 */ return this.length;\n/* */ }", "public int read(byte[] p_bytes, int p_offset, int p_length);", "public abstract byte[] readData(int address, int length);", "private byte[] readBuffer( DataInputStream in ) throws IOException{\n String factory = in.readUTF();\n int count = in.readInt();\n \n ByteArrayOutputStream out = new ByteArrayOutputStream( factory.length()*4 + 4 + count );\n DataOutputStream dout = new DataOutputStream( out );\n \n dout.writeUTF( factory );\n dout.writeInt( count );\n \n for( int i = 0; i < count; i++ ){\n int read = in.read();\n if( read == -1 )\n throw new EOFException( \"unexpectetly reached end of file\" );\n dout.write( read );\n }\n \n dout.close();\n return out.toByteArray();\n }", "private static byte[] getFileBytes(String filePath) {\n try {\n return Files.readAllBytes(Paths.get(filePath));\n } catch (IOException e) {\n throw new RuntimeException(\"I/O exception reading contents of file \" + filePath, e);\n }\n }", "@Override\n public int read() throws IOException {\n int r = -1;\n \n if (encryptedDataBuffer!=null && pos>=encryptedDataBuffer.length && !closed)\n fillBuffer();\n \n if (encryptedDataBuffer!=null && pos<encryptedDataBuffer.length)\n r = (int)encryptedDataBuffer[pos++]; // next element in the buffer\n return r;\n }", "public byte[] readBytes() {\n\t\tif (bufferIndex == bufferLast)\n\t\t\treturn null;\n\n\t\tsynchronized (buffer) {\n\t\t\tint length = bufferLast - bufferIndex;\n\t\t\tbyte outgoing[] = new byte[length];\n\t\t\tSystem.arraycopy(buffer, bufferIndex, outgoing, 0, length);\n\n\t\t\tbufferIndex = 0; // rewind\n\t\t\tbufferLast = 0;\n\t\t\treturn outgoing;\n\t\t}\n\t}", "byte[] readPiece(int index){\n return Arrays.copyOfRange(file_pieces,index*piece_size,piece_size*(index+1)-1);\n }", "public byte[] readRawFile(int fileID)throws Exception{\n\t\tResources rs = context.getResources();\r\n\t\tInputStream inputStream = rs.openRawResource(fileID);\r\n\t\tByteArrayOutputStream mArrayOutputStream = new ByteArrayOutputStream();\r\n\t\tbyte [] b = new byte[1024];\r\n\t\tint length =0;\r\n\t\twhile((length=inputStream.read(b, 0, b.length))!=-1){\r\n\t\t\tmArrayOutputStream.write(b, 0, length);\r\n\t\t}\r\n\t\tif(inputStream!=null){\r\n\t\t\tinputStream.close();\r\n\t\t}\r\n\t\treturn mArrayOutputStream.toByteArray();\r\n\t}", "static byte[] readContents(File file) {\n if (!file.isFile()) {\n throw new IllegalArgumentException(\"must be a normal file\");\n }\n try {\n return Files.readAllBytes(file.toPath());\n } catch (IOException excp) {\n throw new IllegalArgumentException(excp.getMessage());\n }\n }", "private int fillBuffer() throws IOException {\r\n int n = super.read(buffer, 0, BUF_SIZE);\r\n if (n >= 0) {\r\n file_pos +=n;\r\n buf_end = n;\r\n buf_pos = 0;\r\n }\r\n return n;\r\n }", "public static byte[] readAll(String filename) {\n\t\ttry {\n\t\t\tFileInputStream fis = new FileInputStream(filename);\n\t\t\treturn readAll(fis);\n\t\t} catch (FileNotFoundException e) {\n\t\t\tthrow new WrappedException(e);\n\t\t}\n\t}", "static byte[] getFileAsByteArray(String filename) {\n\n byte[] fileDisk = new byte[DISK_SIZE];\n\n try {\n byte[] array = Files.readAllBytes(new File(filename).toPath());\n return array;\n } catch (Exception e) {\n System.out.println(\"error\");\n System.exit(0);\n }\n\n return fileDisk;\n }", "private synchronized byte[] mReadBytes(InputStream oInput){\n nDataRcvd= nBytesAvailable(oInput);\n if (nDataRcvd==0)\n return null;\n byte[] buffer = new byte[nDataRcvd];\n try {\n nDataRcvd=oInput.read(buffer); //Read is a blocking operation\n } catch (IOException e) {\n e.printStackTrace();\n buffer= null;\n }\n return buffer;\n }", "private ByteList fread(RubyThread thread, int length) throws IOException, BadDescriptorException {\n Stream stream = openFile.getMainStreamSafe();\n int rest = length;\n waitReadable(stream);\n ByteList buf = blockingFRead(stream, thread, length);\n if (buf != null) {\n rest -= buf.length();\n }\n while (rest > 0) {\n waitReadable(stream);\n openFile.checkClosed(getRuntime());\n stream.clearerr();\n ByteList newBuffer = blockingFRead(stream, thread, rest);\n if (newBuffer == null) {\n // means EOF\n break;\n }\n int len = newBuffer.length();\n if (len == 0) {\n // TODO: warn?\n // rb_warning(\"nonblocking IO#read is obsolete; use IO#readpartial or IO#sysread\")\n continue;\n }\n if (buf == null) {\n buf = newBuffer;\n } else {\n buf.append(newBuffer);\n }\n rest -= len;\n }\n if (buf == null) {\n return ByteList.EMPTY_BYTELIST.dup();\n } else {\n return buf;\n }\n }", "@Override\n public int read(byte[] b, int off, int len) throws IOException {\n int readA = readFromSpare(b, off, len);\n\n // Now read from the stream \n int readB = source.read(b, off+readA, len-readA);\n \n // Figure out how much we've done\n int read;\n if(readB == -1 || readB == 0) {\n read = readA; \n } else {\n read = readA + readB;\n }\n \n // Fix up our data\n if(read > 0) {\n read = fixUp(b, off, read);\n }\n \n // All done\n return read;\n }", "protected final int readBytesAt(int offset)\n throws IOException\n {\n // shouldn't modify mBytePtr, assumed to be 'offset'\n if (_inputSource != null) {\n int count = _inputSource.read(_inputBuffer, offset, _inputBuffer.length - offset);\n if (count > 0) {\n _inputEnd += count;\n }\n return count;\n }\n return -1;\n }", "public byte[] getContents() throws VlException\n {\n long len = getLength();\n // 2 GB files cannot be read into memory !\n\n // zero size optimization ! \n\n if (len==0) \n {\n return new byte[0]; // empty buffer ! \n }\n\n if (len > ((long) VRS.MAX_CONTENTS_READ_SIZE))\n throw (new ResourceToBigException(\n \"Cannot read complete contents of a file greater then:\"\n + VRS.MAX_CONTENTS_READ_SIZE));\n\n int intLen = (int) len;\n return getContents(intLen);\n\n }", "int getBytesRead() {\n \treturn _read + _o;\n }", "int read(byte[] buffer, int bufferOffset, int length) throws IOException;", "private static String readAllBytesJava7(String filePath) {\n String content = \"\";\n\n try {\n content = new String(Files.readAllBytes(Paths.get(filePath)));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return content;\n }", "public byte[] readBytes(int inNumberMessages) throws IOException;", "public void initializeFullRead() {\r\n\r\n try {\r\n bPtr = 0;\r\n\r\n if (raFile != null) {\r\n fLength = raFile.length();\r\n } else {\r\n return;\r\n }\r\n\r\n if (tagBuffer == null) {\r\n tagBuffer = new byte[(int) fLength];\r\n } else if (fLength > tagBuffer.length) {\r\n tagBuffer = new byte[(int) fLength];\r\n }\r\n\r\n raFile.readFully(tagBuffer);\r\n } catch (final IOException ioE) {}\r\n }", "public static byte[] To_Byte_Array (String filename) throws java.security.NoSuchAlgorithmException {\n byte[] data = null;\n // MessageDigest hash = MessageDigest.getInstance(\"SHA-512\");//SHA2 //removed\n\n //Streams, in:\n File textFile;//Textdatei\n FileInputStream in;//Dateieingabe-Stream\n\n try {\n\n textFile = new File(filename);\n in = new FileInputStream(textFile);\n int size = (int)textFile.length(); // Dateilaenge\n int read = 0; // Anzahl der gelesenen Zeichen\n data = new byte[size]; // Lesepuffer\n // Auslesen der Datei\n while (read < size)\n read =+ in.read(data, read, size-read);\n in.close();\n // Schreiben des Lesepuffers in Instanz von MessageDigest und speichern des Hash-Werts in message\n //hash.update (data);//removed\n //message=hash.digest ();//removed\n\n\n }//try\n catch (IOException ex) {\n ex.printStackTrace();\n }\n return data;//added\n }", "protected int filterBytes()\n throws IOException {\n\n if (headerPending) {\n parseHeader();\n }\n\n //System.out.println(\"nEncoded: \" + nEncoded);\n //System.out.println(\"Current: \" + current);\n \n if (nEncoded <= current) {\n int br = readEncodedBytes();\n System.out.println(\"reb: \" + br);\n if (br < 0) {\n return -1;\n }\n }\n\n // bytes decoding loop\n int inserted = 0;\n while (current < nEncoded) {\n \t\n if (current < firstQuantum) {\n if (decode(current) == 0) {\n // this is the end of the encoded data\n parseTrailer();\n return inserted;\n }\n\n // store the expected number of raw bytes encoded in the line\n remaining = decode(current);\n current = firstQuantum;\n\n }\n\n if (encoded[current] == '\\n' && encoded[current + 1] != '\\n') {\n \t \n \t \n \t System.out.println(\"Cur rEad\");\n \t \n \t \n if (remaining != 0) {\n throw new IOException(\"encoded length inconsistent with encoded data\");\n }\n\n //System.out.println(\"Remaning: \" + remaining);\n \n // update state for next line\n firstQuantum = current + 2;\n\n } else if (encoded[current] == '\\n') {\n \t System.out.println(\"CurrEad\");\n \t current = current + 1;\n } else {\n // this is an encoded data byte\n int fByte;\n \n // combine the various 6-bits bytes to produce 8-bits bytes\n switch ((current - firstQuantum) % 4) {\n case 0:\n // nothing to do\n break;\n case 1:\n fByte = ((decode(current - 1) & 0x3F) << 2)\n | ((decode(current) & 0x30) >> 4);\n if (remaining > 0) {\n putFilteredByte(fByte);\n ++inserted;\n --remaining;\n } else if (fByte != 0) {\n throw new IOException(\"unexpected non null bytes after encoded line\");\n }\n break;\n case 2:\n fByte = ((decode(current - 1) & 0x0F) << 4)\n | ((decode(current) & 0x3C) >> 2);\n if (remaining > 0) {\n putFilteredByte(fByte);\n ++inserted;\n --remaining;\n } else if (fByte != 0) {\n throw new IOException(\"unexpected non null bytes after encoded line\");\n }\n break;\n default:\n fByte = ((decode(current - 1) & 0x03) << 6)\n | (decode(current) & 0x3F);\n if (remaining > 0) {\n putFilteredByte(fByte);\n ++inserted;\n --remaining;\n } else if (fByte != 0) {\n throw new IOException(\"unexpected non null bytes after encoded line\");\n }\n \n }\n }\n\n ++current;\n\n }\n \n //System.out.println(inserted);\n\n // preserve current quantum for next round\n int start = current - ((current - firstQuantum) % 4);\n \n //System.out.println(\"FQ: \" + firstQuantum + \"S: \" + (char)encoded[current - 1]);\n \n //System.out.println(\"start: \" + start + \" nEenc-stsrt: \" + (nEncoded - start));\n \n if (firstQuantum < start) {\n System.arraycopy(encoded, start, encoded, 0, nEncoded - start);\n nEncoded -= start;\n current -= start;\n firstQuantum -= start;\n } else {\n \tnEncoded = 0;\n \tcurrent = 0;\n \tfirstQuantum = 0;\n }\n \n //System.out.println(\"out!\");\n //System.out.println (\"inserted == \" + inserted);\n \n return inserted;\n \n }", "public void read() throws IOException {\n\t\twhile (this.in.getReadBytes() != size) {\n\t\t\tString chunkID;\n\t\t\ttry {\n\t\t\t\tchunkID = readString(4);\n\t\t\t} catch (EmptyReadException e) {\n\t\t\t\t/**\n\t\t\t\t * T4L bug 15259: Some encoders must write a byte \"0\" to signify\n\t\t\t\t * EOF?\n\t\t\t\t */\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlong chunkSize = readLong(4);\n\t\t\treadChunk(chunkID, chunkSize);\n\t\t}\n\t}", "private void eraseBinary(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check if access to this file is allowed\r\n\t\tif (!fileAccessAllowed(ERASE_BINARY))\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// use P1 and P2 as offset\r\n\t\tshort offset = Util.makeShort(buffer[ISO7816.OFFSET_P1], buffer[ISO7816.OFFSET_P2]);\r\n\t\tJCSystem.beginTransaction();\r\n\t\t//@ open valid(); // hard to eliminate as the conjunct selectedFile.ElementaryFile depends on non-input parameters\r\n\t\tif (selectedFile == masterFile)\r\n\t\t\tISOException.throwIt(ISO7816.SW_FILE_INVALID); //~allow_dead_code Dead because fileAccessAllowed() checks that selectedFile instanceof ElementaryFile and masterFile is not an ElementaryFile.\r\n\t\t// impossible to start erasing from offset large than size of file\r\n\t\t//@ open selected_file_types(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _);\r\n\t\tshort size = ((ElementaryFile)selectedFile).getCurrentSize();\r\n\t\t\r\n\t\tif (offset > size || offset < 0)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t((ElementaryFile) selectedFile).eraseData(offset);\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}", "void readBytes(byte[] into, int offset, int toRead) throws IOException;", "public static byte[] readFile(File file, int valueType) {\n if (!file.exists()) {\n Log.e(TAG, \"The file doesn't exist\");\n }\n try {\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n FileInputStream fileInputStream = new FileInputStream(file);\n BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);\n byte[] buf = new byte[4096];\n switch (valueType) {\n case 0:\n case 1:\n case 2:\n case 3:\n while (bufferedInputStream.read(buf) != -1) {\n byteArrayOutputStream.write(buf, 16 * valueType, 16);\n }\n break;\n case 4:\n if (!file.getName().equals(\"E_SK2\")) {\n if (!file.getName().equals(\"E_PIN2\")) {\n while (true) {\n int len = bufferedInputStream.read(buf);\n if (len == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, (len - 32) - (16 * 1));\n }\n }\n } else {\n while (true) {\n int len2 = bufferedInputStream.read(buf);\n if (len2 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 1, ((len2 - 32) - (16 * 1)) - PKLENGTH);\n }\n }\n }\n } else {\n while (true) {\n int len3 = bufferedInputStream.read(buf);\n if (len3 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 16 * 4, (len3 - 32) - (16 * 4));\n }\n }\n }\n case 5:\n while (true) {\n int len4 = bufferedInputStream.read(buf);\n if (len4 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, len4 - 32, 32);\n }\n }\n case PUBLICKEY /* 7 */:\n while (true) {\n int len5 = bufferedInputStream.read(buf);\n if (len5 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, (len5 - 32) - PKLENGTH, PKLENGTH);\n }\n }\n case 8:\n while (true) {\n int len6 = bufferedInputStream.read(buf);\n if (len6 == -1) {\n break;\n } else {\n byteArrayOutputStream.write(buf, 0, len6 - 32);\n }\n }\n }\n byte[] buffer = byteArrayOutputStream.toByteArray();\n bufferedInputStream.close();\n fileInputStream.close();\n byteArrayOutputStream.close();\n return buffer;\n } catch (IOException e) {\n Log.e(TAG, \"read file exception!\" + e.getMessage());\n return new byte[0];\n }\n }", "private byte[] read(int length) throws IOException {\n byte[] result = new byte[length];\n\n int read = 0;\n while (read < length)\n {\n int i = this.in.read(result, read, length - read);\n if (i == -1)\n throw new EOFException();\n read += i;\n }\n return result;\n }", "public boolean hasCompleteFile() {\n return ((bitField0_ & 0x00000020) == 0x00000020);\n }", "private static byte[] readBytes(InputStream input, int length) throws IOException {\n\n int count = 0;\n byte[] buffer = new byte[length];\n\n while (count < length) count += input.read(buffer, count, length - count);\n\n return buffer;\n }", "private int mRead() {\n\t\t// read in a full buffer of bytes from the file\n\t\tint bytesRead = rawBytes.length;\n\t\tif (loop) {\n\t\t\treadBytesLoop();\n\t\t} else {\n\t\t\tbytesRead = readBytes();\n\t\t}\n\t\t// convert them to floating point\n\t\tint frameCount = bytesRead / format.getFrameSize();\n\t\tsynchronized (buffer) {\n\t\t\tbuffer.setSamplesFromBytes(rawBytes, 0, format, 0, frameCount);\n\t\t}\n\n\t\treturn frameCount;\n\t}", "boolean hasMoreBytes();", "public byte[] getbyteArray() {\n byte[] output = new byte[header_size+fileData.length];\n output[0] = (byte)((type & 0xff00)>> 8);\n output[1] = (byte)(type & 0xff);\n output[2] = (byte)((length & 0xff00)>> 8);\n\t output[3] = (byte)(length & 0xff);\n output[4] = (byte)((clientID & 0xff00)>> 8);\n output[5] = (byte)(clientID & 0xff);\n output[6] = action;\n byte[] temp2 = ByteBuffer.allocate(4).putInt(sectionLength).array();\n for(int i=0;i<4;i++) {\n output[7+i] = temp2[i]; \n }\n temp2 = ByteBuffer.allocate(4).putInt(filePosition).array();\n for(int j=0;j<4;j++) {\n output[11+j] = temp2[j]; \n }\n //copy file data\n System.arraycopy(fileData, 0,output, 15,fileData.length); \n return output;\n }", "private void getArquivo()\n {\n /*** Obtem o conteudo do pacote através do diretorio ***/\n File file = new File(caminho_origem);\n if (file.isFile())\n {\n try\n {\n /*** Lê o pacote e põe em um array de bytes ***/\n DataInputStream diStream = new DataInputStream(new FileInputStream(file));\n long len = (int) file.length();\n if (len > Utils.tamanho_maximo_arquivo)\n {\n System.out.println(Utils.prefixo_cliente + Utils.arquivo_muito_grande);\n System.exit(0);\n }\n Float numero_pacotes_ = ((float)len / Utils.tamanho_util_pacote);\n int numero_pacotes = numero_pacotes_.intValue();\n int ultimo_pacote = (int) len - (Utils.tamanho_util_pacote * numero_pacotes);\n int read = 0;\n /***\n 1500\n fileBytes[1500]\n p[512]\n p[512]\n p[476]len - (512 * numero_pacotes.intValue())\n ***/\n byte[] fileBytes = new byte[(int)len];\n while (read < fileBytes.length)\n {\n fileBytes[read] = diStream.readByte();\n read++;\n }\n int i = 0;\n int pacotes_feitos = 0;\n while ( pacotes_feitos < numero_pacotes)\n {\n byte[] mini_pacote = new byte[Utils.tamanho_util_pacote];\n for (int k = 0; k < Utils.tamanho_util_pacote; k++)\n {\n mini_pacote[k] = fileBytes[i];\n i++;\n }\n Pacote pacote_ = new Pacote();\n pacote_.setConteudo(mini_pacote);\n this.pacotes.add(pacote_);\n pacotes_feitos++;\n }\n byte[] ultimo_mini_pacote = new byte[ultimo_pacote];\n int ultimo_indice = ultimo_mini_pacote.length;\n for (int j = 0; j < ultimo_mini_pacote.length; j++)\n {\n ultimo_mini_pacote[j] = fileBytes[i];\n i++;\n }\n byte[] ultimo_mini_pacote2 = new byte[512];\n System.arraycopy(ultimo_mini_pacote, 0, ultimo_mini_pacote2, 0, ultimo_mini_pacote.length);\n for(int h = ultimo_indice; h < 512; h++ ) ultimo_mini_pacote2[h] = \" \".getBytes()[0];\n Pacote pacote_ = new Pacote();\n pacote_.setConteudo(ultimo_mini_pacote2);\n this.pacotes.add(pacote_);\n this.janela = new HashMap<>();\n for (int iterator = 0; iterator < this.pacotes.size(); iterator++) janela.put(iterator, new Estado());\n } catch (Exception e)\n {\n System.out.println(Utils.prefixo_cliente + Utils.erro_na_leitura);\n System.exit(0);\n }\n } else\n {\n System.out.println(Utils.prefixo_cliente + Utils.arquivo_inexistente);\n System.exit(0);\n }\n }", "@Override\n protected int read0() throws IOException {\n if (this.delegate.hasRemaining()) {\n return this.delegate.get() & 0xFF;\n } else {\n return RESULT_EOF;\n }\n }", "private int readFill(InputStream stream, byte[] buffer)\n throws IOException {\n int r = buffer.length;\n while (r > 0) {\n int p = buffer.length - r;\n int c = stream.read(buffer, p, r);\n if (c == -1) {\n break;\n }\n r -= c;\n }\n return buffer.length - r;\n\n }", "public void readBytes(byte[] buffer) throws IOException;", "public abstract byte[] read() throws IOException, IllegalArgumentException , IllegalStateException;", "public boolean hasCompleteFile() {\n return ((bitField0_ & 0x00000020) == 0x00000020);\n }", "public int readBytes(GatheringByteChannel out, int length)\r\n/* 508: */ throws IOException\r\n/* 509: */ {\r\n/* 510:520 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 511:521 */ return super.readBytes(out, length);\r\n/* 512: */ }", "private byte[] getStreamArquivo(File arquivo) throws IOException\n\t{\n\t\t/* Define o tamanho do buffer a ser lido do arquivo (max 32kb),\n\t\t * faz a criacao de um buffer em memoria para ir armazenando os dados\n\t\t * lidos e entao apos a leitura faz o envio dos dados para o GPP\n\t\t */\n\t\tint sizeBuffer = Integer.parseInt(getPropriedade(\"ordemVoucher.tamanhoBufferArquivos\"));\n\t\tFileInputStream fileInput = new FileInputStream(arquivo);\n\t\tByteArrayOutputStream bufferArquivo = new ByteArrayOutputStream();\n\n\t\tbyte[] data = new byte[sizeBuffer];\n\t\tint count=0;\n\t\twhile ( (count = fileInput.read(data)) != -1 )\n\t\t\tbufferArquivo.write(data,0,count);\n\t\t\n\t\treturn bufferArquivo.toByteArray();\n\t}", "protected Object readUnknownData() throws IOException {\r\n byte[] bytesValue;\r\n Byte[] bytesV;\r\n Preferences.debug(\"Unknown data; length is \" + elementLength + \" fp = \" + getFilePointer() + \"\\n\", 2);\r\n\r\n if (elementLength <= 0) {\r\n Preferences.debug(\"Unknown data; Error length is \" + elementLength + \"!!!!!\\n\", 2);\r\n\r\n return null;\r\n }\r\n\r\n bytesValue = new byte[elementLength];\r\n read(bytesValue);\r\n bytesV = new Byte[elementLength];\r\n\r\n for (int k = 0; k < bytesValue.length; k++) {\r\n bytesV[k] = new Byte(bytesValue[k]);\r\n }\r\n\r\n return bytesV;\r\n }", "public int read() throws IOException {\n/* 173 */ long next = this.pointer + 1L;\n/* 174 */ long pos = readUntil(next);\n/* 175 */ if (pos >= next) {\n/* 176 */ byte[] buf = this.data.get((int)(this.pointer >> 9L));\n/* */ \n/* 178 */ return buf[(int)(this.pointer++ & 0x1FFL)] & 0xFF;\n/* */ } \n/* 180 */ return -1;\n/* */ }", "alluxio.proto.journal.File.CompleteFileEntryOrBuilder getCompleteFileOrBuilder();", "public abstract void nextBytes(byte[] byteBuffer);", "protected byte[] readRecordData(RecordHeader header) throws IOException {\n byte[] buf = new byte[header.dataCount];\n file.seek(header.dataPointer);\n file.readFully(buf);\n return buf;\n }", "int readBytes(VRL vrl, long fileOffset, byte[] bytes, int bufferOffset, int nrBytes) throws VRLSyntaxException, IOException, VlException {\n String[] containerAndPath = getContainerAndPath(vrl);\n long end = fileOffset + nrBytes;\n Blob blob = getBlobstore().getBlob(containerAndPath[0], containerAndPath[1], range(fileOffset, end));\n int numRead = blob.getPayload().getInput().read(bytes, bufferOffset, nrBytes);\n// if (numRead != nrBytes) {\n// debug(\"-----------------Asked: \" + nrBytes + \" got: \" + numRead);\n// }\n return numRead;\n }", "public byte[] readRawByte() throws IOException {\n byte[] bytes = new byte[2];\n bytes[0] = (byte) Type.BYTE.code;\n in.readFully(bytes, 1, 1);\n return bytes;\n }", "public int readBytes(GatheringByteChannel out, int length)\r\n/* 219: */ throws IOException\r\n/* 220: */ {\r\n/* 221:240 */ checkReadableBytes(length);\r\n/* 222:241 */ int readBytes = getBytes(this.readerIndex, out, length, true);\r\n/* 223:242 */ this.readerIndex += readBytes;\r\n/* 224:243 */ return readBytes;\r\n/* 225: */ }" ]
[ "0.6530784", "0.6274362", "0.6161624", "0.58519745", "0.58268666", "0.5810144", "0.5796792", "0.57363147", "0.5735362", "0.5733499", "0.5714032", "0.5711769", "0.57066405", "0.5680843", "0.56393", "0.56330234", "0.562002", "0.56180704", "0.5609561", "0.56008494", "0.55539143", "0.5546608", "0.55230516", "0.5515838", "0.5510864", "0.55040175", "0.5486559", "0.5469554", "0.5468607", "0.5461935", "0.5455338", "0.54509616", "0.54445773", "0.5438776", "0.54328793", "0.5420292", "0.541718", "0.54044634", "0.539954", "0.53861564", "0.53823787", "0.53507674", "0.5334528", "0.5323625", "0.5318683", "0.5318099", "0.5313055", "0.53126675", "0.5287153", "0.5274438", "0.5271085", "0.52487636", "0.52434117", "0.5241276", "0.52227515", "0.52211523", "0.52191126", "0.52157354", "0.520992", "0.52075917", "0.5206796", "0.52000576", "0.5190252", "0.51822734", "0.5182194", "0.5181087", "0.5180918", "0.5179424", "0.51747245", "0.51693755", "0.51586705", "0.51563174", "0.5152815", "0.5144841", "0.51123255", "0.5092075", "0.5085891", "0.5072232", "0.50645846", "0.5063888", "0.506087", "0.50600135", "0.50524545", "0.5046122", "0.5043956", "0.50389344", "0.50366676", "0.50364697", "0.5025509", "0.5022658", "0.5004603", "0.50005704", "0.49996233", "0.49981204", "0.49976614", "0.49967566", "0.4992889", "0.498866", "0.49880084", "0.49834695" ]
0.6396269
1
points of teritory / General : The class constractor. Input : startR the start row index to init pieces , endR the end row index to init pieces, startC the start col index to init pieces, endC the end col index to init pieces , color the color of the player pieces . Output : instance of the class.
public Player(int startR ,int endR , int startC ,int endC , String color) { // constractor // startR - start row for creating the pieces , startC - start colomn for creating the pieces // endR - End row for creating the pieces , endC - END colomn for creating the pieces this.color=color; for(int i = startR; i <= endR; i++){ for(int j = startC ; j <= endC ;j++){ pieces.put(new Integer (j*Board.N+i), new Piece(i,j, color)); // new piece teritory.add(j* Board.N +i); // saving index of teritory base } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Pieces(int row, int column, PieceType piece, PieceColor color){\r\n\t\tthis.piece = piece;\r\n\t\tthis.row = row;\r\n\t\tthis.column = column;\r\n\t\tthis.color = color;\r\n\t\tthis.moved = false;\r\n\t}", "@Override\r\n public void getRange(ArrayList<Piece> pieces){\r\n this.range.clear();\r\n int pieceX = this.getX(); int pieceY = this.getY(); // X and Y coordinates for the king piece\r\n\r\n // getPiece: 0 = empty; 1 = same color; 2 = opposite color\r\n //Up\r\n if (this.getPiece(pieceX, pieceY+1, pieces) == 0 || this.getPiece(pieceX, pieceY+1, pieces) == 2)\r\n this.range.add(new int[] {pieceX, pieceY+1}); // Return int[] of tested coordinates\r\n\r\n //Up-right\r\n if (this.getPiece(pieceX+1, pieceY+1, pieces) == 0 || this.getPiece(pieceX+1, pieceY+1, pieces) == 2)\r\n this.range.add(new int[] {pieceX+1, pieceY+1}); // Return int[] of tested coordinates\r\n\r\n //Right\r\n if (this.getPiece(pieceX+1, pieceY, pieces) == 0 || this.getPiece(pieceX+1, pieceY, pieces) == 2)\r\n this.range.add(new int[] {pieceX+1, pieceY}); // Return int[] of tested coordinates\r\n\r\n //Down-right\r\n if (this.getPiece(pieceX+1, pieceY-1, pieces) == 0 || this.getPiece(pieceX+1, pieceY-1, pieces) == 2)\r\n this.range.add(new int[] {pieceX+1, pieceY-1}); // Return int[] of tested coordinates\r\n\r\n //Down\r\n if (this.getPiece(pieceX, pieceY-1, pieces) == 0 || this.getPiece(pieceX, pieceY-1, pieces) == 2)\r\n this.range.add(new int[] {pieceX, pieceY-1}); // Return int[] of tested coordinates\r\n\r\n //Down-left\r\n if (this.getPiece(pieceX-1, pieceY-1, pieces) == 0 || this.getPiece(pieceX-1, pieceY-1, pieces) == 2)\r\n this.range.add(new int[] {pieceX-1, pieceY-1}); // Return int[] of tested coordinates\r\n\r\n //Left\r\n if (this.getPiece(pieceX-1, pieceY, pieces) == 0 || this.getPiece(pieceX-1, pieceY, pieces) == 2)\r\n this.range.add(new int[] {pieceX-1, pieceY}); // Return int[] of tested coordinates\r\n\r\n //Up-left\r\n if (this.getPiece(pieceX-1, pieceY+1, pieces) == 0 || this.getPiece(pieceX-1, pieceY+1, pieces) == 2)\r\n this.range.add(new int[] {pieceX-1, pieceY+1}); // Return int[] of tested coordinates\r\n\r\n //Castling\r\n for (Piece piece : pieces) {\r\n if (piece instanceof Rook) {\r\n if (piece.getColor() == this.getColor()) {\r\n if (validCastling(pieces, (Rook)piece)) {\r\n int targetX = (piece.getX() < getX()) ? (this.getX() - 2) : (this.getX() + 2);\r\n this.range.add(new int[] {targetX, this.getY()});\r\n }\r\n }\r\n }\r\n }\r\n }", "public List<Point> getPieces(Color pColor){\r\n List<Point> result = new LinkedList<>();\r\n Point pos = new Point();\r\n for (int i = 0; i < 8; i++){\r\n pos.setFirst(i);\r\n for (int j = 0; j < 8; j++){\r\n pos.setSecond(j);\r\n if((isBlack(pColor) && isBlack(pos)) || (isRed(pColor) && isRed(pos))){\r\n result.add(pos.clone());\r\n }\r\n }\r\n } \r\n return result;\r\n }", "public Piece(int x , int y, PlayerType color,Names type){\n this.x = x;\n this.y = y;\n \n this.color = color;\n this.type = type;\n }", "public Pawn(int x, int y, String ID, String color) {\n\t\tsuper(x,y,ID);\n\t\tif (color == \"white\") {\n\t\t\txrange = -2;\n\t\t\tyrange = 1;\n\t\t\tthis.color = 1;\n\t\t}\n\t\tif (color == \"black\") {\n\t\t\txrange = 2;\n\t\t\tyrange = 1;\n\t\t\tthis.color = 0;\n\t\t}\n\t\tfirstMove = true;\n\t}", "interface Cnst {\r\n\r\n /////////////////////////////////////////////////////////////\r\n // These constants can be changed to edit the big bang ran //\r\n /////////////////////////////////////////////////////////////\r\n\r\n //full size is eight, scales the size of the board\r\n int scale = 8;\r\n\r\n //numbers of blocks in a row and a column\r\n int blocks = 10;\r\n\r\n //number of colors the game will use, between 2-8 inclusive\r\n int numOfColors = 8;\r\n\r\n //the number of turns you have to win the game\r\n int maxTurns = 25;\r\n\r\n\r\n ////////////////////////////////////////\r\n // Please do not edit these constants //\r\n ////////////////////////////////////////\r\n\r\n //the visible board width, scales with scale\r\n int boardWidth = 70 * scale;\r\n\r\n //the visible board height, scales with scale\r\n int boardHeight = 70 * scale;\r\n\r\n //cell width scales with the board and scale\r\n int cellWidth = boardWidth / blocks;\r\n\r\n //cell height scales with board and scale\r\n int cellHeight = boardHeight / blocks;\r\n\r\n //new constant for text on the board\r\n int textHeight = boardWidth / 12;\r\n\r\n //the 8 colors that can be selected by the user\r\n ArrayList<Color> colorsToChoose =\r\n new ArrayList<Color>(Arrays.asList(\r\n Color.CYAN, Color.PINK, Color.ORANGE,\r\n Color.BLUE, Color.RED, Color.GREEN,\r\n Color.MAGENTA, Color.YELLOW));\r\n}", "public Pawn(String color){\r\n this.color=color; \r\n }", "private void paintCourbePoints() {\n\t\tfloat x, y;\n\t\tint i, j;\n\t\t\n\t\tfor(x=xMin; x<=xMax; x++) {\n\t\t\ty = parent.getY(x);\n\t\t\t\n\t\t\tif(y>yMin && y<yMax) {\n\t\t\t\ti = convertX(x);\n\t\t\t\tj = convertY(y);\n\t\t\t\t\n\t\t\t\t//Utilisation d'un carre/losange pour simuler un point \n\t\t\t\t//de taille superieur a un pixel car celui-ci est peu visible.\n\t\t\t\tpaintPointInColor(i-2, j);\n\t\t\t\tpaintPointInColor(i-1, j-1);\t\t\t\t\n\t\t\t\tpaintPointInColor(i-1, j);\n\t\t\t\tpaintPointInColor(i-1, j+1);\n\t\t\t\tpaintPointInColor(i, j-2);\t//\t *\n\t\t\t\tpaintPointInColor(i, j-1);\t//\t * * *\n\t\t\t\tpaintPointInColor(i, j);\t//\t* * * * *\n\t\t\t\tpaintPointInColor(i, j+1);\t//\t * * *\n\t\t\t\tpaintPointInColor(i, j+2);\t//\t *\n\t\t\t\tpaintPointInColor(i+1, j-1);\n\t\t\t\tpaintPointInColor(i+1, j);\n\t\t\t\tpaintPointInColor(i+1, j+1);\n\t\t\t\tpaintPointInColor(i+2, j);\n\t\t\t}\n\t\t}\t\t\n\t}", "public PieceView2D(PieceEnum pieceType, Color color) {\n super(pieceType, color);\n\n setColor(color);\n\n }", "private primitives.Color AdaptiveDiffusedAndGlossyRec(Point3D centerP, double WidthAndHeight, double minCubeSize, Point3D pIntersection,Vector Vright,Vector Vup , Vector normal, int direction, int level , double k, double ktr, List<Point3D> prePoints) throws Exception {\r\n List<Point3D> nextCenterPList = new LinkedList<Point3D>();\r\n List<Point3D> cornersList = new LinkedList<Point3D>();\r\n List<primitives.Color> colorList = new LinkedList<primitives.Color>();\r\n Point3D tempCorner;\r\n GeoPoint gp;\r\n Ray tempRay;\r\n for (int i = -1; i <= 1; i += 2)\r\n for (int j = -1; j <= 1; j += 2) {\r\n tempCorner = centerP.add(Vright.scale(i * WidthAndHeight / 2)).add(Vup.scale(j * WidthAndHeight / 2));\r\n cornersList.add(tempCorner);\r\n if (prePoints == null || !isInList(prePoints, tempCorner)) {\r\n tempRay = new Ray(pIntersection, tempCorner.subtract(pIntersection), normal);\r\n if ((normal.dotProduct(tempRay.getDir()) < 0 && direction == 1) || (normal.dotProduct(tempRay.getDir()) > 0 && direction == -1)) {\r\n nextCenterPList.add(centerP.add(Vright.scale(i * WidthAndHeight / 4)).add(Vup.scale(j * WidthAndHeight / 4)));\r\n gp = findClosestIntersection(tempRay);\r\n if (gp == null)\r\n colorList.add(scene.background);\r\n else {\r\n colorList.add(calcColor(gp, tempRay, level - 1, k));\r\n } \r\n }\r\n \r\n }\r\n }\r\n\r\n if (nextCenterPList == null || nextCenterPList.size() == 0) {\r\n return primitives.Color.BLACK;\r\n }\r\n\r\n\r\n if (WidthAndHeight < minCubeSize * 2) {\r\n primitives.Color sumColor = primitives.Color.BLACK;\r\n for (primitives.Color color : colorList) {\r\n sumColor = sumColor.add(color);\r\n }\r\n return sumColor.reduce(colorList.size());\r\n }\r\n\r\n\r\n boolean isAllEquals = true;\r\n primitives.Color tempColor = colorList.get(0);\r\n for (primitives.Color color : colorList) {\r\n if (!tempColor.isAlmostEquals(color))\r\n isAllEquals = false;\r\n }\r\n if (isAllEquals && colorList.size() > 1)\r\n return tempColor;\r\n\r\n\r\n tempColor = primitives.Color.BLACK;\r\n for (Point3D center : nextCenterPList) {\r\n tempColor = tempColor.add(AdaptiveDiffusedAndGlossyRec(center, WidthAndHeight / 2, minCubeSize, pIntersection, Vright, Vup, normal, direction, level, k, ktr, cornersList));\r\n }\r\n return tempColor.reduce(nextCenterPList.size());\r\n }", "public Piece(Color color) {\r\n this.type = Type.SINGLE;\r\n this.color = color;\r\n }", "public static Point[] init_starting_points(boolean red){\n \n Point corner = red ? Map.red_corner : Map.blue_corner;\n ArrayList<Point> list_points = new ArrayList<>();\n Point[] ret_points;\n for (int x = 0; x < MAP_HEIGHT; x++){\n for (int y = 0; y < MAP_WIDTH; y++){\n if (Point.distance(corner, x,y) < spawn_size ){\n\n boolean valid = true;\n for (int _x = x-2; _x < x+2 && valid; _x++){\n for (int _y = y-2; _y < y + 2 && valid; _y++){\n if (Point.distance(x,y,_x,_y) > 2)\n continue;\n try {\n if (global_map[_x][_y] != Terrain.GRASS)\n valid = false;\n\n }\n catch (Exception e){\n valid = false;\n }\n }\n }\n\n if (valid)\n list_points.add(new Point(x,y));\n\n }\n }\n }\n \n \n ret_points = new Point[list_points.size()];\n ret_points = list_points.toArray(ret_points);\n return ret_points;\n\n }", "public Player(int r, int c) { // contructor that makes the player object and declares the varaibles\r\n\t\t_row = r;\r\n\t\t_col = c;\r\n\t\t_isAlive = true;\r\n\t}", "public Pawn(int xPosition, int yPosition, Color color, PieceType pieceType) {\n\t\tsuper(xPosition, yPosition, color, pieceType);\n\t}", "public PlayerClass(int color, String name){\n\t\tthis.color=color;\n\t\tthis.name=name;\n\t\tpawns = new PawnClass[4];\n\t\tdiceTossed = false;\n\t}", "public Piece.color getColor() { return color; }", "public GamePiece(Color color, int x, int y){\n king = false;\n this.x = x;\n this.y = y;\n this.color = color;\n // Aligns to correct position on centre of the correct tile\n setCenterX(30 + (x * 60));\n setCenterY(30 + (y * 60));\n setRadius(20);\n // Sets the colour of the piece to visually show who it belongs to\n setFill(color);\n }", "private ArrayList<Point> extractCC(Point r, Image img)\r\n/* 55: */ {\r\n/* 56: 58 */ this.s.clear();\r\n/* 57: 59 */ this.s.add(r);\r\n/* 58: 60 */ this.temp.setXYBoolean(r.x, r.y, true);\r\n/* 59: 61 */ this.list2.add(r);\r\n/* 60: */ \r\n/* 61: 63 */ Point[] N = { new Point(1, 0), new Point(0, 1), new Point(-1, 0), new Point(0, -1), \r\n/* 62: 64 */ new Point(1, 1), new Point(-1, -1), new Point(-1, 1), new Point(1, -1) };\r\n/* 63: */ \r\n/* 64: 66 */ ArrayList<Point> pixels = new ArrayList();\r\n/* 65: */ int x;\r\n/* 66: */ int i;\r\n/* 67: 68 */ for (; !this.s.isEmpty(); i < N.length)\r\n/* 68: */ {\r\n/* 69: 70 */ Point tmp = (Point)this.s.pop();\r\n/* 70: */ \r\n/* 71: 72 */ x = tmp.x;\r\n/* 72: 73 */ int y = tmp.y;\r\n/* 73: 74 */ pixels.add(tmp);\r\n/* 74: */ \r\n/* 75: 76 */ this.temp2.setXYBoolean(x, y, true);\r\n/* 76: */ \r\n/* 77: 78 */ i = 0; continue;\r\n/* 78: 79 */ int _x = x + N[i].x;\r\n/* 79: 80 */ int _y = y + N[i].y;\r\n/* 80: 82 */ if ((_x >= 0) && (_x < this.xdim) && (_y >= 0) && (_y < this.ydim)) {\r\n/* 81: 84 */ if (!this.temp.getXYBoolean(_x, _y))\r\n/* 82: */ {\r\n/* 83: 86 */ boolean q = img.getXYBoolean(_x, _y);\r\n/* 84: 88 */ if (q)\r\n/* 85: */ {\r\n/* 86: 90 */ Point t = new Point(_x, _y);\r\n/* 87: 91 */ this.s.add(t);\r\n/* 88: */ \r\n/* 89: 93 */ this.temp.setXYBoolean(t.x, t.y, true);\r\n/* 90: 94 */ this.list2.add(t);\r\n/* 91: */ }\r\n/* 92: */ }\r\n/* 93: */ }\r\n/* 94: 78 */ i++;\r\n/* 95: */ }\r\n/* 96: 99 */ for (Point t : this.list2) {\r\n/* 97:100 */ this.temp.setXYBoolean(t.x, t.y, false);\r\n/* 98: */ }\r\n/* 99:101 */ this.list2.clear();\r\n/* 100: */ \r\n/* 101:103 */ return pixels;\r\n/* 102: */ }", "public Pawn(Point location, Color color) {\n this.numMoves = 0;\n this.color = color;\n this.location = location;\n }", "public void getNewPiece(){\n\t\tthis.next_piece_index= rand.nextInt(18);\n\t\tthis.next_piece_colour= rand.nextInt(10);\n\t\tnext_currentPiece = Pentominoes.Pentomino_array[this.next_piece_index];\n\t\tnext_currentColor = Pentominoes.color_array[this.next_piece_colour];\n\t\tfor(int i = 0; i < next_pieces_array.length; i++){\n\t\t\tfor(int j = 0; j<next_pieces_array[0].length; j++){\n\t\t\t\t\tnext_pieces_array[i][j] = Color.WHITE;\n\t\t\t}\n\t\t}\n\t\tfor(Point p: next_currentPiece){\n\t\t\tnext_pieces_array[p.x + pieceOrigin2.x][p.y + pieceOrigin2.y] = next_currentColor;\n\t\t}\n\t}", "private TetrisPiece randomPiece() {\n\t\tint rand = Math.abs(random.nextInt());\n\t\treturn new TetrisPiece(rand % (PIECE_COLORS.length));\n\t}", "public Tile(int xPos, int yPos, int zPos, int colour) {\n this.xPos = xPos;\n this.yPos = yPos;\n this.zPos = zPos;\n occupied = 0;\n setWidth(50);\n setHeight(50);\n if ((colour % 2) == 0) {\n setFill(Color.YELLOW);\n } else {\n setFill(Color.GREEN);\n }\n }", "public void addPawn(Pawn.Color c) { pawn = new Pawn(c, Pawn.Type.BASIC); }", "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 }", "private void paintCourbeCroix() {\n\t\tfloat x, y;\n\t\tint i, j;\n\t\tint k, l;\n\t\t\n\t\t\n\t\tfor(x=xMin; x<=xMax; x++) { //Une croix pour chaque x entier dans le repere\n\t\t\ty = parent.getY(x);\n\t\t\t\n\t\t\tif(y>yMin && y<yMax) { //Si le point est dans le repere\n\t\t\t\ti = convertX(x);\n\t\t\t\tj = convertY(y);\n\t\t\t\t\n\t\t\t\tfor(k=i-2, l=j-2; l<=j+2; k++, l++)\t// * *\n\t\t\t\t\tpaintPointInColor(k, l);\t\t// * *\n\t\t\t\t\t\t\t\t\t\t\t\t\t// *\n\t\t\t\tfor(k=i+2, l=j-2; l<=j+2; k--, l++)\t// * *\n\t\t\t\t\tpaintPointInColor(k, l);\t\t// * *\n\t\t\t}\n\t\t}\t\n\t}", "public BigLpiece()\r\n\t{\r\n\t\tsuper();\r\n\t\ttype=BIGL_PIECE; \r\n\t\tpositions = new Point[][]{{new Point (0,1), new Point (0,2), new Point (0,3), new Point (1,3)}, \r\n\t\t\t\t{new Point (1,0), new Point (2,0), new Point (3,0), new Point (3,-1)},\r\n\t\t\t\t{new Point (0,-1), new Point (0,-2), new Point (0,-3), new Point (-1,-3)},\r\n\t\t\t\t{new Point (-1,0), new Point (-2,0), new Point (-3,0), new Point (-3,1)},\r\n\t\t\t\t{new Point (0,-1), new Point (0,-2), new Point (0,-3), new Point (1,-3)},\r\n\t\t\t\t{new Point (1,0), new Point (2,0), new Point (3,0), new Point (3,1)},\r\n\t\t\t\t{new Point (0,1), new Point (0,2), new Point (0,3), new Point (-1,3)}, \r\n\t\t\t\t{new Point (-1,0), new Point (-2,0), new Point (-3,0), new Point (-3,-1)}};\r\n\t}", "public void drawPoligono(Color c, Color f){\n int xPoints[] = new int[nPoints];\n int yPoints[] = new int[nPoints];\n \n // Copia pontos de arraylist para arrays\n for(int i = 0; i < nPoints; i++){\n xPoints[i] = pointsX.get(i);\n yPoints[i] = pointsY.get(i);\n System.out.println(xPoints[i] + \", \" + yPoints[i]);\n }\n Poligono k = new Poligono(xPoints, yPoints, nPoints, c, f);\n k.draw(canvas, info);\n \n // Limpa os pontos e reseta contador\n pointsX.clear();\n pointsY.clear();\n nPoints = 0;\n }", "public void setPieces(){\r\n Pawn[] arrwPawn = new Pawn[8];\r\n for (int i=0 ; i<8 ; i++){\r\n pos.setPosition(6,i);\r\n arrwPawn[i] = new Pawn (pos , piece.Colour.WHITE);\r\n GameBoard.putPiece(arrwPawn[i]);\r\n }\r\n\r\n Pawn[] arrbPawn = new Pawn[8];\r\n for(int i=0 ; i<8 ; i++){\r\n pos.setPosition(0,i);\r\n arrbPawn[i] = new Pawn(pos , piece.Colour.BLACK);\r\n GameBoard.putPiece(arrbPawn[i]);\r\n }\r\n\r\n\r\n //set black pieces in the board\r\n\r\n pos.setPosition(0,0);\r\n Rook bRook1 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook1);;\r\n\r\n pos.setPosition(0,7);\r\n Rook bRook2 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook2);\r\n\r\n\r\n pos.setPosition(0,1);\r\n Knight bKnight1 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,6);\r\n Knight bKnight2 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,2);\r\n Bishop bBishop1 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop1);\r\n\r\n pos.setPosition(0,5);\r\n Bishop bBishop2 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop2);\r\n\r\n pos.setPosition(0,3);\r\n Queen bQueen = new Queen(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bQueen);\r\n\r\n pos.setPosition(0,4);\r\n King bKing = new King(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKing);\r\n\r\n //set white pieces in the board\r\n\r\n pos.setPosition(7,0);\r\n Rook wRook1 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook1);\r\n\r\n pos.setPosition(7,7);\r\n Rook wRook2 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook2);\r\n\r\n pos.setPosition(7,1);\r\n Knight wKnight1 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,6);\r\n Knight wKnight2 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,2);\r\n Bishop wBishop1 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop1);\r\n\r\n pos.setPosition(7,5);\r\n Bishop wBishop2 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop2);\r\n\r\n pos.setPosition(7,3);\r\n Queen wQueen = new Queen(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wQueen);\r\n\r\n pos.setPosition(7,4);\r\n King wKing = new King(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKing);\r\n\r\n\r\n\r\n Rook arrwRook[] = {wRook1,wRook2};\r\n Rook arrbRook[] = {bRook1,bRook2};\r\n Queen arrwQueen[] = {wQueen};\r\n Queen arrbQueen[] = {bQueen};\r\n Knight arrwKnight[] = {wKnight1,wKnight2};\r\n Knight arrbKnight[] = {bKnight1,bKnight2};\r\n King arrwKing[] = {wKing};\r\n King arrbKing[] = {bKing};\r\n Bishop arrwBishop[] = {wBishop1,wBishop2};\r\n Bishop arrbBishop[] = {bBishop1,bBishop2};\r\n }", "public Cabeza (Color color, Serpiente serpiente,String sentido, Posicion posicion) {\r\n //Inicializa los atributos\r\n// ojos = new ArrayList<Circle>();\r\n this.serpiente = serpiente;\r\n //Se crea la cabeza, se compone de la cabeza, los ojos y las pupilas\r\n cabeza = new Circle(color);\r\n setSentido(sentido);\r\n setPosicion(posicion);\r\n setColor(color);\r\n// Circle ojoDerecho = new Circle(10,Color.WHITE);\r\n// Circle ojoIzquierdo = new Circle(10,Color.WHITE);\r\n// Circle pupilaDerecha = new Circle(8,Color.BLACK);\r\n// Circle pupulaIzquierda = new Circle(8,Color.BLACK);\r\n// //Se agregan los miembros a la cabeza\r\n// ojos.add(ojoDerecho);\r\n// ojos.add(ojoIzquierdo);\r\n// ojos.add(pupilaDerecha);\r\n// ojos.add(pupulaIzquierda);\r\n }", "@Override\n\tpublic Color getColor(Vector point)\n\t{\n\t\tVector d = point.sub(position);\n\t\t\n\t\tdouble\tlenx = Math.floor( d.dot(oX) ),\n\t\t\t\tleny = Math.floor( d.dot(oY) );\n\t\t\n\t\t//int ModularDistance = Math.abs( (int) (lenx + leny) ) % 2;\n\t\tif ( 0 == Math.abs( (int) (lenx + leny) ) % 2)\n\t\t{\n\t\t\treturn c1.dup();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn c2.dup();\n\t\t}\n\t}", "public Pawn(Player player, Board board, char color, int xpos, int ypos) {\n\t\tsuper(player, board, color, xpos, ypos);\n\t\tthis.name = 'p';\n\t\tthis.enpassant = false;\n\t\thasMovedTwo = false;\n\t}", "public Critter(){\n\tthis.x_location = (int) (Math.random()*99);\n\tthis.y_location = (int) (Math.random()*99);\n\tthis.wrap();\n\t}", "public Pellets(Color c, int num)\n {\n color = c;\n \n for (int i=0; i<num; i++)\n {\n Point p = new Point(gen.nextInt(MunchGame.BOARD_WIDTH-1)+1,\n gen.nextInt(MunchGame.BOARD_HEIGHT-1)+1);\n pellets.add(p);\n }\n }", "public PieceView(Color color, Type type) {\n this.color = color;\n this.type = type;\n }", "public TetrisPiece (int shape, int location) {\n\t\t\n\t}", "PRColor occupiedBy() {\n return c;\n }", "public Television(int precioBase, int peso, char consumoEnergetico, String color, int pulgadas, boolean sintonizador){\r\n super(precioBase, peso, consumoEnergetico, color);\r\n this.pulgadas=pulgadas;\r\n this.sintonizador=sintonizador;\r\n }", "public ChessModel(int r, int c, ArrayList<Integer> s){\n Rows = r;\n Cols = c;\n start = s;\n curBoard = s;\n clearStack();\n }", "public PieceColor getColor(){\r\n\t\treturn this.color;\r\n\t}", "Piece(int a, int b, int player)\n {\n x = a;\n y = b;\n this.player = player;\n }", "public Point getMovingPositions(Point c , Color color , Movement m){\n Orientation or = color==Color.black?Orientation.DOWN:Orientation.UP;\n Color oposite = color==Color.black?Color.red:Color.black;\n Point soldierPoint = getXandYgivenOrientation(c, or, m);\n Soldier friend = new Soldier(soldierPoint.x,soldierPoint.y,color);\n Soldier foe = new Soldier(soldierPoint.x,soldierPoint.y,oposite);\n if(!containsSoldier(friend, gamePieces) && !containsSoldier(foe, gamePieces) \n && isValidSquare(soldierPoint.x, soldierPoint.y))\n return new Point(soldierPoint.x,soldierPoint.y);\n else if(containsSoldier(friend, gamePieces))\n return new Point(0,0);\n else if (containsSoldier(foe, gamePieces))\n return new Point(0,0); \n return new Point(0,0);\n }", "private Pawn(Point location, Color color, int moves, boolean captureableEnPassant) {\n enPassantOk = captureableEnPassant;\n this.numMoves = moves;\n this.color = color;\n this.location = location;\n }", "public Processor(int n, Point p, int r, Color color) {\n super(n, p, r, color);\n child = new LinkedList<>();\n }", "public TilePiece(){\n\t\t\n\t\tiColour = null;\n\t\tiShape = null;\n\t}", "public Electrodomestico(int precioBase, Colores color, Letra consumoEnergetico, int peso) {\r\n this.precioBase = precioBase;\r\n this.color = color;\r\n this.consumoEnergetico = consumoEnergetico;\r\n this.peso = peso;\r\n }", "public GameTileyul579(int tileValue) {\n\n //calls the empty constructor\n super(tileValue);\n\n /*TODO: Create one or more new Shape(s) to represent the tile \n * (it can be a Rectangle, a Circle, a combination, etc. Get creative!)\n *\n * Don't forget to set the width and height of the object(s)\n * \n * Set the color of the object(s) depending on the tile's value.\n * You can use the colors HashMap to get the appropriate color.\n * Remember you can change the colors in this HashMap, and you can \n * combine them with other colors to make a creative tile. The\n * only requirement is that each legal value in the game have a \n * different color or color scheme. You need to handle illegal \n * values, but the color you choose for these illegal values is \n * up to you.\n * \n * Remember that colors.get(tileValue) will return the Color\n * associated with the value.\n * \n */ \n Rectangle square = new Rectangle();\n square.setWidth(100);\n square.setHeight(100);\n populateColors();\n square.setFill(colors.get(tileValue));\n //illegal value\n if((tileValue & (tileValue-1))!=0 || tileValue<0 ||tileValue==1)\n square.setFill(Color.BLACK);\n if(tileValue > 256)\n square.setFill(Color.WHITE);\n\n \n \n /* TODO: Create a Text object to display the value of the tile,\n * if the tileValue is non-zero\n * Don't forget to setText, setFont, and setFill\n *\n * The font type and color is up to you. You might choose to vary it\n * depending on the value of the tile, or you can just use a single\n * color.\n *\n * If tileValue is 0,\n * you do not need to create this text object. I.e. it will be blank.\n */\n Text someText = new Text();\n if(tileValue!=0){\n someText.setText(Integer.toString(tileValue));\n someText.setFont(Font.font(\n \"Times New Roman\",FontWeight.BOLD,30));\n someText.setFill(Color.WHITE); \n }else{\n someText.setText(\"\"); \n }\n\n /* TODO: Finally, add tile shape(s) and value of tile to the calling\n * object, which is a StackPane. \n * Hint: Look into the getChildren method of the StackPane/Pane class\n * and remember that you are adding your objects to the calling object\n * which is a StackPane. \n */\n this.getChildren().add(square);\n this.getChildren().add(someText);\n\n }", "public void createPieces(){ \n\t\tfor(int x = 0; x<BOARD_LENGTH; x++){\n\t\t\tfor(int y = 0; y<BOARD_LENGTH; y++){ \n\t\t\t\tif(CHESS_MAP[x][y] != (null)){\n\t\t\t\t\tswitch (CHESS_MAP[x][y]){\n\t\t\t\t\tcase KING:\n\t\t\t\t\t\tpieces[pieceCounter] = new King(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase QUEEN:\n\t\t\t\t\t\tpieces[pieceCounter] = new Queen(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BISHOP:\n\t\t\t\t\t\tpieces[pieceCounter] = new Bishop(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KNIGHT:\n\t\t\t\t\t\tpieces[pieceCounter] = new Knight(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PAWN:\n\t\t\t\t\t\tpieces[pieceCounter] = new Pawn(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ROOK:\n\t\t\t\t\t\tpieces[pieceCounter] = new Rook(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} \n\t\t\t\t\tsetPieceIconAndName(x, y, CHESS_MAP[x][y]); \t\n\t\t\t\t\tpieceCounter++;\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t}", "public RedCell()\n {\n super(1, Greenfoot.getRandomNumber(2) + 1);\n setRotation(Greenfoot.getRandomNumber(360));\n }", "void setColor(char c, char t) {\n\t\tif(c == 'b' && t == 'b') pI = PieceImage.B_BISHOP;\n\t\tif(c == 'b' && t == 'k') pI = PieceImage.B_KING;\n\t\tif(c == 'b' && t == 'c') pI = PieceImage.B_KNIGHT;\n\t\tif(c == 'b' && t == 'p') pI = PieceImage.B_PAWN;\n\t\tif(c == 'b' && t == 'q') pI = PieceImage.B_QUEEN;\n\t\tif(c == 'b' && t == 'r') pI = PieceImage.B_ROOK;\n\t\t\n\t\tif(c == 'w' && t == 'b') pI = PieceImage.W_BISHOP;\n\t\tif(c == 'w' && t == 'k') pI = PieceImage.W_KING;\n\t\tif(c == 'w' && t == 'c') pI = PieceImage.W_KNIGHT;\n\t\tif(c == 'w' && t == 'p') pI = PieceImage.W_PAWN;\n\t\tif(c == 'w' && t == 'q') pI = PieceImage.W_QUEEN;\n\t\tif(c == 'w' && t == 'r') pI = PieceImage.W_ROOK;\n\t\n\t\tif(c == 'c' && t == 'b') pI = PieceImage.C_BISHOP;\n\t\tif(c == 'c' && t == 'k') pI = PieceImage.C_KING;\n\t\tif(c == 'c' && t == 'c') pI = PieceImage.C_KNIGHT;\n\t\tif(c == 'c' && t == 'p') pI = PieceImage.C_PAWN;\n\t\tif(c == 'c' && t == 'q') pI = PieceImage.C_QUEEN;\n\t\tif(c == 'c' && t == 'r') pI = PieceImage.C_ROOK;\n\t\t\n\t\tif(c == 'p' && t == 'b') pI = PieceImage.P_BISHOP;\n\t\tif(c == 'p' && t == 'k') pI = PieceImage.P_KING;\n\t\tif(c == 'p' && t == 'c') pI = PieceImage.P_KNIGHT;\n\t\tif(c == 'p' && t == 'p') pI = PieceImage.P_PAWN;\n\t\tif(c == 'p' && t == 'q') pI = PieceImage.P_QUEEN;\n\t\tif(c == 'p' && t == 'r') pI = PieceImage.P_ROOK;\n\t\t}", "public void generete() {\n int minQuantFig = 1,\r\n maxQuantFig = 10,\r\n minNum = 1,\r\n maxNum = 100,\r\n minColor = 0,\r\n maxColor = (int)colors.length - 1,\r\n\r\n // Initialize figures property for random calculations\r\n randomColor = 0,\r\n randomFigure = 0,\r\n\r\n // Squere property\r\n randomSideLength = 0,\r\n\r\n // Circle property\r\n randomRadius = 0,\r\n \r\n // IsoscelesRightTriangle property \r\n randomHypotenus = 0,\r\n \r\n // Trapizoid properties\r\n randomBaseA = 0,\r\n randomBaseB = 0,\r\n randomAltitude = 0;\r\n\r\n // Generate random number to set figueres's quantaty\r\n setFigureQuantaty( generateWholoeNumInRange(minQuantFig, maxQuantFig) );\r\n\r\n for( int i = 0; i < getFigureQuantaty(); i++ ) {\r\n\r\n // Convert double random value to int and close it in range from 1 to number of elements in array\r\n randomFigure = (int)( Math.random() * figures.length );\r\n \r\n randomColor = generateWholoeNumInRange( minColor, maxColor ); // Get random color's index from colors array\r\n\r\n // Create new figure depending on randomFigure \r\n switch (figures[randomFigure]) {\r\n\r\n case \"Circle\":\r\n\r\n randomRadius = generateWholoeNumInRange( minNum, maxNum ); // Get random value of circle's radius;\r\n\r\n Circle newCircle = new Circle( colors[randomColor], randomRadius ); // Initialize Circle with random parameters\r\n\r\n newCircle.drawFigure();\r\n \r\n break;\r\n\r\n case \"Squere\":\r\n\r\n randomSideLength = generateWholoeNumInRange( minNum, maxNum ); // Get random value of side length;\r\n\r\n Squere newSquere = new Squere( colors[randomColor], randomSideLength ); // Initialize Circle with random parameters\r\n\r\n newSquere.drawFigure();\r\n\r\n break;\r\n\r\n case \"Triangle\":\r\n\r\n randomSideLength = generateWholoeNumInRange( minNum, maxNum ); // Get random value of side length;\r\n\r\n randomHypotenus = generateWholoeNumInRange( minNum, maxNum ); // Get random value of hypotenus;\r\n\r\n IsoscelesRightTriangle newTriangle = new IsoscelesRightTriangle( colors[randomColor], randomSideLength, randomHypotenus ); // Initialize Circle with random parameters\r\n\r\n newTriangle.drawFigure();\r\n\r\n break;\r\n\r\n case \"Trapezoid\":\r\n\r\n randomBaseA = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's side A;\r\n\r\n randomBaseB = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's side B;\r\n\r\n randomAltitude = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's altitude;\r\n\r\n Trapezoid newTrapezoid = new Trapezoid( colors[randomColor], randomBaseA, randomBaseB, randomAltitude ); // Create new Trapezoid with random parameters\r\n\r\n newTrapezoid.drawFigure();\r\n\r\n break;\r\n\r\n };\r\n };\r\n }", "public static void main(String[] args) {\n\n Sviesoforas s1 = new Sviesoforas(44,55,Color.RED);\n Sviesoforas s2 = new Sviesoforas(44,55,Color.GREEN);\n Sviesoforas s3 = new Sviesoforas(44,55,Color.YELLOW);\n\n System.out.println(Color.RED);\n\n// Color.red = Color.yellow;\n// System.out.println(Color.red);\n\n// class ColorEx extends Color {\n//\n// public ColorEx() {\n// }\n// }\n s1.setTipas(Tipas.A);\n s2.setTipas(Tipas.B);\n s3.setTipas(Tipas.C);\n\n// if ( s3.getTipas().equals(Tipas.C)) {\n if ( s3.getTipas() == Tipas.C) {\n System.out.println(\"s3 yra tipo C \");\n\n }\n }", "public static void makeBoardChess() {\r\n \r\n white = new AllPiece(\"White\");\r\n black = new AllPiece(\"Black\");\r\n \r\n }", "public Position (int r, int c) {\n\t\tthis.r = r;\n\t\tthis.c = c;\n\t}", "public Circle(SelectedColor color) {\n super(Name.Circle, color);\n\n Log.i(\"Circle\",\"Created a \" + color + \" Circle\");\n //Need getcolor() to pick random\n //Maybe keep all colors random at create time, then when we add them to data struc\n //we change one of the colors depending on \"correct shape\"\n }", "PieceColor get(char c, char r) {\n assert validSquare(c, r);\n return get(index(c, r));\n }", "public SpawnPoint getSpawnPoint(Color color){\n for(SpawnPoint sp : spawnPoints){\n if(sp.getColor() == color)\n return sp;\n\n }\n return null;\n }", "public final void initialPosition() {\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.RED, Type.PAWN), new PositionImpl( 38 + 8*i));\n\t\t}\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.BLACK, Type.PAWN), new PositionImpl( 12 + i));\n\t\t}\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.YELLOW, Type.PAWN), new PositionImpl( 1 + 8*i));\n\t\t}\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.GREEN, Type.PAWN), new PositionImpl( 48 + i));\n\t\t}\n\t\t\n\t\tsetPiece( new PieceImpl( Color.RED, Type.BOAT), new PositionImpl( 63 ));\n\t\tsetPiece( new PieceImpl( Color.RED, Type.KNIGHT), new PositionImpl( 55 ));\n\t\tsetPiece( new PieceImpl( Color.RED, Type.ELEPHANT), new PositionImpl( 47 ));\n\t\tsetPiece( new PieceImpl( Color.RED, Type.KING), new PositionImpl( 39 ));\n\t\t\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.BOAT), new PositionImpl( 7 ));\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.KNIGHT), new PositionImpl( 6 ));\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.ELEPHANT), new PositionImpl( 5 ));\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.KING), new PositionImpl( 4 ));\n\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.BOAT), new PositionImpl( 0 ));\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.KNIGHT), new PositionImpl( 8 ));\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.ELEPHANT), new PositionImpl( 16 ));\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.KING), new PositionImpl( 24 ));\n\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.BOAT), new PositionImpl( 56 ));\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.KNIGHT), new PositionImpl( 57 ));\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.ELEPHANT), new PositionImpl( 58 ));\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.KING), new PositionImpl( 59 ));\n\t\t\n }", "public Laptops(double xCoor,double yCoor,double r){\n\t\t\n\t\tthis.xCoor=xCoor;\n\t\tthis.yCoor=yCoor;\n\t\tthis.r=r;\n\t\t\n\t}", "public PantallaVictoria()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(400, 600, 1); \n prepare();\n }", "public ArrayList<Piece> getColorPieces(PrimaryColor color){\n\t\tArrayList<Piece> colorPieces = new ArrayList<Piece>();\n\n\t\tfor(Piece p : this.pieces) {\n\t\t\tif(p.getColor()== color) {\n\t\t\t\tcolorPieces.add(p);\n\t\t\t}\n\t\t}\n\t\treturn colorPieces;\n\n\t}", "public void prepare(int posx, int posy, int piece, String color) {\n\t\tColor clr;\n\t\tif (color == \"black\")\n\t\t\tclr = Color.black;\n\t\telse\n\t\t\tclr = Color.red;\n\t\tif (prevComp != null)\n\t\t\tchangeBackground(prevComp, null, false);\n\t\tchangeBackground(curComp, clr, true);\n\t\tstoreValues(posx, posy, piece);\n\t}", "private void init(Point[] points, int color) {\n // Set paint\n paint = new Paint(Paint.ANTI_ALIAS_FLAG);\n paint.setColor(color);\n\n setPadding(50,50,50,50);\n setBackgroundColor(Color.TRANSPARENT);\n\n // Create path for triangle\n path = new Path();\n path.setFillType(Path.FillType.EVEN_ODD);\n // Draw triangle\n path.moveTo(points[0].x, points[0].y);\n path.lineTo(points[1].x,points[1].y);\n path.lineTo(points[2].x,points[2].y);\n path.lineTo(points[0].x,points[0].y);\n path.close();\n }", "public void newGame() {\n \tturn = PieceColor.White;\n \t\n \t//the middle are empty squares\n \tfor(int i = 2; i < 6; i++) {\n \t\tfor(int j = 0; j < 8; j++) {\n \t\t\tsetPiece(j, i, new NoPiece(j, i));\n \t\t}\n \t}\n \t\n \t//pawns\n \tfor(int i = 0; i < 8; i++) {\n \t\t//make these pawns\n \t\tsetPiece(i, 1, new Pawn(i, 1, PieceColor.White, this));\n \t\tsetPiece(i, 6, new Pawn(i, 6, PieceColor.Black, this));\n \t}\n \t\n \t//white back row\n \tsetPiece(0, 0, new Rook(0, 0, PieceColor.White, this));\n \tsetPiece(1, 0, new Knight(1, 0, PieceColor.White, this));\n \tsetPiece(2, 0, new Bishop(2, 0, PieceColor.White, this));\n \tsetPiece(3, 0, new Queen(3, 0, PieceColor.White, this));\n \tsetPiece(4, 0, new King(4, 0, PieceColor.White, this));\n \tsetPiece(5, 0, new Bishop(5, 0, PieceColor.White, this));\n \tsetPiece(6, 0, new Knight(6, 0, PieceColor.White, this));\n \tsetPiece(7, 0, new Rook(7, 0, PieceColor.White, this));\n \t\n \t//black back row\n \tsetPiece(0, 7, new Rook(0, 7, PieceColor.Black, this));\n \tsetPiece(1, 7, new Knight(1, 7, PieceColor.Black, this));\n \tsetPiece(2, 7, new Bishop(2, 7, PieceColor.Black, this));\n \tsetPiece(3, 7, new Queen(3, 7, PieceColor.Black, this));\n \tsetPiece(4, 7, new King(4, 7, PieceColor.Black, this));\n \tsetPiece(5, 7, new Bishop(5, 7, PieceColor.Black, this));\n \tsetPiece(6, 7, new Knight(6, 7, PieceColor.Black, this));\n \tsetPiece(7, 7, new Rook(7, 7, PieceColor.Black, this));\n \t\n \t//store locations of king so they can be checked\n \twKing = new Square(4, 0);\n \tbKing = new Square(4, 7);\n }", "public void ajoutPions() {\n for (int i = 0; i < 4; i++) {\n for (int j = 0; j < 10; j += 2) {\n if (i % 2 == 0) {\n this.ajoutPieces(new Pion(i, j, true, (String) JouerIA.getColor1().first()));\n\n } else {\n this.ajoutPieces(new Pion(i, j+1, true, (String) JouerIA.getColor1().first()));\n }\n }\n\n }\n\n for (int i = 6; i < 10; i++) {\n for (int j = 0; j < 10; j += 2) {\n if (i % 2 == 0) {\n this.ajoutPieces(new Pion(i, j, false, (String) JouerIA.getColor2().first()));\n } else {\n this.ajoutPieces(new Pion(i, j + 1, false, (String) JouerIA.getColor2().first()));\n }\n }\n\n }\n }", "public PieceView(Piece piece){\n if (piece.pieceColor == Piece.PColor.red) {\n this.color = Color.RED;\n } else {\n this.color = Color.WHITE;\n }\n\n if (piece.pieceType == Piece.PType.king) {\n this.type = Type.KING;\n } else {\n this.type = Type.SINGLE;\n }\n }", "public Stage1()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1200, 900, 1);\n \n GreenfootImage image = getBackground();\n image.setColor(Color.BLACK);\n image.fill();\n star();\n \n \n \n //TurretBase turretBase = new TurretBase();\n playerShip = new PlayerShip();\n scoreDisplay = new ScoreDisplay();\n addObject(scoreDisplay, 100, 50);\n addObject(playerShip, 100, 450);\n \n }", "private void drawPiece(int row, int col, Graphics g, Color color){\r\n ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\r\n ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\r\n g.setColor(color);\r\n g.fillOval((col*tileSize)+2, (row*tileSize)+2, tileSize-4, tileSize-4);\r\n }", "public Circle(int x, int y, int r, Color c) {\n super(x-r,y-r);\n color = c;\n name = \"Circle\";\n width = 2*r;\n height = 2*r;\n radius = r;\n }", "public Piezas(String color) {\r\n this.color = color;\r\n }", "void setOccupier(PRColor color) {\n c = color;\n }", "public MyWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 400, 1); \n \n Player player = new Player();\n Point point0 = new Point();\n Point point1 = new Point();\n Point point2 = new Point();\n Point point3 = new Point();\n Point point4 = new Point();\n Danger danger0 = new Danger();\n Danger danger1 = new Danger();\n addObject(player, getWidth()/2, getHeight()/2);\n \n addObject(point0,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point1,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point2,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point3,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point4,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n \n addObject(danger0,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(danger1,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n }", "public Rook(int row, int col, boolean color)\n {\n super(row, col, color);\n }", "public void addNewPiece() {\n\t\t// creates a range from 1-7 to choose from each of the pieces\n\t\tint pieceChoice = (int) (Math.random()*7) + 1; \n\t\tif(pieceChoice == 1) {\n\t\t\tcurrentPiece = new TetrisI();\n\t\t}\n\t\telse if(pieceChoice == 2) {\n\t\t\tcurrentPiece = new TetrisJ();\n\t\t}\n\t\telse if(pieceChoice == 3) {\n\t\t\tcurrentPiece = new TetrisL();\n\t\t}\n\t\telse if(pieceChoice == 4) {\n\t\t\tcurrentPiece = new TetrisO();\n\t\t}\n\t\telse if(pieceChoice == 5) {\n\t\t\tcurrentPiece = new TetrisS();\n\t\t}\n\t\telse if(pieceChoice == 6) {\n\t\t\tcurrentPiece = new TetrisT();\n\t\t}\n\t\telse {\n\t\t\tcurrentPiece = new TetrisZ();\n\t\t}\n\t\tcurrentPiece.pieceRotation = 0;\n\t\tinitCurrentGP();\n\t}", "public Piece(PieceColor color, int y, int x) {\n\t\tthis.color = color;\n\t\tthis.y = y;\n\t\tthis.x = x;\n\t\ttimesMoved = 0;\n\t}", "public static Corridor genCorridor() {\n Intersection int1 = new Intersection(100, 50, 60, 0, 0, 0);\n int1.setRef(true);\n Intersection int2 = new Intersection(100, 60, 40, 0, 0, 4200);\n Intersection int3 = new Intersection(100, 60, 40, 0, 0, 5600);\n Intersection int4 = new Intersection(100, 50, 60, 10, 30, 7000);\n ArrayList<Intersection> intersections = new ArrayList<>(Arrays.asList(int1, int2, int3, int4));\n Corridor corr = new Corridor(intersections);\n corr.setSpeed(GlobalVariables.speedLim.get());\n return corr;\n }", "public void setStart (int r, int c)\n\t{\n\t\tPosition p = new Position (r, c);\n\n\t\tif (validPosition (p))\n\t\t{\n\t\t\tsquares[p.r][p.c] = START_SPACE;\n\t\t\tstart = p;\n\t\t}\n\t\telse\n\t\t\tstart = null;\n\t}", "public Knight(String color, Position position){\n super(\"Knight\", color, position);\n\n List<Position> directions = new ArrayList<Position>();\n directions.add(new Position(1,-2));\n directions.add(new Position(2,-1));\n directions.add(new Position(2,1));\n directions.add(new Position(1,2));\n directions.add(new Position(-1,-2));\n directions.add(new Position(-2,-1));\n directions.add(new Position(-1,2));\n directions.add(new Position(-2,1));\n setDirectionVectors(directions);\n\n if (color.equals(\"White\")){\n setImageResource(R.mipmap.white_knight_foreground);\n }\n else{\n setImageResource(R.mipmap.black_knight_foreground);\n }\n\n }", "public void start() {\n clear();\n // Assigning chess pieces to players.\n whitePieces.add(new Piece(Owner.WHITE, Who.KING, Rank.R1, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.QUEEN, Rank.R1, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.H));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.H));\n\n for (Piece p : whitePieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n blackPieces.add(new Piece(Owner.BLACK, Who.KING, Rank.R8, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.QUEEN, Rank.R8, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.H));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.H));\n\n for (Piece p : blackPieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n whoseTurn = Owner.WHITE;\n canCastle = 15;\n passer = null;\n movesDone = lastEatMove = 0;\n }", "public GameColor getColor();", "private Paint crearPintura(Casillero casillero) {\n\n\t\tPaint pintura;\n\n\t\tswitch (casillero) {\n\t\t\n\t\t\tcase BLANCAS:\n\t\t\t\tpintura = Color.WHITE;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase NEGRAS:\n\t\t\t\tpintura = Color.BLACK;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tpintura = Color.TRANSPARENT;\n\t\t}\n\n\t\treturn pintura;\n\t}", "public static void main(String[] args) {\nPeon peonBlanco1=new Peon();\npeonBlanco1.setColor(\"Blanco\");\npeonBlanco1.setFigura(\"Peon\");\n\nPeon peonBlanco2=new Peon();\npeonBlanco2.setColor(\"Blanco\");\npeonBlanco2.setFigura(\"Peon\");\n\nPeon peonBlanco3=new Peon();\npeonBlanco3.setColor(\"Blanco\");\npeonBlanco3.setFigura(\"Peon\");\n\nPeon peonBlanco4=new Peon();\npeonBlanco4.setColor(\"Blanco\");\npeonBlanco4.setFigura(\"Peon\");\n\nPeon peonBlanco5=new Peon();\npeonBlanco5.setColor(\"Blanco\");\npeonBlanco5.setFigura(\"Peon\");\n\nPeon peonBlanco6=new Peon();\npeonBlanco6.setColor(\"Blanco\");\npeonBlanco6.setFigura(\"Peon\");\n\nPeon peonBlanco7=new Peon();\npeonBlanco7.setColor(\"Blanco\");\npeonBlanco7.setFigura(\"Peon\");\n\nPeon peonBlanco8=new Peon();\npeonBlanco8.setColor(\"Blanco\");\npeonBlanco8.setFigura(\"Peon\");\n\n\n\nPeon peonNegro1=new Peon();\npeonNegro1.setColor(\"Negro\");\npeonNegro1.setFigura(\"Peon\");\n\nPeon peonNegro2=new Peon();\npeonNegro2.setColor(\"Negro\");\npeonNegro2.setFigura(\"Peon\");\n\nPeon peonNegro3=new Peon();\npeonNegro3.setColor(\"Negro\");\npeonNegro3.setFigura(\"Peon\");\n\nPeon peonNegro4=new Peon();\npeonNegro4.setColor(\"Negro\");\npeonNegro4.setFigura(\"Peon\");\n\nPeon peonNegro5=new Peon();\npeonNegro5.setColor(\"Negro\");\npeonNegro5.setFigura(\"Peon\");\n\nPeon peonNegro6=new Peon();\npeonNegro6.setColor(\"Negro\");\npeonNegro6.setFigura(\"Peon\");\n\nPeon peonNegro7=new Peon();\npeonNegro7.setColor(\"Negro\");\npeonNegro7.setFigura(\"Peon\");\n\nPeon peonNegro8=new Peon();\npeonNegro8.setColor(\"Negro\");\npeonNegro8.setFigura(\"Peon\");\n\nAlfil alfilBlancoA=new Alfil();\nalfilBlancoA.setColor(\"Blanco\");\nalfilBlancoA.setFigura(\"Alfil\");\n\nAlfil alfilBlancoB=new Alfil();\nalfilBlancoB.setColor(\"Blanco\");\nalfilBlancoB.setFigura(\"Alfil\");\n\nAlfil alfilNegroA=new Alfil();\nalfilNegroA.setColor(\"Negro\");\nalfilNegroA.setFigura(\"Alfil\");\n\nAlfil alfilNegroB=new Alfil();\nalfilNegroB.setColor(\"Negro\");\nalfilNegroB.setFigura(\"Alfil\");\n\nCaballo caballoBlancoA=new Caballo();\ncaballoBlancoA.setColor(\"Blanco\");\ncaballoBlancoA.setFigura(\"Caballo\");\n\nCaballo caballoBlancoB=new Caballo();\ncaballoBlancoB.setColor(\"Blanco\");\ncaballoBlancoB.setFigura(\"Caballo\");\n\nCaballo caballoNegroA=new Caballo();\ncaballoNegroA.setColor(\"Negro\");\ncaballoNegroA.setFigura(\"Caballo\");\n\nCaballo caballoNegroB=new Caballo();\ncaballoNegroB.setColor(\"Negro\");\ncaballoNegroB.setFigura(\"Caballo\");\n\nTorre TorreBalncaA=new Torre();\nTorreBalncaA.setColor(\"Blanca\");\nTorreBalncaA.setFigura(\"Torre\");\n\nTorre TorreBlancaB=new Torre();\nTorreBlancaB.setColor(\"Blanca\");\nTorreBlancaB.setFigura(\"Torre\");\n\nTorre TorreNegraA=new Torre();\nTorreNegraA.setColor(\"Negro\");\nTorreNegraA.setFigura(\"Torre\");\n\nTorre TorreNegraB=new Torre();\nTorreNegraB.setColor(\"Blanca\");\nTorreNegraB.setFigura(\"Torre\");\n\nDama damaBlanca=new Dama();\ndamaBlanca.setColor(\"Blanco\");\ndamaBlanca.setFigura(\"Dama\");\n\nDama damaNegra=new Dama();\ndamaNegra.setColor(\"Negra\");\ndamaNegra.setFigura(\"Dama\");\n\n\nRey reyBlanco=new Rey();\nreyBlanco.setColor(\"Blanco\");\nreyBlanco.setFigura(\"Rey\");\n\nRey reyNegro= new Rey();\nreyNegro.setColor(\"Negro\");\nreyNegro.setFigura(\"Rey\");\n\nPieza figura[][]=new Pieza[8][8];\nfigura[0][0]=TorreBalncaA;\nfigura[0][1]=caballoBlancoA;\nfigura[0][2]=alfilBlancoA;\nfigura[0][3]=damaBlanca;\nfigura[0][4]=reyBlanco;\nfigura[0][5]=alfilBlancoB;\nfigura[0][6]=caballoBlancoB;\nfigura[0][7]=TorreBlancaB;\n\nfigura[1][0]=peonBlanco1;\nfigura[1][1]=peonBlanco2;\nfigura[1][2]=peonBlanco3;\nfigura[1][3]=peonBlanco4;\nfigura[1][4]=peonBlanco5;\nfigura[1][5]=peonBlanco6;\nfigura[1][6]=peonBlanco7;\nfigura[1][7]=peonBlanco8;\n\n\nfigura[6][0]=peonNegro1;\nfigura[6][1]=peonNegro2;\nfigura[6][2]=peonNegro3;\nfigura[6][3]=peonNegro4;\nfigura[6][4]=peonNegro5;\nfigura[6][5]=peonNegro6;\nfigura[6][6]=peonNegro7;\nfigura[6][7]=peonNegro8;\n\n\nfigura[7][0]=TorreNegraA;\nfigura[7][1]=caballoNegroA;\nfigura[7][2]=alfilNegroA;\nfigura[7][3]=damaNegra;\nfigura[7][4]=reyNegro;\nfigura[7][5]=alfilNegroB;\nfigura[7][6]=caballoNegroB;\nfigura[7][7]=TorreNegraB;\n\nfor (int x=0; x < figura.length; x++) {\n\t System.out.print(\" \");\n\t for (int y=0; y < figura[x].length; y++) {\n\t System.out.print(figura[x][y]+\" \");\n\t if (y!=figura[x].length-1) System.out.print(\" \");\n\t }\n\t System.out.println(\" \");\n\t}\n\t}", "public PowerUp(double x,double y,Color color)\n\t{\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.color = color;\n\t}", "public Pawn(Color c, Type t) {\n color = c;\n type = t;\n lives = type == Type.KING ? 5 : 2;\n }", "pieces getPiece(int position)\n {\n int j ;\n if(position == whiteHorse1.position && whiteHorse1.alive == true ) return whiteHorse1;\n if(position == whiteHorse2.position && whiteHorse2.alive == true) return whiteHorse2;\n if(position == whiteQueen.position && whiteQueen.alive == true ) return whiteQueen;\n if(position == whiteKing.position && whiteKing.alive == true) return whiteKing;\n if(position == whiteCastle1.position && whiteCastle1.alive == true ) return whiteCastle1;\n if(position == whiteCastle2.position && whiteCastle2.alive == true) return whiteCastle2;\n if(position == whiteBishop1.position && whiteBishop1.alive == true) return whiteBishop1;\n if(position == whiteBishop2.position && whiteBishop2.alive == true) return whiteBishop2;\n j=0;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];\n \n \n \n if(position == blackHorse1.position && blackHorse1.alive == true ) return blackHorse1;\n if(position == blackHorse2.position && blackHorse2.alive == true) return blackHorse2;\n if(position == blackQueen.position && blackQueen.alive == true ) return blackQueen;\n if(position == blackKing.position && blackKing.alive == true) return blackKing;\n if(position == blackCastle1.position && blackCastle1.alive == true ) return blackCastle1;\n if(position == blackCastle2.position && blackCastle2.alive == true) return blackCastle2;\n if(position == blackBishop1.position && blackBishop1.alive == true) return blackBishop1;\n if(position == blackBishop2.position && blackBishop2.alive == true) return blackBishop2;\n j=0;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];\n\n else return null;\n }", "public void setNewPiece(){\n\t\tcurrentPiece = Pentominoes.Pentomino_array[this.next_piece_index];\n\t\tcurrentColor = Pentominoes.color_array[this.next_piece_colour];\n\t\tpieceOrigin = new Point(6, 2);\n\t}", "void showpos(pieces chesspiece)\n {if(chesspiece.alive == true)\n {\n int position = chesspiece.position;\n chesspiece.select = true;\n \n int x;int y;\n if((position+1)%8 == 0) {x = 8; y = (position+8)/8;}\n else{ x = (position+1)%8;\n y = (position+9)/8;}\n chesspiece.move(new moves(x,y));\n for( int a : chesspiece.movnum )\n {\n if ( chesspiece.color == 0)\n {\n if (Checkerboard.allWhitePositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.GRAY);\n else if (Checkerboard.allBlackPositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.RED);\n else\n panel[a-1].setBackground(Color.GREEN);\n }\n else\n {\n if (Checkerboard.allWhitePositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.RED);\n else if (Checkerboard.allBlackPositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.GRAY);\n else\n panel[a-1].setBackground(Color.GREEN);\n }\n \n }\n }//if(chesspiece.alive==true) ends\n }", "public abstract PaintObject[][] separate(Rectangle _r);", "private primitives.Color AdaptiveDiffusedAndGlossy(Vector n, Point3D point, Vector Vto, int direction, double DiffusedAndGlossy, int level , double k, double ktr) throws Exception {\r\n\r\n if (direction != 1 && direction != -1)\r\n throw new IllegalArgumentException(\"direction must be 1 or -1\");\r\n double gridSize = DiffusedAndGlossy;\r\n int numOfRowCol = isZero(gridSize) ? 1 : (int) Math.floor(Math.sqrt(maxRaysForDiffusedAndGlossy));\r\n Vector Vup = Vto.findRandomOrthogonal();//vector in the grid\r\n Vector Vright = Vto.crossProduct(Vup);//vector in the grid\r\n Point3D centerOfGrid = point.add(Vto.scale(distanceForDiffusedAndGlossy)); // center point of the grid\r\n double sizeOfCube = gridSize / numOfRowCol;//size of each cube in the grid\r\n n = n.dotProduct(Vto) > 0 ? n.scale(-direction) : n.scale(direction);//fix the normal direction\r\n\r\n if(isZero(gridSize))\r\n {\r\n Ray tempRay = new Ray(point, centerOfGrid.subtract(point), n);\r\n GeoPoint gp = findClosestIntersection(tempRay);\r\n if (gp == null)\r\n return scene.background;\r\n else\r\n return calcColor(gp, tempRay, level - 1, k);\r\n }\r\n\r\n return AdaptiveDiffusedAndGlossyRec(centerOfGrid, gridSize, sizeOfCube, point, Vright, Vup, n, direction, level, k, ktr, null);\r\n }", "FuelCan(FloatPoint p, Color c){\n\t\tsuper(p, c);\n\t\tsize = randInt(3,6);\n\t}", "public Pellet(int xLoc, int yLoc, Color someColor) {\n\t\tx = xLoc;\n\t\ty = yLoc;\n\t\tcolor = someColor;\n\t}", "public Piece[][] createStandardChessboard(Player whitePlayer, Player blackPlayer) {\t\t\r\n\t\tPiece[][] start_board = {\r\n\t\t\t\t{new Rook(0,0,blackPlayer), new Knight(1,0,blackPlayer), new Bishop(2,0,blackPlayer), new Queen(3,0,blackPlayer),new King(4,0,blackPlayer), new Bishop(5,0,blackPlayer), new Knight(6,0,blackPlayer), new Rook(7,0,blackPlayer)},\r\n\t\t\t\t{new Pawn(0,1,blackPlayer), new Pawn(1,1,blackPlayer), new Pawn(2,1,blackPlayer), new Pawn(3,1,blackPlayer),new Pawn(4,1,blackPlayer), new Pawn(5,1,blackPlayer), new Pawn(6,1,blackPlayer), new Pawn(7,1,blackPlayer)},\r\n\t\t\t\t{null, null, null, null,null, null, null, null},\r\n\t\t\t\t{null, null, null, null,null, null, null, null},\r\n\t\t\t\t{null, null, null, null,null, null, null, null},\r\n\t\t\t\t{null, null, null, null,null, null, null, null},\r\n\t\t\t\t{new Pawn(0,6,whitePlayer), new Pawn(1,6,whitePlayer), new Pawn(2,6,whitePlayer), new Pawn(3,6,whitePlayer),new Pawn(4,6,whitePlayer), new Pawn(5,6,whitePlayer), new Pawn(6,6,whitePlayer), new Pawn(7,6,whitePlayer)},\r\n\t\t\t\t{new Rook(0,7,whitePlayer), new Knight(1,7,whitePlayer), new Bishop(2,7,whitePlayer), new Queen(3,7,whitePlayer),new King(4,7,whitePlayer), new Bishop(5,7,whitePlayer), new Knight(6,7,whitePlayer), new Rook(7,7,whitePlayer)}\r\n\t\t};\r\n\t\treturn start_board;\r\n\t}", "public Piece(int a_row, int a_col)\n {\n this.tileLocation = Pair.create(a_row,a_col);\n }", "public Electrodomestico(int precioBase, int peso) {\r\n this.precioBase = precioBase;\r\n this.peso = peso;\r\n this.color = Colores.BLANCO;\r\n this.consumoEnergetico = Letra.F;\r\n }", "public Celula generaCelula(){\n ArrayList<Elemento> adjointPositions = getPosicionesAdyacentes();\n \n for(Elemento e : adjointPositions){\n if(e.isVivo()){\n return null;\n }\n \n }\n int fil = (int) Math.random() * 29;\n int col = (int) Math.random() * 29;\n return new Celula(automata,fil,col);\n }", "public Plane(Point a, Point b, Point c) {\n\t\tthis(a, b, c, new Color((int) (Math.random() * 256),\n\t\t\t\t(int) (Math.random() * 256), (int) (Math.random() * 256)));\n\t}", "public Cenario1()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(900, 600, 1);\n adicionar();\n \n }", "public ConnectedObject createConnectedPoints(int x, int y, int targetColor,\n int replaceColor, ConnectedObject cp) {\n if (x >= WIDTH || x < 0 || y >= HEIGHT || y < 0) {\n return cp;\n }\n if (gameScreen.getRGB(x, y) != targetColor) {\n return cp;\n }\n if (gameScreen.getRGB(x, y) == replaceColor) {\n return cp;\n }\n gameScreen.setRGB(x, y, replaceColor);\n cp.addPoint(new Point(x, y));\n createConnectedPoints(x - 1, y, targetColor, replaceColor, cp);\n createConnectedPoints(x + 1, y, targetColor, replaceColor, cp);\n createConnectedPoints(x, y - 1, targetColor, replaceColor, cp);\n createConnectedPoints(x, y + 1, targetColor, replaceColor, cp);\n return cp;\n }", "public Coordenada kingCoordenada(Color c) {\n\t\tif (c == this.getColor()) {\n\t\t\treturn posicion;\n\t\t} else\n\t\t\treturn null;\n\t}", "Piece get(int c, int r) {\n assert 1 <= c && c <= 8 && 1 <= r && r <= 8;\n return _pieces[r - 1][c - 1];\n }", "public void draw() {\n PImage grid = loadImage(\"C:/Users/NM/Desktop/UNI_ACAD/INFO1113/Assignment2/Atomination/assets/tile.png\");\n for(int i = 0 ; i < 10 ; i++){\n for(int j = 0 ; j < 6 ; j++){\n image(grid, i*grid.width, j*grid.height);\n if(gridPlane.get(List.of(i, j)).getOwner() != null){\n if(gridPlane.get(List.of(i, j)).getOwner().getColor().equals(\"Red\")){\n if(gridPlane.get(List.of(i, j)).getAtomCount() == 1){\n image(loadImage(\"C:/Users/NM/Desktop/UNI_ACAD/INFO1113/Assignment2/Atomination/assets/red1.png\"), i*grid.width, j*grid.height);\n }else if(gridPlane.get(List.of(i, j)).getAtomCount() == 2){\n image(loadImage(\"C:/Users/NM/Desktop/UNI_ACAD/INFO1113/Assignment2/Atomination/assets/red2.png\"), i*grid.width, j*grid.height);\n }else if(gridPlane.get(List.of(i, j)).getAtomCount() == 3){\n image(loadImage(\"C:/Users/NM/Desktop/UNI_ACAD/INFO1113/Assignment2/Atomination/assets/red3.png\"), i*grid.width, j*grid.height);\n }\n }else if(gridPlane.get(List.of(i, j)).getOwner().getColor().equals(\"Green\")){\n if(gridPlane.get(List.of(i, j)).getAtomCount() == 1){\n image(loadImage(\"C:/Users/NM/Desktop/UNI_ACAD/INFO1113/Assignment2/Atomination/assets/green1.png\"), i*grid.width, j*grid.height);\n }else if(gridPlane.get(List.of(i, j)).getAtomCount() == 2){\n image(loadImage(\"C:/Users/NM/Desktop/UNI_ACAD/INFO1113/Assignment2/Atomination/assets/green2.png\"), i*grid.width, j*grid.height);\n }else if(gridPlane.get(List.of(i, j)).getAtomCount() == 3){\n image(loadImage(\"C:/Users/NM/Desktop/UNI_ACAD/INFO1113/Assignment2/Atomination/assets/green3.png\"), i*grid.width, j*grid.height);\n }\n }\n }\n }\n }\n if(this.finish == true){\n System.exit(0);\n }\n }" ]
[ "0.6255101", "0.61821204", "0.61310077", "0.61193484", "0.60608196", "0.5950894", "0.59446007", "0.5874126", "0.58459216", "0.58396703", "0.5808581", "0.5796518", "0.5795544", "0.57645535", "0.5737657", "0.57343733", "0.5720587", "0.57177156", "0.57111275", "0.5665832", "0.56098557", "0.5597026", "0.5579539", "0.55711675", "0.5567933", "0.5561404", "0.5542973", "0.5541896", "0.5541579", "0.55413705", "0.5530972", "0.55264586", "0.5515549", "0.55094033", "0.55002177", "0.548988", "0.5476311", "0.54672587", "0.5457443", "0.54165673", "0.5416361", "0.54157543", "0.5410217", "0.5403414", "0.5400862", "0.5392506", "0.5364549", "0.536427", "0.5358605", "0.53505194", "0.5344927", "0.5338176", "0.5325196", "0.53250813", "0.5315027", "0.5288244", "0.5280894", "0.52772534", "0.52616596", "0.52612185", "0.5255479", "0.5252934", "0.52515334", "0.52457726", "0.52342826", "0.52279663", "0.5223892", "0.52218515", "0.52202123", "0.52187896", "0.5212129", "0.52101666", "0.52034765", "0.5195524", "0.5193128", "0.51929617", "0.51929474", "0.5187775", "0.51842517", "0.5183434", "0.518105", "0.51769984", "0.5175524", "0.51751465", "0.5174303", "0.5170912", "0.51687104", "0.51682067", "0.5167783", "0.516613", "0.51656973", "0.51622313", "0.5157052", "0.515433", "0.5154082", "0.51484215", "0.5146328", "0.5127301", "0.51264733", "0.5126395" ]
0.79290646
0
getting the game pieces of the player
public HashMap<Integer, Piece> getPieces() { return pieces; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Set<GamePiece> getPlayerPieces() \n\t{\n\t\tSet<GamePiece> pieces = new HashSet<GamePiece>();\n\t\tfor(GamePiece piece: playerPieces.values())\n\t\t{\n\t\t\tpieces.add(piece);\n\t\t}\n\t\treturn pieces;\n\t}", "public List<Piece> allPieces();", "public int getPlayersPiece() {\n return playersPiece;\n }", "pieces getPiece(int position)\n {\n int j ;\n if(position == whiteHorse1.position && whiteHorse1.alive == true ) return whiteHorse1;\n if(position == whiteHorse2.position && whiteHorse2.alive == true) return whiteHorse2;\n if(position == whiteQueen.position && whiteQueen.alive == true ) return whiteQueen;\n if(position == whiteKing.position && whiteKing.alive == true) return whiteKing;\n if(position == whiteCastle1.position && whiteCastle1.alive == true ) return whiteCastle1;\n if(position == whiteCastle2.position && whiteCastle2.alive == true) return whiteCastle2;\n if(position == whiteBishop1.position && whiteBishop1.alive == true) return whiteBishop1;\n if(position == whiteBishop2.position && whiteBishop2.alive == true) return whiteBishop2;\n j=0;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];j++;\n if(position == whitePawn[j].position && whitePawn[j].alive == true) return whitePawn[j];\n \n \n \n if(position == blackHorse1.position && blackHorse1.alive == true ) return blackHorse1;\n if(position == blackHorse2.position && blackHorse2.alive == true) return blackHorse2;\n if(position == blackQueen.position && blackQueen.alive == true ) return blackQueen;\n if(position == blackKing.position && blackKing.alive == true) return blackKing;\n if(position == blackCastle1.position && blackCastle1.alive == true ) return blackCastle1;\n if(position == blackCastle2.position && blackCastle2.alive == true) return blackCastle2;\n if(position == blackBishop1.position && blackBishop1.alive == true) return blackBishop1;\n if(position == blackBishop2.position && blackBishop2.alive == true) return blackBishop2;\n j=0;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];j++;\n if(position == blackPawn[j].position && blackPawn[j].alive == true) return blackPawn[j];\n\n else return null;\n }", "@Override\r\n public MessageList getPieces()\r\n {\r\n MessageList pieces = new MessageList();\r\n pieces.add( loginPiece );\r\n pieces.add( viewexpPiece );\r\n pieces.add( getjsPiece );\r\n pieces.add( getcssPiece );\r\n pieces.add( increaseexpPiece );\r\n pieces.add( viewuserstatsPiece );\r\n pieces.add( getimagePiece );\r\n return pieces;\r\n }", "public List<Piece> getPieces() {\n\t\treturn this.pieces;\n\t}", "public ArrayList<Piece> getPieces() {\n\treturn pieces;\n }", "public OthelloPiece[][] getPieces() {\n \t return m_Pieces;\n \t}", "Piece[][] getPieces() {\n return _pieces;\n }", "public float getPieces(){\r\n return pieces; \r\n }", "public ArrayList<String> getPieces() {\n\treturn pieces;\n }", "List genCaps() {\n\tList ret = new ArrayList();\n\n\tif (side == LIGHT) {\n\tlong moves = ((pawnBits[LIGHT] & 0x00fefefefefefefeL) >> 9)\n\t& pieceBits[DARK];\n\twhile (moves != 0) {\n\tint theMove = getLBit(moves);\n\tgenPush(ret, theMove + 9, theMove, 17);\n\tmoves &= (moves - 1);\n\t}\n\tmoves = ((pawnBits[LIGHT] & 0x007f7f7f7f7f7f7fL) >> 7)\n\t& pieceBits[DARK];\n\twhile (moves != 0) {\n\tint theMove = getLBit(moves);\n\tgenPush(ret, theMove + 7, theMove, 17);\n\tmoves &= (moves - 1);\n\t}\n\t} else {\n\tlong moves = ((pawnBits[DARK] & 0x00fefefefefefefeL) << 7)\n\t& pieceBits[LIGHT];\n\twhile (moves != 0) {\n\tint theMove = getLBit(moves);\n\tgenPush(ret, theMove - 7, theMove, 17);\n\tmoves &= (moves - 1);\n\t}\n\tmoves = ((pawnBits[DARK] & 0x007f7f7f7f7f7f7fL) << 9)\n\t& pieceBits[LIGHT];\n\twhile (moves != 0) {\n\tint theMove = getLBit(moves);\n\tgenPush(ret, theMove - 9, theMove, 17);\n\tmoves &= (moves - 1);\n\t}\n\t}\n\tlong pieces = pieceBits[side] ^ pawnBits[side];\n\twhile (pieces != 0) {\n\tint p = getLBit(pieces);\n\tfor (int j = 0; j < offsets[piece[p]]; ++j)\n\tfor (int n = p;;) {\n\tn = mailbox[mailbox64[n] + offset[piece[p]][j]];\n\tif (n == -1)\n\tbreak;\n\tif (color[n] != EMPTY) {\n\tif (color[n] == xside)\n\tgenPush(ret, p, n, 1);\n\tbreak;\n\t}\n\tif (!slide[piece[p]])\n\tbreak;\n\t}\n\tpieces &= (pieces - 1);\n\t}\n\tif (ep != -1) {\n\tif (side == LIGHT) {\n\tif (COL(ep) != 0 && color[ep + 7] == LIGHT\n\t&& piece[ep + 7] == PAWN)\n\tgenPush(ret, ep + 7, ep, 21);\n\tif (COL(ep) != 7 && color[ep + 9] == LIGHT\n\t&& piece[ep + 9] == PAWN)\n\tgenPush(ret, ep + 9, ep, 21);\n\t} else {\n\tif (COL(ep) != 0 && color[ep - 9] == DARK\n\t&& piece[ep - 9] == PAWN)\n\tgenPush(ret, ep - 9, ep, 21);\n\tif (COL(ep) != 7 && color[ep - 7] == DARK\n\t&& piece[ep - 7] == PAWN)\n\tgenPush(ret, ep - 7, ep, 21);\n\t}\n\t}\n\treturn ret;\n\t}", "public List<Piece> allPieces(){\n List<Piece> pieces = new ArrayList<>();\n for (int y = 0; y < 8; y++){\n for (int x = 0; x < 8; x++){\n int val = board[y][x];\n if (val != 0){\n pieces.add(new Piece(val,x,y));\n }\n }\n }\n return pieces;\n }", "public List<Piece> whitePieces();", "public abstract Collection<Piece> getActivePieces();", "public abstract Collection<Piece> getActivePieces();", "public ChessPiece getPiece(){return piece;}", "public ArrayList<Piece> getPieces()\n {\n ArrayList<Piece> pieces = new ArrayList<>();\n for (Square[] s1: squares)\n {\n for (Square s: s1)\n {\n Piece p = s.getPiece();\n if (p!=null)\n pieces.add(p);\n }\n }\n return pieces;\n }", "static ArrayList<Piece> createPieces (Bitmap image) {\n\t\tint[] picSize = InitDisplay.getPicDimensions();\n\t\tint[] pieceSize = InitDisplay.getPieceDimensions();\n\t\t\n\t\t/* Scale the image to the dynamically calculated values */\n\t\tBitmap imageScaled = Bitmap.createScaledBitmap(image, picSize[WIDTH], picSize[HEIGHT], false);\n\t\t\n\t\t/* The imageScaled bitmap now contains the given image in scaled bitmap form. Break it and\n\t\t * assign it to [rows*cols] small Jigsaw pieces after randomizing their positions and orientations\n\t\t * The image is being broken into a 3x3 grid. i represents rows while j represents columns */\n\t\t\n\t\tArrayList<Piece> pieces = new ArrayList<Piece>(Play.NUM[TOTAL]);\n\t\tBitmap imgPiece = null;\n\t\tint offsetX = 0, offsetY = 0;\n\t\tint pos = 0;\n\t\t\n\t\tfor (int i=0; i<Play.NUM[COLS]; i++) {\n\t\t\t/* offsetX represents the x coordinate while offsetY represents the y coordinate */\n\t\t\toffsetX = 0; //start from (0,0)\n\t\t\tfor (int j=0; j<Play.NUM[ROWS]; j++) {\n\t\t\t\t/* Extract a specific area of the imageScaled bitmap and store it in imgPiece.\n\t\t\t\t * Coordinates for the extraction are specified using offsetX and offsetY */\n\t\t\t\timgPiece = Bitmap.createBitmap\n\t\t\t\t\t\t(imageScaled, offsetX, offsetY, pieceSize[WIDTH], pieceSize[HEIGHT]);\n\t\t\t\t\n\t\t\t\t/* Create a Jigsaw piece and add it to the pieces array */\n\t\t\t\tPiece piece = new Piece (imgPiece); //create a new piece with the extracted bitmap image\n\t\t\t\tpieces.add(pos, piece); //add the piece to the pieces array\n\t\t\t\t\n\t\t\t\toffsetX += pieceSize[WIDTH]; //move to the next x coordinate\n\t\t\t\tpos++;\n\t\t\t}\n\t\t\toffsetY += pieceSize[HEIGHT]; //move to the next y coordinate\n\t\t}\n\t\t\n\t\treturn pieces;\n\t}", "public List<Piece> blackPieces();", "Piece getWinner();", "public Collection<Player> getPlayersChunk() {\n var chunk = new Chunk<Player>();\n var playersChunk = chunk.get(this.players, ALL_PLAYERS_CHUNK_SIZE, allPlayersChunkIndex);\n\n // up to ALL_PLAYERS_CHUNK_SIZE with empty players\n // to have an even view\n var startIndex = playersChunk.size();\n for (var i = startIndex; i < ALL_PLAYERS_CHUNK_SIZE; i++) {\n playersChunk.add(new Player(new Person()));\n }\n\n return playersChunk;\n }", "public PlayerPiece getPlayerPiece(int playerNum) {\n return playerPieces[playerNum];\n }", "public GamePiece getPlayerGamePiece(String playerName)\n\t{\n\t\treturn playerPieces.get(playerName);\n\t}", "public void setPieces(){\r\n Pawn[] arrwPawn = new Pawn[8];\r\n for (int i=0 ; i<8 ; i++){\r\n pos.setPosition(6,i);\r\n arrwPawn[i] = new Pawn (pos , piece.Colour.WHITE);\r\n GameBoard.putPiece(arrwPawn[i]);\r\n }\r\n\r\n Pawn[] arrbPawn = new Pawn[8];\r\n for(int i=0 ; i<8 ; i++){\r\n pos.setPosition(0,i);\r\n arrbPawn[i] = new Pawn(pos , piece.Colour.BLACK);\r\n GameBoard.putPiece(arrbPawn[i]);\r\n }\r\n\r\n\r\n //set black pieces in the board\r\n\r\n pos.setPosition(0,0);\r\n Rook bRook1 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook1);;\r\n\r\n pos.setPosition(0,7);\r\n Rook bRook2 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook2);\r\n\r\n\r\n pos.setPosition(0,1);\r\n Knight bKnight1 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,6);\r\n Knight bKnight2 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,2);\r\n Bishop bBishop1 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop1);\r\n\r\n pos.setPosition(0,5);\r\n Bishop bBishop2 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop2);\r\n\r\n pos.setPosition(0,3);\r\n Queen bQueen = new Queen(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bQueen);\r\n\r\n pos.setPosition(0,4);\r\n King bKing = new King(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKing);\r\n\r\n //set white pieces in the board\r\n\r\n pos.setPosition(7,0);\r\n Rook wRook1 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook1);\r\n\r\n pos.setPosition(7,7);\r\n Rook wRook2 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook2);\r\n\r\n pos.setPosition(7,1);\r\n Knight wKnight1 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,6);\r\n Knight wKnight2 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,2);\r\n Bishop wBishop1 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop1);\r\n\r\n pos.setPosition(7,5);\r\n Bishop wBishop2 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop2);\r\n\r\n pos.setPosition(7,3);\r\n Queen wQueen = new Queen(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wQueen);\r\n\r\n pos.setPosition(7,4);\r\n King wKing = new King(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKing);\r\n\r\n\r\n\r\n Rook arrwRook[] = {wRook1,wRook2};\r\n Rook arrbRook[] = {bRook1,bRook2};\r\n Queen arrwQueen[] = {wQueen};\r\n Queen arrbQueen[] = {bQueen};\r\n Knight arrwKnight[] = {wKnight1,wKnight2};\r\n Knight arrbKnight[] = {bKnight1,bKnight2};\r\n King arrwKing[] = {wKing};\r\n King arrbKing[] = {bKing};\r\n Bishop arrwBishop[] = {wBishop1,wBishop2};\r\n Bishop arrbBishop[] = {bBishop1,bBishop2};\r\n }", "public int getNumOfPlayerPieces() {\n return playerPiecePositions.length;\n }", "@Override\n public String toString() {\n return String.valueOf(playerPiece);\n }", "List<Player> getPlayers();", "public Piece getPiece() {\n return this.piece;\n }", "public void Draw (Graphics graphics, MainJPanel JPanel){ // draw the player game pieces\n for(Piece piece : pieces.values())\n piece.Draw(graphics,JPanel);\n }", "public PieceIF getPiece();", "public Piece getPieceInTile() {\n \r\n return pieceInTile;\r\n }", "ArrayList<Tile> getTilesPlayerOne() throws RemoteException;", "public Set<String> getPlayers()\n\t{\n\t\tSet<String> player = playerPieces.keySet();\n\t\treturn player;\n\t}", "public CompactPlayer[] getPlayers()\n {\n return players;\n }", "public Piece getPiece()\r\n\t{\r\n\t\treturn piece;\r\n\t}", "public BuildingPiece[] getPossiblePieces(){\n\t\treturn possiblePieces;\n\t}", "public void createPieces(){ \n\t\tfor(int x = 0; x<BOARD_LENGTH; x++){\n\t\t\tfor(int y = 0; y<BOARD_LENGTH; y++){ \n\t\t\t\tif(CHESS_MAP[x][y] != (null)){\n\t\t\t\t\tswitch (CHESS_MAP[x][y]){\n\t\t\t\t\tcase KING:\n\t\t\t\t\t\tpieces[pieceCounter] = new King(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase QUEEN:\n\t\t\t\t\t\tpieces[pieceCounter] = new Queen(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BISHOP:\n\t\t\t\t\t\tpieces[pieceCounter] = new Bishop(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KNIGHT:\n\t\t\t\t\t\tpieces[pieceCounter] = new Knight(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PAWN:\n\t\t\t\t\t\tpieces[pieceCounter] = new Pawn(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ROOK:\n\t\t\t\t\t\tpieces[pieceCounter] = new Rook(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} \n\t\t\t\t\tsetPieceIconAndName(x, y, CHESS_MAP[x][y]); \t\n\t\t\t\t\tpieceCounter++;\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t}", "public void start() {\n clear();\n // Assigning chess pieces to players.\n whitePieces.add(new Piece(Owner.WHITE, Who.KING, Rank.R1, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.QUEEN, Rank.R1, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.H));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.H));\n\n for (Piece p : whitePieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n blackPieces.add(new Piece(Owner.BLACK, Who.KING, Rank.R8, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.QUEEN, Rank.R8, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.H));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.H));\n\n for (Piece p : blackPieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n whoseTurn = Owner.WHITE;\n canCastle = 15;\n passer = null;\n movesDone = lastEatMove = 0;\n }", "public Pawn getPawn() {\n return (Pawn) this.piece;\n }", "public Vector<ChessBoardBlock> getMovablePosition(ChessPiece p) {\r\n\t\tString player = p.chessPlayer;\r\n\t\tString position = p.position;\r\n\t\tchar h = position.charAt(0);\r\n\t\tint v = Integer.parseInt(position.substring(1));\r\n\t\tVector<ChessBoardBlock> tmp = new Vector<ChessBoardBlock>();\r\n\t\ttmp.add(board.get(position));\r\n\t\t\r\n\t\t// Condition for white piece\r\n\t\tif (player.equals(\"white\")) {\r\n\t\t\t\r\n\t\t\t// Condition for not King piece\r\n\t\t\tif (p.getText() == null) {\r\n\t\t\t\tChessBoardBlock br1 = board.get(Character.toString((char)(h+1)) + (v+1));\r\n\t\t\t\tChessBoardBlock br2 = board.get(Character.toString((char)(h+2)) + (v+2));\r\n\t\t\t\t// Condition for upper right to the piece\r\n\t\t\t\tif (br1 != null && piece.get(br1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(br1.position));\r\n\t\t\t\t} else if (br2 != null && piece.get(br1.position).chessPlayer.equals(\"black\") && piece.get(br2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(br2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tChessBoardBlock bl1 = board.get(Character.toString((char)(h-1)) + (v+1));\r\n\t\t\t\tChessBoardBlock bl2 = board.get(Character.toString((char)(h-2)) + (v+2));\r\n\t\t\t\t// Condition for upper left to the piece\r\n\t\t\t\tif (bl1 != null && piece.get(bl1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bl1.position));\r\n\t\t\t\t} else if (bl2 != null && piece.get(bl1.position).chessPlayer.equals(\"black\") && piece.get(bl2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bl2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} \r\n\r\n\t\t\t// Condition for King piece\r\n\t\t\telse {\r\n\t\t\t\tChessBoardBlock bur1 = board.get(Character.toString((char)(h+1)) + (v+1));\r\n\t\t\t\tChessBoardBlock bur2 = board.get(Character.toString((char)(h+2)) + (v+2));\r\n\t\t\t\t// Condition for upper right to the piece\r\n\t\t\t\tif (bur1 != null && piece.get(bur1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bur1.position));\r\n\t\t\t\t} else if (bur2 != null && piece.get(bur1.position).chessPlayer.equals(\"black\") && piece.get(bur2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bur2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tChessBoardBlock bul1 = board.get(Character.toString((char)(h-1)) + (v+1));\r\n\t\t\t\tChessBoardBlock bul2 = board.get(Character.toString((char)(h-2)) + (v+2));\r\n\t\t\t\t// Condition for upper left to the piece\r\n\t\t\t\tif (bul1 != null && piece.get(bul1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bul1.position));\r\n\t\t\t\t} else if (bul2 != null && piece.get(bul1.position).chessPlayer.equals(\"black\") && piece.get(bul2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bul2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tChessBoardBlock bdr1 = board.get(Character.toString((char)(h+1)) + (v-1));\r\n\t\t\t\tChessBoardBlock bdr2 = board.get(Character.toString((char)(h+2)) + (v-2));\r\n\t\t\t\t// Condition for lower right to the piece\r\n\t\t\t\tif (bdr1 != null && piece.get(bdr1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bdr1.position));\r\n\t\t\t\t} else if (bdr2 != null && piece.get(bdr1.position).chessPlayer.equals(\"black\") && piece.get(bdr2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bdr2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tChessBoardBlock bdl1 = board.get(Character.toString((char)(h-1)) + (v-1));\r\n\t\t\t\tChessBoardBlock bdl2 = board.get(Character.toString((char)(h-2)) + (v-2));\r\n\t\t\t\t// Condition for lower left to the piece\r\n\t\t\t\tif (bdl1 != null && piece.get(bdl1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bdl1.position));\r\n\t\t\t\t} else if (bdl2 != null && piece.get(bdl1.position).chessPlayer.equals(\"black\") && piece.get(bdl2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bdl2.position));\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\t// Condition for black piece\r\n\t\telse {\r\n\t\t\t\r\n\t\t\t// Condition for not King piece\r\n\t\t\tif (p.getText() == null) {\r\n\t\t\t\tChessBoardBlock br1 = board.get(Character.toString((char)(h+1)) + (v-1));\r\n\t\t\t\tChessBoardBlock br2 = board.get(Character.toString((char)(h+2)) + (v-2));\r\n\t\t\t\t// Condition for upper right to the piece\r\n\t\t\t\tif (br1 != null && piece.get(br1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(br1.position));\r\n\t\t\t\t} else if (br2 != null && piece.get(br1.position).chessPlayer.equals(\"white\") && piece.get(br2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(br2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tChessBoardBlock bl1 = board.get(Character.toString((char)(h-1)) + (v-1));\r\n\t\t\t\tChessBoardBlock bl2 = board.get(Character.toString((char)(h-2)) + (v-2));\r\n\t\t\t\t// Condition for upper left to the piece\r\n\t\t\t\tif (bl1 != null && piece.get(bl1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bl1.position));\r\n\t\t\t\t} else if (bl2 != null && piece.get(bl1.position).chessPlayer.equals(\"white\") && piece.get(bl2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bl2.position));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tChessBoardBlock bur1 = board.get(Character.toString((char)(h+1)) + (v+1));\r\n\t\t\t\tChessBoardBlock bur2 = board.get(Character.toString((char)(h+2)) + (v+2));\r\n\t\t\t\t// Condition for upper right to the piece\r\n\t\t\t\tif (bur1 != null && piece.get(bur1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bur1.position));\r\n\t\t\t\t} else if (bur2 != null && piece.get(bur1.position).chessPlayer.equals(\"white\") && piece.get(bur2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bur2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tChessBoardBlock bul1 = board.get(Character.toString((char)(h-1)) + (v+1));\r\n\t\t\t\tChessBoardBlock bul2 = board.get(Character.toString((char)(h-2)) + (v+2));\r\n\t\t\t\t// Condition for upper left to the piece\r\n\t\t\t\tif (bul1 != null && piece.get(bul1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bul1.position));\r\n\t\t\t\t} else if (bul2 != null && piece.get(bul1.position).chessPlayer.equals(\"white\") && piece.get(bul2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bul2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tChessBoardBlock bdr1 = board.get(Character.toString((char)(h+1)) + (v-1));\r\n\t\t\t\tChessBoardBlock bdr2 = board.get(Character.toString((char)(h+2)) + (v-2));\r\n\t\t\t\t// Condition for lower right to the piece\r\n\t\t\t\tif (bdr1 != null && piece.get(bdr1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bdr1.position));\r\n\t\t\t\t} else if (bdr2 != null && piece.get(bdr1.position).chessPlayer.equals(\"white\") && piece.get(bdr2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bdr2.position));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tChessBoardBlock bdl1 = board.get(Character.toString((char)(h-1)) + (v-1));\r\n\t\t\t\tChessBoardBlock bdl2 = board.get(Character.toString((char)(h-2)) + (v-2));\r\n\t\t\t\t// Condition for lower left to the piece\r\n\t\t\t\tif (bdl1 != null && piece.get(bdl1.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bdl1.position));\r\n\t\t\t\t} else if (bdl2 != null && piece.get(bdl1.position).chessPlayer.equals(\"white\") && piece.get(bdl2.position).chessPlayer.equals(\"empty\")) {\r\n\t\t\t\t\ttmp.add(board.get(bdl2.position));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn tmp;\r\n\t}", "public abstract Collection<PlayerFish> getPlayers();", "public Piece getPiece() {\n\treturn piece;\n }", "public int getPiece() {\n return piece;\n }", "public void setPlayersPiece(int a_playersPiece) {\n this.playersPiece = a_playersPiece;\n }", "private void specialPowersPhase() {\n \tSpecialCharacter tmpPiece = null;\n \tTerrain theHex = null;\n\n for (Player p : playerList) {\n pause();\n this.player = p;\n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n \n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Game.getRackGui().setOwner(player);\n }\n });\n /*\n * Loops through all of the hexes that the player has pieces on.\n * If one of the pieces is either Master Thief or Assassin Primus, perform their\n * special ability.\n */\n for (Terrain hex : player.getHexesWithPiece()) {\n for (Piece pc : hex.getContents(player.getName()).getStack()) {\n if (pc.getName().equals(\"Master Thief\") || pc.getName().equals(\"Assassin Primus\")) { \n ((Performable)pc).specialAbility();\n if (MasterThief.isReturnPiece() || AssassinPrimus.isReturnPiece()) {\n \ttmpPiece = (SpecialCharacter)pc;\n \ttheHex = hex;\n \ttmpPiece.returnToBank(theHex);\n \tbreak;\n }\n }\n }\n }\n player.flipAllDown();\n }\n ClickObserver.getInstance().setPlayerFlag(\"\");\n\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n DiceGUI.getInstance().setFaceValue(0);\n DiceGUI.getInstance().cover();\n }\n });\n }", "public List<Colour> getPlayerList();", "public ArrayList<GamePiece> getGamePiecesAtLocation(Location loc)\n\t{\n\t\tArrayList<GamePiece> pieceLocation = new ArrayList<GamePiece>();\n\t\tfor(String name: getPlayersAtLocation(loc))\n\t\t{\n\t\t\tpieceLocation.add(getPlayerGamePiece(name));\n\t\t}\n\t\treturn pieceLocation;\n\t}", "public void pullPlayerTiles() {\r\n\t\tRandom r = new Random();\r\n\t\tfor (int i=0; i < 7; i++) {\r\n\t\t\tint random = r.nextInt(Launch.getBoneyard().size());\r\n\t\t\t//System.out.println(\"[debug] random = \"+random);\r\n\t\t\t//System.out.println(\"[debug] index\"+random+\" in BONEYARD = \"+Arrays.toString(Launch.BONEYARD.get(random).getDots()));\r\n\t\t\tif (Utils.isSet(Launch.getBoneyard(), random)) {\r\n\t\t\t\tPLAYER_DOMINOS.add(Launch.getBoneyard().get(random));\r\n\t\t\t\tLaunch.getBoneyard().remove(random);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public ArrayList<Player> getPlayers() {return steadyPlayers;}", "void printPlayersPiecesOnBoard(Player... P);", "@Override\r\n public void getRange(ArrayList<Piece> pieces){\r\n this.range.clear();\r\n int pieceX = this.getX(); int pieceY = this.getY(); // X and Y coordinates for the king piece\r\n\r\n // getPiece: 0 = empty; 1 = same color; 2 = opposite color\r\n //Up\r\n if (this.getPiece(pieceX, pieceY+1, pieces) == 0 || this.getPiece(pieceX, pieceY+1, pieces) == 2)\r\n this.range.add(new int[] {pieceX, pieceY+1}); // Return int[] of tested coordinates\r\n\r\n //Up-right\r\n if (this.getPiece(pieceX+1, pieceY+1, pieces) == 0 || this.getPiece(pieceX+1, pieceY+1, pieces) == 2)\r\n this.range.add(new int[] {pieceX+1, pieceY+1}); // Return int[] of tested coordinates\r\n\r\n //Right\r\n if (this.getPiece(pieceX+1, pieceY, pieces) == 0 || this.getPiece(pieceX+1, pieceY, pieces) == 2)\r\n this.range.add(new int[] {pieceX+1, pieceY}); // Return int[] of tested coordinates\r\n\r\n //Down-right\r\n if (this.getPiece(pieceX+1, pieceY-1, pieces) == 0 || this.getPiece(pieceX+1, pieceY-1, pieces) == 2)\r\n this.range.add(new int[] {pieceX+1, pieceY-1}); // Return int[] of tested coordinates\r\n\r\n //Down\r\n if (this.getPiece(pieceX, pieceY-1, pieces) == 0 || this.getPiece(pieceX, pieceY-1, pieces) == 2)\r\n this.range.add(new int[] {pieceX, pieceY-1}); // Return int[] of tested coordinates\r\n\r\n //Down-left\r\n if (this.getPiece(pieceX-1, pieceY-1, pieces) == 0 || this.getPiece(pieceX-1, pieceY-1, pieces) == 2)\r\n this.range.add(new int[] {pieceX-1, pieceY-1}); // Return int[] of tested coordinates\r\n\r\n //Left\r\n if (this.getPiece(pieceX-1, pieceY, pieces) == 0 || this.getPiece(pieceX-1, pieceY, pieces) == 2)\r\n this.range.add(new int[] {pieceX-1, pieceY}); // Return int[] of tested coordinates\r\n\r\n //Up-left\r\n if (this.getPiece(pieceX-1, pieceY+1, pieces) == 0 || this.getPiece(pieceX-1, pieceY+1, pieces) == 2)\r\n this.range.add(new int[] {pieceX-1, pieceY+1}); // Return int[] of tested coordinates\r\n\r\n //Castling\r\n for (Piece piece : pieces) {\r\n if (piece instanceof Rook) {\r\n if (piece.getColor() == this.getColor()) {\r\n if (validCastling(pieces, (Rook)piece)) {\r\n int targetX = (piece.getX() < getX()) ? (this.getX() - 2) : (this.getX() + 2);\r\n this.range.add(new int[] {targetX, this.getY()});\r\n }\r\n }\r\n }\r\n }\r\n }", "public int getPiece()\n\t{\n\t\treturn this.piece;\n\t}", "public Board getPlayersBoard() {\n return playersBoard;\n }", "@Test\n\tpublic void testgetPlayers() {\n\t\tList<Character> characters = new ArrayList<Character>();\n\t\tcharacters.add(new Character(\"Miss Scarlet\", Color.red, new Point(7,24), \"assets/cards/character/MissScarlet.jpg\"));\n\t\tcharacters.add(new Character(\"Colonel Mustard\", Color.yellow, new Point(0,17),\"assets/cards/character/ColonelMustard.jpg\"));\n\t\tcharacters.add(new Character(\"Mrs. White\", Color.white, new Point(9,0), \"assets/cards/character/MrsWhite.jpg\"));\n\t\tcharacters.add(new Character(\"The Reverend Green\", Color.green, new Point(14,0),\"assets/cards/character/MrGreen.jpg\"));\n\t\tcharacters.add(new Character(\"Mrs. Peacock\", Color.blue, new Point(23,6), \"assets/cards/character/MrsPeacock.jpg\"));\n\t\tcharacters.add(new Character(\"Professor Plum\", Color.pink, new Point(23,19),\"assets/cards/character/ProfessorPlum.jpg\"));\n\t\tPlayer p = new Player(\"Chris\");\n\t\tcharacters.get(1).setPlayer(p);\t\t\n\t\tBoard b = new Board(characters);\n\t\tassertTrue(b.getPlayers().contains(p));\n\t\tassertTrue(b.getPlayers().size() ==1);\n\t\t\n\t}", "public Set<Colour> getWinningPlayers();", "public Piece getPiece() {\n\t\treturn _piece;\n\t}", "List<Move> getLegalMoves(Player player);", "public int getPoints ( Player player );", "public static void makePieces() {\n\t\tPiece[] pieces = new Piece[35];\n\t\tfor (int i = 0; i < pieces.length; i++) {\n\t\t\tTile t = new Tile(false, true, 0, 0);\n\t\t\tTile f = new Tile(false, false, 0, 0);\n\t\t\tTile[][] tiles = new Tile[6][6];\n\t\t\tswitch (i) {\n\t\t\tcase 0:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, t, t, f, f }, { f, f, t, f, f, f },\n\t\t\t\t\t\t{ f, f, t, f, f, f }, { f, f, t, t, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, t, t, f, f }, { f, f, t, f, f, f },\n\t\t\t\t\t\t{ f, f, t, t, f, f }, { f, f, t, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, t, t, f, f }, { f, f, t, t, f, f },\n\t\t\t\t\t\t{ f, f, f, t, f, f }, { f, f, f, t, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, t, f, f }, { f, f, t, t, f, f }, { f, f, t, f, f, f },\n\t\t\t\t\t\t{ f, f, t, f, f, f }, { f, f, t, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\ttiles = new Tile[][] { { f, f, t, f, f, f }, { f, f, t, f, f, f }, { f, f, t, t, f, f },\n\t\t\t\t\t\t{ f, f, t, f, f, f }, { f, f, t, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\ttiles = new Tile[][] { { f, f, t, f, f, f }, { f, f, t, t, f, f }, { f, f, t, f, f, f },\n\t\t\t\t\t\t{ f, f, t, f, f, f }, { f, f, t, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\ttiles = new Tile[][] { { f, f, t, t, f, f }, { f, f, t, f, f, f }, { f, f, t, f, f, f },\n\t\t\t\t\t\t{ f, f, t, f, f, f }, { f, f, t, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\ttiles = new Tile[][] { { f, f, t, f, f, f }, { f, f, t, f, f, f }, { f, f, t, f, f, f },\n\t\t\t\t\t\t{ f, f, t, f, f, f }, { f, f, t, f, f, f }, { f, f, t, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, t, f, f, f, f }, { f, t, t, f, f, f },\n\t\t\t\t\t\t{ f, t, t, t, f, f }, { f, f, f, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, f, t, f, f }, { f, t, t, t, f, f },\n\t\t\t\t\t\t{ f, t, t, f, f, f }, { f, f, f, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 10:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, t, f, f, f }, { f, f, t, t, f, f },\n\t\t\t\t\t\t{ f, f, t, t, f, f }, { f, f, t, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 11:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, t, t, t, f, f }, { f, t, f, f, f, f },\n\t\t\t\t\t\t{ f, t, f, f, f, f }, { f, t, f, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 12:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, t, f, f, f, f }, { f, t, t, t, f, f },\n\t\t\t\t\t\t{ f, t, f, f, f, f }, { f, t, f, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 13:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, t, t, t, f, f }, { f, f, t, f, f, f },\n\t\t\t\t\t\t{ f, f, t, f, f, f }, { f, f, t, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 14:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, t, t, f, f }, { f, t, t, f, f, f },\n\t\t\t\t\t\t{ f, f, t, f, f, f }, { f, f, t, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 15:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, t, t, f, f }, { f, f, t, f, f, f },\n\t\t\t\t\t\t{ f, t, t, f, f, f }, { f, f, t, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 16:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, t, t, f, f }, { f, f, t, f, f, f },\n\t\t\t\t\t\t{ f, f, t, f, f, f }, { f, t, t, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 17:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, t, f, f, f }, { f, f, t, t, f, f },\n\t\t\t\t\t\t{ f, t, t, f, f, f }, { f, f, t, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 18:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, t, f, t, f, f }, { f, t, t, t, f, f },\n\t\t\t\t\t\t{ f, t, f, f, f, f }, { f, f, f, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 19:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, t, t, t, f, f }, { f, f, t, t, f, f },\n\t\t\t\t\t\t{ f, f, t, f, f, f }, { f, f, f, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 20:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, t, f, t, f, f }, { f, t, t, t, f, f },\n\t\t\t\t\t\t{ f, f, t, f, f, f }, { f, f, f, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 21:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, t, f, f, f }, { f, t, t, t, f, f },\n\t\t\t\t\t\t{ f, t, t, f, f, f }, { f, f, f, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 22:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, t, f, f, f }, { f, t, t, t, f, f },\n\t\t\t\t\t\t{ f, f, t, f, f, f }, { f, f, t, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 23:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, t, f, f, f }, { f, t, t, t, f, f },\n\t\t\t\t\t\t{ f, t, f, f, f, f }, { f, t, f, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 24:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, t, f, f }, { f, f, f, t, f, f }, { f, f, t, t, f, f },\n\t\t\t\t\t\t{ f, f, t, f, f, f }, { f, f, t, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 25:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, f, t, f, f }, { f, f, t, t, f, f },\n\t\t\t\t\t\t{ f, f, t, f, f, f }, { f, f, t, t, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 26:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, f, t, f, f }, { f, f, t, t, f, f },\n\t\t\t\t\t\t{ f, f, t, t, f, f }, { f, f, t, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 27:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, t, t, f, f }, { f, f, t, t, f, f },\n\t\t\t\t\t\t{ f, f, t, t, f, f }, { f, f, f, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 28:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, f, t, f, f }, { f, t, t, t, f, f },\n\t\t\t\t\t\t{ f, f, t, f, f, f }, { f, f, t, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 29:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, f, t, f, f }, { f, f, t, t, f, f },\n\t\t\t\t\t\t{ f, t, t, f, f, f }, { f, f, t, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 30:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, f, t, f, f }, { f, t, t, t, f, f },\n\t\t\t\t\t\t{ f, t, f, f, f, f }, { f, t, f, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 31:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, t, t, t, f, f }, { f, t, f, t, f, f },\n\t\t\t\t\t\t{ f, t, f, f, f, f }, { f, f, f, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 32:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, f, t, f, f }, { f, f, t, t, f, f },\n\t\t\t\t\t\t{ f, t, t, f, f, f }, { f, t, f, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 33:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, t, t, f, f }, { f, t, t, f, f, f },\n\t\t\t\t\t\t{ f, t, f, f, f, f }, { f, t, f, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\tcase 34:\n\t\t\t\ttiles = new Tile[][] { { f, f, f, f, f, f }, { f, f, t, t, f, f }, { f, f, t, f, f, f },\n\t\t\t\t\t\t{ f, t, t, f, f, f }, { f, t, f, f, f, f }, { f, f, f, f, f, f } };\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpieces[i] = new Piece(tiles);\n\t\t}\n\t\ttry {\n\t\t\tFileOutputStream saveFile = new FileOutputStream(\"pieces.data\");\n\t\t\tObjectOutputStream save = new ObjectOutputStream(saveFile);\n\t\t\tsave.reset();\n\t\t\tsave.writeObject(pieces);\n\t\t\tsave.close();\n\t\t} catch (Exception exc) {\n\t\t\texc.printStackTrace(); // If there was an error, print the info.\n\t\t}\n\t}", "private Collection<Player> getPlayers() {\n\t\treturn players;\n\t}", "private List<Position> getHalos() {\n\t\t\tList<Position> halos = new ArrayList<Position>();\n\t\t\tGamePiece selectedPiece = game.getSelectedPiece();\n\t\t\tif (selectedPiece != null) {\n\t\t\t\thalos.add(selectedPiece.getPosition());\n\t\t\t\thalos.addAll(selectedPiece.getLegalMoves());\n\t\t\t}\n\t\t\treturn halos;\n\t\t}", "@Test\n public void shouldBeAbleToInitializeWithPieces() {\n Player p1 = new Player(ChessPieceColor.WHITE, position);\n Player p2 = new Player(ChessPieceColor.BLACK, position);\n for (int i = 0; i < position.getSize(); i++) {\n Assert.assertNotNull(position.getPieceAtPosition(i, 0)); // Regular pieces\n Assert.assertNotNull(position.getPieceAtPosition(i, 1)); // Pawns\n Assert.assertNotNull(position.getPieceAtPosition(i, 7)); // Regular pieces\n Assert.assertNotNull(position.getPieceAtPosition(i, 6)); // Pawns\n }\n }", "public List<ColorId> checkPlayersBasicMode ()\n {\n List<ColorId> players = new ArrayList<>();\n\n for (Player playerIterate : player.playerThatSee(player.getSquare().getGameBoard()))\n {\n if (playerIterate.getSquare() != player.getSquare())\n players.add(playerIterate.getColor());\n }\n return players;\n }", "private void renderPlayers() {\n\t\tfor (Player player : this.game.players()) {\n\t\t\t/* So, logically convluted crap ahead.\n\t\t\t * Player position is tracked via a 1-based coordinate system.\n\t\t\t * Our output array is 0-based.\n\t\t\t * Our output array contains an additional row/column on each side for the wall.\n\t\t\t *\n\t\t\t * Hence, when mapping the player's position to an\n\t\t\t * index in the output array, we have to subtract one\n\t\t\t * to switch from 1-basedness to 0-basedness, then add\n\t\t\t * 1 to accomodate for the wall column/row. Which\n\t\t\t * leaves us with a difference of 0. */\n\t\t\tthis.output[player.position().y][player.position().x] = player.sign();\n\t\t}\n\t}", "public ArrayList<Coordinates> getHeroesPositions (){\n\t\tArrayList<Coordinates> path = new ArrayList<>();\n\t\tArrayList<Coordinates> coordinatePieces = chessboard.getTurnPieces();\n\t\tArrayList<Coordinates> threats = getThreats();\n\n\t\tfor ( Coordinates c : threats ){\n\t\t\tpath.add(c); //aggiungo la posizione dell'avversario\n\t\t\tif ( !(chessboard.at(c) instanceof Knight) )\n\t\t\t\tpath.addAll(chessboard.at(c).getPath(c, chessboard.getTurnKing())); //tutte le posizione in cui può andare\n\t\t}\n\t\t\n\t\tArrayList<Coordinates> result = new ArrayList<>();\n\t\t\tfor ( Coordinates c : coordinatePieces )\n\t\t\t\tfor ( Coordinates to : path)\n\t\t\t\t\tif ( !(chessboard.at(c) instanceof King) && checkMove(c, to) )\n\t\t\t\t\t\tresult.add(to);\n\t\treturn result;\n\t}", "List gen() {\n\tList ret = new ArrayList();\n\n\tlong emptySlots = ~(pieceBits[LIGHT] | pieceBits[DARK]);\n\tif (side == LIGHT) {\n\tlong moves = (pawnBits[LIGHT] >> 8) & emptySlots;\n\tlong keep = moves;\n\twhile (moves != 0) {////// bouger le pion d'une case\n\t\tint theMove = getLBit(moves);\n\t\tgenPush(ret, theMove + 8, theMove, 16);\n\t\tmoves &= (moves - 1);\n\t\t}\n\t\tmoves = ((keep & 0x0000ff0000000000L) >> 8) & emptySlots;// bouge le pion\n\t\twhile (moves != 0) {//bouger le pion de deux case\n\t\tint theMove = getLBit(moves);\n\t\tgenPush(ret, theMove + 16, theMove, 24);\n\t\tmoves &= (moves - 1);\n\t\t}\n\t\tmoves = ((pawnBits[LIGHT] & 0x00fefefefefefefeL) >> 9)\n\t\t& pieceBits[DARK];\n\t\twhile (moves != 0) {//pion qui mange un autre pion\n\t\tint theMove = getLBit(moves);\n\t\tgenPush(ret, theMove + 9, theMove, 17);\n\t\tmoves &= (moves - 1);\n\t\t}\n\t\tmoves = ((pawnBits[LIGHT] & 0x007f7f7f7f7f7f7fL) >> 7)\n\t\t& pieceBits[DARK];\n\t\twhile (moves != 0) {// manger a droite\n\n\tint theMove = getLBit(moves);\n\tgenPush(ret, theMove + 7, theMove, 17);\n\tmoves &= (moves - 1);\n\t}\n\t} else {\n\tlong moves = (pawnBits[DARK] << 8) & emptySlots;\n\tlong keep = moves;\n\twhile (moves != 0) {\n\tint theMove = getLBit(moves);\n\tgenPush(ret, theMove - 8, theMove, 16);\n\tmoves &= (moves - 1);\n\t}\n\tmoves = ((keep & 0xff0000L) << 8) & emptySlots;\n\twhile (moves != 0) {\n\tint theMove = getLBit(moves);\n\tgenPush(ret, theMove - 16, theMove, 24);\n\tmoves &= (moves - 1);\n\t}\n\tmoves = ((pawnBits[DARK] & 0x00fefefefefefefeL) << 7)\n\t& pieceBits[LIGHT];\n\twhile (moves != 0) {\n\tint theMove = getLBit(moves);\n\tgenPush(ret, theMove - 7, theMove, 17);\n\tmoves &= (moves - 1);\n\t}\n\tmoves = ((pawnBits[DARK] & 0x007f7f7f7f7f7f7fL) << 9)\n\t& pieceBits[LIGHT];\n\twhile (moves != 0) {\n\tint theMove = getLBit(moves);\n\tgenPush(ret, theMove - 9, theMove, 17);\n\tmoves &= (moves - 1);\n\t}\n\t}\n\tlong pieces = pieceBits[side] ^ pawnBits[side];\n\twhile (pieces != 0) {\n\tint i = getLBit(pieces);\n\tint p = piece[i];\n\tfor (int j = 0; j < offsets[p]; ++j)\n\tfor (int n = i;;) {\n\tn = mailbox[mailbox64[n] + offset[p][j]];\n\tif (n == -1)\n\tbreak;\n\tif (color[n] != EMPTY) {\n\tif (color[n] == xside)\n\tgenPush(ret, i, n, 1);\n\tbreak;\n\t}\n\tgenPush(ret, i, n, 0);\n\tif (!slide[p])\n\tbreak;\n\t}\n\tpieces &= (pieces - 1);\n\t}\n\n\t/* petit rock */\n\tif (side == LIGHT) {\n\tif (((castle & 1) != 0) && (piece[F1] == EMPTY)\n\t&& (piece[G1] == EMPTY))\n\tgenPush(ret, E1, G1, 2);\n\tif (((castle & 2) != 0) && (piece[D1] == EMPTY)\n\t&& (piece[C1] == EMPTY) && (piece[B1] == EMPTY))\n\tgenPush(ret, E1, C1, 2);\n\t} else {\n\tif (((castle & 4) != 0) && (piece[F8] == EMPTY)\n\t&& (piece[G8] == EMPTY))\n\tgenPush(ret, E8, G8, 2);\n\tif (((castle & 8) != 0) && (piece[D8] == EMPTY)\n\t&& (piece[C8] == EMPTY) && (piece[B8] == EMPTY))\n\tgenPush(ret, E8, C8, 2);\n\t}\n\n\t/* generate en passant moves */\n\tif (ep != -1) {\n\tif (side == LIGHT) {\n\tif (COL(ep) != 0 && color[ep + 7] == LIGHT\n\t&& piece[ep + 7] == PAWN)\n\tgenPush(ret, ep + 7, ep, 21);\n\tif (COL(ep) != 7 && color[ep + 9] == LIGHT\n\t&& piece[ep + 9] == PAWN)\n\tgenPush(ret, ep + 9, ep, 21);\n\t} else {\n\tif (COL(ep) != 0 && color[ep - 9] == DARK\n\t&& piece[ep - 9] == PAWN)\n\tgenPush(ret, ep - 9, ep, 21);\n\tif (COL(ep) != 7 && color[ep - 7] == DARK\n\t&& piece[ep - 7] == PAWN)\n\tgenPush(ret, ep - 7, ep, 21);\n\t}\n\t}\n\treturn ret;\n\t}", "public Connect4Player[] getPlayers(){\n\t\tConnect4Player[] output = new Connect4Player[4];\n\t\tif(players.isEmpty()){\n\t\t\tplayers.add(new Connect4Player(this, TOKEN.X));\n\t\t\tplayers.add(new Connect4Player(this, TOKEN.O));\n\t\t}\n\t\toutput[0] = players.get(0);\n\t\toutput[1] = players.get(1);\n\t\treturn output;\n\t}", "public ArrayList<Card> getPlayableCards(Player p) {\n ArrayList<Card> playableCards;\n\t if (gameLogic.getLeadSuitCard() == null) {\n\t playableCards = p.getPlayableHand(null, gameLogic.getTrumpCard().getSuit());\n\t System.out.println(playableCards);\n\t System.out.println(\"Player's playable Cards: \" + p.getPlayableHand(null, gameLogic.getTrumpCard().getSuit()));\n\t } else {\n\t playableCards = p.getPlayableHand(gameLogic.getLeadSuitCard().getSuit(), gameLogic.getTrumpCard().getSuit());\n\t System.out.println(\"Player's playable Cards: \" + p.getPlayableHand(gameLogic.getLeadSuitCard().getSuit(),\n\t gameLogic.getTrumpCard().getSuit()));\n\t }\n\n\t return playableCards;\n\t}", "public ArrayList<Piece> getHand() {\n return this.piecesInHand;\n }", "public ArrayList<Tile> getPlayerHand(){\n return playerHand;\n }", "public Piece[] getBoard() {\n return board;\n }", "public void newgame() {\n\t\tthis.player = 1;\n\t\t\n\n\t\tSystem.out.println(\"made a pice\");\n\t\tthis.piece = new String [9] [9];\n\t\tfor (int i=0; i<8 ;i++) {\n\t\t\tfor (int j= 0; j<8; j++) {\n\t\t\tpiece[i] [j] = \" \";\n\t\t\t}\n\t\t}\n\t\tint p = 0;\n\t\tfor (int i=0; i<=2 ;i++) {\n\t\t\tfor (int j= 0; j<8; j++) {\t\t\t\t\n\t\t\tif (p%2==1) {\n\t\t\t\tpiece[i][j]= \"1\";\n\t\t\t\tpiece[i+5][j+1] = \"2\";\n\t\t\t\tj +=1;}\n\t\t\telse {\n\t\t\t\tpiece[i][j+1]= \"1\";\n\t\t\t\tpiece[i+5][j] = \"2\";\n\t\t\t\tj +=1;\n\t\t\t\t}\n\t\t\t}p +=1;\n\t\t}\n\t\t\n\t}", "public void playTheGame() {\n\t\tint column;\n\t\ttry {\n\t\t\tboolean gameIsOver = false;\n\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\tthePlayers[count].getView().showOutput(\n\t\t\t\t\t\taConnect4Field.toString());\n\n\t\t\tdo {\n\t\t\t\tfor (int index = 0; index < thePlayers.length; index++) {\n\t\t\t\t\t// thePlayers[index].getView().showOutput(aConnect4Field.toString());\n\t\t\t\t\tif (aConnect4Field.isItaDraw()) {\n\t\t\t\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\t\t\t\tthePlayers[count].getView().showOutput(\"Draw\");\n\t\t\t\t\t\tgameIsOver = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthePlayers[index].getView().showOutput(\n\t\t\t\t\t\t\t\tthePlayers[index].getName()\n\t\t\t\t\t\t\t\t\t\t+ \" it's Your Turn! play your move\");\n\t\t\t\t\t\tcolumn = thePlayers[index].nextMove();\n\t\t\t\t\t\twhile (!aConnect4Field\n\t\t\t\t\t\t\t\t.checkIfPiecedCanBeDroppedIn(column)) {\n\t\t\t\t\t\t\tthePlayers[index].getView().showOutput(\n\t\t\t\t\t\t\t\t\t\"Invalid Turn Try again\");\n\t\t\t\t\t\t\tcolumn = thePlayers[index].nextMove();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taConnect4Field.dropPieces(column,\n\t\t\t\t\t\t\t\tthePlayers[index].getGamePiece());\n\t\t\t\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\t\t\t\tthePlayers[count].getView().showOutput(\n\t\t\t\t\t\t\t\t\taConnect4Field.toString());\n\t\t\t\t\t\tif (aConnect4Field.error != \"\") {\n\n\t\t\t\t\t\t\tthePlayers[index].getView().showOutput(\n\t\t\t\t\t\t\t\t\taConnect4Field.error);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (aConnect4Field.didLastMoveWin()) {\n\t\t\t\t\t\t\t\tgameIsOver = true;\n\t\t\t\t\t\t\t\t// all player get to know\n\t\t\t\t\t\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\t\t\t\t\t\tthePlayers[count].getView().showOutput(\n\t\t\t\t\t\t\t\t\t\t\t\"The winner is: \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ thePlayers[index]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getName());\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} while (!gameIsOver);\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "@Override\n public Game cloneGame(){\n GridGame clone = new pegsolitaire();\n clone.pieces = new LinkedList<Piece>();\n for(Piece pc : pieces){\n clone.pieces.add(pc.clonePiece());\n }\n clone.current_player = current_player;\n clone.size_x = size_x;\n clone.size_y = size_y;\n return clone;\n }", "public void newGame() {\n \tturn = PieceColor.White;\n \t\n \t//the middle are empty squares\n \tfor(int i = 2; i < 6; i++) {\n \t\tfor(int j = 0; j < 8; j++) {\n \t\t\tsetPiece(j, i, new NoPiece(j, i));\n \t\t}\n \t}\n \t\n \t//pawns\n \tfor(int i = 0; i < 8; i++) {\n \t\t//make these pawns\n \t\tsetPiece(i, 1, new Pawn(i, 1, PieceColor.White, this));\n \t\tsetPiece(i, 6, new Pawn(i, 6, PieceColor.Black, this));\n \t}\n \t\n \t//white back row\n \tsetPiece(0, 0, new Rook(0, 0, PieceColor.White, this));\n \tsetPiece(1, 0, new Knight(1, 0, PieceColor.White, this));\n \tsetPiece(2, 0, new Bishop(2, 0, PieceColor.White, this));\n \tsetPiece(3, 0, new Queen(3, 0, PieceColor.White, this));\n \tsetPiece(4, 0, new King(4, 0, PieceColor.White, this));\n \tsetPiece(5, 0, new Bishop(5, 0, PieceColor.White, this));\n \tsetPiece(6, 0, new Knight(6, 0, PieceColor.White, this));\n \tsetPiece(7, 0, new Rook(7, 0, PieceColor.White, this));\n \t\n \t//black back row\n \tsetPiece(0, 7, new Rook(0, 7, PieceColor.Black, this));\n \tsetPiece(1, 7, new Knight(1, 7, PieceColor.Black, this));\n \tsetPiece(2, 7, new Bishop(2, 7, PieceColor.Black, this));\n \tsetPiece(3, 7, new Queen(3, 7, PieceColor.Black, this));\n \tsetPiece(4, 7, new King(4, 7, PieceColor.Black, this));\n \tsetPiece(5, 7, new Bishop(5, 7, PieceColor.Black, this));\n \tsetPiece(6, 7, new Knight(6, 7, PieceColor.Black, this));\n \tsetPiece(7, 7, new Rook(7, 7, PieceColor.Black, this));\n \t\n \t//store locations of king so they can be checked\n \twKing = new Square(4, 0);\n \tbKing = new Square(4, 7);\n }", "public void initPieces() {\r\n\t\tfor (int i = 0; i < 64; i++) {\r\n\t\t\tif (i < 12) {\r\n\t\t\t\tblackPieces[i] = new ChessPiece(\"black\", \"\");\r\n\t\t\t\tblackPieces[i].setBackground(Color.BLACK);\r\n\t\t\t\tblackPieces[i].addMouseMotionListener(this);\r\n\t\t\t\tblackPieces[i].addMouseListener(this);\r\n\t\t\t\tblackPieces[i].setText(null);\r\n\t\t\t\twhitePieces[i] = new ChessPiece(\"white\", \"\");\r\n\t\t\t\twhitePieces[i].setBackground(Color.WHITE);\r\n\t\t\t\twhitePieces[i].addMouseMotionListener(this);\r\n\t\t\t\twhitePieces[i].addMouseListener(this);\r\n\t\t\t\twhitePieces[i].setText(null);\r\n\t\t\t}\r\n\t\t\tspacePieces[i] = new ChessPiece(\"empty\", \"\");\r\n\t\t\tspacePieces[i].setEnabled(false);\r\n\t\t\tspacePieces[i].setVisible(false);\r\n\t\t\tspacePieces[i].setText(null);\r\n\t\t}\r\n\t}", "public Piece getPiece(int i) { /* ... code ... */ }", "public Player[] getPlayers() {\r\n return players;\r\n }", "void initializeGame() {\n // Initialize players\n // Put the pieces on the board\n }", "Piece getPieceAt(int col, int row);", "public Player getPlayer();", "public Player getPlayer();", "public void generateAroundPlayer() {\n try {\n DataOutputStream dataOutputStream = new DataOutputStream(SixEngineClient.client.socket.getOutputStream());\n\n dataOutputStream.writeByte(5);\n dataOutputStream.writeInt(getChunkX());\n dataOutputStream.writeInt(getChunkY());\n dataOutputStream.writeInt(getChunkZ());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "List<Player> listPlayers();", "public String[] getNearestPlayer(Player p, PlayerData pd)\r\n/* 60: */ {\r\n/* 61:58 */ Game g = pd.getGame();\r\n/* 62: */ \r\n/* 63:60 */ int x = p.getLocation().getBlockX();\r\n/* 64:61 */ int y = p.getLocation().getBlockY();\r\n/* 65:62 */ int z = p.getLocation().getBlockZ();\r\n/* 66: */ \r\n/* 67:64 */ int i = 200000;\r\n/* 68: */ \r\n/* 69:66 */ Player player = null;\r\n/* 70:68 */ for (String s : g.getPlayers())\r\n/* 71: */ {\r\n/* 72:70 */ Player p2 = Bukkit.getPlayer(s);\r\n/* 73:72 */ if ((p2 != null) && (!p2.equals(p)) && (!pd.isOnTeam(s)))\r\n/* 74: */ {\r\n/* 75:74 */ Location l = p2.getLocation();\r\n/* 76: */ \r\n/* 77:76 */ int c = cal((int)(x - l.getX())) + cal((int)(y - l.getY())) + cal((int)(z - l.getZ()));\r\n/* 78:78 */ if (i > c)\r\n/* 79: */ {\r\n/* 80:79 */ player = p2;\r\n/* 81:80 */ i = c;\r\n/* 82: */ }\r\n/* 83: */ }\r\n/* 84: */ }\r\n/* 85:84 */ if (player != null) {\r\n/* 86:84 */ p.setCompassTarget(player.getLocation());\r\n/* 87: */ }\r\n/* 88:86 */ return new String[] { player == null ? \"none\" : player.getName(), String.valueOf(i) };\r\n/* 89: */ }", "public Player[] getPlayers() {\n return this.players;\n }", "public Player[] getPlayers() {\n return this.players;\n }", "@Test\n void grab() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n\n Square s = new Square(0, 4, false, true, false, true, false, 'b');\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n p.setPlayerPosition(s);\n p.getPh().getPowerupDeck().getPowerups().clear();\n p.setTurn(true);\n AmmoTile a = new AmmoTile();\n PowerupDeck pud = new PowerupDeck();\n int[] cubes = new int[3];\n cubes[0] = 2;\n cubes[2] = 1;\n char[] c1 = {'b', 'b', 'b'};\n char[] c2 = {'r', 'r', 'r'};\n char[] c3 = {'y', 'y', 'y'};\n p.getPb().payAmmo(c1);\n p.getPb().payAmmo(c2);\n p.getPb().payAmmo(c3);\n a.setCubes(cubes);\n a.setPowerup(false);\n s.setAmmo(a);\n try{\n p.grab(p.getPlayerPosition(), pud);\n }catch (WrongSquareException e){}\n }", "ArrayList<Player> getAllPlayer();", "private Ship[] consoleGetShips(int player) {\n //Grid grid = new Grid();\n Ship[] ships = new Ship[5];\n System.out.println();\n System.out.println(\"You are player \" + player);\n System.out.println(\"Please place your ships.\");\n ships[0] = consoleGetAShip(ships, \"CARRIER\", 5);\n ships[1] = consoleGetAShip(ships, \"DESTROYER\", 4);\n ships[2] = consoleGetAShip(ships, \"BATTLESHIP\", 3);\n ships[3] = consoleGetAShip(ships, \"SUBMARINE\", 3);\n ships[4] = consoleGetAShip(ships, \"PT\", 2);\n return ships;\n }", "public void run()\r\n/* 29: */ {\r\n/* 30:26 */ for (Player p :HG.plugin.getServer().getOnlinePlayers()) {\r\n/* 31:28 */ if (p.getInventory().contains(Material.COMPASS))\r\n/* 32: */ {\r\n/* 33:29 */ PlayerData pd = (PlayerData)this.plugin.players.get(p.getName());\r\n/* 34:31 */ if (pd != null)\r\n/* 35: */ {\r\n/* 36:33 */ String[] st = getNearestPlayer(p, pd);\r\n/* 37:34 */ String info = \"\" + ChatColor.WHITE + ChatColor.BOLD + \"Nearest Player: \" + ChatColor.RED + st[0] + \" \" + ChatColor.WHITE + ChatColor.BOLD + \"Distance: \" + ChatColor.RED + st[1];\r\n/* 38:36 */ for (ItemStack it : p.getInventory()) {\r\n/* 39:37 */ if ((it != null) && (it.getType() == Material.COMPASS))\r\n/* 40: */ {\r\n/* 41:38 */ ItemMeta im = it.getItemMeta();\r\n/* 42:39 */ im.setDisplayName(info);\r\n/* 43:40 */ it.setItemMeta(im);\r\n/* 44: */ }\r\n/* 45: */ }\r\n/* 46: */ }\r\n/* 47: */ }\r\n/* 48: */ }\r\n/* 49: */ }", "private void computePresentPleyers() {\n\t\tthis.presentPlayerKeys = new ArrayList<>();\n\t\tList<ChesspairingPlayer> players = mTournament.getPlayers();\n\t\tfor (ChesspairingPlayer player : players) {\n\t\t\tif (player.isPresent()) {\n\t\t\t\tthis.presentPlayerKeys.add(player.getPlayerKey());\n\t\t\t}\n\t\t}\n\t}", "private void drawPlayers(Graphics g){\n\t\tg.setColor(Color.BLACK);\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\tfor(GameMatter itm: grid[i][j].getItems()){\n\t\t\t\t\tif(itm instanceof Bandit){\n\t\t\t\t\t\tif(itm.equals(player))\n\t\t\t\t\t\t\tg.setColor(Color.MAGENTA);\n\t\t\t\t\t\tg.fillRect(j*widthBlock+padding, i*heightBlock+padding, bandit, bandit);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public ChunkCoordinates getPlayerCoordinates()\n {\n return new ChunkCoordinates(0, 0, 0);\n }", "public synchronized List<Card> getCardsInPlay(){\n cardsInPlay.clear();\r\n \r\n for(Player player: players){\r\n if(player == null){\r\n continue;\r\n }\r\n if(player.getCardsInHand().isEmpty()){\r\n continue;\r\n }\r\n for(Card card: player.getCardsInHand()){\r\n cardsInPlay.add(card);\r\n }\r\n }\r\n return cardsInPlay;\r\n }", "public Position getPlayerPiecePosition(int playerNum) {\n return playerPiecePositions[playerNum];\n }", "public Player[] getPlayers()\r\n\t{\r\n\t\treturn this.players;\r\n\t}", "@Override\n public List<Player> getPlayers() {\n return players;\n }", "public Player[] getPlayers() {\n return players;\n }" ]
[ "0.7050669", "0.68401146", "0.68349886", "0.6709615", "0.66394836", "0.6587558", "0.65387416", "0.6423168", "0.64046425", "0.63961124", "0.6396", "0.6383869", "0.6349627", "0.6339064", "0.6337013", "0.6337013", "0.6299992", "0.62618124", "0.6230514", "0.6213569", "0.62070847", "0.6197296", "0.6176146", "0.6158235", "0.61504394", "0.6077015", "0.6062232", "0.60568184", "0.60335857", "0.60302514", "0.6028826", "0.602348", "0.60225564", "0.60065675", "0.5985434", "0.59785384", "0.59746826", "0.59699714", "0.5963681", "0.59593195", "0.5958274", "0.5953775", "0.5948887", "0.5947235", "0.59215206", "0.5916317", "0.5905649", "0.5894502", "0.5893107", "0.58841497", "0.58764786", "0.5872093", "0.58594155", "0.5855845", "0.58541685", "0.58134276", "0.5808919", "0.5804383", "0.5799905", "0.5776068", "0.576106", "0.5760239", "0.57595164", "0.57589173", "0.5752982", "0.5749562", "0.5746454", "0.57373273", "0.57368433", "0.57363045", "0.5735311", "0.57282424", "0.57246876", "0.5716179", "0.57116723", "0.57064676", "0.570098", "0.56969374", "0.56916475", "0.5691364", "0.5685379", "0.56837684", "0.56837684", "0.56826466", "0.56747824", "0.56744516", "0.5664742", "0.5664742", "0.5659035", "0.5651019", "0.5650935", "0.56467843", "0.5641828", "0.5640699", "0.5638325", "0.5638166", "0.56365323", "0.5633606", "0.563223", "0.5631769" ]
0.6701259
4
getting the player pieces color
public String getColor() { return color; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Piece.color getColor() { return color; }", "public PieceColor getColor(){\r\n\t\treturn this.color;\r\n\t}", "@Override\n\tpublic Color getColor() {\n\t\treturn playerColor;\n\t}", "public GameColor getColor();", "public String getPieceColor(){\n\t\t\n\t\tif(xPosition>=ColumnNumber.firstColumn.ordinal() && xPosition<=ColumnNumber.eightColumn.ordinal() && xPosition>=RowNumber.firstRow.ordinal() && xPosition<=RowNumber.eightRow.ordinal()){\n\t\t\t\n\t\t\tif(isIcon){\n\t\t\t\treturn piece.getColor();\n\t\t\t}else{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t\n\t}", "public PlayerColor playerColor() {\n return color;\n }", "private Color getPlayerColor(int player){\n\t\tColor pColor;\n\t\tswitch (this.groups[player]){ // adjust color based on what group of balls they're hitting\n\t\t\tcase Ball.TYPE_RED: pColor = new Color(200, 7, 23); break;\n\t\t\tcase Ball.TYPE_BLUE: pColor = new Color(10, 7, 200); break;\n\t\t\tcase 3: pColor = new Color(230, 210, 0); break; // color/type for winner (TODO: enum for player group?)\n\t\t\tdefault: pColor = Color.black; break;\n\t\t}\n\t\t// change color based on if they're allowed to place/hit the ball at the moment\n\t\tpColor = (this.turn==player && !this.table.moving) ? pColor : new Color(pColor.getRed(), pColor.getGreen(), pColor.getBlue(), (int)(0.4*255)); \n\t\treturn pColor;\n\t}", "public PieceColor colorGoing()\n {\n if (turn%2==0)\n return PieceColor.WHITE;\n else return PieceColor.BLACK;\n }", "public Piece.COLOR getActiveColor() {\n return activePlayer;\n }", "public static Color getRemainsColorForPlayer(int player) {\n if (player >= remainsColors.length) {\n player = 0;\n }\n return remainsColors[player];\n }", "int getColour();", "public static Color getColorForPlayer(int player) {\n if (player >= playerColors.length) {\n player = 0;\n }\n return playerColors[player];\n }", "String getColour();", "public List<ColorId> checkPlayersBasicMode ()\n {\n List<ColorId> players = new ArrayList<>();\n\n for (Player playerIterate : player.playerThatSee(player.getSquare().getGameBoard()))\n {\n if (playerIterate.getSquare() != player.getSquare())\n players.add(playerIterate.getColor());\n }\n return players;\n }", "public String getPlayer1Color() {\r\n return this.player1Color;\r\n }", "public String getPlayer2Color() {\r\n return this.player2Color;\r\n }", "protected final Color getColor() {\n\t\treturn tile.getColor();\n\t}", "String getColour(int winningNumber);", "public Color color(){\n return PackedCard.color(this.nbCard);\n }", "protected String playerListColor() {\n return cfg.getString(\"Colors.player\").toUpperCase();\n }", "public int getColor();", "public int getColor();", "public int getRenderColor(int p_149741_1_)\n {\n \n \tBlock[] coloredStones = MachineryCraft.blocks.coloredStoneSlab;\n \n \tfor(int i = 0; i<coloredStones.length; i++){\n \t\tif(this == coloredStones[i]) return this.colors[i];\n \t\t\n \t}\n \treturn colors[1];\n \n }", "public Color getColor()\n {\n return mTeam.getColor();\n }", "public int getColor(){\r\n\t\treturn color;\r\n\t}", "String getColor();", "public Color getColor() {\r\n return this.BoardColor;\r\n }", "private int getCurrentMainColor () {\n int translatedHue = 255 - ( int ) ( mCurrentHue * 255 / 360 );\n int index = 0;\n for ( float i = 0; i < 256; i += 256 / 42 ) {\n if ( index == translatedHue )\n return Color.rgb( 255, 0, ( int ) i );\n index++;\n }\n for ( float i = 0; i < 256; i += 256 / 42 ) {\n if ( index == translatedHue )\n return Color.rgb( 255 - ( int ) i, 0, 255 );\n index++;\n }\n for ( float i = 0; i < 256; i += 256 / 42 ) {\n if ( index == translatedHue )\n return Color.rgb( 0, ( int ) i, 255 );\n index++;\n }\n for ( float i = 0; i < 256; i += 256 / 42 ) {\n if ( index == translatedHue )\n return Color.rgb( 0, 255, 255 - ( int ) i );\n index++;\n }\n for ( float i = 0; i < 256; i += 256 / 42 ) {\n if ( index == translatedHue )\n return Color.rgb( ( int ) i, 255, 0 );\n index++;\n }\n for ( float i = 0; i < 256; i += 256 / 42 ) {\n if ( index == translatedHue )\n return Color.rgb( 255, 255 - ( int ) i, 0 );\n index++;\n }\n return Color.RED;\n }", "public int getColor(){\n\t\treturn color;\n\t}", "public int getColor(){\n\t\treturn color;\n\t}", "private void initPieceColors(){\n\t\tfor(Piece p : this.pieces)\n\t\t\tpieceColors.put(p, Utils.randomColor());\n\t}", "public int getColor() {\n \t\treturn color;\n \t}", "public int getColor() {\n return color;\n }", "public int getTurnColor() {\n return turnColor;\n }", "public Color getColor() { return color; }", "Color getCor();", "public static List<PlayerColor> getPlayerColors() {\n List<PlayerColor> colorList = new ArrayList<>();\n for (PlayerColor color: PlayerColor.values()) {\n colorList.add(color);\n }\n return colorList;\n }", "PieceColor whoseMove() {\n return _whoseMove;\n }", "public Card.Color color() {\n return PackedCard.color(packedCard);\n }", "public String getColor() { \n return color; \n }", "public Color getColor()\n { \n return color;\n }", "private static Collection<Piece> getCorrectBluePieces() {\n\t\tfinal Collection<Piece> pieces = new ArrayList<Piece>();\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.CAPTAIN, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.CAPTAIN, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.COLONEL, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.COLONEL, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.MARSHAL, PlayerColor.BLUE));\n\t\tpieces.add(new Piece(PieceType.FLAG, PlayerColor.BLUE));\n\t\treturn pieces;\n\t}", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "@Test\n public void getColorTest() {\n assertTrue(red_piece.getColor() == Piece.Color.RED);\n assertTrue(white_piece.getColor() == Piece.Color.WHITE);\n }", "public ColorRoom getColor() {\n return color;\n }", "public Color getColor();", "public Color getColor();", "public Color getColor();", "public String getColor(){\r\n return color;\r\n }", "public Color getColor()\n {\n return color;\n }", "public int getColor() {\n return this.color;\n }", "public Color getColor()\n {\n return color;\n }", "public abstract BossColor getColor();", "@Override\n public Color getColor() {\n return Utils.Pion.BLANC.getCouleur();\n }", "public CardColor getColor() {\n return this.color;\n }", "private static Collection<Piece> getCorrectRedPieces() {\n\t\tfinal Collection<Piece> pieces = new ArrayList<Piece>();\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.SERGEANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.LIEUTENANT, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.CAPTAIN, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.CAPTAIN, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.COLONEL, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.COLONEL, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.MARSHAL, PlayerColor.RED));\n\t\tpieces.add(new Piece(PieceType.FLAG, PlayerColor.RED));\n\t\treturn pieces;\n\t}", "public int getColour()\r\n\t{\r\n\t\treturn colour;\r\n\t}", "public Color getColor() { return color.get(); }", "private Colors ingameColor() {\n\t\tList<Colors> colors = new ArrayList<Colors>();\n\t\tIterator<Sphere> it = this.spheres.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tSphere s = it.next();\n\t\t\tif (!colors.contains(s.color())) {\n\t\t\t\tcolors.add(s.color());\n\t\t\t}\n\t\t}\n\t\treturn colors.get(MathUtils.random(colors.size() - 1));\n\t}", "public int getColour() {\n return colour;\n }", "public String getColor()\n {\n return color;\n }", "public String getColor()\n {\n return color;\n }", "public String getColor(){\n return this._color;\n }", "public Color getColor(){\n return color;\n }", "public abstract int getColour();", "public Color getColor()\n {\n return color;\n }", "public Color getColor()\n {\n return color;\n }", "public Color getColor()\n {\n return color;\n }", "public DyeColor getColor() {\n/* 43 */ return DyeColor.getByWoolData(getData());\n/* */ }", "public Color getColor() {\n return color;\r\n }", "@Override\n Color getColor() {\n return new Color(32, 83, 226, 255);\n }", "PieceColor get(int k) {\n assert validSquare(k);\n return _board[k];\n }", "public char getColor();", "public Color getColor() {\n \t\treturn color;\n \t}", "public String getColor(){\n return this.color;\n }", "public List<Colour> getPlayerList();", "public Color getColor() {\n\treturn color;\n }", "public Color getColor()\r\n\t{\r\n\t\treturn _g2.getColor();\r\n\t}", "public String getColor(){\n\t\treturn color;\n\t}", "public Colour getColour();", "public PlayerColor getColor( int x, int y )\n {\n Field field = getField( x, y );\n if( field != null )\n return field.getColor();\n else\n return PlayerColor.NONE;\n }", "public PlayerColor getTurn() {\n return board.getTurn();\n }", "public String getBubbleColour(){\n return myBathtub.getBubbleColour();\n }", "public Color getColor() {\n return this.color;\n }", "public String getColor()\n {\n return this.color;\n }", "int getHighLightColor();", "public Color getColor() {\n return color;\n }", "public String getColor() {\r\n return color;\r\n }", "public RGBColor getColor(){\r\n return this._color;\r\n }", "public int getColor()\r\n {\r\n return m_iColor;\r\n }", "public Color getColor() \n\t{\n\t\treturn color;\n\t}", "public Color getColor() {\r\n return color;\r\n }", "public Color getColor() {\r\n return color;\r\n }", "public Color getColor() {\r\n return color;\r\n }", "public DiceColor getColor() {\n return color;\n }", "java.awt.Color getColor();", "@Override\n public Color getColor() {\n return color;\n }" ]
[ "0.78078663", "0.7643629", "0.7511635", "0.74122345", "0.7288832", "0.71557105", "0.713621", "0.7056253", "0.7034237", "0.6872518", "0.6862464", "0.68394065", "0.6824578", "0.6776612", "0.6751967", "0.6712391", "0.6712193", "0.670769", "0.67071617", "0.67054653", "0.66754127", "0.66754127", "0.66511273", "0.663615", "0.66360277", "0.66252255", "0.66248393", "0.660828", "0.65724945", "0.65724945", "0.65714365", "0.65600467", "0.6529368", "0.65245765", "0.6480868", "0.64803517", "0.64550763", "0.6440017", "0.6429697", "0.64123297", "0.63944936", "0.63918585", "0.6390792", "0.6390792", "0.6390792", "0.6390792", "0.6390792", "0.6389709", "0.6385076", "0.63742393", "0.63742393", "0.63742393", "0.63629466", "0.63596106", "0.63577724", "0.6356869", "0.6354661", "0.63482004", "0.63354623", "0.6334814", "0.6320214", "0.63115644", "0.6295868", "0.6292963", "0.6291368", "0.6291368", "0.62885296", "0.6288426", "0.6284808", "0.62839234", "0.62839234", "0.62839234", "0.62799615", "0.6276731", "0.62749416", "0.6257486", "0.62504596", "0.6246279", "0.62421244", "0.6237375", "0.6231068", "0.6230855", "0.6227584", "0.6220694", "0.62125856", "0.6210703", "0.6207986", "0.6207175", "0.6204574", "0.6200515", "0.61952907", "0.61929244", "0.6191176", "0.61864185", "0.61840683", "0.61817265", "0.61817265", "0.61817265", "0.6180762", "0.6167696", "0.616625" ]
0.0
-1
setting the game pieces of the player
public void setPieces(HashMap<Integer, Piece> pieces) { this.pieces = pieces; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPieces(){\r\n Pawn[] arrwPawn = new Pawn[8];\r\n for (int i=0 ; i<8 ; i++){\r\n pos.setPosition(6,i);\r\n arrwPawn[i] = new Pawn (pos , piece.Colour.WHITE);\r\n GameBoard.putPiece(arrwPawn[i]);\r\n }\r\n\r\n Pawn[] arrbPawn = new Pawn[8];\r\n for(int i=0 ; i<8 ; i++){\r\n pos.setPosition(0,i);\r\n arrbPawn[i] = new Pawn(pos , piece.Colour.BLACK);\r\n GameBoard.putPiece(arrbPawn[i]);\r\n }\r\n\r\n\r\n //set black pieces in the board\r\n\r\n pos.setPosition(0,0);\r\n Rook bRook1 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook1);;\r\n\r\n pos.setPosition(0,7);\r\n Rook bRook2 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook2);\r\n\r\n\r\n pos.setPosition(0,1);\r\n Knight bKnight1 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,6);\r\n Knight bKnight2 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,2);\r\n Bishop bBishop1 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop1);\r\n\r\n pos.setPosition(0,5);\r\n Bishop bBishop2 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop2);\r\n\r\n pos.setPosition(0,3);\r\n Queen bQueen = new Queen(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bQueen);\r\n\r\n pos.setPosition(0,4);\r\n King bKing = new King(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKing);\r\n\r\n //set white pieces in the board\r\n\r\n pos.setPosition(7,0);\r\n Rook wRook1 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook1);\r\n\r\n pos.setPosition(7,7);\r\n Rook wRook2 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook2);\r\n\r\n pos.setPosition(7,1);\r\n Knight wKnight1 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,6);\r\n Knight wKnight2 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,2);\r\n Bishop wBishop1 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop1);\r\n\r\n pos.setPosition(7,5);\r\n Bishop wBishop2 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop2);\r\n\r\n pos.setPosition(7,3);\r\n Queen wQueen = new Queen(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wQueen);\r\n\r\n pos.setPosition(7,4);\r\n King wKing = new King(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKing);\r\n\r\n\r\n\r\n Rook arrwRook[] = {wRook1,wRook2};\r\n Rook arrbRook[] = {bRook1,bRook2};\r\n Queen arrwQueen[] = {wQueen};\r\n Queen arrbQueen[] = {bQueen};\r\n Knight arrwKnight[] = {wKnight1,wKnight2};\r\n Knight arrbKnight[] = {bKnight1,bKnight2};\r\n King arrwKing[] = {wKing};\r\n King arrbKing[] = {bKing};\r\n Bishop arrwBishop[] = {wBishop1,wBishop2};\r\n Bishop arrbBishop[] = {bBishop1,bBishop2};\r\n }", "public void setPlayersPiece(int a_playersPiece) {\n this.playersPiece = a_playersPiece;\n }", "private void setPlayer()\t{\n\t\tgrid.setGameObject(spy, Spy.INITIAL_X, Spy.INITIAL_Y);\n\t}", "public void setBoard(){\n \n\t m_Pieces[3][3]= WHITE_PIECE;\n m_Pieces[4][4]= WHITE_PIECE;\n m_Pieces[3][4]= BLACK_PIECE;\n m_Pieces[4][3]= BLACK_PIECE;\n for(int x=0;x<WIDTH;x++){\n for(int y=0;y<HEIGHT;y++){\n if(m_Pieces[x][y]==null){\n m_Pieces[x][y]=NONE_PIECE;\n }\n }\n }\n }", "public OthelloPiece[][] setPieces(){\n return piecesToSwap;\n \n }", "void initializeGame() {\n // Initialize players\n // Put the pieces on the board\n }", "public void setSpawns() {\n List<Tile> spawns = this.board.getSpawns();// get all the possible spawns from board\n List<Tile> usedSpawns = new ArrayList<Tile>();// empty list used to represent all the spawns that have been used so no playerPiece gets the same spawn\n for (PlayerPiece playerPiece : this.playerPieces) { // for each playerPiece\n boolean hasSpawn = false; // boolean to represent whether the playerPiece has a spawn and used to initiate and stop the following while loop.\n while (!hasSpawn) { // while hasSpawn is false.\n int random_int = (int) (Math.random() * spawns.size());// get random number with max number of the total possible tiles the pieces can spawn from\n Tile spawn = spawns.get(random_int); // get spawn from spawns list using the random int as an index\n if (!usedSpawns.contains(spawn)) {// if the spawn isn't in the usedSpawn list\n playerPiece.setLocation(spawn);// set the location of the playerPiece to the spawn\n usedSpawns.add(spawn);//add the spawn to usedSpawns\n hasSpawn = true; // set the variable to true so the while loop stops.\n }\n }\n }\n }", "public void setBoard() {\n bestPieceToMove = null;\n bestPieceFound = false;\n bestMoveDirectionX = 0;\n bestMoveDirectionY = 0;\n bestMoveFound = false;\n killAvailable = false;\n lightCounter = 12;\n darkCounter = 12;\n for (int y = 0; y < boardSize; y++) {\n for (int x = 0; x < boardSize; x++) {\n board[y][x] = new Field(x, y);\n if (y < 3 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.DARK, PieceType.MEN));\n } else if (y > 4 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.LIGHT, PieceType.MEN));\n }\n }\n }\n }", "public void setPlayerGrid(){\n\t\tplayerGrid = new Grid(true);\n\t\tsetShips(playerGrid,playerBattleShipsList,0);//2\n\t}", "public void setPieces(List<Piece> pieces) {\n\t\tthis.pieces = pieces;\n\t}", "public void setPiece(Piece piece){\n this.piece = piece;\n this.pieceName = piece.pieceName;\n this.pieceColor = piece.pieceColor;\n this.firstMove = piece.firstMove;\n this.Enpassant = piece.Enpassant;\n }", "public void setPiece(int x, int y, int player) throws GameException {\n if (!squareInBounds(x, y)) {\n throw new GameException(\"Square is off the board\");\n }\n int arrayPos = getArrayPos(x, y);\n if (!isSquareFree(arrayPos)) {\n throw new GameException(\"Location is already taken\");\n }\n ;\n setSurrounding(x, y);\n intArray[arrayPos] = player;\n }", "private void setThePieces(){\n for(int i = 0; i<HEIGHT;i++){\n for(int j = 0; j<WIDTH;j++){\n if(piecesToSwap[i][j]==null){\n \n }else{\n m_Pieces[i][j]=piecesToSwap[i][j];\n \n }\n }\n }\n }", "public void setPiece(Piece p) {\n\tpiece = p;\n }", "public void set (Piece p, int x, int y){\n\t\t\t\t\n\t\tboard[x][y] = p;\n\t}", "public static void setPieceTest() {\n\t\tOthelloBoard Board = new OthelloBoard(BOARD_SIZE,BOARD_SIZE);\n\t\tBoard.setBoard();\n\t\tBoard.decPieceCount();\n\t\tSystem.out.println(Board.getPieceCount());\n\t\tSystem.out.println(Board.move(\n\t\t\t\tTEST_MOVE_X1, TEST_MOVE_Y1, Board.WHITE_PIECE));\n\t\tBoard.m_Pieces[TEST_PIECE_X][TEST_PIECE_Y]=Board.WHITE_PIECE;\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"\");\n\t\tBoard.checkWin();\n\t\tSystem.out.println(\"Valid inputs\");\n\t\tSystem.out.println(\"OthelloBoard.setPiece() - Begin\");\n\t\tSystem.out.println(\"Expected output: true\");\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"Actual output: \" + \n\t\tBoard.setPiece(\n\t\t\t\tOUTPUT_SETPIECE_TEST_X,OUTPUT_SETPIECE_TEST_Y,Board.BLACK_PIECE));\n\t\tSystem.out.println(\"\");\n\t}", "public static void set_players(){\n\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\tbat1=PlayBrain1.myteam[0];\n\t\t\tbat2=PlayBrain1.myteam[1];\n\t\t\tStriker=bat1;\n\t\t\tNonStriker=bat2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\tbat1=PlayBrain1.oppteam[0];\n\t\t\t\tbat2=PlayBrain1.oppteam[1];\n\t\t\t\tStriker=bat1;\n\t\t\t\tNonStriker=bat2;\n\n\t\t\t\t}\n\t}", "public void changePlayerPixels() {\n //change the player point2pixels\n if (!playerFlag) {\n game.getPlayer().setPixels(convertor.gps2Pixels(game.getPlayer().getPoint()));\n Point3D point = new Point3D(game.getPlayer().getPixels()[0] , game.getPlayer().getPixels()[1]);\n GraphNode playerNode = new GraphNode(point);\n vertices.add(playerNode);\n\n }\n\n else {\n Point3D point = new Point3D(game.getPlayer().getPixels()[0] , game.getPlayer().getPixels()[1]);\n GraphNode playerNode = new GraphNode(point);\n vertices.add(playerNode);\n }\n\n playerFlag = true;\n\n }", "public void setPlayersAtGo()\n {\n for(int i = 0; i < m_numPlayers; i++)\n {\n m_gameBoard.addPlayerToSpace(i + 1, 0);\n }\n }", "public void setPlayer(Player myPlayer){\n battlePlayer=myPlayer;\n }", "public void setPiece(PieceIF p);", "public void changePiece() {\n if (piece == 1) {\n piece = 2;\n } else {\n piece = 1;\n }\n //System.out.println(\"Nu ben ik piece \" + piece);\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 }", "private void setShips() {\n //This clears the board. To \"Invalidate\"\n for (int x = 0; x < maxN; x++) {\n for (int y = 0; y < maxN; y++) {\n ivCell[x][y].setBackgroundResource(gridID);\n }\n }\n\n for (Ship s : ships) {\n for (int i = 0; i < s.getShipSize(); i++) {\n if(player)ivCell[s.getBodyLocationPoints()[i].x][s.getBodyLocationPoints()[i].y].setBackgroundResource(s.getBodyResources()[i]);\n updateOccupiedCells(s.getBodyLocationPoints());\n }\n }\n\n }", "public void setNewPiece(){\n\t\tcurrentPiece = Pentominoes.Pentomino_array[this.next_piece_index];\n\t\tcurrentColor = Pentominoes.color_array[this.next_piece_colour];\n\t\tpieceOrigin = new Point(6, 2);\n\t}", "private void setPlayerRoom(){\n player.setRoom(currentRoom);\n }", "public void setPlayer(Player _player) { // beallit egy ezredest az adott mapElementre, ha az rajta van\n player = _player;\n }", "public void start() {\n clear();\n // Assigning chess pieces to players.\n whitePieces.add(new Piece(Owner.WHITE, Who.KING, Rank.R1, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.QUEEN, Rank.R1, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.H));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.H));\n\n for (Piece p : whitePieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n blackPieces.add(new Piece(Owner.BLACK, Who.KING, Rank.R8, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.QUEEN, Rank.R8, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.H));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.H));\n\n for (Piece p : blackPieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n whoseTurn = Owner.WHITE;\n canCastle = 15;\n passer = null;\n movesDone = lastEatMove = 0;\n }", "public void putPieceOnBoard(ChessBoardBlock b, String player) {\r\n\t\tint blackCount = getBlackCountInVector();\r\n\t\tint whiteCount = getWhiteCountInVector();\r\n\t\tif (blackCount == 12 && whiteCount == 12) {\r\n\t\t\tt.setText(\"<html>black:\" + getBlackCountInVector() + \" white:\" + getWhiteCountInVector() + \"<br>Cannot put any more pieces on</html>\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (blackCount == 12 && player.equals(\"black\")) {\r\n\t\t\tt.setText(\"<html>black:\" + getBlackCountInVector() + \" white:\" + getWhiteCountInVector() + \"<br>Black pieces are maximum</html>\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (whiteCount == 12 && player.equals(\"white\")) {\r\n\t\t\tt.setText(\"<html>black:\" + getBlackCountInVector() + \" white:\" + getWhiteCountInVector() + \"<br>White pieces are maximum</html>\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tString position = b.position;\r\n\t\tChessPiece tmpPiece;\r\n\t\tif (player.equals(\"black\")) {\r\n\t\t\ttmpPiece = blackPieces[blackCount];\r\n\t\t\tSystem.out.println(player);\r\n\r\n\t\t\t// Set 'K' label\r\n\t\t\tif (position.equals(\"A1\")||position.equals(\"B1\")||position.equals(\"C1\")||position.equals(\"D1\")||\r\n\t\t\t\tposition.equals(\"E1\")||position.equals(\"F1\")||position.equals(\"G1\")||position.equals(\"H1\")) {\r\n\t\t\t\ttmpPiece.setText(\"<html><font color=\\\"white\\\">K</font></html>\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\ttmpPiece = whitePieces[whiteCount];\r\n\r\n\t\t\t// Set 'K' label\r\n\t\t\tif (position.equals(\"A8\")||position.equals(\"B8\")||position.equals(\"C8\")||position.equals(\"D8\")||\r\n\t\t\t\tposition.equals(\"E8\")||position.equals(\"F8\")||position.equals(\"G8\")||position.equals(\"H8\")) {\r\n\t\t\t\ttmpPiece.setText(\"<html><font color=\\\"black\\\">K</font></html>\");\r\n\t\t\t}\r\n\t\t}\r\n\t\ttmpPiece.position = position;\r\n\t\tpiece.put(position, tmpPiece);\r\n\t\tbody.add(tmpPiece);\r\n\t\treFormatPieceLayer();\r\n\r\n\t\tt.setText(\"<html>black:\" + getBlackCountInVector() + \" white:\" + getWhiteCountInVector() + \"</html>\");\r\n\t}", "public static void setScoreBoard(Player p) {\n\t\n}", "private void placePiece() {\r\n pieces[numPieces] = getRandomPoint();\r\n Game.movePiece(new PositionData(-1,-1,Constants.PLAYER_A_ID), pieces[numPieces]);\r\n numPieces++;\r\n }", "public void newGame() {\n \tturn = PieceColor.White;\n \t\n \t//the middle are empty squares\n \tfor(int i = 2; i < 6; i++) {\n \t\tfor(int j = 0; j < 8; j++) {\n \t\t\tsetPiece(j, i, new NoPiece(j, i));\n \t\t}\n \t}\n \t\n \t//pawns\n \tfor(int i = 0; i < 8; i++) {\n \t\t//make these pawns\n \t\tsetPiece(i, 1, new Pawn(i, 1, PieceColor.White, this));\n \t\tsetPiece(i, 6, new Pawn(i, 6, PieceColor.Black, this));\n \t}\n \t\n \t//white back row\n \tsetPiece(0, 0, new Rook(0, 0, PieceColor.White, this));\n \tsetPiece(1, 0, new Knight(1, 0, PieceColor.White, this));\n \tsetPiece(2, 0, new Bishop(2, 0, PieceColor.White, this));\n \tsetPiece(3, 0, new Queen(3, 0, PieceColor.White, this));\n \tsetPiece(4, 0, new King(4, 0, PieceColor.White, this));\n \tsetPiece(5, 0, new Bishop(5, 0, PieceColor.White, this));\n \tsetPiece(6, 0, new Knight(6, 0, PieceColor.White, this));\n \tsetPiece(7, 0, new Rook(7, 0, PieceColor.White, this));\n \t\n \t//black back row\n \tsetPiece(0, 7, new Rook(0, 7, PieceColor.Black, this));\n \tsetPiece(1, 7, new Knight(1, 7, PieceColor.Black, this));\n \tsetPiece(2, 7, new Bishop(2, 7, PieceColor.Black, this));\n \tsetPiece(3, 7, new Queen(3, 7, PieceColor.Black, this));\n \tsetPiece(4, 7, new King(4, 7, PieceColor.Black, this));\n \tsetPiece(5, 7, new Bishop(5, 7, PieceColor.Black, this));\n \tsetPiece(6, 7, new Knight(6, 7, PieceColor.Black, this));\n \tsetPiece(7, 7, new Rook(7, 7, PieceColor.Black, this));\n \t\n \t//store locations of king so they can be checked\n \twKing = new Square(4, 0);\n \tbKing = new Square(4, 7);\n }", "public abstract void changePlayerAt(ShortPoint2D pos, Player player);", "public void Draw (Graphics graphics, MainJPanel JPanel){ // draw the player game pieces\n for(Piece piece : pieces.values())\n piece.Draw(graphics,JPanel);\n }", "public static void setPieceTest2() {\n\t\t\t\tOthelloBoard Board = new OthelloBoard(BOARD_SIZE,BOARD_SIZE);\n\t\t\t \tBoard.setBoard();\n\t\t\t\tBoard.decPieceCount();\n\t\t\t \tSystem.out.println(Board.getPieceCount());\t\n\t\t\t\tSystem.out.println(Board.move(\n\t\t\t\t\t\tTEST_MOVE_X1, TEST_MOVE_Y1, Board.WHITE_PIECE));\n\t\t\t\tBoard.m_Pieces[TEST_PIECE_X][TEST_PIECE_Y]=Board.WHITE_PIECE;\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t\tBoard.checkWin();\n\t\t\t\tSystem.out.println(\"Valid inputs\");\n\t\t\t\tSystem.out.println(\"OthelloBoard.clearPieces() - Begin\");\n\t\t\t\tSystem.out.println(\"Expected output: Throws exception\");\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t\ttry{\n\t\t\t\t\t\n\t\t\t\t}catch(UnsupportedOperationException e){\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\");\n\t\t}", "public void areaEffect(Player player){\n if(object.getProperties().containsKey(\"endLevel\")) {\n System.out.println(\"Fin du level\");\n setCategoryFilter(GameTest.DESTROYED_BIT);\n PlayScreen.setEndLevel();\n }\n\n if(object.getProperties().containsKey(\"startBossFight\")) {\n\n System.out.println(\"Start Boss Fight\");\n setCategoryFilter(GameTest.DESTROYED_BIT);\n\n TiledMapTileLayer.Cell cell = new TiledMapTileLayer.Cell();\n cell.setTile(tileSet.getTile(910));\n layer.setCell(99, 6, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(99, 7, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(99, 8, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(99, 9, cell);\n\n cell.setTile(tileSet.getTile(910));\n layer.setCell(100, 6, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(100, 7, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(100, 8, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(100, 9, cell);\n\n PlayScreen.cameraChangeBoss(true);\n setCategoryFilterFixture(GameTest.GROUND_BIT, PlayScreen.getFixtureStartBoss());\n\n }\n\n if(object.getProperties().containsKey(\"blueKnight\")) {\n System.out.println(\"Changement en bleu\");\n setCategoryFilter(GameTest.DESTROYED_BIT);\n getCell().setTile(null);\n PlayScreen.setColorKnight(\"blue\");\n }\n\n if(object.getProperties().containsKey(\"greyKnight\")) {\n System.out.println(\"Changement en gris\");\n setCategoryFilter(GameTest.DESTROYED_BIT);\n getCell().setTile(null);\n PlayScreen.setColorKnight(\"grey\");\n }\n\n if(object.getProperties().containsKey(\"redKnight\")) {\n System.out.println(\"Changement en rouge\");\n setCategoryFilter(GameTest.DESTROYED_BIT);\n getCell().setTile(null);\n PlayScreen.setColorKnight(\"red\");\n }\n\n }", "public void addPieces() {\r\n\t\tboard[0] = 8;\r\n\t\tboard[1] = 1;\r\n\t\tboard[2] = 6;\r\n\t\tboard[3] = 3;\r\n\t\tboard[4] = 5;\r\n\t\tboard[5] = 7;\r\n\t\tboard[6] = 4;\r\n\t\tboard[7] = 9;\r\n\t\tboard[8] = 2;\r\n\t}", "public void pickUp(Player player) {\n player.setBox(this);\n }", "public void setPiece(int x, int y, Piece piece) {\n \tboard[y][x] = piece;\n }", "public void initPieces() {\r\n\t\tfor (int i = 0; i < 64; i++) {\r\n\t\t\tif (i < 12) {\r\n\t\t\t\tblackPieces[i] = new ChessPiece(\"black\", \"\");\r\n\t\t\t\tblackPieces[i].setBackground(Color.BLACK);\r\n\t\t\t\tblackPieces[i].addMouseMotionListener(this);\r\n\t\t\t\tblackPieces[i].addMouseListener(this);\r\n\t\t\t\tblackPieces[i].setText(null);\r\n\t\t\t\twhitePieces[i] = new ChessPiece(\"white\", \"\");\r\n\t\t\t\twhitePieces[i].setBackground(Color.WHITE);\r\n\t\t\t\twhitePieces[i].addMouseMotionListener(this);\r\n\t\t\t\twhitePieces[i].addMouseListener(this);\r\n\t\t\t\twhitePieces[i].setText(null);\r\n\t\t\t}\r\n\t\t\tspacePieces[i] = new ChessPiece(\"empty\", \"\");\r\n\t\t\tspacePieces[i].setEnabled(false);\r\n\t\t\tspacePieces[i].setVisible(false);\r\n\t\t\tspacePieces[i].setText(null);\r\n\t\t}\r\n\t}", "public void attack(int x, int y, int xx, int yy) {\n int result = ((MovablePiece)(controller.getBoard().getPiece(x, y))).attack(controller.getBoard().getPiece(xx,yy));\n int player;\n \n if(result < 4) {\n mc.playMusic(\"sounds\\\\Bomb.wav\");\n }\n \n if(result == 1) {\n controller.getPlayer(controller.getTurn()).getMyGraveyard().setPiece(controller.getBoard().getPiece(xx, yy));\n controller.getBoard().setPiece(controller.getBoard().getPiece(x, y), xx, yy);\n controller.getBoard().deletePiece(x, y);\n Cell[xx][yy].setIcon(new ImageIcon(\"pieces\\\\\" + this.getName()));\n } else if(result == 2) {\n controller.getPlayer(controller.getTurn()).getMyGraveyard().setPiece(controller.getBoard().getPiece(xx, yy));\n controller.getPlayer(prevTurn).getMyGraveyard().setPiece(controller.getBoard().getPiece(x, y));\n controller.getBoard().deletePiece(xx,yy);\n controller.getBoard().deletePiece(x, y);\n Cell[xx][yy].setIcon(null);\n Cell[xx][yy].setBackground(Color.white);\n } else if(result == 3){\n controller.getPlayer(prevTurn).getMyGraveyard().setPiece(controller.getBoard().getPiece(x, y));\n controller.getBoard().deletePiece(x, y);\n } else if(result == 5) {\n mc.playMusic(\"sounds\\\\Sorceress.wav\");\n try {\n Thread.sleep(4000);\n } catch (InterruptedException ex) {\n Logger.getLogger(Graphics.class.getName()).log(Level.SEVERE, null, ex);\n }\n piece = controller.getBoard().getTable()[xx][yy];\n if(piece.getLevel()< controller.getBoard().getPiece(x, y).getLevel() && piece.getLevel() != 0 ) {\n if(piece.getColour() == 'R') {\n piece.setColour('B');\n piece.setName(piece.getName().replace(\"R\", \"B\"));\n } else {\n piece.setColour('R');\n piece.setName(piece.getName().replace(\"B\", \"R\"));\n }\n piece.setIcon(piece.getName());\n }\n } else {\n /* NOTHING IS CHARGED */\n }\n Cell[x][y].setIcon(null);\n Cell[x][y].setBackground(Color.white);\n for(int i = 0; i < 12; i++) {\n RGrave[i].setToolTipText(controller.getPlayer(2).getMyGraveyard().getQuantity(i) + \"/\" + (new Collection('R')).getQuantity(i));\n BGrave[i].setToolTipText(controller.getPlayer(1).getMyGraveyard().getQuantity(i) + \"/\" + (new Collection('B')).getQuantity(i));\n }\n }", "private void setupPlayers() {\n\t\tuserData=(UserData) Main.currentStage.getUserData();\n\t\tnumberPlayers=userData.getNumberPlayers();\n\t\tplayerNames=userData.getPlayerNames();\n\t\tcurrentPlayer=userData.getFirstPlayer();\n\t\tlb_currentplayername.setText(playerNames[currentPlayer]);\n\t\tplayers =new Player[4];\n\t\tfor(int i=0;i<4;i++) {\n\t\t\tif(i<numberPlayers) {\n\t\t\t\tplayers[i]=new Player(playerNames[i], false, i) {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void rollDices() {\n\t\t\t\t\t\trotatedDice1();\n\t\t\t\t\t\trotatedDice2();\n\t\t\t\t\t\t//waiting for player choose what way to go then handler that choice\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\telse {\n\t\t\t\tplayers[i]=new Player(playerNames[i], true, i) {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void rollDices() {\n\t\t\t\t\t\trotatedDice1();\n\t\t\t\t\t\trotatedDice2();\n\t\t\t\t\t\t//randomchoice and next player rolldice\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\tswitch (i) {\n\t\t\t\tcase 0:{\n\t\t\t\t\tplayers[i].setHorseColor(yh0, yh1, yh2, yh3);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 1:{\n\t\t\t\t\tplayers[i].setHorseColor(bh0, bh1, bh2, bh3);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 2:{\n\t\t\t\t\tplayers[i].setHorseColor(rh0, rh1, rh2, rh3);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 3:{\n\t\t\t\t\tplayers[i].setHorseColor(gh0, gh1, gh2, gh3);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public void setPiece(Piece newPiece) {\n this.piece = newPiece;\n }", "public void makesHereBack(){this.piece.affect();}", "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 }", "void changepos(MouseEvent e, pieces chessPiece) \n { \n for(int beta : chessPiece.movnum)\n { \n if (chessPiece.color == 0 && e.getSource()== panel[beta-1 ]&& chessPiece.select == true && Checkerboard.allWhitePositions.contains(beta-1) == false)\n {\n if(this.getPiece(beta-1) != null)\n { \n getPiece(beta-1).alive = false;\n \n \n \n panel[beta-1].removeAll();/*getPiece(beta-1).position = 64;*/\n }\n chessPiece.position = beta-1;\n chessPiece.movnum.clear();\n chessPiece.mov.clear();\n chessPiece.select = false;\n chessPiece.timesMoved++;\n whiteToPlay = false;\n }\n else if (chessPiece.color == 1 && e.getSource()== panel[beta-1 ]&& chessPiece.select == true && Checkerboard.allBlackPositions.contains(beta-1) == false)\n {\n if(this.getPiece(beta-1) != null)\n { \n getPiece(beta-1).alive = false; \n panel[beta-1].removeAll();/*getPiece(beta-1).position = 64;*/}\n chessPiece.position = beta-1;\n chessPiece.movnum.clear();\n chessPiece.mov.clear();\n chessPiece.select = false;\n chessPiece.timesMoved++;\n whiteToPlay = true;\n }\n }//for ends\n \n }", "MachinePlayer(Piece side, Game game) {\n super(side, game);\n _piece = side;\n _game = game;\n }", "private void setInformationToDraw(Player player)\n {\n playerPieceList = player.getPieces();\n\n if (player == antagonistPlayer) {\n x = antagonistLocation[0];\n y = antagonistLocation[1];\n damageToAnnounce = antagonistDamage;\n healthBenefitToAnnounce = antagonistHealthBenefit;\n } else if (player == heroPlayer) {\n x = heroLocation[0];\n y = heroLocation[1];\n damageToAnnounce = heroDamage;\n healthBenefitToAnnounce = heroHealthBenefit;\n } else {\n x = 0;\n y = 0;\n }\n }", "private void setUp() {\n players.forEach(player -> player.draw(GameConstants.STARTING_HAND_SIZE.value()));\n }", "public void setPieces(float piecesProduced){\r\n pieces = ( piecesProduced <= 0 ) ? 0 : piecesProduced; \r\n }", "public void setGame() {\n }", "private void setPlayer(BoardSquaresState player){\n\t\tif(player == BoardSquaresState.CROSS){\n\t\t\tselectedPlayer = BoardSquaresState.CROSS;\n\t\t\tplayerSelectionButton.setText(R.id.button_title, \"Cross\");\n\t\t\tplayerSelectionButton.setText(R.id.button_subtitle, \"You go first!\");\n\t\t\tplayerSelectionButton.setImageResource(R.id.selector_button_image, R.drawable.cross_1);\n\t\t\tplayerSelectionButton.setImageResource(R.id.item_set_image, R.drawable.btn_check_on_focused_holo_light);\n\t\t}\n\t\telse{\n\t\t\tselectedPlayer = BoardSquaresState.NOUGHT;\n\t\t\tplayerSelectionButton.setText(R.id.button_title, \"Nought\");\n\t\t\tplayerSelectionButton.setText(R.id.button_subtitle, \"Computer goes first!\");\n\t\t\tplayerSelectionButton.setImageResource(R.id.selector_button_image, R.drawable.nought_1);\n\t\t\tplayerSelectionButton.setImageResource(R.id.item_set_image, R.drawable.btn_check_on_focused_holo_light);\n\t\t}\n\n\t}", "private void addMockPieces() {\n for (int i = 0; i < 4; i++)\n for (int j = 0; j < 4; j++)\n serverGameManager.getBoard()\n .getSquare(i, j)\n .setPiece(new Piece(PieceType.SCOUT, PieceColor.BLUE, true));\n\n // set up fake red as all scout pieces\n for (int i = 9; i > 5; i--)\n for (int j = 9; j > 5; j--)\n serverGameManager.getBoard()\n .getSquare(i, j)\n .setPiece(new Piece(PieceType.SCOUT, PieceColor.RED, false));\n }", "public void setToPlayer(Player player)\n \t{\n \t\t// Define the inventory\n \t\tPlayerInventory inventory = player.getInventory();\n \n \t\t// Clear it all first\n \t\tinventory.clear();\n \t\tinventory.setHelmet(new ItemStack(Material.AIR));\n \t\tinventory.setChestplate(new ItemStack(Material.AIR));\n \t\tinventory.setLeggings(new ItemStack(Material.AIR));\n \t\tinventory.setBoots(new ItemStack(Material.AIR));\n \n \t\t// Set the armor contents\n \t\tif(this.helmet != null) inventory.setHelmet(this.helmet.toItemStack());\n \t\tif(this.chestplate != null) inventory.setChestplate(this.chestplate.toItemStack());\n \t\tif(this.leggings != null) inventory.setLeggings(this.leggings.toItemStack());\n \t\tif(this.boots != null) inventory.setBoots(this.boots.toItemStack());\n \n \t\t// Set items\n \t\tfor(int i = 0; i < 35; i++)\n \t\t{\n\t\t\tinventory.setItem(i, this.items[i].toItemStack());\n \t\t}\n \n \t\t// Delete\n \t\tDemigodsData.jOhm.delete(PlayerCharacterInventory.class, id);\n \t}", "Piece(int side, Board b) {\n\t\t //YOUR CODE HERE\n\t\tteamSide = side;\n\t\twhichBoard = b;\n\t\tisKinged = false;\n\t\t\t \n\t\t\t \n\t\t\t \n\t\t }", "private void setGridElement (int row, int column, Player player)\n {\n mGrid[row][column] = new Move(player, row, column);\n }", "void defaultsetup(int phi) \n {// The Images should be loded here... Also add labels here\n System.out.println(\"IN DEFAULT SETUP..\");\n if( phi == 0) \n whiteToPlay = true;\n else if (phi == 1) \n whiteToPlay = false;\n // White Chess Pieces\n whiteHorse1.position = 1; whiteHorse1.color = 0;\n whiteHorse2.position = 6; whiteHorse2.color = 0;\n whiteQueen.position = 3; whiteQueen.color = 0;\n whiteKing.position =4 ; whiteKing.color = 0;\n whiteCastle1.position = 0; whiteCastle1.color = 0;\n whiteCastle2.position = 7; whiteCastle2.color = 0;\n whiteBishop1.position = 2; whiteBishop1.color = 0;\n whiteBishop2.position = 5; whiteBishop2.color = 0;\n int y = 8;\n for(int x = 0 ; x < 8; x++)\n {\n whitePawn[x] = new pawn();\n whitePawn[x].position = 8+x;\n whitePawn[x].color = 0;\n }\n //Black Chess Pieces\n blackHorse1.position = 57; blackHorse1.color = 1;\n blackHorse2.position = 62; blackHorse2.color = 1;\n blackQueen.position = 59; blackQueen.color = 1;\n blackKing.position = 60; blackKing.color = 1;\n blackCastle1.position = 56;blackCastle1.color = 1;\n blackCastle2.position = 63;blackCastle2.color = 1;\n blackBishop1.position = 58;blackBishop1.color = 1;\n blackBishop2.position = 61;blackBishop2.color = 1;\n y = 8;\n for(int x = 0 ; x < 8; x++)\n {\n blackPawn[x] = new pawn();\n blackPawn[x].position = 48+x;\n blackPawn[x].color = 1;\n }\n \n this.updatePositions();\n }", "public PlayerPiece(String name, String type, int curH, int maxH, int x, int y, \n int atkP, int defP, int curSP, int maxSP) {\n pieceName = name;\n //fill in the rest of the values here\n pieceType = type;\n currentHealth = curH;\n maxHealth = maxH;\n locX = x;\n locY = y;\n attackPower = atkP;\n defensePower = defP;\n currentSpecialPower = curSP;\n maxSpecialPower = maxSP;\n }", "public final void setPiece(String piece){\r\n switch (piece) {\r\n case \"black King\":\r\n {\r\n this.piece = new King(\"black King\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"black Rook\":\r\n {\r\n this.piece = new Rook(\"black Rook\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"black Knight\":\r\n {\r\n this.piece = new Knight(\"black Knight\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"black Bishop\":\r\n {\r\n this.piece = new Bishop(\"black Bishop\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"black Queen\":\r\n {\r\n this.piece = new Queen(\"black Queen\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"black Pawn\":\r\n {\r\n this.piece = new Pawn(\"black Pawn\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"white King\":\r\n {\r\n this.piece = new King(\"white King\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"white Rook\":\r\n {\r\n this.piece = new Rook(\"white Rook\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"white Knight\":\r\n {\r\n this.piece = new Knight(\"white Knight\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"white Bishop\":\r\n {\r\n this.piece = new Bishop(\"white Bishop\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"white Queen\":\r\n {\r\n this.piece = new Queen(\"white Queen\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n case \"white Pawn\":\r\n {\r\n this.piece = new Pawn(\"white Pawn\");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n break;\r\n }\r\n default:\r\n {\r\n this.piece = new Empty(\" \");\r\n ImagePattern imagePattern = new ImagePattern(this.piece.getImage());\r\n space.setFill(imagePattern);\r\n this.piece.color=\"empty\";\r\n this.piece.imageName=\"empty\";\r\n break;\r\n }\r\n }\r\n }", "public PlayerPiece()\n {\n // initialise instance variables\n //Use the values listed in the comments\n //above that are next to each instance variable\n pieceName = \"no name\";\n pieceType = \"human\";\n currentHealth = 100;\n maxHealth = 100;\n locX = 7;\n locY = 8;\n attackPower = 25;\n defensePower = 20;\n currentSpecialPower = 50;\n maxSpecialPower = 50;\n \n }", "private void update() {\n setPieceType();\n initBackground(pieceIndex);\n }", "public void setup() {\r\n\t\thumanCardsPanel.setHumanCards(players.get(0).getCards());\r\n\t\tfor ( Player p : players ) {\r\n\t\t\tp.setBoard(board);\r\n\t\t\tp.setGame(this);\r\n\t\t}\r\n\t\tboard.setGame(this);\r\n\t\tboard.repaint();\r\n\t\tJOptionPane popup = new JOptionPane();\r\n\t\tString message = \"You are Miss Scarlet. Press Next Player to begin.\\n Hint: Use File > Detective Notes to help you win!\";\r\n\t\tpopup.showMessageDialog(this, message, \"Welcome to Clue!\", JOptionPane.INFORMATION_MESSAGE);\r\n\t}", "private void setupPlayerPosition() {\n\t\tHashMap<Suspect, Coordinates> startPositions = new HashMap<Suspect, Coordinates>();\r\n\t\tstartPositions.put(Suspect.KasandraScarlet, new Coordinates(18, 28));\r\n\t\tstartPositions.put(Suspect.JackMustard, new Coordinates(7, 28));\r\n\t\tstartPositions.put(Suspect.DianeWhite, new Coordinates(0, 19));\r\n\t\tstartPositions.put(Suspect.JacobGreen, new Coordinates(0, 9));\r\n\t\tstartPositions.put(Suspect.EleanorPeacock, new Coordinates(6, 0));\r\n\t\tstartPositions.put(Suspect.VictorPlum, new Coordinates(20, 0));\r\n\r\n\t\tfor (int i = 0; i < this.listOfPlayer.size(); i++) {\r\n\t\t\tPlayer p = this.listOfPlayer.get(i);\r\n\t\t\tSuspect sus = p.getSuspect().getData();\r\n\t\t\tboolean b = p.setCoord(startPositions.get(sus), this.grid);\r\n\t\t\t// should always be able to put character on starting position\r\n\t\t}\r\n\t\tSystem.out.println(\"Initial player starting positions set\");\r\n\t}", "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}", "public void setHiddenPiece() {\n for(int j = 0; j < 12; j++) {\n controller.getBoard().setPiece(new Forbidden(), 0, j);\n Cell[0][j] = new JButton();\n }\n for(int j = 0; j < 12; j++) {\n controller.getBoard().setPiece(new Forbidden(), 9, j);\n Cell[9][j] = new JButton();\n }\n for(int j = 0; j < 10; j++) {\n controller.getBoard().setPiece(new Forbidden(), j, 0);\n Cell[j][0] = new JButton();\n }\n for(int j = 0; j < 10; j++) {\n controller.getBoard().setPiece(new Forbidden(), j, 11);\n Cell[j][11] = new JButton();\n }\n }", "Piece(int a, int b, int player)\n {\n x = a;\n y = b;\n this.player = player;\n }", "public void setPiece (int oldKey ,int key, Piece value){\n if(pieces.containsKey(oldKey))\n pieces.remove(oldKey);\n pieces.put(key, value); \n }", "@Override\n public void run(){\n Settings.setGameSettings(new Player(0,Color.RED,1800, \"Player 1\",true),\n new Player(1,Color.BLUE,1800, \"Player 2\",false),1800,25);\n MenuFrame menuFrame = new MenuFrame();\n }", "private void setUpGame() {\n DotCom one = new DotCom();\n one.setName(\"Pets.com\");\n DotCom two = new DotCom();\n two.setName(\"eToys.com\");\n DotCom three = new DotCom();\n three.setName(\"Go2.com\");\n dotComList.add(one);\n dotComList.add(two);\n dotComList.add(three);\n\n //display brief instructions for the user//Выводим краткие инструкции для пользователя\n System.out.println(\"Ваша цель - потопить 3 сайта\");\n System.out.println(\"Pets.com, eToys.com,Go2.com\");\n System.out.println(\"Потытайтесь потопить их за минимальное количество ходов\");\n\n for (DotCom dotComToSet : dotComList) {// Повторяем с каждым объектом DotCom в списке\n ArrayList<String> newLocation = helper.placeDotCom(3);//Запрашиваем у вспомогательного объекта адрес \"сайта\"\n dotComToSet.setLocationCells(newLocation); // Вызываем сеттре из объекта DotCom чтобы передать ему\n // местоположение которое только что получилии от вспомогательного объекта\n }\n }", "public TTT_GamePlay() {\r\n\t\tArrays.fill(p1, 0);\r\n\t\tArrays.fill(p2, 0);\r\n\t\tArrays.fill(selectedCells, false);\r\n\t\tthis.board = new int[9];\r\n\t\tthis.player = player1;\r\n\t\twin = false;\r\n\t}", "private void specialPowersPhase() {\n \tSpecialCharacter tmpPiece = null;\n \tTerrain theHex = null;\n\n for (Player p : playerList) {\n pause();\n this.player = p;\n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n \n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Game.getRackGui().setOwner(player);\n }\n });\n /*\n * Loops through all of the hexes that the player has pieces on.\n * If one of the pieces is either Master Thief or Assassin Primus, perform their\n * special ability.\n */\n for (Terrain hex : player.getHexesWithPiece()) {\n for (Piece pc : hex.getContents(player.getName()).getStack()) {\n if (pc.getName().equals(\"Master Thief\") || pc.getName().equals(\"Assassin Primus\")) { \n ((Performable)pc).specialAbility();\n if (MasterThief.isReturnPiece() || AssassinPrimus.isReturnPiece()) {\n \ttmpPiece = (SpecialCharacter)pc;\n \ttheHex = hex;\n \ttmpPiece.returnToBank(theHex);\n \tbreak;\n }\n }\n }\n }\n player.flipAllDown();\n }\n ClickObserver.getInstance().setPlayerFlag(\"\");\n\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n DiceGUI.getInstance().setFaceValue(0);\n DiceGUI.getInstance().cover();\n }\n });\n }", "private void prepareBoard(){\n gameBoard.arrangeShips();\n }", "private void placePieces(List<Piece> pieces) {\r\n pieces.forEach(\r\n piece -> {\r\n grid[piece.getPosition()] = piece;\r\n // if key doesn't exist create new with array containing piece\r\n // if it does exist add piece to existing array\r\n this.pieces.merge(\r\n piece.getPlayerColor(),\r\n new ArrayList<>(Collections.singletonList(piece)),\r\n (o, n) -> {\r\n o.add(piece);\r\n return o;\r\n });\r\n });\r\n }", "public void setSuspectCardsAndPlayerPieces() {\n List<SuspectCard> suspectCards = new ArrayList<SuspectCard>(); // empty list for the suspect cards\n List<PlayerPiece> playerPieces = new ArrayList<PlayerPiece>(); // empty list for playerPieces\n Data data = new Data(\"data.json\");// read data from file data.json\n JSONObject suspectData = (JSONObject) data.getJsonData().get(\"Suspects\");// get the data within the class suspects\n for (int i = 0; i < 6; i++) {// for i from 0 to 5\n String suspectName = String.valueOf(suspectData.get(String.valueOf(i))); // Get name of suspect\n PlayerPiece playerPiece = new PlayerPiece(suspectName); // new playerPiece instance\n suspectCards.add(new SuspectCard(suspectName)); // add a new instance of suspectCard into suspectCards\n playerPieces.add(playerPiece);// add playerPiece instance into playerPieces\n\n }\n // assign the lists to class variables.\n this.suspectCards = suspectCards;\n this.playerPieces = playerPieces;\n }", "private void initialSetup() {\n\t\tplaceNewPiece('a', 1, new Rook(board, Color.WHITE));\n placeNewPiece('b', 1, new Knight(board, Color.WHITE));\n placeNewPiece('c', 1, new Bishop(board, Color.WHITE));\n placeNewPiece('d', 1, new Queen(board, Color.WHITE));\n placeNewPiece('e', 1, new King(board, Color.WHITE, this)); // 'this' refere-se a esta jogada\n placeNewPiece('f', 1, new Bishop(board, Color.WHITE));\n placeNewPiece('g', 1, new Knight(board, Color.WHITE));\n placeNewPiece('h', 1, new Rook(board, Color.WHITE));\n placeNewPiece('a', 2, new Pawn(board, Color.WHITE, this));\n placeNewPiece('b', 2, new Pawn(board, Color.WHITE, this));\n placeNewPiece('c', 2, new Pawn(board, Color.WHITE, this));\n placeNewPiece('d', 2, new Pawn(board, Color.WHITE, this));\n placeNewPiece('e', 2, new Pawn(board, Color.WHITE, this));\n placeNewPiece('f', 2, new Pawn(board, Color.WHITE, this));\n placeNewPiece('g', 2, new Pawn(board, Color.WHITE, this));\n placeNewPiece('h', 2, new Pawn(board, Color.WHITE, this));\n\n placeNewPiece('a', 8, new Rook(board, Color.BLACK));\n placeNewPiece('b', 8, new Knight(board, Color.BLACK));\n placeNewPiece('c', 8, new Bishop(board, Color.BLACK));\n placeNewPiece('d', 8, new Queen(board, Color.BLACK));\n placeNewPiece('e', 8, new King(board, Color.BLACK, this));\n placeNewPiece('f', 8, new Bishop(board, Color.BLACK));\n placeNewPiece('g', 8, new Knight(board, Color.BLACK));\n placeNewPiece('h', 8, new Rook(board, Color.BLACK));\n placeNewPiece('a', 7, new Pawn(board, Color.BLACK, this));\n placeNewPiece('b', 7, new Pawn(board, Color.BLACK, this));\n placeNewPiece('c', 7, new Pawn(board, Color.BLACK, this));\n placeNewPiece('d', 7, new Pawn(board, Color.BLACK, this));\n placeNewPiece('e', 7, new Pawn(board, Color.BLACK, this));\n placeNewPiece('f', 7, new Pawn(board, Color.BLACK, this));\n placeNewPiece('g', 7, new Pawn(board, Color.BLACK, this));\n placeNewPiece('h', 7, new Pawn(board, Color.BLACK, this));\n\t}", "public void setStartConditions() {\r\n\t\tplayer1.relocate(0, 0);\r\n\t\tgamemap.setPlayerLocation(1, 1);\r\n\t\tgamemap.setEnemyLocation(20, 10);\r\n\t\tenemy1.relocate(19*46, 9*85);\r\n\t\tportal1.relocate(9*46, 9*85);\r\n\t\tportal2.relocate(9*46, 0*85);\r\n\t\tspikes1.relocate(5*46,0*85);\r\n\t\tspikes2.relocate(5*46,1*85);\r\n\t\tspikes3.relocate(5*46,2*85);\r\n\t\tspikes4.relocate(5*46,7*85);\r\n\t\tspikes5.relocate(5*46,8*85);\r\n\t\tspikes6.relocate(5*46,9*85);\r\n\t\tspikes7.relocate(10*46,2*85);\r\n\t\tspikes8.relocate(10*46,3*85);\r\n\t\tspikes9.relocate(10*46,4*85);\r\n\t\tspikes10.relocate(10*46,5*85);\r\n\t\tspikes11.relocate(10*46,6*85);\r\n\t\tspikes12.relocate(10*46,7*85);\r\n\t\tspikes13.relocate(15*46,0*85);\r\n\t\tspikes14.relocate(15*46,1*85);\r\n\t\tspikes15.relocate(15*46,2*85);\r\n\t\tspikes16.relocate(15*46,7*85);\r\n\t\tspikes16.relocate(15*46,8*85);\r\n\t\tspikes17.relocate(15*46,9*85);\r\n\t\tRandom randomObj = new Random();\r\n\t\tint randomX = randomObj.nextInt(20);\r\n\t\tint randomY = randomObj.nextInt(10);\r\n\t\tcoins1.relocate(randomX*46, randomY*85);\r\n\t\tgamemap.setLootLocation(randomX + 1, randomY + 1);\r\n\t\t//coins1.relocate(10*46,5*85);\r\n\t\t//gamemap.setLootLocation(11, 6);\r\n\t}", "public void setMove(char player, int place) {\n\n playBoard[place] = player;\n }", "public void createPieces(){ \n\t\tfor(int x = 0; x<BOARD_LENGTH; x++){\n\t\t\tfor(int y = 0; y<BOARD_LENGTH; y++){ \n\t\t\t\tif(CHESS_MAP[x][y] != (null)){\n\t\t\t\t\tswitch (CHESS_MAP[x][y]){\n\t\t\t\t\tcase KING:\n\t\t\t\t\t\tpieces[pieceCounter] = new King(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase QUEEN:\n\t\t\t\t\t\tpieces[pieceCounter] = new Queen(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BISHOP:\n\t\t\t\t\t\tpieces[pieceCounter] = new Bishop(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KNIGHT:\n\t\t\t\t\t\tpieces[pieceCounter] = new Knight(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PAWN:\n\t\t\t\t\t\tpieces[pieceCounter] = new Pawn(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ROOK:\n\t\t\t\t\t\tpieces[pieceCounter] = new Rook(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} \n\t\t\t\t\tsetPieceIconAndName(x, y, CHESS_MAP[x][y]); \t\n\t\t\t\t\tpieceCounter++;\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t}", "public void affectPiece(Piece piece){\r\n this.piece = piece;\r\n this.piece.affect();\r\n }", "public void autoCommand(Piece p) {\r\n _playing = false;\r\n _players[p.ordinal()] = new MachinePlayer(p, this);\r\n }", "public void setPiece(Piece piece, PieceValidator pv);", "public void setSpace(int position, Box player){\r\n\t\tboard[position - 1] = player;\r\n\t\t\r\n\t}", "public void newgame() {\n\t\tthis.player = 1;\n\t\t\n\n\t\tSystem.out.println(\"made a pice\");\n\t\tthis.piece = new String [9] [9];\n\t\tfor (int i=0; i<8 ;i++) {\n\t\t\tfor (int j= 0; j<8; j++) {\n\t\t\tpiece[i] [j] = \" \";\n\t\t\t}\n\t\t}\n\t\tint p = 0;\n\t\tfor (int i=0; i<=2 ;i++) {\n\t\t\tfor (int j= 0; j<8; j++) {\t\t\t\t\n\t\t\tif (p%2==1) {\n\t\t\t\tpiece[i][j]= \"1\";\n\t\t\t\tpiece[i+5][j+1] = \"2\";\n\t\t\t\tj +=1;}\n\t\t\telse {\n\t\t\t\tpiece[i][j+1]= \"1\";\n\t\t\t\tpiece[i+5][j] = \"2\";\n\t\t\t\tj +=1;\n\t\t\t\t}\n\t\t\t}p +=1;\n\t\t}\n\t\t\n\t}", "public void setPlayer(Player p){\r\n playerModel=p; \r\n jEnemigoDatos.setText(p.getEnemy().getName());\r\n /*if(p.getBadConsequence()==null)\r\n jMalRolloDatos.setText(\"No\");\r\n else\r\n jMalRolloDatos.setText(\"Si\");*/\r\n if(p.isDead())\r\n jMuertoDatos.setText(\"Si\");\r\n else\r\n jMuertoDatos.setText(\"No\");\r\n \r\n jNivelDatos.setText(p.getLevels()+\"\");\r\n jCombatLevelDatos.setText(p.getCombatLevel()+\"\");\r\n jNombreDatos.setText(p.getName());\r\n if(p.canISteal())\r\n jRobarDatos.setText(\"Si\");\r\n else\r\n jRobarDatos.setText(\"No\");\r\n \r\n jNSectDatos.setText(Integer.toString(CultistPlayer.getTotalCultistPlayer()));\r\n \r\n if(playerModel.getClass() == CultistPlayer.class){\r\n jSectarioDatos.setText(\"Si\");\r\n //String text=(CultistPlayer)playerModel.getMyCultist().getGainedLevels()+\"\";\r\n //jSectarioDatos.setText(\"\"+(CultistPlayer)playerModel.getGainedLevels());\r\n \r\n }else\r\n jSectarioDatos.setText(\"No\");\r\n \r\n /*if(playerModel.getBadConsequence().isEmpty())\r\n pendingBadView1.setVisiblePending(false);\r\n else*/\r\n pendingBadView1.setVisiblePending(true);\r\n pendingBadView1.limpiar();\r\n \r\n // A continuación se actualizan sus tesoros \r\n fillTreasurePanel (jpVisibles, playerModel.getVisibleTreasures()); \r\n fillTreasurePanel (jpOcultos, playerModel.getHiddenTreasures()); \r\n btRobar.setEnabled(playerModel.canISteal());\r\n manejarBotones(true);\r\n repaint(); \r\n revalidate();\r\n }", "public final void initialPosition() {\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.RED, Type.PAWN), new PositionImpl( 38 + 8*i));\n\t\t}\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.BLACK, Type.PAWN), new PositionImpl( 12 + i));\n\t\t}\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.YELLOW, Type.PAWN), new PositionImpl( 1 + 8*i));\n\t\t}\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.GREEN, Type.PAWN), new PositionImpl( 48 + i));\n\t\t}\n\t\t\n\t\tsetPiece( new PieceImpl( Color.RED, Type.BOAT), new PositionImpl( 63 ));\n\t\tsetPiece( new PieceImpl( Color.RED, Type.KNIGHT), new PositionImpl( 55 ));\n\t\tsetPiece( new PieceImpl( Color.RED, Type.ELEPHANT), new PositionImpl( 47 ));\n\t\tsetPiece( new PieceImpl( Color.RED, Type.KING), new PositionImpl( 39 ));\n\t\t\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.BOAT), new PositionImpl( 7 ));\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.KNIGHT), new PositionImpl( 6 ));\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.ELEPHANT), new PositionImpl( 5 ));\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.KING), new PositionImpl( 4 ));\n\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.BOAT), new PositionImpl( 0 ));\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.KNIGHT), new PositionImpl( 8 ));\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.ELEPHANT), new PositionImpl( 16 ));\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.KING), new PositionImpl( 24 ));\n\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.BOAT), new PositionImpl( 56 ));\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.KNIGHT), new PositionImpl( 57 ));\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.ELEPHANT), new PositionImpl( 58 ));\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.KING), new PositionImpl( 59 ));\n\t\t\n }", "private void setBaseSpawns() {\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team0-X:148\");\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team0-Y:517\");\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team0-Radius:20\");\r\n\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team1-X:330\");\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team1-Y:517\");\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team1-Radius:20\");\r\n\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team2-X:694\");\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team2-Y:517\");\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team2-Radius:20\");\r\n\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team3-X:876\");\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team3-Y:517\");\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team3-Radius:20\");\r\n\r\n }", "public abstract Piece setLocation(int row, int column);", "private void setMapPos()\r\n {\r\n try\r\n {\r\n Thread.sleep(1000);//so that you can see players move\r\n }\r\n catch(Exception e){}\r\n int currentPlayer = worldPanel.getCurrentPlayer();\r\n int currentUnit = worldPanel.getCurrentUnit();\r\n int unitPos = 0;\r\n int firstX = 0;\r\n int firstY = 0;\r\n if (currentPlayer == 1)\r\n {\r\n unitPos = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n }\r\n if (currentPlayer == 2)\r\n {\r\n unitPos = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n }\r\n int tempX = unitPos % mapWidth;\r\n int tempY = unitPos - tempX;\r\n if (tempY == 0) {}\r\n else\r\n tempY = tempY / mapHeight;\r\n tempX = tempX - 11;\r\n tempY = tempY - 7;\r\n if (tempX >= 0)\r\n firstX = tempX;\r\n else\r\n firstX = tempX + mapWidth;\r\n if (tempY >= 0)\r\n firstY = tempY;\r\n else\r\n firstY = tempY + mapWidth;\r\n\r\n int drawWidth = worldPanel.getDrawWidth();\r\n int drawHeight = worldPanel.getDrawHeight();\r\n worldPanel.setNewXYPos(firstX, firstY);\r\n miniMap.setNewXY(firstX, firstY, drawWidth, drawHeight);\r\n }", "public static void boardInit() {\n ArrayList<Piece> white_piece_list = new ArrayList<>();\n ArrayList<Piece> black_piece_list = new ArrayList<>();\n ArrayList<Piece> piece_array = PieceFactory.createPieces();\n for(Piece p : piece_array)\n {\n if(p.getColor())\n {\n black_piece_list.add(p);\n }\n else\n {\n white_piece_list.add(p);\n }\n }\n white_player.setpieceList(white_piece_list);\n white_player.setKingXYCoords(PieceFactory.KING_INITIAL_X, PieceFactory.INITAL_Y_COORD_WHITE_PLAYER_OTHER);\n black_player.setpieceList(black_piece_list);\n black_player.setKingXYCoords(PieceFactory.KING_INITIAL_X, PieceFactory.INITAL_Y_COORD_WHITE_PLAYER_OTHER + PieceFactory.DIST_BETWEEN_PIECES);\n }", "@Override\n\tpublic void setPlayer(Player player) {\n\n\t}", "public void setWeaponCardsAndPieces() {\n List<WeaponCard> weaponCards = new ArrayList<>(); // empty list for the new weapon cards\n List<WeaponPiece> weaponPieces = new ArrayList<>(); // empty list for the new weapon pieces\n\n Data data = new Data(\"data.json\"); // read data from data.json\n JSONObject weaponData = (JSONObject) data.getJsonData().get(\"Weapons\"); // get the weapon data from the data\n for (int i = 0; i < 6; i++) { // for loop 0 to 5\n String weaponName = String.valueOf(weaponData.get(String.valueOf(i))); // get the weapon name\n //Make and add weaponCard and WeaponPiece to their specified lists.\n weaponCards.add(new WeaponCard(weaponName));\n weaponPieces.add(new WeaponPiece(weaponName));\n }\n //Assign the lists into their class variables\n this.weaponCards = weaponCards;\n this.weaponPieces = weaponPieces;\n }", "@Test\n public void shouldBeAbleToInitializeWithPieces() {\n Player p1 = new Player(ChessPieceColor.WHITE, position);\n Player p2 = new Player(ChessPieceColor.BLACK, position);\n for (int i = 0; i < position.getSize(); i++) {\n Assert.assertNotNull(position.getPieceAtPosition(i, 0)); // Regular pieces\n Assert.assertNotNull(position.getPieceAtPosition(i, 1)); // Pawns\n Assert.assertNotNull(position.getPieceAtPosition(i, 7)); // Regular pieces\n Assert.assertNotNull(position.getPieceAtPosition(i, 6)); // Pawns\n }\n }", "private void assignPlayerPieces(List<Pair<Player, Integer>> playerOrder) {\n Collections.sort(playerOrder, Comparator.comparing(p -> -p.getValue()));\n\n for (int i = 0; i < playerOrder.size(); i++) {\n playerOrder.get(i).getKey().setPiece(this.playerPieces.get(i));\n }\n locAtTurnStart = currentPlayersTurn.getPiece().getLocation();\n }", "public static void makeBoardChess() {\r\n \r\n white = new AllPiece(\"White\");\r\n black = new AllPiece(\"Black\");\r\n \r\n }", "@Override\r\n\tpublic void set(final Player t) {\n\r\n\t}", "public void setPlayer(int row, int col, int value) {\n\t\tplayer[row][col] = value;\n\t}", "private final void setupNewGame() throws IOException {\n\t\tmessage.setText(\"Make your move!\");\n\n\t\twhiteTeam = PokemonDao.getRandomPokemons(TEAM_SIZE);\n\t\tblackTeam = PokemonDao.getRandomPokemons(TEAM_SIZE);\n\n\t\tcreateImages();\n\n\t\tint middleSquare = BOARD_SIZE/2;\n\n\t\tint i=0;\n\t\tfor(int col = middleSquare - whiteTeam.size()/2; col< middleSquare+ whiteTeam.size()/2;col++){\n\t\t\tJButton jButton = chessBoardSquares[col][0];\n\t\t\tImageIcon icon = new ImageIcon(whiteImages.get(i++));\n\t\t\tjButton.setIcon(icon);\n\t\t}\n\n\t\tint j=0;\n\t\tfor(int col = middleSquare - whiteTeam.size()/2; col< middleSquare+ whiteTeam.size()/2;col++){\n\t\t\tJButton jButton = chessBoardSquares[col][BOARD_SIZE-1];\n\t\t\tImageIcon icon = new ImageIcon(blackImages.get(j++));\n\t\t\tjButton.setIcon(icon);\n\t\t}\n\n\t\tframe.pack();\n\t\t//\t\tfor (int ii = 0; ii < BOARD_SIZE; ii++) {\n\t\t//\t\t\tfor (int jj = 0; jj < BOARD_SIZE; jj++) {\n\t\t//\t\t\t\tchessBoardSquares[ii][jj].setIcon(new ImageIcon(whiteImages.get(0)));\n\t\t//\t\t\t}\n\t\t//\t\t}\n\t\t//\t\t// set up the black pieces\n\t\t//\t\tfor (int ii = 0; ii < STARTING_ROW.length; ii++) {\n\t\t//\t\t\tchessBoardSquares[ii][0].setIcon(new ImageIcon(chessPieceImages[BLACK][STARTING_ROW[ii]]));\n\t\t//\t\t}\n\t\t//\t\tfor (int ii = 0; ii < STARTING_ROW.length; ii++) {\n\t\t//\t\t\tchessBoardSquares[ii][1].setIcon(new ImageIcon(chessPieceImages[BLACK][PAWN]));\n\t\t//\t\t}\n\t\t//\t\t// set up the white pieces\n\t\t//\t\tfor (int ii = 0; ii < STARTING_ROW.length; ii++) {\n\t\t//\t\t\tchessBoardSquares[ii][6].setIcon(new ImageIcon(chessPieceImages[WHITE][PAWN]));\n\t\t//\t\t}\n\t\t//\t\tfor (int ii = 0; ii < STARTING_ROW.length; ii++) {\n\t\t//\t\t\tchessBoardSquares[ii][7].setIcon(new ImageIcon(chessPieceImages[WHITE][STARTING_ROW[ii]]));\n\t\t//\t\t}\n\t}", "public void fillGamePanel() {\n for (int row = 0; row < world.getRowCount(); row++) {\n for (int col = 0; col < world.getColumnCount(); col++) {\n add(world.getCellAt(row, col));\n world.getCellAt(row, col).setBorder(\n BorderFactory.createMatteBorder(\n 1, 1, 0, 0, Color.BLACK));\n }\n }\n for (int row = 0; row < world.getRowCount(); row++) {\n for (int col = 0; col < world.getColumnCount(); col++) {\n gridPanel.add(world.getCellAt(row, col));\n world.getCellAt(row, col).setBorder(\n BorderFactory.createMatteBorder(\n 1, 1, 0, 0, Color.BLACK));\n }\n }\n }", "public void setPlayer(Player player) {\r\n this.player = player;\r\n }", "public void setPiece(Tetrimino piece)\n {\n this.piece = piece;\n }" ]
[ "0.7569837", "0.7061554", "0.66794693", "0.6648428", "0.6619526", "0.6576087", "0.6560435", "0.65399027", "0.65347433", "0.65306693", "0.6517343", "0.64858115", "0.64762634", "0.64677864", "0.64564383", "0.64469063", "0.64003164", "0.6373833", "0.6355723", "0.6336384", "0.6317414", "0.6317176", "0.63168246", "0.6310739", "0.62776923", "0.62582934", "0.6244773", "0.6224221", "0.62156004", "0.61993194", "0.61967766", "0.61928344", "0.6188218", "0.61872065", "0.618325", "0.6158301", "0.6147759", "0.6141816", "0.6138879", "0.61334616", "0.6121584", "0.61123866", "0.61069924", "0.6105968", "0.6093171", "0.6090632", "0.60903263", "0.6076501", "0.60734975", "0.6071214", "0.60652864", "0.6064504", "0.6056964", "0.6056205", "0.60552096", "0.6032778", "0.6032618", "0.6029639", "0.60262585", "0.6024524", "0.6022766", "0.60202503", "0.60195816", "0.6016479", "0.6010387", "0.6010018", "0.6004094", "0.60025567", "0.60006094", "0.59864044", "0.5978175", "0.59633476", "0.5959915", "0.5952817", "0.5950657", "0.59487534", "0.5937122", "0.59335184", "0.5914831", "0.5914757", "0.59145695", "0.5913665", "0.5912855", "0.5911821", "0.5902508", "0.5900676", "0.5893672", "0.5887071", "0.5884561", "0.5883936", "0.58812857", "0.5879216", "0.58746016", "0.58733225", "0.5850502", "0.58431125", "0.5839962", "0.5839742", "0.58331823", "0.5831059" ]
0.6750601
2
setting the index of a single piece
public void setPiece (int oldKey ,int key, Piece value){ if(pieces.containsKey(oldKey)) pieces.remove(oldKey); pieces.put(key, value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setIdx(int i);", "public void set(long index);", "public void setIndex(int index)\n/* */ {\n/* 39 */ this.index = index;\n/* */ }", "public int set(int index, int element);", "public void setIndex(int index) { this.index = index; }", "void set(int index, Object element);", "private void setComponentsOfIndex() {\n\t\tint t = this.numbersIdex + 1;\n\t\tif (t == NUMBEROFEACHCARD) {\n\t\t\tthis.numbersIdex = 0;\n\t\t\tsetColorIndex();\n\t\t} else {\n\t\t\tthis.numbersIdex = t;\n\t\t}\n\t}", "public void set(int index, int o) {\n\t\tif(index == 0) return;\n\t\tr[index] = o;\n\t}", "public abstract E set(int index, E e);", "public E set(int index, E element);", "private void setIndex(int index){\n\t\tthis.index = index;\n\t}", "T set(int index, T element);", "void set(int idx, int val);", "public void setElementAt(Object obj, int index);", "public abstract <T> void set(int index, T value);", "public void set(int pos);", "void set(int index, T data);", "public void setIndex(int index){\r\n \tthis.index = index;\r\n }", "public abstract Piece setLocation(int row, int column);", "public void setX (int index, int x) { coords[index][0] = x; }", "public abstract int getIndex();", "public int getIndex(\n )\n {return index;}", "public void setIndex(int i) {\n\t\t\n\t}", "void setArrayElement(int index, Object value);", "void setArrayElement(int index, Object value);", "public int index();", "BinaryArrayReadWrite set(int index, byte x);", "@Override\n public E set(int index, E elem) {\n\t E first = _store[index];\n\t _store[index] =elem;\n\t return first;\n }", "public int getPosition(int index);", "private int newIndex() {\n //return indexes.remove(0);\n return random.nextInt(81);\n }", "public @Override E set(int index, E element) {\n \tNode n = getNode(index);\n \tE result = n.data;\n \tn.data = element;\n \treturn result;\n }", "public int getIndex() { return this.index; }", "public int getIndex();", "public int getIndex();", "public int getIndex();", "public void setIndex(int i){\n\t\tthis.index = i;\r\n\t}", "void set(int index, int value) {\n array[index] = value;\n }", "public void setIndex(int index) {\n _index = index;\n }", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "public int getIndex()\n/* */ {\n/* 46 */ return this.index;\n/* */ }", "int index();", "public void setMaterialIndex(int index) { materialIndex = index; }", "public abstract void setIndex(int i, boolean b);", "public int getIndex(){\r\n \treturn index;\r\n }", "void locate(int pos, int [] ind)\n\t{\n\t\tind[0] = (int) pos / dimy; // x\n\t\tind[1] = pos % dimy; // y\t\n\t}", "private void setFormedIndex() {\n\t\tint t = this.formeIndex + 1;\n\t\tif (t == NUMBEROFEACHCARD) {\n\t\t\tsetFillIndex();\n\t\t\tthis.formeIndex = 0;\n\t\t} else {\n\t\t\tthis.formeIndex = t;\n\t\t}\n\n\t}", "@Override\n\tpublic E set(int index, E element) {\n\t\tNode<E> node = node(index);\n\t\tE old = node.elementE;\n\t\tnode.elementE = element;\n\t\treturn old;\n\t}", "public void set(int index, Object wert) {\r\n\t\t// Das Element an der Stelle index \r\n\t\t//soll auf den Wert wert gesetzt werden\r\n\t\tgeheim[index] = wert;\r\n\t}", "@Override\n public E set(int index, E value) {\n // todo: Students must code\n checkRange(index);\n int pos = calculate(index);\n E oldVal = data[pos];\n data[pos] = value;\n return oldVal;\n }", "private void setElement(int index, E element) {\n// if (getElement(index) != null) {\n// setContents.remove(getElement(index));\n// }\n while (index >= contents.size()) {\n contents.add(null);\n }\n contents.set(index, element);\n// contents.put(index, element);\n backwards.put(element, index);\n\n// if (element != null) {\n// setContents.add(getElement(index));\n// }\n }", "@Override\n public int set(int index, int element) {\n checkIndex(index);\n int result = getEntry(index).value;\n getEntry(index).value = element;\n return result;\n }", "public int getIndex(){\n return index;\n }", "public int getIndex(){\n return index;\n }", "void setCardIndexInArgumentUnchecked(UUID argumentId, short newIndex, short oldIndex);", "protected void _setIntLE(int index, int value)\r\n/* 495: */ {\r\n/* 496:509 */ HeapByteBufUtil.setIntLE(this.array, index, value);\r\n/* 497: */ }", "public void setIndex(int index){\n\t\tthis.index = index;\n\t}", "public final int getIndex(){\n return index_;\n }", "public void setIndex(int ind){\n\t\tindex = ind;\n\t}", "public Object set(int index, Object element) {\r\n Entry e = entry(index);\r\n Object oldVal = e.element;\r\n e.element = element;\r\n return oldVal;\r\n }", "public void setMyShape(int shapeIndex){this.myShape = shapeIndex;}", "void setFeature(int index, Feature feature);", "public abstract int getSourceIndex(int index);", "public abstract void updateIndex();", "E set(int i , E e) throws IndexOutOfBoundsException;", "void setBit(int index, int value);", "public Integer mutate(int index);", "public void setIndex(int index) {\r\n this.index = index;\r\n }", "E set(int i, E e) throws IndexOutOfBoundsException;", "@Override\n\tpublic void setValueIndex(int index) {\n\t\t\n\t}", "protected final int getIndex() {\n return index;\n }", "protected void _setMediumLE(int index, int value)\r\n/* 471: */ {\r\n/* 472:485 */ HeapByteBufUtil.setMediumLE(this.array, index, value);\r\n/* 473: */ }", "public void setIndx(int indx){\n this.indx = indx;\n }", "public void setIndexFromMouse(double ex, double ey) {\n double y = 0;\n int rowcount =0;\n for(TextLayoutModel.LayoutLine line : _layout_model.lines()) {\n if(ey >= y && ey < y + line.getHeight()) {\n row = rowcount;\n break;\n }\n y+= line.getHeight();\n rowcount++;\n }\n\n TextLayoutModel.LayoutLine line = _layout_model.line(row);\n if(ex < 0) {\n col = 0;\n } else if(ex > line.getWidth()) {\n col = line.letterCount();\n } else {\n //now calc the column\n String text = line.getString();\n// u.p(\"text = \" + text);\n double lastX = 0;\n for(int i=0; i<text.length(); i++) {\n double x = getFont().calculateWidth(text.substring(0,i));\n double w = (x-lastX)/2;\n// u.p(\"i = \" + i + \" x = \" + x + \" w = \" + w);\n if(ex >= x-w && ex < x+w) {\n// u.p(\"found at \" + i);\n col = i;\n }\n if(i==1 && ex < w) {\n col = 0;\n }\n lastX = x;\n }\n }\n// u.p(\"pos = \" + col+\",\"+row);\n\n index = rowColToIndex(row,col);\n }", "public void changePiece() {\n if (piece == 1) {\n piece = 2;\n } else {\n piece = 1;\n }\n //System.out.println(\"Nu ben ik piece \" + piece);\n }", "public int getIndex() {\r\n \t\t\treturn index;\r\n \t\t}", "public void setIndex(int position) {\n/* 271 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public void placePiece(Piece newPiece){pieceAtVertex = newPiece;}", "public void set(int idx, E value) {\n assert idx >= 0;\n \n checkgrow(idx);\n \n\tarray[idx] = value;\n\t\n }", "@Override\n public final int getIndex() {\n return index;\n }", "@Override\r\n\tpublic int getIndex() {\n\t\treturn index;\r\n\t}", "@Override\n public T set(final int index, final T element) {\n this.checkIndex(index);\n final T prevElment = get(index);\n this.data[index] = element;\n return prevElment;\n }", "@Test\n\tpublic void testGettingIndexOfAPiece()\n\t{\n\t\t// arrange\n\t\tData d = new Data();\n\t\t// act\n\t\tint index = d.getIndex(50);\n\n\t\t// assert\n\t\tassertTrue(index < 13); // the piece should be white, i.e. its index is below 13\n\t}", "public void setIndex(Integer index) {\n this.index = index;\n }", "public void setIndex(Integer index) {\n this.index = index;\n }", "int getIndex(){\r\n\t\treturn index;\r\n\t}", "public void setIdx(Integer idx) {\r\n\t\tthis.idx = idx;\r\n\t}", "public void setPiece(int x, int y, Piece piece) {\n \tboard[y][x] = piece;\n }", "public void set(int index,Fraction x)\r\n\t{\r\n\t\tif(index<0 || index >=n)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Invalid index\");\r\n\t\t}\r\n\t\telse\r\n\t\t\ta[index]=x;\r\n\t}", "void changeSetting(int idx) {\n currentIdx = idx;\n }" ]
[ "0.7275147", "0.71630687", "0.69979006", "0.6911047", "0.68747914", "0.67789733", "0.6754756", "0.66975486", "0.6619405", "0.66135335", "0.65007555", "0.64729524", "0.6455763", "0.64273226", "0.6404847", "0.63833725", "0.6379256", "0.63530475", "0.6304433", "0.62862206", "0.62727803", "0.6269123", "0.62417376", "0.62406015", "0.62406015", "0.6238868", "0.6232493", "0.62234867", "0.6210607", "0.6198002", "0.61823255", "0.6170605", "0.6166313", "0.6166313", "0.6166313", "0.6155675", "0.6146135", "0.61429757", "0.6137789", "0.6137789", "0.6137789", "0.6137789", "0.6137789", "0.6137789", "0.6137789", "0.6137789", "0.6137789", "0.6137789", "0.6137789", "0.6137789", "0.6137789", "0.6132163", "0.6127163", "0.6121126", "0.61156404", "0.6108768", "0.6069243", "0.60572577", "0.6050084", "0.60474724", "0.60449445", "0.60438377", "0.6042026", "0.60255605", "0.60255605", "0.6022121", "0.60215265", "0.6021316", "0.6015166", "0.60110986", "0.60070586", "0.6006343", "0.5996064", "0.5993133", "0.5990274", "0.5988328", "0.59580594", "0.5957021", "0.5948546", "0.5945357", "0.59315497", "0.59282583", "0.59253436", "0.59232646", "0.59222484", "0.59177977", "0.59167427", "0.5912164", "0.5906765", "0.59062374", "0.5895906", "0.5895692", "0.58951277", "0.5892136", "0.5889194", "0.5889194", "0.5883351", "0.58804864", "0.5875509", "0.5875191", "0.58691925" ]
0.0
-1
getting a list of the base of the player
public List<Integer> getTeritory() { return teritory; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public ArrayList<Player> getPlayers() {return steadyPlayers;}", "List<Player> getPlayers();", "ArrayList<Player> getAllPlayer();", "public List<Colour> getPlayerList();", "List<Player> listPlayers();", "@Override\n\tpublic List<Player> getPlayer() {\n\t\treturn ofy().load().type(Player.class).list();\n\t}", "@Override\n public List<Player> getPlayers() {\n return new ArrayList<Player>(players);\n }", "@Override\n public List<Player> getPlayers() {\n return players;\n }", "protected ClientList getCurrentPlayers() {\r\n\t\treturn this.players;\r\n\t}", "static List<Player> getAllPlayers() {\n\t\treturn null;\r\n\t}", "public List<Player> getPlayerList(){\n return this.players;\n }", "public List<PlayerItem> getAll();", "public List<Player> getDisplayList(){\n\t\tList<Player> dis = new ArrayList<>(1);\n\t\tif(!playersFinished.isEmpty()){\n\t\t\tdis.add(playersFinished.get(tempNumber -1));//last to finish\n\t\t}\n\t\treturn dis;\n\t}", "ArrayList<IPlayer> buildPlayerList();", "public static ArrayList<Player> getWinners(){return winners;}", "List<Player> getViewers();", "private void getPlayerList(){\r\n\r\n PlayerDAO playerDAO = new PlayerDAO(Statistics.this);\r\n players = playerDAO.readListofPlayerNameswDefaultFirst();\r\n\r\n }", "public List<PlayerItem> getAllPlayerItemById(Player player);", "public ArrayList<Player> getPlayerList() {\n ArrayList<Player> ret = new ArrayList<>();\n ret.addAll(playerList);\n return ret;\n }", "public List<Player> getAllPlayers() {\r\n // TODO fix actual order of players in the List.\r\n\r\n List<Player> players = new ArrayList<>();\r\n players.addAll(teamRed.getPlayers());\r\n players.addAll(teamBlue.getPlayers());\r\n\r\n return players;\r\n }", "public List<Player> getPlayerList()\n\t{\n\t\treturn playerList;\n\t}", "@Override\r\n\tpublic ArrayList<PlayerPO> getAllPlayers() {\n\t\treturn playerController.getAllPlayers();\r\n\t}", "public static ArrayList<Player> getPlayerAry(){\n\t\treturn players;\n\t}", "public List<Player> getAll() {\n PlayerDB pdb = new PlayerDB();\n return pdb.getAll();\n }", "public List<Player> getPlayers() {\r\n return players;\r\n }", "public List<Player> getPlayers() {\r\n return players;\r\n }", "public List<PlayerInstance> getAllPlayers()\n\t{\n\t\tfinal List<PlayerInstance> players = new ArrayList<>();\n\t\tfor (Creature temp : getCharactersInside())\n\t\t{\n\t\t\tif (temp instanceof PlayerInstance)\n\t\t\t{\n\t\t\t\tplayers.add((PlayerInstance) temp);\n\t\t\t}\n\t\t}\n\t\treturn players;\n\t}", "java.util.List<com.message.BagProto.PlayerBagMsg> \n getListPlayerBagsList();", "@Override\n public ArrayList<Player> getPlayers() throws RemoteException {\n return players;\n }", "public List<ColorId> getPlayerList() {\n return playerList;\n }", "public void initializePlayers(){\r\n allPlayers = new ArrayList<Player>();\r\n currentPlayerIndex = 0;\r\n Player redPlayer = new Player(1, new Location(2, 2), Color.RED);\r\n Player bluePlayer = new Player(2, new Location(4, 2), Color.BLUE);\r\n Player whitePlayer = new Player(3, new Location(2, 4), Color.WHITE);\r\n Player yellowPlayer = new Player(4, new Location(4, 4), Color.YELLOW);\r\n allPlayers.add(redPlayer);\r\n allPlayers.add(bluePlayer);\r\n allPlayers.add(whitePlayer);\r\n allPlayers.add(yellowPlayer);\r\n }", "public List<String> getAllPlayerNames() {\n List<String> playerNames = new ArrayList<>(10);\n for (Player p : players) {\n playerNames.add(p.getName());\n }\n return playerNames;\n }", "public CopyOnWriteArrayList<Player> getPlayerList() \t\t\t\t\t\t\t{ return this.playerList; }", "private Collection<Player> getPlayers() {\n\t\treturn players;\n\t}", "public PlayerStart[] getPlayerStartingPoints() {\n if(mPlayerStartList == null) {\n generate();\n }\n return mPlayerStartList;\n }", "public ArrayList<Tile> getPlayerHand(){\n return playerHand;\n }", "public Collection<Player> getPlayersChunk() {\n var chunk = new Chunk<Player>();\n var playersChunk = chunk.get(this.players, ALL_PLAYERS_CHUNK_SIZE, allPlayersChunkIndex);\n\n // up to ALL_PLAYERS_CHUNK_SIZE with empty players\n // to have an even view\n var startIndex = playersChunk.size();\n for (var i = startIndex; i < ALL_PLAYERS_CHUNK_SIZE; i++) {\n playersChunk.add(new Player(new Person()));\n }\n\n return playersChunk;\n }", "public List<Player> findAllPlayers(){\n\t\treturn playerRepository.findAll();\n\t}", "public Connect4Player[] getPlayers(){\n\t\tConnect4Player[] output = new Connect4Player[4];\n\t\tif(players.isEmpty()){\n\t\t\tplayers.add(new Connect4Player(this, TOKEN.X));\n\t\t\tplayers.add(new Connect4Player(this, TOKEN.O));\n\t\t}\n\t\toutput[0] = players.get(0);\n\t\toutput[1] = players.get(1);\n\t\treturn output;\n\t}", "public Player[] getPlayers() {\r\n return players;\r\n }", "public abstract Collection<PlayerFish> getPlayers();", "public static List<Player> getTrackablePlayers() {\n\t\tPlayer[] players = Bukkit.getOnlinePlayers();\n\t\tList<Player> players1 = new ArrayList<Player>();\n\t\tfor (int i = 0; i < players.length; i++) {\n\t\t\tif (!players[i].hasMetadata(\"invisible\")) {\n\t\t\t\tplayers1.add(players[i]);\n\t\t\t}\n\n\t\t}\n\t\treturn players1;\n\t}", "public void getPlayerList() {\n if (connected == true) {\n try {\n write(\"get playerlist\");\n } catch (IOException e) {\n System.out.println(\"No connecting with server:ServerCommunication:getPlayerList()\");\n }\n }\n }", "public List<Vector2f> getPlayerStartPositions() {\n \n List<Vector2f> list = new ArrayList();\n PlayerStart[] points = getPlayerStartingPoints();\n \n if(points == null || points.length <= 0) {\n return list;\n }\n \n for(int i = 0; i < points.length; i++) {\n PlayerStart p = points[i];\n list.add(new Vector2f( p.x, p.y ));\n }\n \n return list;\n \n }", "ArrayList<Tile> getTilesPlayerOne() throws RemoteException;", "private void refreshPlayerList() {\n List<MarketItem> items = new ArrayList<>();\n EntityRef player = localPlayer.getCharacterEntity();\n for (int i = 0; i < inventoryManager.getNumSlots(player); i++) {\n EntityRef entity = inventoryManager.getItemInSlot(player, i);\n\n if (entity.getParentPrefab() != null) {\n MarketItem item;\n\n if (entity.hasComponent(BlockItemComponent.class)) {\n String itemName = entity.getComponent(BlockItemComponent.class).blockFamily.getURI().toString();\n item = marketItemRegistry.get(itemName, 1);\n } else {\n item = marketItemRegistry.get(entity.getParentPrefab().getName(), 1);\n }\n\n items.add(item);\n }\n }\n\n tradingScreen.setPlayerItems(items);\n }", "public Robber() {\n\t\t// robberPlayers = (ArrayList<Player>) GSC.players.clone();\n\t}", "public ArrayList<CardGamePlayer> getPlayerList(){\n\t\treturn this.playerList;\n\t}", "public ArrayList<Player> getLeaderboard() {\n ArrayList<Player> result = new ArrayList(players);\n for (Player player : players) {\n Collections.sort(result);\n Collections.reverse(result);\n }\n return result;\n}", "public ArrayList<Long> base() {\n\t\tint _size = this.members.size();\n\t\tArrayList<Long> _returns = new ArrayList<Long>(_size);\n\t\tfor (int _index = 0; _index < _size; _index++)\n\t\t\t_returns.add(this.members.get(_index).base());\n\t\treturn _returns;\n\t}", "@Override\n public List<Set<String>> getPlayersVisibleTo(){\n Set<String> players = new HashSet<String>();\n players.add(destination.getOwner().getName());\n for(Region adj : destination.getAdjRegions()){\n players.add(adj.getOwner().getName());\n }\n //All adjacent can see cloaking happened\n return Arrays.asList(players);\n }", "public List<ServerPlayerEntity> getPlayerList() {\n return this.players;\n }", "@Override\r\n public String toString(){\n \r\n for(Player player: players){\r\n if(player == null){\r\n continue;\r\n }\r\n System.out.println(player.toString());\r\n }\r\n return \"\";\r\n }", "public Player[] getPlayers() {\n return players;\n }", "public List<Player> getAllOrdered() {\n PlayerDB pdb = new PlayerDB();\n return pdb.getAllOrdered();\n }", "private static Image[][] getTileBases()\n\t{\n\t\tImage[][] tileBases = new Image[2][4];\n\t\tfor (int type = 0; type < 4; type++) {\n\t\t\ttry {\n\t\t\t\ttileBases[0][type] = ImageIO.read(new File(tileDirectory\n\t\t\t\t\t\t+ \"tile_\" + tileColours[type] + \".png\"));\n\t\t\t} catch (IOException ioe) {\n\t\t\t}\n\t\t}\n\t\tfor (int type = 0; type < 4; type++) {\n\t\t\ttry {\n\t\t\t\ttileBases[1][type] = ImageIO.read(new File(tileDirectory\n\t\t\t\t\t\t+ \"tile_\" + tileColours[type] + \"_trans.png\"));\n\t\t\t} catch (IOException ioe) {\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn tileBases;\n\t}", "public List<Player> getPlayers() {\r\n\t\tList<Player> playerList = new ArrayList<Player>();\r\n\r\n\t\tfor (Player p : players.values()) {\r\n\t\t\tif (p != null)\r\n\t\t\t\tplayerList.add(p);\r\n\t\t}\r\n\r\n\t\treturn playerList;\r\n\t}", "private List<Boat> playStateBoats() {\n\t\tList<Boat> output = new ArrayList<>();\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tBoat boat = this.boats.get(generator.nextInt(this.boats.size() - 1));\n\t\t\toutput.add(boat);\n\t\t\tthis.boats.remove(boat);\n\t\t}\n\t\treturn output;\n\t}", "public List<PlayerRecord> display4() {\n List<PlayerRecord> l = new List<PlayerRecord>();\n int max = 0;\n PlayerRecord curr = playerlist.first();\n while (curr != null) {\n int c = curr.getShots();\n if (c > max) {// if is a new maximum value, empty the list\n l.clear();\n l.add(curr);\n max = c;\n } else if (c == max) { // if there are more than one maximum value,\n // add it\n l.add(curr);\n }\n curr = playerlist.next();\n }\n return l;\n }", "public List<Player> getPlayers() {\r\n\t\treturn players;\r\n\t}", "public List<String> getRankingPlayer() throws IOException, ClassNotFoundException {\r\n return ctrlDomain.getRankingPlayer();\r\n }", "protected void newPlayerList() {\n int len = getPlayerCount();\n mPlayerStartList = new PlayerStart[ len ];\n for(int i = 0; i < len; i++) {\n mPlayerStartList[i] = new PlayerStart( 0.f, 0.f );\n }\n }", "public ArrayList<Player> getPlayers() {\n return players;\n}", "public Player[] getPlayers() {\n return this.players;\n }", "public Player[] getPlayers() {\n return this.players;\n }", "java.util.List<com.orange.network.game.protocol.model.ZhaJinHuaProtos.PBPoker> \n getPokersList();", "public ListResponse<PlayerResponse> getPlayers() {\n\t\tcheckProvided();\n\t\treturn players;\n\t}", "public CompactPlayer[] getPlayers()\n {\n return players;\n }", "public ArrayList<PlayingCard> getHand();", "public abstract ArrayList<GameObject> fight();", "public Player[] getPlayers()\r\n\t{\r\n\t\treturn this.players;\r\n\t}", "public ArrayList<Player> getPlayers() {\n return players;\n }", "List<Player> findAllPlayers();", "public String toString()\n\t{\n\t\treturn Integer.toString(playerList.size());\n\t}", "Collection<User> players();", "public List<Player> getPlayers() {\n\t\treturn players;\n\t}", "public List <FootballPlayer> getAllPlayers() {\n\t\treturn market.getAllPlayers();\n\t}", "public ArrayList<Entity> getPlayers() {\n ArrayList<Entity> players = new ArrayList<>();\n students.forEach(student -> players.add(student.getPlayer()));\n return players;\n }", "public static ArrayList<String> getPlayerInformation() {\n clearScreen();\n ArrayList<String> Names = new ArrayList<String>();\n for (int i = 1; i < 3; i++) {\n System.out.println(\"Player \" + i + \"'s Name:\");\n Names.add(Input.nextLine());\n clearScreen();\n }\n return Names;\n }", "public synchronized List<Card> getCardsInPlay(){\n cardsInPlay.clear();\r\n \r\n for(Player player: players){\r\n if(player == null){\r\n continue;\r\n }\r\n if(player.getCardsInHand().isEmpty()){\r\n continue;\r\n }\r\n for(Card card: player.getCardsInHand()){\r\n cardsInPlay.add(card);\r\n }\r\n }\r\n return cardsInPlay;\r\n }", "public Player[] getPlayers()\n\t{\n\t\treturn players;\n\t}", "public ArrayList<Integer> getXPlayers() {\n return this.xPlayers;\n }", "public Set<UUID> getAlivePlayers() {\n return new HashSet<>(players);\n }", "@SuppressWarnings(\"ResultOfObjectAllocationIgnored\")\n private String getWinnerList() {\n String list = \"\";\n\n ArrayList<IPlayer> arrlist = sortPlayerAfterPoints();\n\n for (IPlayer i : arrlist) {\n try {\n list += i.getName();\n list += \": \" + i.getPoints() + \"\\n\";\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n }\n\n try {\n if (dialog.getSoundBox().isSelected()) {\n if (iPlayerList.size() > 0) {\n if (playersAgentsMap.get(arrlist.get(0).getName()).get(0).getColor().equals(Color.decode(AgentUtils.ROT))) {\n new SoundClip(\"red_team_is_the_winner\");\n } else if (playersAgentsMap.get(arrlist.get(0).getName()).get(0).getColor().equals(Color.decode(AgentUtils.BLAU))) {\n new SoundClip(\"blue_team_is_the_winner\");\n } else {\n new SoundClip(\"Flawless_victory\");\n }\n } else {\n new SoundClip(\"players_left\");\n }\n }\n } catch (NumberFormatException | RemoteException e) {\n e.printStackTrace();\n }\n\n return list;\n }", "Set<String> getPlayers();", "public Set<GamePiece> getPlayerPieces() \n\t{\n\t\tSet<GamePiece> pieces = new HashSet<GamePiece>();\n\t\tfor(GamePiece piece: playerPieces.values())\n\t\t{\n\t\t\tpieces.add(piece);\n\t\t}\n\t\treturn pieces;\n\t}", "public static ArrayList<EntityPlayer> getAll() {\r\n\t\ttry {\r\n\t\t\tArrayList<EntityPlayer> players = new ArrayList<EntityPlayer>();\r\n\t\t\t\r\n\t\t\tfor (EntityPlayer player : mc.world.playerEntities) {\r\n\t\t\t\tif (!player.isEntityEqual(mc.player)) {\r\n\t\t\t\t\tplayers.add(player);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn players;\r\n\t\t} catch (NullPointerException ignored) {\r\n\t\t\treturn new ArrayList<EntityPlayer>();\r\n\t\t}\r\n\t}", "public JList<Player> getPlayerListGui() {\r\n return playerListGui;\r\n }", "public EntityList<Player> getPlayers() {\n\t\treturn players;\n\t}", "public ArrayList<Player> getPlayers() {\n return players;\n }", "public String[] getPlayers() {\r\n return playerIds;\r\n }", "public ArrayList<Card> getPlayableCards(Player p) {\n ArrayList<Card> playableCards;\n\t if (gameLogic.getLeadSuitCard() == null) {\n\t playableCards = p.getPlayableHand(null, gameLogic.getTrumpCard().getSuit());\n\t System.out.println(playableCards);\n\t System.out.println(\"Player's playable Cards: \" + p.getPlayableHand(null, gameLogic.getTrumpCard().getSuit()));\n\t } else {\n\t playableCards = p.getPlayableHand(gameLogic.getLeadSuitCard().getSuit(), gameLogic.getTrumpCard().getSuit());\n\t System.out.println(\"Player's playable Cards: \" + p.getPlayableHand(gameLogic.getLeadSuitCard().getSuit(),\n\t gameLogic.getTrumpCard().getSuit()));\n\t }\n\n\t return playableCards;\n\t}", "public GUIPlayer[] getGUIPlayers() {\n return this.guiPlayers;\n }", "private List<Character> lookupPlayerCharacters() throws SQLException {\n QueryBuilder<Character, Integer> charactersQb = characterDao.queryBuilder();\n charactersQb.where().in(\"isPlayer\", true);\n return charactersQb.query();\n }", "Player getCurrentPlayer();", "Player getCurrentPlayer();", "java.util.List<WorldUps.UGoPickup> \n getPickupsList();", "@Override\n public String getCurrentPlayer() {\n return godPower.getCurrentPlayer();\n }", "public List<Player> getPassengers() {\n\t\tList<Player> ret = new ArrayList<Player>();\n\t\t\n\t\tfor (Player p : Bukkit.getOnlinePlayers()) {\n\t\t\tif (isPassenger(p))\n\t\t\t\tret.add(p);\n\t\t}\n\t\treturn ret;\n\t}", "private List<BaseLocation> getExpectedBaseLocations() {\r\n final List<BaseLocation> baseLocations = new ArrayList<>();\r\n\r\n final Position position1 = new Position(3104, 3856, PIXEL);\r\n final Position center1 = new Position(3040, 3808, PIXEL);\r\n baseLocations.add(new BaseLocation(position1, center1, 13500, 5000, true, false, true));\r\n\r\n final Position position2 = new Position(2208, 3632, PIXEL);\r\n final Position center2 = new Position(2144, 3584, PIXEL);\r\n baseLocations.add(new BaseLocation(position2, center2, 9000, 5000, true, false, false));\r\n\r\n final Position position3 = new Position(640, 3280, PIXEL);\r\n final Position center3 = new Position(576, 3232, PIXEL);\r\n baseLocations.add(new BaseLocation(position3, center3, 13500, 5000, true, false, true));\r\n\r\n final Position position4 = new Position(2688, 2992, PIXEL);\r\n final Position center4 = new Position(2624, 2944, PIXEL);\r\n baseLocations.add(new BaseLocation(position4, center4, 9000, 5000, true, false, false));\r\n\r\n final Position position5 = new Position(1792, 2480, PIXEL);\r\n final Position center5 = new Position(1728, 2432, PIXEL);\r\n baseLocations.add(new BaseLocation(position5, center5, 12000, 0, true, true, false));\r\n\r\n final Position position6 = new Position(3200, 1776, PIXEL);\r\n final Position center6 = new Position(3136, 1728, PIXEL);\r\n baseLocations.add(new BaseLocation(position6, center6, 13500, 5000, true, false, true));\r\n\r\n final Position position7 = new Position(640, 1968, PIXEL);\r\n final Position center7 = new Position(576, 1920, PIXEL);\r\n baseLocations.add(new BaseLocation(position7, center7, 9000, 5000, true, false, false));\r\n\r\n final Position position8 = new Position(1792, 1808, PIXEL);\r\n final Position center8 = new Position(1728, 1760, PIXEL);\r\n baseLocations.add(new BaseLocation(position8, center8, 12000, 0, true, true, false));\r\n\r\n final Position position9 = new Position(2336, 560, PIXEL);\r\n final Position center9 = new Position(2272, 512, PIXEL);\r\n baseLocations.add(new BaseLocation(position9, center9, 13500, 5000, true, false, true));\r\n\r\n final Position position10 = new Position(3584, 720, PIXEL);\r\n final Position center10 = new Position(3520, 672, PIXEL);\r\n baseLocations.add(new BaseLocation(position10, center10, 9000, 5000, true, false, false));\r\n\r\n final Position position11 = new Position(544, 432, PIXEL);\r\n final Position center11 = new Position(480, 384, PIXEL);\r\n baseLocations.add(new BaseLocation(position11, center11, 13500, 5000, true, false, true));\r\n\r\n return baseLocations;\r\n }", "public Set<String> getPlayers()\n\t{\n\t\tSet<String> player = playerPieces.keySet();\n\t\treturn player;\n\t}" ]
[ "0.6583577", "0.6556866", "0.65088886", "0.6387515", "0.6367967", "0.634431", "0.6323395", "0.6322374", "0.62540334", "0.6236384", "0.6234127", "0.622238", "0.61593205", "0.6156944", "0.6128809", "0.6112506", "0.61048114", "0.610318", "0.6075071", "0.6022351", "0.59817314", "0.59542036", "0.593638", "0.59239686", "0.59141374", "0.59141374", "0.5913294", "0.5819766", "0.5814393", "0.5813894", "0.5805904", "0.5792504", "0.5784505", "0.5774888", "0.5770371", "0.57673895", "0.5755368", "0.5739905", "0.57179457", "0.57175976", "0.5716482", "0.5715938", "0.57157", "0.5705175", "0.57026047", "0.5702412", "0.5701683", "0.56999964", "0.5683321", "0.5658603", "0.56554425", "0.56550413", "0.5652424", "0.56470853", "0.5643545", "0.56401426", "0.5629166", "0.5621157", "0.56097746", "0.56092894", "0.55996835", "0.5590415", "0.55850255", "0.55671483", "0.55671483", "0.5558716", "0.55512327", "0.55494326", "0.55339026", "0.5527072", "0.55263066", "0.55258954", "0.5523362", "0.5521197", "0.55163413", "0.551545", "0.5512759", "0.5507376", "0.5506532", "0.55012655", "0.5494723", "0.5489731", "0.54892355", "0.548728", "0.5485702", "0.5484618", "0.54743415", "0.5472541", "0.54703367", "0.547024", "0.54674166", "0.54664254", "0.546113", "0.5454122", "0.54512954", "0.54512954", "0.54501355", "0.54501224", "0.5449029", "0.5434758", "0.5428473" ]
0.0
-1
/ FuncName: Draw General : the function draw the game pieces of the player on the board. Input : graphics the graghics of the frame that the drawing will be on, jPanel the panel that the drawing will be on . Output : a draw of the game pieces on the board . Run Time : O(1) because the number of pieces is a constant (16)
public void Draw (Graphics graphics, MainJPanel JPanel){ // draw the player game pieces for(Piece piece : pieces.values()) piece.Draw(graphics,JPanel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void paint(Graphics graphics){\n\n\t\tsetSize(BOARD_SIZE, BOARD_SIZE);\n\n\t\tint iWidth = getWidth();\n\t\tint iHeight = getHeight();\n\n\t\t// print the cells of the game board\n\t\tfor(int i = 0; i< BOARD_LENGTH; i+=2){\n\t\t\tfor(int j = 0; j<BOARD_LENGTH; j+=2){\n\n\t\t\t\tgraphics.setColor(BOARD_FIELD_COLOR);\n\t\t\t\tgraphics.fillRect(j * iWidth / BOARD_LENGTH, (1 + i) * iWidth / BOARD_LENGTH, iWidth / BOARD_LENGTH, iHeight / BOARD_LENGTH); \n\t\t\t\tgraphics.fillRect((1 + j) * iWidth / BOARD_LENGTH, i * iWidth / BOARD_LENGTH, iWidth / BOARD_LENGTH, iHeight / BOARD_LENGTH);\n\t\t\t}\n\t\t}\n\n\t\t// print the pieces on the gameboard\n\t\tfor(int i = 0; i<BOARD_NUM_PIECES; i++){\n\t\t\tpieces[i].getPosition().x = rowToX(pieces[i].getColumnRow().y);\n\t\t\tpieces[i].getPosition().y = colToY(pieces[i].getColumnRow().x);\n\t\t\tif (pieces[i].isVisible())\n\t\t\t\tgraphics.drawImage(\n\t\t\t\t\t\tpieces[i].getPieceIcon(), \n\t\t\t\t\t\tpieces[i].getPosition().x,\n\t\t\t\t\t\tpieces[i].getPosition().y, \n\t\t\t\t\t\tiWidth / BOARD_LENGTH, \n\t\t\t\t\t\tiHeight / BOARD_LENGTH, this);\n\n\t\t} \n\t\t// this is a square hightlighted\n\t\tif(this.okToMove){\n\t\t\tgraphics.setColor(Color.green.darker());\n\t\t\tgraphics.drawRect(pieces[pieceChosen].getPosition().x,\n\t\t\t\t\tpieces[pieceChosen].getPosition().y, BOARD_PIECE_LENGTH, BOARD_PIECE_LENGTH);\n\n\t\t\tgraphics.setColor(Color.green.brighter().brighter());\n\t\t\tgraphics.drawRect(pieces[pieceChosen].getPosition().x + 1,\n\t\t\t\t\tpieces[pieceChosen].getPosition().y + 1, BOARD_PIECE_LENGTH-2, BOARD_PIECE_LENGTH-2);\n\n\t\t\tgraphics.setColor(Color.green.darker());\n\t\t\tgraphics.drawRect(pieces[pieceChosen].getPosition().x + 2,\n\t\t\t\t\tpieces[pieceChosen].getPosition().y + 2, BOARD_PIECE_LENGTH-4, BOARD_PIECE_LENGTH-4);\n\n\t\t} \n\t}", "public abstract void drawPiece(int x, int y, Graphics g);", "@Override \r\n public void paintComponent(final Graphics theGraphics) { \r\n super.paintComponent(theGraphics); \r\n final Graphics2D g2d = (Graphics2D) theGraphics; \r\n \r\n final int width = myBoard.getWidth(); \r\n final int height = myBoard.getHeight(); \r\n g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, \r\n RenderingHints.VALUE_ANTIALIAS_ON); \r\n \r\n // draw purple game grid\r\n g2d.setColor(PURPLE); \r\n for (int i = 0; i < Math.max(width, height); i++) { \r\n final int lines = i * GRID_SIZING; \r\n \r\n //draws horizontal lines\r\n g2d.draw(new Line2D.Double(lines, ZERO, lines, height * GRID_SIZING));\r\n \r\n //draws vertical lines\r\n g2d.draw(new Line2D.Double(ZERO, lines, width * GRID_SIZING, lines));\r\n \r\n if (myBoard.isGameOver()) { \r\n myGameOver = true; \r\n myGamePaused = true; \r\n }\r\n } \r\n \r\n //update blocks\r\n drawCurrentPiece(g2d, height, width);\r\n drawFrozenBlocks(g2d, height, width);\r\n handlePausedGame(g2d);\r\n }", "public void drawPiece(Graphics g){\n if (current == null){\n return;\n }\n\n for (int y = 1; y < 21; y++){\n for (int x = 1; x < 13; x++){\n if (map[x][y]){\n g.setColor(colors[x][y]);\n g.fillRoundRect(26 * x - 13, 26 * (21 - y) - 13, 25, 25, 2, 2);\n }\n }\n }\n }", "@Override\n\tpublic void paint(Graphics g) {\n\t\tsuper.paint(g);\t\t\t\t\t\t\t\t\t// If this method is reimplemented, super.paint(g) should be called so that lightweight components are properly rendered.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// If a child component is entirely clipped by the current clipping setting in g, paint() will not be forwarded to that child.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// from http://docs.oracle.com/javase/7/docs/api/java/awt/Container.html#paint(java.awt.Graphics)\n\t\t\n\t\tif (newGame) newGoGame();\t\t\t\t\t\t// if new go game: setup goBoard array, goHistory, black player first\n\t\tif (checkWin) \t\t\t\t\t\t\t\t\t// if checkWin is true - check to see if the last move was a win\n\t\t\tif ((k=gameWin())!=0) {\n\t\t\t\tif (k==1)\n\t\t\t\t\tJOptionPane.showMessageDialog(this, \"White player has won!\", \"Gomoku Winner\", JOptionPane.PLAIN_MESSAGE);\n\t\t\t\telse \n\t\t\t\t\tJOptionPane.showMessageDialog(this, \"Black player has won!\", \"Gomoku Winner\", JOptionPane.PLAIN_MESSAGE);\n\t\t\t\tnewGoGame();\n\t\t\t}\n\t\t\n\t\t// Draw Background Image, depending on the index of bgNum\n\t\tg.drawImage(imgBackground[bgNum], 0, 54, Color.BLACK, null); // 44\n\t\t\n\t\t// Draw Grid\n\t\tg.setColor(Color.BLACK);\n\t\tfor (i=0; i<525; i+=35) {\t\t\t\t\t\t// 15x15 grid - 35 pixels per side - offset by 75 pixels on x, 75 pixels on y\n\t\t\tg.drawLine(75, 75+i, 565, 75+i);\t\t// draws horizontal lines\n\t\t\tg.drawLine(75+i, 75+0, 75+i, 565); \t// draws vertical lines\n\t\t} // end loop for drawing lines\n\t\t\n\t\t// draw pieces on board\n\t\tfor (i=0; i<15; ++i) {\n\t\t\tfor (j=0; j<15; ++j) {\n\t\t\t\tif ((k=goBoard[i][j])!=0) {\n\t\t\t\t\tif (k==1) { g.setColor(Color.WHITE); g.fillOval(61+(i*35),62+(j*35),30,30); }\n\t\t\t\t\telse { g.setColor(Color.BLACK); g.fillOval(61+(i*35),62+(j*35),30,30); }\n\t\t\t\t} // end if goBoard\n\t\t\t} // end j - inner loop for drawing game pieces\n\t\t} // end i - outer loop for drawing game pieces\n\n\t\t\n\t\t// To Do list\n\t\t// Check move - 5 in a row - (not with stack, but with int Array)\n\n\t\t\n\t}", "public void paint(Graphics g){\r\n super.paintComponent(g);\r\n for(int row = 0; row < 8; row++) {\r\n for (int col = 0; col < 8; col++) {\r\n if((row % 2 == 0 && col % 2 == 0) || (row % 2 != 0 && col % 2 != 0)){\r\n g.setColor(Color.gray.brighter()); //pale yellow\r\n g.fillRect(col * tileSize, row * tileSize, tileSize, tileSize);\r\n }\r\n else{\r\n g.setColor(Color.gray.darker()); //dark brown\r\n g.fillRect(col * tileSize, row * tileSize, tileSize, tileSize);\r\n if ((currentPlayer.getColor()==checks[row][col])) {\r\n g.setColor(Color.darkGray.darker());\r\n g.fillRect(col * tileSize, row * tileSize, tileSize, tileSize);\r\n }\r\n if (this.nextMove[row][col] == 1) {\r\n g.setColor(Color.getHSBColor(98,70,43));\r\n g.fillRect(col * tileSize, row * tileSize, tileSize, tileSize);\r\n }\r\n if (this.checks[row][col] != 0) {\r\n if (this.checks[row][col] == WHITE) {\r\n drawPiece(row, col, g, Color.yellow.brighter());\r\n if (row == 7)\r\n g.drawImage(crownImage, (col * tileSize)+6, (row * tileSize) + 6, tileSize - 12, tileSize - 12, null);\r\n }\r\n else{\r\n drawPiece(row, col, g, Color.black);\r\n if (row == 0)\r\n g.drawImage(crownImage, (col * tileSize)+6, (row * tileSize) + 6, tileSize - 12, tileSize - 12, null);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if(isOver && isGame){\r\n gameOverDisplay(g);\r\n }\r\n }", "@Override\n\tpublic void paintComponent(Graphics g)\n\t{\n\t\tsuper.paintComponent(g);\n\t\t//Draw the board and the table\n\t\tif (isTableVisible) {\n\t\t\tdrawBackground(this, g, gameInstance);\n\t\t}\n\n\t\tGraphics2D g2 = (Graphics2D)g;\n\t\tRenderingHints rh = new RenderingHints(RenderingHints.KEY_RENDERING,RenderingHints.VALUE_RENDER_QUALITY);\n\t\tg2.setRenderingHints(rh);\n\t\tg2.setTransform(boardToScreenTransformation);\n\t\tdrawPlayerIcons(this, g, gameInstance);\n\t\t//Draw all player related information\n\t\tdrawPlayerPositions(this, g, gameInstance, player, infoText);\n\n\t\t//Draw all objects not in some private area\n\t\tObjectFunctions.getDrawOrder(gameInstance, ial);\n\t\toiList.clear();\n\t\tgameInstance.getObjects(oiList);\n\t\tArrayList<ObjectInstance> drawableObjects = new ArrayList<>();\n\t\tCheckFunctions.drawableObjectsOnTable(oiList, drawableObjects);\n\t\tdrawableObjects.sort(ObjectFunctions.objectInstanceDrawValueComparator);\n\t\tial.clear();\n\t\tObjectFunctions.addObjectListToIdList(drawableObjects, ial);\n\t\tdrawObjectsFromList(this,g,gameInstance,player, ial);\n\n\t\t//Draw selection rectangle\n\t\tdrawSelection(this, g, player);\n\n\t\t//Draw Private Area\n\t\tif (!player.visitor) {\n\t\t\tdrawPrivateArea(this, g);\n\t\t}\n\n\n\t\tAffineTransform tmp = g2.getTransform();\n\t\tg2.setTransform(boardToScreenTransformation);\n\n\t\t//Redraw selected objects not in some private area\n\t\tial.clear();\n\t\tIntegerArrayList selectedObjects = new IntegerArrayList();\n\t\tObjectFunctions.getSelectedObjects(gameInstance, selectedObjects);\n\t\tfor (int id : selectedObjects){\n\t\t ial.addUnique(id);\n\t\t\tObjectFunctions.getAllAboveLyingObjects(gameInstance, player, gameInstance.getObjectInstanceById(id), ial2);\n ial.addUnique(ial2);\n\t\t}\n\t\tObjectFunctions.sortByDrawValue(gameInstance, ial);\n\t\t//ArrayUtil.unifySorted(ial);\n\t\tdrawObjectsFromList(this, g, gameInstance, player, ial, ial2);\n\n\n\t\t//Draw objects in private area\n\t\tif (!player.visitor && privateArea.zooming != 0) {\n\t\t\tdrawTokensInPrivateArea(this, g, gameInstance, player, hoveredObject);\n\t\t}\n\n\n\t\tg2.setTransform(tmp);\n\n\t\t//Draw debug informations\n\t\tif (isDebug) {\n\t\t\tDrawFunctions.drawDebugInfo(this, g2, gameInstance, player);\n\t\t}\n\t\tif (show_ping) {\n\t\t\tg2.drawString(\"Last Signal\", getWidth() - 100, 80);\n\t\t\tfor (int i = 0; i < gameInstance.getPlayerCount(); ++i)\n\t\t\t{\n\t\t\t\tPlayer pl = gameInstance.getPlayerByIndex(i);\n\t\t\t\tg2.drawString(pl.getName() + \" \" + ((System.nanoTime() - pl.lastReceivedSignal) / 100000000) / 10f, getWidth() - 100, 100 + 20 * i);\n\t\t\t}\n\t\t}\n\t}", "public void paintComponent(Graphics g) {\r\n\t\t((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\r\n\t\tg.setColor(Color.WHITE);\r\n\t\tg.clearRect(0, 0, getWidth(), getHeight());\r\n\t\t\r\n\t\t//Drawn the board\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\tif (board[i][j] != -1) {\r\n\t\t\t\t\tint x = (int) (getWidth() / 2 - WIDTH / 2 + 4 * SPACE / 2 - DIAMETER / 2) + (j * SPACE - i * SPACE / 2);\r\n\t\t\t\t\tint y = (int) ((getHeight() / 2 - HEIGHT / 2) + (i * SPACE * Math.sqrt(3) / 2));\r\n\t\t\t\t\tg.setColor(Color.BLACK);\r\n\t\t\t\t\tg.fillOval(x - BORDER, y - BORDER, DIAMETER + 2 * BORDER, DIAMETER + 2 * BORDER);\r\n\t\t\t\t\t// 0 = empty position\r\n\t\t\t\t\tif (board[i][j] == 0)\r\n\t\t\t\t\t\tg.setColor(Color.LIGHT_GRAY);\r\n\t\t\t\t\t// 1-6 player positions\r\n\t\t\t\t\telse if (board[i][j] == 1)\r\n\t\t\t\t\t\tg.setColor(Color.RED);\r\n\t\t\t\t\telse if (board[i][j] == 2)\r\n\t\t\t\t\t\tg.setColor(Color.ORANGE);\r\n\t\t\t\t\telse if (board[i][j] == 3)\r\n\t\t\t\t\t\tg.setColor(Color.YELLOW);\r\n\t\t\t\t\telse if (board[i][j] == 4)\r\n\t\t\t\t\t\tg.setColor(Color.GREEN);\r\n\t\t\t\t\telse if (board[i][j] == 5)\r\n\t\t\t\t\t\tg.setColor(Color.BLUE);\r\n\t\t\t\t\telse if (board[i][j] == 6)\r\n\t\t\t\t\t\tg.setColor(Color.MAGENTA.darker());\r\n\t\t\t\t\tg.fillOval(x, y, DIAMETER, DIAMETER);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Display the current player\r\n\t\tg.setColor(Color.BLACK);\r\n\t\tg.setFont(g.getFont().deriveFont(Font.PLAIN, 32));\r\n\t\tg.drawString(\"Current player: \" + (turn), 5, 36);\r\n\t\tg.drawString(\"Total Turns: \" + (totalTurn), 5, 76);\r\n\t}", "private void drawStuff() {\n //Toolkit.getDefaultToolkit().sync();\n g = bf.getDrawGraphics();\n bf.show();\n Image background = window.getBackg();\n try {\n g.drawImage(background, 4, 24, this);\n\n for(i=12; i<264; i++) {\n cellKind = matrix[i];\n\n if(cellKind > 0)\n g.drawImage(tile[cellKind], (i%12)*23-3, (i/12)*23+17, this);\n }\n\n drawPiece(piece);\n drawNextPiece(pieceKind2);\n\n g.setColor(Color.WHITE);\n g.drawString(\"\" + (level+1), 303, 259);\n g.drawString(\"\" + score, 303, 339);\n g.drawString(\"\" + lines, 303, 429);\n\n } finally {bf.show(); g.dispose();}\n }", "public void paint(Graphics g) {\n int rad = 30;\n int x = border;\n int y = border;\n size = 400/n;\n\n for (int i = 0; i < n; i++) {\n y = i * size + border;\n for (int j = 0; j < n; j++) {\n x = j * size + border;\n int z = matrix[i][j].getColor();\n\n if (matrix[i][j].isClicked()) {\n setRectColor(g, z); \n }\n\n else {\n g.setColor(Color.white);\n }\n\n g.fillRect(x, y, size, size);\n g.setColor(Color.black);\n g.drawRect(x, y, size, size);\n\n if (matrix[i][j].isDot()) {\n setDotColor(g, z);\n drawCircle(g, x, y, rad);\n }\n }\n }\n\n if (isOver()==true) { //Draw win screen if entire board is filled\n g.setColor(Color.white);\n g.fillRect(70, 70, 300, 225);\n g.setColor(Color.black);\n g.drawRect(70, 70, 300, 225);\n \n youWin(g, 110, 160, game.getMoves());\n }\n\n\n }", "public void draw(Graphics g, Dimension winSize) {\n\t\t\n\t\tfor (int i = 0; i < dimensions.x; ++i) {\n\t\t\tfor (int j = 0; j < dimensions.y; ++j) {\n\t\t\t\tg.setColor(Color.getHSBColor(.5f, .5f, .5f));\n\t\t\t\tg.fillRect(i*Square.Size, j*Square.Size, Square.Size, Square.Size);\n\t\t\t\tg.setColor(Color.BLACK);\n\t\t\t\tg.drawRect(i*Square.Size, j*Square.Size, Square.Size, Square.Size);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fill selected square\n\t\tg.setColor(Color.CYAN);\n\t\tRectangle r = highlightedSquare.getBoundingRect(); \n\t\tg.fill3DRect(r.x, r.y, r.width, r.height, true);\n\t\t\n\t\t// Draw pieces - delegated to square class\n\t\tfor (int i = 0; i < dimensions.x; ++i) {\n\t\t\tfor (int j = 0; j < dimensions.y; ++j) {\n\t\t\t\tboard[i][j].draw(g);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\n public String[] draw() {\n Piece[][] pieces = solver.getSolution();\n int height = pieces.length;\n int width = pieces[0].length;\n char[][] board = new char[height * 4][width * 4 + 1];\n int totalPieces = pieces.length * pieces[0].length;\n int countPieces = 0;\n // run through each piece and add it to the temp board\n for (int i = 0; i < height; i++) {\n for (int j = 0; j < width; j++) {\n countPieces++;\n Piece curPiece = pieces[i][j];\n int tempHeight = i * 4 + 1;\n int tempWidth = j * 4 + 2;\n if (curPiece == null) {\n board[tempHeight][tempWidth] = EMPTY;\n board[tempHeight][tempWidth + 1] = EMPTY;\n board[tempHeight][tempWidth + 2] = EMPTY;\n board[tempHeight + 1][tempWidth] = EMPTY;\n board[tempHeight + 1][tempWidth + 1] = EMPTY;\n board[tempHeight + 1][tempWidth + 2] = EMPTY;\n board[tempHeight + 2][tempWidth] = EMPTY;\n board[tempHeight + 2][tempWidth + 1] = EMPTY;\n board[tempHeight + 2][tempWidth + 2] = EMPTY;\n Arrays.fill(board[tempHeight + 3], EMPTY);\n } else {\n char[][] displayPiece = pieceToDisplay(curPiece);\n\n board[tempHeight][tempWidth] = displayPiece[0][0];\n board[tempHeight][tempWidth + 1] = displayPiece[0][1];\n board[tempHeight][tempWidth + 2] = displayPiece[0][2];\n board[tempHeight + 1][tempWidth] = displayPiece[1][0];\n board[tempHeight + 1][tempWidth + 1] = displayPiece[1][1];\n board[tempHeight + 1][tempWidth + 2] = displayPiece[1][2];\n board[tempHeight + 2][tempWidth] = displayPiece[2][0];\n board[tempHeight + 2][tempWidth + 1] = displayPiece[2][1];\n board[tempHeight + 2][tempWidth + 2] = displayPiece[2][2];\n Arrays.fill(board[tempHeight + 3], EMPTY);\n }\n }\n }\n\n // convert the completed char[][] to the final string[]\n return finalBoard(board, totalPieces, totalPieces - countPieces);\n }", "public void paintComponent(Graphics g) {\n\t\t\tsuper.paintComponent(g);\n\t\t\tif (image == null) return;\n\t\t\t((Graphics2D) g).setStroke(new BasicStroke(4)); // thick border\n\t\t\tcreatePieces();\n\t\t\t// Lay out the pieces in a matrix.\n\t\t\tint c = 0, r = 0;\n\t\t\tfor (int p = 0; p < order.size(); p++) {\n\t\t\t\t// Piece image.\n\t\t\t\tCvMat piece = pieces.get(order.get(p));\n\t\t\t\tg.drawImage(piece.asIplImage().getBufferedImage(), c * pieceWidth, r * pieceHeight, null);\n\t\t\t\t// Border (green if selected).\n\t\t\t\tif (p == selected) {\n\t\t\t\t\tg.setColor(Color.green);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t}\n\t\t\t\tg.drawRect(c * pieceWidth, r * pieceHeight, pieceWidth - 2, pieceHeight - 2);\n\t\t\t\t// Advance column, and maybe row.\n\t\t\t\tc++;\n\t\t\t\tif (c == pcols) {\n\t\t\t\t\tc = 0;\n\t\t\t\t\tr++;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private void doDrawing(Graphics g) {\n Dimension size = getSize();\n//paint all the shapes that have been dropped to the bottom \n int boardTop = (int) size.getHeight() - BOARD_HEIGHT * squareHeight();\n\n for (int i = 0; i < BOARD_HEIGHT; ++i) {\n\n for (int j = 0; j < BOARD_WIDTH; ++j) {\n// access all the squares that were stored in the board array\n Tetrominoe shape = shapeAt(j, BOARD_HEIGHT - i - 1);\n\n if (shape != Tetrominoe.NoShape) {\n \n drawSquare(g, 0 + j * squareWidth(),\n boardTop + i * squareHeight(), shape);\n }\n }\n }\n//paint the falling piece\n if (curPiece.getShape() != Tetrominoe.NoShape) {\n\n for (int i = 0; i < 4; ++i) {\n\n int x = curX + curPiece.x(i);\n int y = curY - curPiece.y(i);\n drawSquare(g, 0 + x * squareWidth(),\n boardTop + (BOARD_HEIGHT - y - 1) * squareHeight(),\n curPiece.getShape());\n }\n }\n }", "private void draw(Graphics2D g)\r\n\t{\t\t\r\n\t\tColor[] cols = new Color[] {Color.red,Color.green,Color.blue};\r\n\t\t\r\n\t\t// clear the background\r\n\t\tg.setColor(Color.black);\r\n\t\tg.fillRect(0,0,640,510);\r\n\t\t\r\n\t\tg.translate(0,30);\t\r\n\r\n\t\tif (zp < 0) {\r\n\t\t\tdrawBall(g);\r\n\t\t} \r\n\r\n\t\tColor[] colMap = new Color[16];\r\n\t\tcolMap[3] = Color.white;\r\n\t\tcolMap[12] = cols[(timers[0] / 100) % 3];\r\n\t\tcolMap[13] = Color.black;\r\n\t\tcolMap[14] = Color.gray;\r\n\t\tcolMap[15] = Color.yellow;\r\n\t\t\r\n\t\tfor (int x=0;x<30;x++) {\r\n\t\t\tfor (int y=0;y<30;y++) {\r\n\t\t\t\tint tile = getTile(x,y);\r\n\t\t\t\tif (tile != 0) {\r\n\t\t\t\t\tPolygon p = new Polygon();\r\n\r\n\t\t\t\t\tint total = addPoint(x,y,p);\r\n\t\t\t\t\ttotal += addPoint(x+1,y,p);\r\n\t\t\t\t\ttotal += addPoint(x+1,y+1,p);\r\n\t\t\t\t\ttotal += addPoint(x,y+1,p);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (total == 4) {\r\n\t\t\t\t\t\tif ((tile == 11) && (!controls[19])) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ((tile == 13) && (toggles > 0)) {\r\n\t\t\t\t\t\t\ttile = 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tColor col = cols[l % 3];\r\n\t\t\t\t\t\tif ((x+y) % 2 == 0) {\r\n\t\t\t\t\t\t\tcol = cols[l % 3].darker();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (colMap[tile] != null) {\r\n\t\t\t\t\t\t\tcol = colMap[tile];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tg.setColor(col);\r\n\t\t\t\t\t\tg.fillPolygon(p);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (tile > 10) {\r\n\t\t\t\t\t\t\tg.setColor(Color.darkGray);\r\n\t\t\t\t\t\t\tif (tile == 11) {\r\n\t\t\t\t\t\t\t\tg.setColor(col.darker());\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tg.fillPolygon(p);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tPolygon p2 = new Polygon();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\taddPoint(x+0.1,y+0.1,p2);\r\n\t\t\t\t\t\t\taddPoint(x+0.9,y+0.1,p2);\t\t\t\t\r\n\t\t\t\t\t\t\taddPoint(x+0.9,y+0.9,p2);\t\t\t\t\r\n\t\t\t\t\t\t\taddPoint(x+0.1,y+0.9,p2);\r\n\t\r\n\t\t\t\t\t\t\tg.setColor(col);\r\n\t\t\t\t\t\t\tg.fillPolygon(p2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (zp >= 0) {\r\n\t\t\tdrawBall(g);\r\n\t\t}\r\n\t\t\r\n\t\tg.setColor(Color.black);\r\n\t\tg.fillRect(0,-20,640,45);\r\n\t\tg.setColor(Color.darkGray);\r\n\t\tg.drawLine(0,25,640,25);\r\n\t\tg.setFont(g.getFont().deriveFont(Font.BOLD, 20.0f));\t\r\n\t\tg.setPaint(new GradientPaint(0,20,Color.green,0,0,Color.white));\r\n\t\t\r\n\t\tg.drawString(\"Time: \"+(timers[0]/1000),530,20);\r\n\t\tg.drawString(\"Ball\",20,20);\r\n\t\t\r\n\t\tg.setPaint(new GradientPaint(0,20,Color.yellow,0,0,Color.white));\r\n\t\tg.drawString(msg,(640-g.getFontMetrics().stringWidth(msg))/2,20);\r\n\t\t\r\n\t\tif (!started) {\r\n\t\t\tang += 0.01f;\r\n\t\t\tg.drawString(\"Cursors - Move PgUp/PgDown - View Space - Jump\",60,470);\r\n\t\t}\r\n\t}", "private void drawBoard(int N) {\n\t\tfor (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n if ((i + j) % 2 == 0) StdDrawPlus.setPenColor(StdDrawPlus.GRAY);\n else StdDrawPlus.setPenColor(StdDrawPlus.BLACK);\n StdDrawPlus.filledSquare(i + .5, j + .5, .5);\n StdDrawPlus.setPenColor(StdDrawPlus.WHITE);\n }\n }\n\n if (hasSelected) {\n StdDrawPlus.setPenColor(StdDrawPlus.WHITE);\n \tStdDrawPlus.filledSquare(prevSelectedX + .5, prevSelectedY + .5, .5);\n }\n\n // Drawing pieces\n for (int x = 0; x < 8; x++) {\n \tfor (int y = 0; y < 8; y++) {\n \t\tPiece p = pieceAt(x, y);\n \t\tif (p != null) {\n\t \t\t\tif (p.isFire() && p.isShield() && !p.isKing()) {\n\t \t\t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/shield-fire.png\", 1, 1);\n\t \t\t\t}\n\t \t\t\telse if (p.isFire() && p.isBomb() && !p.isKing()) {\n\t \t\t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/bomb-fire.png\", 1, 1);\n\t \t\t\t}\n\t \t\t\telse if (!p.isFire() && p.isBomb() && !p.isKing()) {\n\t \t\t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/bomb-water.png\", 1, 1);\n\t \t\t\t}\n\t \t\t\telse if (!p.isFire() && p.isShield() && !p.isKing()) {\n\t \t\t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/shield-water.png\", 1, 1);\n\t \t\t\t}\n\t \t\t\telse if (!p.isFire() && !p.isKing()) {\n\t \t\t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/pawn-water.png\", 1, 1);\n\t \t\t\t}\n\t \t\t\telse if (p.isFire() && !p.isKing()) {\n\t \t\t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/pawn-fire.png\", 1, 1);\n\t \t\t}\n\t \t\telse if (p.isFire() && p.isBomb() && p.isKing()) {\n\t \t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/bomb-fire-crowned.png\", 1, 1);\n\t \t\t}\n\t \t\telse if (p.isFire() && p.isShield() && p.isKing()) {\n\t \t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/shield-fire-crowned.png\", 1, 1);\n\t \t\t}\n\t \t\telse if (p.isFire() && p.isKing()) {\n\t \t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/pawn-fire-crowned.png\", 1, 1);\n\t \t\t}\n\t \t\telse if (!p.isFire() && p.isBomb() && p.isKing()) {\n\t \t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/bomb-water-crowned.png\", 1, 1);\n\t \t\t}\n\t \t\telse if (!p.isFire() && p.isShield() && p.isKing()) {\n\t \t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/shield-fire-crowned.png\", 1, 1);\n\t \t\t}\n\t \t\telse if (!p.isFire() && p.isKing()) {\n\t \t\t\tStdDrawPlus.picture(x + .5, y + .5, \"img/pawn-water-crowned.png\", 1, 1);\n\t \t\t}\n\t \t}\n \t}\n }\n\t}", "@Override\n public void paint(Graphics g) {\n g.setColor(Color.white);\n g.fillRect(0, 0, getWidth(), getHeight() );\n\n for (PieceUI pieceUI : pieceUIList) {\n pieceUI.draw(g);\n }\n\n g.drawImage(trapeze.getTrapezeView(), 200, 400, null);\n }", "@Override\n public void paintComponent(Graphics g){\n // Paint the well\n g.setColor(Color.DARK_GRAY);\n g.fillRoundRect(0, 0, 338, 546, 8, 8);\n\n for (int i = 1; i < 21; i++){\n for (int j = 1; j < 13; j++){\n g.setColor(Color.BLACK);\n g.fillRoundRect(26 * j - 13, 26 * i - 13, 25, 25, 2, 2);\n }\n }\n\n drawPiece(g);\n }", "protected void paintComponent(Graphics g) {\n super.paintComponent(g);\n // draw all piles and the remaining cards left in the deck\n for (int i = 0; i < mainPiles.length; i++) {\n mainPiles[i].draw(g);\n }\n for (int i = 0; i < suitPiles.length; i++) {\n suitPiles[i].draw(g);\n }\n deckPile.draw(g);\n deck.draw(g);\n \n if (selectedPile != null) {\n selectedPile.draw(g);\n }\n }", "public void paintComponent(final Graphics the_graphics)\n {\n super.paintComponent(the_graphics);\n final Graphics2D g2d = (Graphics2D) the_graphics;\n g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, \n RenderingHints.VALUE_ANTIALIAS_ON);\n g2d.setFont(my_font);\n g2d.setColor(Color.WHITE);\n g2d.setStroke(new BasicStroke(STROKE_SIZE));\n g2d.drawString(PIECE_STRING, (getWidth() / (STROKE_SIZE * STROKE_SIZE)) - \n (PIECE_STRING.length() / STROKE_SIZE), (int) (getHeight() * LABEL_STARTING_Y));\n \n for (int y = Piece.NUMBER_OF_BLOCKS - 1; 0 <= y; y--) \n {\n for (int x = 0; x < Piece.NUMBER_OF_BLOCKS; x++) \n {\n for (int i = 0; i < Piece.NUMBER_OF_BLOCKS; i++) \n {\n final Point block = my_board.nextPiece().blocks()[i];\n if (block.x() == x && block.y() == y) \n {\n g2d.setColor(my_board.nextPiece().color());\n g2d.fill(new Rectangle2D.Double((x * getWidth() * BLOCK_SIZE_CONSTANT) + \n (int) (getWidth() * BLOCK_STARTING_X), (getHeight() / 2) + \n (float) (getWidth() * BLOCK_SIZE_CONSTANT) - (y * getWidth() * \n BLOCK_SIZE_CONSTANT), getWidth() * BLOCK_SIZE_CONSTANT, getWidth() * \n BLOCK_SIZE_CONSTANT));\n g2d.setColor(Color.DARK_GRAY);\n g2d.draw(new Rectangle2D.Double((x * getWidth() * BLOCK_SIZE_CONSTANT) + \n (int) (getWidth() * BLOCK_STARTING_X), (getHeight() / 2) + \n (float) (getWidth() * BLOCK_SIZE_CONSTANT) - (y * getWidth() * \n BLOCK_SIZE_CONSTANT), getWidth() * BLOCK_SIZE_CONSTANT, getWidth() * \n BLOCK_SIZE_CONSTANT));\n } \n }\n }\n }\n }", "private void drawObjects(Graphics g) {\n\n g.setColor(Color.white);\n g.fillRect(0,0,WIDTH,HEIGHT);\n\n Player player = physics.getPlayer();\n\n\n\n ArrayList<Sprite> sprites = physics.getSprites();\n for( Sprite p: sprites){\n if (p.isVisible()) {\n g.drawImage(p.getImage(), p.getX() - scroll, p.getY(),\n this);\n }\n }\n\n if (player.isVisible()) {\n g.drawImage(player.getImage(), player.getX() - scroll, player.getY(),\n this);\n }\n Font font = new Font(\"Helvetica\", Font.BOLD, 30);\n FontMetrics fm = getFontMetrics(font);\n\n g.setColor(Color.black);\n g.setFont(font);\n g.drawString(Integer.toString(physics.playerScore),5, 25);\n }", "@Override\n\tprotected void draw(Graphics2D g) {\n\t\tint medidaLado = GenericGame.getMedidaLado();\n\t\t\n\t\tfor (int i = 0; i <Juego.FILAS; i++) {\n\t\t\tg.setColor(Color.BLACK);\n\t\t\tg.drawLine(0, medidaLado*i,GenericGame.Width,medidaLado*i);\n\t\t\tg.setColor(Color.BLACK);\n\t\t\tg.drawString(\"\"+i, 5, 30 + medidaLado*i);\n\t\t}\n\t\t\n\t\tfor (int j = 0; j < Juego.COLUMNAS; j++) {\n\t\t\tg.setColor(Color.BLACK);\n\t\t\tg.drawLine(medidaLado*j,0, medidaLado*j,GenericGame.Height);\n\t\t\tg.setColor(Color.BLACK);\n\t\t\tg.drawString(\"\"+j, medidaLado*j, 30);\n\t\t}\n\t\t///\n\t\t//System.out.println(\"MATRIZ TABLERO \"+matrizTablero.length+\"_\" +matrizTablero[0].length);\n\t\t///game compoente\n\t\tint i = 0;\n\t\tfor (; i < matrizTablero.length; i++) \n\t\t{\n\t\t\n\t\t\tfor (int j = 0; j < matrizTablero[0].length; j++) \n\t\t\t{\n\t\t\t\t//System.out.print(\"[i\"+i+\",j\"+j);\n\t\t\t\t//System.out.print(\"- ip\"+(i*medidaLado)+\", jp\"+(j*medidaLado)+\"]\");\n\t\t\t\tif (matrizTablero[i][j] != 0) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tg.setColor(new Color( matrizTablero[i][j]));\t\t\t\t\t\n\t\t\t\t\tg.fillRect(j*medidaLado, i*medidaLado, medidaLado, medidaLado);\n\t\t\t\t\t\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.drawRect(j*medidaLado, i*medidaLado, medidaLado, medidaLado);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t//\tSystem.out.println();\n\t\t}\n\t\t///game compoente\n\t\t//System.out.println(\"I\"+i);\n\t\t\n\t}", "public static void main( String[] args ) {\n for( int i = 0; i < 8; i++ ){\n for( int i1 = 0; i1 < 8; i1++ ){\n gamepieces[i][i1] = BACKGROUND_COLOR;\n }\n }\n //setup initial center game pieces\n gamepieces[3][3] = Color.WHITE;\n gamepieces[4][4] = Color.WHITE;\n gamepieces[3][4] = Color.BLACK;\n gamepieces[4][3] = Color.BLACK;\n gameFrame.setTitle( \"Othello\" );\n //make sure the process exits when window is closed\n gameFrame.setDefaultCloseOperation( WindowConstants.EXIT_ON_CLOSE );\n //make a pane to display everything in\n JPanel pane = new JPanel(){\n @Override\n protected void paintComponent( Graphics g ){\n super.paintComponent(g);\n //draw the game board\n drawGameboard( g );\n //draw individual game pieces\n g.setColor( Color.BLACK );\n for( int row = 0; row < 8; row++){\n for( int column = 0; column < 8; column ++ ){\n if (gamepieces[ row ][ column ] == BACKGROUND_COLOR && isMoveValid(row, column)) {\n //show available moves\n drawGamePiece( g, row, column, Color.BLUE );\n }else {\n drawGamePiece(g, row, column, gamepieces[row][column]);\n }\n }\n }\n }\n };\n\n pane.addMouseListener( new MouseListener(){\n final ActionListener aiMove = new ActionListener(){\n public void actionPerformed(ActionEvent e) {\n //we don't need to do this more than once in a row; stop the timer\n timer.stop();\n //get all the available moves\n ArrayList<Point> possibleMoves = getCurrentlyValidMoves();\n canLastPlayerMove = false;\n try {\n //check if we can move\n if( possibleMoves.size() == 0 ){\n return;\n }\n //make an array to store the best moves available\n ArrayList<Point> bestMoves = new ArrayList<Point>();\n //the lower the level, the higher priority is assigned to the move\n //a move of level 10 is the absolute lowest\n //this heuristic follows the strategy I use, omitting situation-specific content\n int level = 10;\n for (Point p : possibleMoves) {\n int x = (int) p.getX();\n int y = (int) p.getY();\n if ((x == 0 || x == 7) && (y == 0 || y == 7)) {\n if (level > 0) {\n bestMoves.clear();\n level = 0;\n }\n bestMoves.add( p );\n } else if (level >= 1 && (x == 0 || y == 0 || x == 7 || y == 7)) {\n if (level > 1) {\n bestMoves.clear();\n level = 1;\n }\n bestMoves.add( p );\n } else if (level >= 2 && (x > 2 && x < 6 && y > 2 && y < 6)) {\n if ( level > 2) {\n bestMoves.clear();\n level = 2;\n }\n bestMoves.add( p );\n } else if (level >= 3 && x != 1 && x != 6 && y != 1 && y != 6) {\n if (level > 3) {\n bestMoves.clear();\n level = 3;\n }\n bestMoves.add(p);\n } else if (level >= 4) {\n bestMoves.add(p);\n }\n }\n //for debugging purposes, output the level of move chosen by the ai\n System.out.println(level);\n //select a random move from the pool of best moves\n Point move = bestMoves.get((int) (Math.random() * bestMoves.size()));\n int aix = (int) move.getX();\n int aiy = (int) move.getY();\n //move there\n attemptMove(aix, aiy);\n gamepieces[aix][aiy] = currentPlayer;\n //the ai moved, so this is true\n canLastPlayerMove = true;\n } finally { //if the ai moved or if it didn't\n //change the player\n currentPlayer = Color.WHITE;\n gameFrame.repaint();\n //if the human player has no moves left\n if( getCurrentlyValidMoves().size() == 0 ){\n if( canLastPlayerMove ){ //... and the ai could move\n //switch players, enable the ai to move again in 1 second\n currentPlayer = Color.BLACK;\n timer.start();\n }else{ //... and the ai couldn't move\n gameOver();\n }\n }\n }\n }\n };\n //timer allows the ai to move 1 second after the player\n private final Timer timer = new Timer( 1000, aiMove );\n\n public void mouseClicked(MouseEvent e) {\n\n }\n\n //mousePressed is used to avoid clicks not registering if the mouse is moving\n public void mousePressed(MouseEvent e) {\n //transpose the coordinates to the gameboard (each tile is 100x100 px)\n int x = (int)(e.getX() * 0.01 );\n int y = (int)(e.getY() * 0.01 );\n //if the ai isn't moving and the move is valid\n if( !timer.isRunning() && attemptMove( x, y ) ) {\n //move there\n gamepieces[x][y] = currentPlayer;\n gameFrame.repaint();\n //switch to the ai\n currentPlayer = Color.BLACK;\n timer.start();\n //the player could move\n canLastPlayerMove = true;\n }\n }\n\n public void mouseReleased(MouseEvent e) {\n\n }\n\n public void mouseEntered(MouseEvent e) {\n\n }\n\n public void mouseExited(MouseEvent e) {\n\n }\n });\n //add the pane to the frame and set size\n gameFrame.add( pane );\n gameFrame.setSize( WINDOW_BOUNDS, WINDOW_BOUNDS );\n gameFrame.setVisible( true );\n //the insets take up room, so we have to account for them\n //this includes the draggable edges of the window, and the title bar\n Insets insets = gameFrame.getInsets();\n gameFrame.setSize( WINDOW_BOUNDS + insets.right + insets.left, WINDOW_BOUNDS + insets.top + insets.bottom );\n }", "protected BufferedImage drawBoard(BufferedImage img) {\n myGame.initTiles();\n Graphics2D g2d = img.createGraphics();\n \n //player one\n g2d.setColor(Color.RED);\n int posx1 = myGame.posX(myGame.playerPos(1));\n int posy1 = myGame.posY(myGame.playerPos(1));\n g2d.fill(new Rectangle(posx1, posy1, 20, 20));\n \n //player two\n g2d.setColor(Color.BLUE);\n int posx2 = myGame.posX(myGame.playerPos(2)) + 20;\n int posy2 = myGame.posY(myGame.playerPos(2)) + 20;\n g2d.fill(new Rectangle(posx2, posy2, 20, 20));\n \n g2d.dispose();\n return img;\n }", "public void drawGame(Graphics g) {\r\n\t\tg.drawImage(board, 0, 0, gameView);\r\n\r\n\t\tdrawSideBoard(g);\r\n\t\tdrawSideOptionPane(g);\r\n\t\tscoreToImage(gameBoard.getBlackScore(), 515, 335, g);\r\n\t\tscoreToImage(gameBoard.getRedScore(), 515, 130, g);\r\n\r\n\t\tif (!gameBoard.getMovesOnFocus().isEmpty()) {\r\n\t\t\tfor (int[] id : gameBoard.getMovesOnFocus()) {\r\n\t\t\t\tg.drawImage(highlighted, gameBoard.IDtoCoordinate(id)[0], gameBoard.IDtoCoordinate(id)[1], gameView);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tint[] id = new int[2];\r\n\t\tint[] loc;\r\n\t\tfor (int i = 0; i < gameBoard.getmBoard().length; i++) {\r\n\t\t\tfor (int j = 0; j < gameBoard.getmBoard()[0].length; j++) {\r\n\t\t\t\tid[0] = i;\r\n\t\t\t\tid[1] = j;\r\n\t\t\t\tswitch (gameBoard.getIdValue(id)) {\r\n\t\t\t\tcase GameBoardModel.CHECKER_RED:\r\n\t\t\t\t\tloc = gameBoard.IDtoCoordinate(id);\r\n\t\t\t\t\tg.drawImage(red, loc[0], loc[1], gameView);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase GameBoardModel.CHECKER_BLACK:\r\n\t\t\t\t\tloc = gameBoard.IDtoCoordinate(id);\r\n\t\t\t\t\tg.drawImage(black, loc[0], loc[1], gameView);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase GameBoardModel.CHECKER_RED_KING:\r\n\t\t\t\t\tloc = gameBoard.IDtoCoordinate(id);\r\n\t\t\t\t\tg.drawImage(red_king, loc[0], loc[1], gameView);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase GameBoardModel.CHECKER_BLACK_KING:\r\n\t\t\t\t\tloc = gameBoard.IDtoCoordinate(id);\r\n\t\t\t\t\tg.drawImage(black_king, loc[0], loc[1], gameView);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tg.drawString(String.format(\"Clock %d s\", timer.getTimeDifference()), 480 + 15, 480 / 2);\r\n\t}", "public void draw()\n\t{\n\t\tSystem.out.println(\" |-------------------------------|\");\n\t\t\n\t\tfor (int i = 0; i < board_size; i++)\n\t\t{\n\t\t\tSystem.out.print(board_size - i + \" |\");\n\t\t\t\n\t\t\tfor (int j = 0; j < board_size; j++)\n\t\t\t{\n\t\t\t\tif (getPiece(i,j) == null) {System.out.print(\" |\");}\n\t\t\t\telse {System.out.print(\" \" + getPiece(i,j).getSymbol().toChar() + \" |\");}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\" |-------------------------------|\");\n\t\t}\n\t\t\n\t\tSystem.out.println(\" A B C D E F G H \\n\");\n\t}", "public void paintComponent(Graphics g){\n super.paintComponent(g);\n g.setColor(Color.BLACK);\n g.fillRect(0,0,width*scale,height*scale);\n if(game.getWindowNum() == 2){\n for(int x = 0; x < world.length*scale; x+=scale){\n for(int y = 0; y < world[0].length*scale; y+= scale){\n if(game.getDiscoverdWorld()[x/scale][y/scale] == 1){\n if(world[x/scale][y/scale] == 0){\n g.setColor(Color.CYAN);\n }\n else if(world[x/scale][y/scale] == 1){\n g.setColor(Color.GREEN);\n }\n else if(world[x/scale][y/scale] == 2){\n g.setColor(new Color(102,66,0));\n }\n else if(world[x/scale][y/scale] == 3){\n g.setColor(new Color(105,105,105));\n }\n g.fillRect(x,y,scale,scale);\n }\n }\n }\n g.setColor(Color.RED);\n g.fillRect((int)(game.getPlayerCords()[0]*(double)scale),(int)(game.getPlayerCords()[1]*(double)scale),scale*game.getPlayerDimentions()[0],scale*game.getPlayerDimentions()[1]);\n g.setColor(Color.BLACK);\n g.drawRect((int)(game.getViewBoxCords()[0]*scale),(int)(game.getViewBoxCords()[1]*scale),(int)(game.getPlayerView().length*scale),(int)(game.getPlayerView()[0].length*scale));\n g.drawString(\"X: \"+game.getPlayerCords()[0]+\" Y: \"+game.getPlayerCords()[1],20,20);\n g.drawString(\"Seed: \"+game.getSeed(),20,40);\n g.drawString(\"Grounded: \"+game.getPlayer().getGrounded(),20,60);\n g.drawString(\"Vertical Velocity: \"+game.getPlayer().getVertVelocity(),20,80);\n }\n else if(game.getWindowNum() == 1){\n int[][] viewPlane = game.getPlayerView();\n double playerViewScale = game.getPlayerViewScale();\n double[] viewBoxCords = game.getViewBoxCords();\n g.setColor(Color.CYAN);\n for(int x = 0; x < viewPlane.length;x++){\n for(int y = 0; y < viewPlane[0].length;y++){\n if(viewPlane[x][y] != 0 && game.getDiscoverdWorld()[x+(int)viewBoxCords[0]][y+(int)viewBoxCords[1]] == 1){\n g.drawImage(textures.get(viewPlane[x][y]-1),(int)(((double)x-(viewBoxCords[0]%1))*playerViewScale),(int)(((double)y-(viewBoxCords[1]%1))*playerViewScale),this);\n /*\n if(viewPlane[x][y] == 1){\n g.setColor(Color.GREEN);\n }\n else if(viewPlane[x][y] == 2){\n g.setColor(new Color(102,66,0));\n }\n else if(viewPlane[x][y] == 3){\n g.setColor(new Color(105,105,105));\n }\n g.fillRect((int)(((double)x-(viewBoxCords[0]%1))*playerViewScale),(int)(((double)y-(viewBoxCords[1]%1))*playerViewScale),(int)(playerViewScale+0.5),(int)(playerViewScale+0.5));\n */\n }\n else if(viewPlane[x][y] == 0 && game.getDiscoverdWorld()[x+(int)viewBoxCords[0]][y+(int)viewBoxCords[1]] == 1){\n g.fillRect((int)(((double)x-(viewBoxCords[0]%1))*playerViewScale),(int)(((double)y-(viewBoxCords[1]%1))*playerViewScale),(int)(playerViewScale+1),(int)(playerViewScale+1));\n }\n }\n }\n if(recentlyHit != null){\n g.setColor(new Color(50,50,50,(int)(255*(1-recentlyHit.getHealthPercent()))));\n g.fillRect((int)(recentlyHit.getX()*playerViewScale)-(int)(viewBoxCords[0]%1*playerViewScale)+1,(int)(recentlyHit.getY()*playerViewScale)-(int)(viewBoxCords[1]%1*playerViewScale)+1,(int)playerViewScale,(int)playerViewScale);\n }\n //g.setColor(Color.RED);\n //g.fillRect((int)((game.getPlayerCords()[0]-viewBoxCords[0])*playerViewScale),(int)((game.getPlayerCords()[1]-viewBoxCords[1])*playerViewScale),(int)playerViewScale*game.getPlayerDimentions()[0],(int)playerViewScale*game.getPlayerDimentions()[1]);\n if(game.isFacingRight()){\n g.drawImage(textures.get(3),(int)((game.getPlayerCords()[0]-viewBoxCords[0])*playerViewScale),(int)((game.getPlayerCords()[1]-viewBoxCords[1])*playerViewScale),this);\n }\n else{\n g.drawImage(textures.get(4),(int)((game.getPlayerCords()[0]-viewBoxCords[0])*playerViewScale),(int)((game.getPlayerCords()[1]-viewBoxCords[1])*playerViewScale),this);\n }\n g.setColor(Color.BLACK);\n g.setFont(font2);\n g.drawString(\"X: \"+game.getPlayerCords()[0]+\" Y: \"+game.getPlayerCords()[1],20,20);\n g.drawString(\"Seed: \"+game.getSeed(),20,40);\n g.drawString(\"Grounded: \"+game.getPlayer().getGrounded(),20,60);\n g.drawString(\"Vertical Velocity: \"+game.getPlayer().getVertVelocity(),20,80);\n g.drawString(\"View Box Cords: X:\"+viewBoxCords[0]+\" Y: \"+viewBoxCords[1],20,100);\n int a = 0;\n for(Item i: game.getPlayerInventory()){\n if(i != null){\n g.drawString(i.getName()+\" Count: \"+i.getCount(),20,120+a*20);\n a++;\n }\n } \n g.setColor(new Color(100,100,100,95));\n g.fillRect((int)(0.09*viewPlane.length*playerViewScale),(int)(0.8*viewPlane[0].length*playerViewScale),(int)(0.82*viewPlane.length*playerViewScale),(int)(0.12*viewPlane[0].length*playerViewScale));\n g.setColor(Color.WHITE);\n for(int i = 0; i < game.getPlayerHotbar().length;i++){\n if(i == game.getPlayer().getHotbarItemSelected()){\n g.setColor(Color.BLACK);\n g.fillRect((int)(0.11*viewPlane.length*playerViewScale)+(int)(i*0.08*viewPlane.length*playerViewScale),(int)(0.81*viewPlane[0].length*playerViewScale),(int)(0.06*playerViewScale*viewPlane.length),(int)(0.1*viewPlane[0].length*playerViewScale));\n g.setColor(Color.WHITE);\n }\n else{\n g.fillRect((int)(0.11*viewPlane.length*playerViewScale)+(int)(i*0.08*viewPlane.length*playerViewScale),(int)(0.81*viewPlane[0].length*playerViewScale),(int)(0.06*playerViewScale*viewPlane.length),(int)(0.1*viewPlane[0].length*playerViewScale));\n }\n if(game.getPlayer().getHotbar()[i] != null){\n g.drawImage(textures.get(game.getPlayer().getHotbar()[i].getTextureNum()),(int)(0.125*viewPlane.length*playerViewScale)+(int)(i*0.08*viewPlane.length*playerViewScale),(int)(0.83*viewPlane[0].length*playerViewScale),this);\n }\n }\n if(game.isInvenVisible()){\n int rowLength = 10;\n g.setColor(new Color(100,100,100,180));\n g.fillRect((int)(0.05*screenWidth),(int)(0.06*screenHeight),(int)(0.9*screenWidth),(int)(0.7*screenHeight));\n g.setColor(Color.WHITE);\n int count = 0; \n for(Item i: game.getPlayerInventory()){\n if(i!=null){\n g.drawImage(textures.get(i.getTextureNum()),(int)(0.08*screenWidth)+(int)((count%rowLength)*0.085*screenWidth),(int)(0.085*screenHeight)+(int)((int)(count/rowLength)*0.085*screenHeight),this);\n g.drawString(\"x\"+i.getCount(),(int)(0.11*screenWidth)+(int)((count%rowLength)*0.085*screenWidth),(int)(0.096*screenHeight)+(int)((int)(count/rowLength)*0.085*screenHeight));\n count++;\n }\n }\n }\n else if(game.isCraftingVisible()){\n g.setColor(new Color(100,100,100,180));\n g.fillRect((int)(0.05*viewPlane.length*playerViewScale),(int)(0.05*viewPlane[0].length*playerViewScale),(int)(0.9*viewPlane.length*playerViewScale),(int)(0.7*viewPlane[0].length*playerViewScale));\n }\n g.setColor(Color.BLACK);\n g.drawRect((int)(screenWidth*0.8),(int)(screenHeight*.03),(int)(screenWidth*.18),(int)(screenHeight*0.04));\n g.setColor(new Color((int)(255*(1-game.getPlayerHealthPercent())),(int)(255*game.getPlayerHealthPercent()),0));\n g.fillRect((int)(screenWidth*0.8)+1,(int)(screenHeight*.03)+1,(int)(screenWidth*.18*game.getPlayerHealthPercent())-1,(int)(screenHeight*0.04)-1);\n g.setColor(new Color(50,50,50,200));\n g.setFont(font1);\n g.drawString(game.getPlayerHealthPercent()*100+\"%\",(int)(screenWidth*.88),(int)(screenHeight*0.06));\n }\n }", "public void paintComponent( Graphics page )\n {\n super.paintComponent( page );//I'll tell you later.\n player.draw( page );//calls the draw method in the Player class\n circle.draw( page );\n if (projectileInitW)\n projectileW.draw( page );\n if (projectileInitA)\n projectileA.draw( page );\n if (projectileInitS)\n projectileS.draw( page );\n if (projectileInitD)\n projectileD.draw( page );\n }", "public static void draw(int part, Graphics g) {\n \n //code goes here\n \n }", "protected synchronized void paintComponent (Graphics g)\n {\n super.paintComponent(g); \n JPanel Phil = new JPanel(); \n int width = getWidth();\n int height = getHeight();\n double x;\n double y;\n int phil_length;\n int phil_height;\n if(_panel_num==1)\n {\n phil_length = width/10;\n phil_height = height/3;\n x = width/3*1.35;\n y = height/3*1.2;\n if(_eats_status_array[0]==true)\n g.fillOval((int)x,(int)y,phil_length,phil_height);\n else\n g.fillRect((int)x,(int)y,phil_length,phil_height);\n }\n else if(_panel_num==2)\n {\n phil_length = width/3;\n phil_height = height/10;\n x = width/3;\n y = height/3*1.2;\n if(_eats_status_array[1]==true)\n g.fillOval((int)x,(int)y,phil_length,phil_height);\n else\n g.fillRect((int)x,(int)y,phil_length,phil_height);\n }\n else if(_panel_num==3)\n {\n phil_length = width/10;\n phil_height = height/3;\n x = width/6*3.42;\n y = height/4;\n if(_eats_status_array[2]==true)\n g.fillOval((int)x,(int)y,phil_length,phil_height);\n else\n g.fillRect((int)x,(int)y,phil_length,phil_height); \n x = width/6*1.92;\n y = height/4;\n if(_eats_status_array[3]==true)\n g.fillOval((int)x,(int)y,phil_length,phil_height);\n else\n g.fillRect((int)x,(int)y,phil_length,phil_height);\n }\n else \n {\n phil_length = width/3;\n phil_height = height/10;\n x = width/3;\n y = height/3*1.2;\n if(_eats_status_array[4]==true)\n g.fillOval((int)x,(int)y,phil_length,phil_height);\n else\n g.fillRect((int)x,(int)y,phil_length,phil_height);\n } \n }", "@Override public void paintComponent(Graphics g) {\n super.paintComponent(g);\n g.drawImage(board, 0, 0, null);\n \n //draw currently placed ship\n if(currentlyPlacedShip != null)\n g.drawImage(imageMap.get(currentlyPlacedShip),\n mousePosition.getX()*40, mousePosition.getY()*40, null);\n \n //draw ships and shots\n if(shotsBoard != null && shipsBoard != null) {\n for(int i = 0; i != 10; ++i)\n for(int j = 0; j != 10; ++j) {\n if(shipsBoard[i][j] != null)\n g.drawImage(imageMap.get(shipsBoard[i][j]), i*40, j*40, null);\n if(shotsBoard[i][j] == ShotField.HIT)\n g.drawImage(hit, i*40, j*40, null);\n if(shotsBoard[i][j] == ShotField.MISHIT)\n g.drawImage(mishit, i*40, j*40, null);\n }\n }\n }", "private void drawPiece(Piece piece) {\n int kind = piece.getKind() + 1;\n int pos0 = piece.getPos(0);\n int pos1 = piece.getPos(1);\n int pos2 = piece.getPos(2);\n int pos3 = piece.getPos(3);\n\n g.drawImage(tile[kind], (pos0%12)*23-3, (pos0/12)*23+17, this);\n g.drawImage(tile[kind], (pos1%12)*23-3, (pos1/12)*23+17, this);\n g.drawImage(tile[kind], (pos2%12)*23-3, (pos2/12)*23+17, this);\n g.drawImage(tile[kind], (pos3%12)*23-3, (pos3/12)*23+17, this);\n }", "private void drawPiece(int row, int col, Graphics g, Color color){\r\n ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\r\n ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\r\n g.setColor(color);\r\n g.fillOval((col*tileSize)+2, (row*tileSize)+2, tileSize-4, tileSize-4);\r\n }", "@Override\n public void paintComponent(final Graphics theGraphics) {\n super.paintComponent(theGraphics);\n final Graphics2D g2d = (Graphics2D) theGraphics;\n\n for (int i = 0; i < myDrawingArray.size(); i++) {\n final Drawing drawing = myDrawingArray.get(i);\n g2d.setPaint(drawing.getColor());\n g2d.setStroke(new BasicStroke(drawing.getWidth()));\n g2d.draw(drawing.getShape());\n }\n \n if (myCurrentShape != null) {\n g2d.setPaint(myCurrentShape.getColor());\n g2d.setStroke(new BasicStroke(myCurrentShape.getWidth()));\n g2d.draw(myCurrentShape.getShape());\n }\n \n if (myGrid) { //Paints the grid if myGrid is true.\n g2d.setStroke(new BasicStroke(1));\n g2d.setPaint(Color.GRAY);\n for (int row = 0; row < getHeight() / GRID_SPACING; row++) {\n final Line2D line = new Line2D.Float(0, GRID_SPACING + (row * GRID_SPACING),\n getWidth(), GRID_SPACING + (row * GRID_SPACING));\n g2d.draw(line);\n }\n for (int col = 0; col < getWidth() / GRID_SPACING; col++) {\n final Line2D line = new Line2D.Float(GRID_SPACING \n + (col * GRID_SPACING), 0,\n GRID_SPACING\n + (col * GRID_SPACING), getHeight());\n g2d.draw(line);\n }\n \n }\n }", "public void paint(Graphics g) {\n // Try-catch to prevent errors from being thrown, although they rarely if ever should be\n try {\n // Cast the simple Graphics object to a Graphics2D\n Graphics2D g2 = (Graphics2D) g;\n\n // Set up visibility ArrayList\n for(int i=0; i<buttonVisibilities.size(); i++) {\n buttonVisibilities.set(i, false);\n }\n\n // draw the poker table\n BufferedImage img = ImageIO.read(new File(GameLauncher.RESOURCE_ROOT+\"table.png\"));\n int tableWidth = (int)(getWidth()*0.8);\n int tableHeight = (int)(getHeight()*0.8);\n int tableX = (getWidth()-tableWidth)/2;\n int tableY = (getHeight()-tableHeight)/2;\n\n int margin=10;\n int optX=margin;\n int optY=getHeight()-50+margin;\n\n // Actually draw the image here\n g2.drawImage(img, tableX, tableY, tableWidth, tableHeight, null);\n\n // Calculate which spot the player should be located at\n // This is a fairly cool feature which prevents players from being bunched up at one end, and also\n // is implemented without any trigonometry, which I tend to avoid at all costs for these sorts of things :)\n int spotFactor=playerSpots.length/(game.getPlayerList().size());\n for(int i=0; i<game.getPlayerList().size(); i++) {\n // Get the player object\n // Player class provides a simple base class, but no instances actually are created directly\n // The only instances are those hiding under the child instances of RemotePlayer and LocalPlayer\n Player p=game.getPlayer(i);\n // If the player has lost the game or is out of the game, skip them\n if(p.hasLost()) continue;\n\n // Boolean for whether the player is the current better or not\n boolean isBetter=game.betterIndex==i;\n\n // If the current better is the local player (the one this instance of the program is controlling), then...\n if(p.getUUID().equals(GameLauncher.manager.mainPlayer.getUUID())&&isBetter&&game.gameStarted) {\n // Draw the fold button\n drawButton(\"Fold\", optX, optY, margin, g2);\n // Draw the call/check button\n if(game.currentBet!=0&&GameLauncher.manager.mainPlayer.getBet()!=game.currentBet) {\n drawButton(\"Call (\"+(game.currentBet-p.getBet())+\")\", optX+200, optY, margin, g2);\n }\n else {\n drawButton(\"Check\", optX+200, optY, margin, g2);\n }\n // Draw the raise button\n drawButton(\"Raise\", optX+400, optY, margin, g2);\n }\n\n // Calculate the current player's x-y position based on the non-trigonometric system implemented\n double[] currentPlayerSpot=playerSpots[i*spotFactor];\n int spotX=(int)(currentPlayerSpot[0]*getWidth());\n int spotY=(int)(currentPlayerSpot[1]*getHeight());\n\n // Calculate the base x and y position of the player's chips\n // Formatting is the way it is to help with editing inside IntelliJ\n int csX;\n int csY;\n if (currentPlayerSpot[0]>0.5) csX=spotX-CHIP_SPACE_X;\n else if(currentPlayerSpot[0]<0.5) csX=spotX+CHIP_SPACE_X;\n else csX=spotX;\n if (currentPlayerSpot[1]>0.5) csY=spotY-CHIP_SPACE_Y;\n else if(currentPlayerSpot[1]<0.5) csY=spotY+CHIP_SPACE_Y;\n else csY=spotY;\n Point chipSpot=new Point(csX, csY);\n // Draw the chips at the calculated position\n p.getChips().draw(chipSpot.x, chipSpot.y, (int)currentPlayerSpot[2], (int)currentPlayerSpot[3], g2);\n\n // Calculate the base card x and y position of the player's hand\n int cardSpotY=spotY;\n if (currentPlayerSpot[1]>=0.5) cardSpotY=spotY+CARD_SPACE_Y;\n else if(currentPlayerSpot[1]<0.5) cardSpotY=spotY-CARD_SPACE_Y;\n // Draw the player's hand at the calculated position\n if(!p.isFolded()) p.drawHand(spotX, cardSpotY, g2);\n\n // Calculate whether or not text should be added to the user's username\n // to show information about their role\n String addedText=\"\";\n if(p.isDealer()) addedText=\" (Dealer)\";\n if(p.getBlind()==1) addedText=\" (Little Blind)\";\n if(p.getBlind()==2) addedText=\" (Big Blind)\";\n if(p.isDealer()&&p.getBlind()==2) addedText=\" (Dealer & Big Blind)\";\n int playerFS=Font.PLAIN;\n // Make the current better's name bold\n if(isBetter&&game.gameStarted) {\n playerFS=Font.BOLD;\n }\n // Draw the calculated strings, as well as the username and the total number of chips the player has\n// drawCenteredString(p.getUsername()+addedText, spotX, spotY-10, new Font(\"Arial\", playerFS, 18), g2);\n String playerStr=p.getUsername()+addedText;\n drawCenteredString(playerStr, spotX, spotY-10, new Font(\"Arial\", playerFS, 18), g2);\n drawCenteredString(p.getChips().getTotal()+\" Chips\", spotX, spotY+10, STANDARD_FONT, g2);\n }\n // Draw server-wide variables\n // Draw current round\n if(game.gameStarted) {\n drawCenteredString(\"Round \"+game.roundCount, getWidth()/2, 30, new Font(\"Arial\", Font.PLAIN, 24), g2);\n }\n\n // Draw chip keys\n // This tells the user globally what each of the chips correspond to\n g2.drawRect(-1, CHIP_INDEX_BASE_Y-10, 100, 100);\n g2.drawImage(ChipBank.IMG_C100, 0, CHIP_INDEX_BASE_Y, ChipBank.CHIP_SIZE, ChipBank.CHIP_SIZE, null);\n g2.drawImage(ChipBank.IMG_C50, 0, CHIP_INDEX_BASE_Y+ChipBank.CHIP_SIZE, ChipBank.CHIP_SIZE, ChipBank.CHIP_SIZE, null);\n g2.drawImage(ChipBank.IMG_C25, 0, CHIP_INDEX_BASE_Y+ChipBank.CHIP_SIZE*2, ChipBank.CHIP_SIZE, ChipBank.CHIP_SIZE, null);\n g2.drawImage(ChipBank.IMG_C5, 0, CHIP_INDEX_BASE_Y+ChipBank.CHIP_SIZE*3, ChipBank.CHIP_SIZE, ChipBank.CHIP_SIZE, null);\n g2.drawImage(ChipBank.IMG_C1, 0, CHIP_INDEX_BASE_Y+ChipBank.CHIP_SIZE*4, ChipBank.CHIP_SIZE, ChipBank.CHIP_SIZE, null);\n g2.setFont(STANDARD_FONT);\n g2.drawString(\"= $100\", ChipBank.CHIP_SIZE, CHIP_INDEX_BASE_Y+ChipBank.CHIP_SIZE);\n g2.drawString(\"= $50\", ChipBank.CHIP_SIZE, CHIP_INDEX_BASE_Y+ChipBank.CHIP_SIZE*2);\n g2.drawString(\"= $25\", ChipBank.CHIP_SIZE, CHIP_INDEX_BASE_Y+ChipBank.CHIP_SIZE*3);\n g2.drawString(\"= $5\", ChipBank.CHIP_SIZE, CHIP_INDEX_BASE_Y+ChipBank.CHIP_SIZE*4);\n g2.drawString(\"= $1\", ChipBank.CHIP_SIZE, CHIP_INDEX_BASE_Y+ChipBank.CHIP_SIZE*5);\n\n // Draw the current bet\n g2.drawString(\"Current Bet: \"+game.currentBet, optX+getWidth()-200, optY+(getHeight()-optY)/2);\n\n // Draw the start game button\n if(!game.gameStarted) drawButton(\"Start Game\", 15, 15, margin, g2);\n\n // Calculate the drawn card's position\n int drawnX=getWidth()/2;\n int drawnY=getHeight()/2;\n // Draw a static hand at the calculated \"drawn\" position\n // This also draws outlines around the cards so it doesn't look like they haven't been flipped yet\n Player.drawUniversalHand(drawnX, drawnY, game.draw, true, g2);\n\n // Draws the divider for actions\n g2.setStroke(new BasicStroke(2));\n g2.drawLine(0, getHeight()-50, getWidth(), getHeight()-50);\n\n // Detects if the game is over or not\n if(game.gameOver) {\n // Get the winner's message\n String winnerUsername=\"\";\n for(Player p : game.players) {\n if(!p.hasLost()) {\n winnerUsername=p.getUsername();\n }\n }\n String winnerMessage=winnerUsername+\" wins!\";\n // If the local player won, then display \"You win!\"\n if(!GameLauncher.manager.mainPlayer.hasLost()) {\n winnerMessage=\"You win!\";\n }\n\n // Set the background\n g2.setPaint(new Color(255, 255, 255, (int)((gameOverCount/255.0)*220)));\n g2.fillRect(0, 0, getWidth(), getHeight());\n // Draw the win message\n g2.setPaint(new Color(64, 64, 64, gameOverCount));\n drawCenteredString(winnerMessage, getWidth() / 2, getHeight() / 2, new Font(\"Arial\", Font.PLAIN, 60), g2);\n // Increment the game counter to create animation\n if(gameOverCount<255-10) gameOverCount+=10;\n }\n\n // Dispose of the Graphics2D object to prevent memory leaks\n g2.dispose();\n }\n // Catch any error thrown. Most likely due to image failure\n catch(IOException e) {\n System.out.println(\"Unable to retrieve image\");\n }\n }", "public void Draw(Graphics g)\r\n {\r\n ///Se parcurge matricea de dale (codurile aferente) si se deseneaza harta respectiva\r\n g.drawImage(mapBackground, 0, 0, mapBackground.getWidth(), mapBackground.getHeight(), null);\r\n\r\n for(CollisionItem collisionItem : list_star){\r\n collisionItem.Draw(g);\r\n }\r\n\r\n for(CollisionItem collisionItem : list_star_blue){\r\n collisionItem.Draw(g);\r\n }\r\n\r\n for(CollisionItem collisionItem : list_fire){\r\n collisionItem.Draw(g);\r\n }\r\n\r\n\r\n for(CollisionItem collisionItem : list_static_element){\r\n collisionItem.Draw(g);\r\n }\r\n\r\n for(CollisionItem collisionItem :list_next_level){\r\n collisionItem.Draw(g);\r\n }\r\n\r\n }", "public void paintComponent(Graphics g)\n { \n cubes = game.getCubes();\n if (!game.is3D()) //2D\n {\n drawPoint(g, player.getX(), player.getY(), player.getZ(), player.getColor());\n if (cubes != null && !cubes.isEmpty())\n {\n for (Point cube : cubes)\n {\n double relx = cube.getX() - player.getX();\n double rely = cube.getY() - player.getY();\n drawPoint(g, cube.getX(), cube.getY(), cube.getZ(), cube.getColor());\n }\n }\n }\n else //is3D\n {\n drawPlayer(g, player.getColor());\n if (cubes != null && !cubes.isEmpty())\n {\n for (Point cube : cubes)\n {\n double relx = cube.getX() - player.getX();\n double rely = cube.getY() - player.getY();\n double toHoriz = -rely;\n if (toHoriz > 0)\n {\n double appHeight = VCONST / toHoriz;\n double screenx = HCONST * relx / toHoriz;\n drawSquare(g, cube, cube.getColor(), appHeight, screenx);\n }\n }\n }\n }\n updateLabel();\n }", "private void doDrawing(Graphics g) {//Void function takes in g from Old graphics class\r\n\r\n Graphics2D g2d = (Graphics2D) g; //Extends the old Graphics class into the newer more advanced\r\n g2d.drawString(\"Hello World!\", 50, 50);//Draws string on the panel with the draw string method\r\n }", "public void draw(Graphics graphics);", "abstract public void draw(Graphics g);", "protected void drawPossibleMoves(){\n if (selectedPiece == null) return;\n Pair<Integer,Integer> coord = getJButtonCoord(selectedPiece);\n int startRow = coord.getKey();\n int startCol = coord.getValue();\n for(int row = 0;row < ROWS;row ++){\n for(int col = 0; col < COLS ;col++){\n if (board.canMove(startRow,startCol,row,col)){\n buttonGrid[row][col].setBackground(Color.GREEN);\n }\n }\n }\n\n\n }", "public void paintComponent(Graphics g)\r\n {\r\n super.paintComponent(g);\r\n g2 = (Graphics2D) g;\r\n this.setBackground(Color.black);\r\n\r\n this.addMouseListener(this);\r\n this.addMouseMotionListener(this);\r\n Image chPieces;\r\n chPieces = new ImageIcon(\"C:/Users/eolochr/Desktop/backup/own/code/Ch/ChessPieces.png\").getImage();\r\n for (int x = 0; x < 8; x++)\r\n {\r\n for (int y = 0; y < 8; y++)\r\n {\r\n if ((x % 2 == 0 && y % 2 == 0) || (x % 2 == 1 && y % 2 == 1))\r\n {\r\n g.setColor(Color.white);\r\n }\r\n else if ((x % 2 == 0 && y % 2 == 1) || (x % 2 == 1 && y % 2 == 0))\r\n {\r\n g.setColor(Color.gray);\r\n }\r\n else\r\n {}\r\n g.fillRect(sizeOfSquare * x, sizeOfSquare * y, sizeOfSquare, sizeOfSquare);\r\n\r\n g.drawString(y + \"\", 420, 24 + (sizeOfSquare * y));\r\n g.drawString(x + \"\", 24 + (sizeOfSquare * x), 420);\r\n }\r\n\r\n }\r\n\r\n for (int i = 0; i < 64; i++) //taken, not my logic\r\n {\r\n int j = -1, k = -1;\r\n switch (Movements.chessBoard[i / 8][i % 8])\r\n {\r\n\r\n case \"R\":\r\n j = 2;\r\n k = 0;\r\n break;\r\n case \"P\":\r\n j = 5;\r\n k = 0;\r\n break;\r\n case \"K\":\r\n j = 4;\r\n k = 0;\r\n break;\r\n case \"B\":\r\n j = 3;\r\n k = 0;\r\n break;\r\n case \"Q\":\r\n j = 1;\r\n k = 0;\r\n break;\r\n case \"A\":\r\n j = 0;\r\n k = 0;\r\n break;\r\n\r\n case \"p\":\r\n j = 5;\r\n k = 1;\r\n break;\r\n case \"r\":\r\n j = 2;\r\n k = 1;\r\n break;\r\n case \"k\":\r\n j = 4;\r\n k = 1;\r\n break;\r\n case \"b\":\r\n j = 3;\r\n k = 1;\r\n break;\r\n case \"q\":\r\n j = 1;\r\n k = 1;\r\n break;\r\n case \"a\":\r\n j = 0;\r\n k = 1;\r\n break;\r\n\r\n }\r\n if (j != -1 && k != -1)\r\n {\r\n g.drawImage(chPieces, (i % 8) * sizeOfSquare, (i / 8) * sizeOfSquare, (i % 8 + 1) * sizeOfSquare, (i / 8 + 1) * sizeOfSquare, j * 64, k * 64, (j + 1) * 64,\r\n (k + 1) * 64, this);\r\n }\r\n }\r\n g.setColor(Color.GREEN);\r\n\r\n if (Movements.turnC)\r\n {\r\n g.drawString(\"White turn\", 150, 440);\r\n }\r\n else\r\n {\r\n g.drawString(\"Black turn\", 150, 440);\r\n }\r\n\r\n if(movement.length() > 3)\r\n {\r\n g.drawString(\"Selected square: \" + movement.charAt(0) + movement.charAt(1), 120, 460);\r\n }\r\n\r\n\r\n if (Movements.checkC)\r\n {\r\n g.drawString(\"Check white\", 240, 440);\r\n }\r\n else if (Movements.checkL)\r\n {\r\n g.drawString(\"Check black\", 240, 440);\r\n }\r\n\r\n }", "private void drawCurrentPiece(final Graphics2D theG2D, final int theHeight, \r\n final int theWidth) {\r\n \r\n final Piece piece = (AbstractPiece) myBoard.getCurrentPiece(); \r\n final int[][] currentPiece = ((AbstractPiece) piece).getBoardCoordinates(); \r\n \r\n //Calculates rows\r\n for (int row = 0; row < theHeight; row++) { \r\n //Calculates columns\r\n for (int column = 0; column < theWidth; column++) { \r\n //Creates blocks from column and rows\r\n for (int block = 0; block < currentPiece.length; block++) { \r\n if (currentPiece[block][1] == row \r\n && currentPiece[block][0] == column) { \r\n \r\n theG2D.setColor(PURPLE); \r\n rectangle(theG2D, SIZE * column, \r\n (SIZE * theHeight) - ((row + 1) * SIZE), \r\n SIZE, SIZE, COLOR); \r\n \r\n theG2D.setColor(((AbstractPiece) piece).getBlock().getColor()); \r\n rectangle(theG2D, \r\n SIZE * column, \r\n (SIZE * theHeight) - ((row + 1) * SIZE), \r\n SIZE - 1, SIZE - 1, COLOR); \r\n \r\n theG2D.setColor(PURPLE); \r\n rectangle(theG2D, SIZE * column, \r\n (SIZE * theHeight) - ((row + 1) * SIZE), \r\n SIZE, SIZE, DRAW); \r\n } \r\n } \r\n } \r\n } \r\n }", "@Override\n\tpublic void draw(Graphics g, JPanel panel) {\n\t\t\n\t}", "@Override\n public void paint(Graphics g) {\n\n g2d = (Graphics2D) g; //Casting the Grahpics object to an Graphics2D object.\n\n /**\n * Setting RenderingHints.\n */\n g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\n g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);\n g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_DEFAULT);\n\n /**\n * Initializing of board.\n * Call to method drawGrid().\n * Drawing all Grids from 0 to 15 in a for()-loop.\n */\n paintGrid();\n\n /**\n * Call to method drawNumbers().\n * Writing numbers in field for easier recognition.\n */\n paintNumbers();\n\n /**\n * Checks if a game is initialized.\n * If it is, it will paint the tokens, if not, it won't paint the tokens.\n */\n if(game != null) {\n\n game.paint(g2d);\n }\n }", "private void drawPlayers(Graphics g){\r\n\t\t// Comprobamos que existen jugadores\r\n\t\tint x = 40, y = 60;\r\n\t\tint spanLeft = 0, spanRight = 0;\r\n\t\tif(players != null){\r\n\t\t\t//Recorremos los jugadores\r\n\t\t\tListIterator<Player> it = players.listIterator();\r\n\t\t\twhile(it.hasNext()){\r\n\t\t\t\tif(it.nextIndex()<4){ // los cuatro primeros jugadores van a la izquierda\r\n\t\t\t\t\tit.next().draw(g, x, y+spanLeft, deck);\r\n\t\t\t\t\tspanLeft += 150;\r\n\t\t\t\t}else{ // los cuatro siguientes a la derecha\r\n\t\t\t\t\tit.next().draw(g, x+500, y+spanRight, deck);\r\n\t\t\t\t\tspanRight += 150;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tg.setColor(Color.black);\r\n\t\t\tg.fillRect(0, 0, this.getWidth(), this.getHeight());\r\n\t\t\tg.setColor(Color.white);\r\n\t\t\tg.setFont(new Font(\"Arial\", Font.PLAIN, 70));\r\n\t\t\tg.drawString(\"¡Bienvenido a Siete y Media!\", 50, 150);\r\n\t\t\tg.setFont(new Font(\"Arial\", Font.PLAIN, 18));\r\n\t\t\tg.drawString(\"Configura tu partida.\", 50, 200);\r\n\t\t}\r\n\r\n\t}", "public void dibujar(Graphics g){\n\t\tg2.setColor(Color.WHITE);\n\t\tfor ( int x =0; x < game.getAmountPersonajes() ;x++){\n\t\t\tRectangle2D.Double personaje =game.getPersonaje(x).getshape(); \n\t\t\t\n\t\t\ttemporal = game.getPersonaje(x).getImage().getImage();\n\t\t\tg.drawImage(temporal, (int)personaje.getX(), (int)(personaje.getY()), this);\n\t\t}\n\t\tfor ( int x =0; x < game.getAmountObjetivos() ;x++){\n\t\t\tRectangle2D.Double objetivo =game.getObjetivo(x).getShape(); \n\t\t\ttemporal = game.getObjetivo(x).getImage().getImage();\n\t\t\tg.drawImage(temporal, (int)objetivo.getX(), (int)(objetivo.getY()), this);\n\t\t}\n\t\tif (game.getCurrentSorpresa()!=null){\n\t\t\tRectangle2D.Double s =game.getCurrentSorpresa().getShape(); \n\t\t\ttemporal = game.getCurrentSorpresa().getImage().getImage();\n\t\t\tg.drawImage(temporal, (int)s.getX(), (int)(s.getY()), this);\t\t\t\n\t\t}\n\t\tif(game.getBloque().isActive() ){\n\t\t\tRectangle2D.Double s =game.getBloque().getShape(); \n\t\t\ttemporal = game.getBloque().getImage().getImage();\n\t\t\tg.drawImage(temporal, (int)s.getX(), (int)(s.getY()), this);\n\t\t}\n\t\t\n\t\tg2.setColor(new Color(100,221,23));\n\t\tg2.fill(game.getShapePelota(0));\n\t\n\t\n\t}", "public void paintComponent(Graphics g) {\n\t\t\n\t\tImage img1 = Utility.getImage(shipPositionLeft.getS1().getA().getImg());\n\t\tImage img2 = Utility.getImage(shipPositionLeft.getS1().getB().getImg());\n\t\tImage img3 = Utility.getImage(shipPositionLeft.getS1().getC().getImg());\n\t\tImage img4 = Utility.getImage(shipPositionLeft.getS1().getD().getImg());\n\t\tImage img5 = Utility.getImage(shipPositionLeft.getS2().getA().getImg());\n\t\tImage img6 = Utility.getImage(shipPositionLeft.getS2().getB().getImg());\n\t\tImage img7 = Utility.getImage(shipPositionLeft.getS2().getC().getImg());\n\t\tImage img8 = Utility.getImage(shipPositionLeft.getS3().getA().getImg());\n\t\tImage img9 = Utility.getImage(shipPositionLeft.getS3().getB().getImg());\n\t\tImage img10 = Utility.getImage(shipPositionLeft.getS4().getA().getImg());\n\t\tImage img11 = Utility.getImage(shipPositionLeft.getS4().getB().getImg());\n\t\tImage img12 = Utility.getImage(shipPositionLeft.getS4().getC().getImg());\n\n\t\tsuper.paintComponent(g);\n\t\tGraphics2D g2 = (Graphics2D)g;\n\n\t\tg2.drawImage(img1, shipPositionLeft.getS1().getA().getX()*25, shipPositionLeft.getS1().getA().getY()*25, this);\n\t\tg2.drawImage(img2, shipPositionLeft.getS1().getB().getX()*25, shipPositionLeft.getS1().getB().getY()*25, this);\n\t\tg2.drawImage(img3, shipPositionLeft.getS1().getC().getX()*25, shipPositionLeft.getS1().getC().getY()*25, this);\n\t\tg2.drawImage(img4, shipPositionLeft.getS1().getD().getX()*25, shipPositionLeft.getS1().getD().getY()*25, this);\n\t\tg2.drawImage(img5, shipPositionLeft.getS2().getA().getX()*25, shipPositionLeft.getS2().getA().getY()*25, this);\n\t\tg2.drawImage(img6, shipPositionLeft.getS2().getB().getX()*25, shipPositionLeft.getS2().getB().getY()*25, this);\n\t\tg2.drawImage(img7, shipPositionLeft.getS2().getC().getX()*25, shipPositionLeft.getS2().getC().getY()*25, this);\n\t\tg2.drawImage(img8, shipPositionLeft.getS3().getA().getX()*25, shipPositionLeft.getS3().getA().getY()*25, this);\n\t\tg2.drawImage(img9, shipPositionLeft.getS3().getB().getX()*25, shipPositionLeft.getS3().getB().getY()*25, this);\n\t\tg2.drawImage(img10, shipPositionLeft.getS4().getA().getX()*25, shipPositionLeft.getS4().getA().getY()*25, this);\n\t\tg2.drawImage(img11, shipPositionLeft.getS4().getB().getX()*25, shipPositionLeft.getS4().getB().getY()*25, this);\n\t\tg2.drawImage(img12, shipPositionLeft.getS4().getC().getX()*25, shipPositionLeft.getS4().getC().getY()*25, this);\n\n\t}", "public void paintComponent(Graphics g) {\n\n\t\t\tif (death==false) {//if we arent dead, the game must be drawn\n\t\t\t\tif (background!=null) {//draw background\n\t\t\t\t\tg.drawImage(background.getImage(), background.getX(), background.getY(), this);\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 (blocks!=null) {//draw the blocks. from the list\n\t\t\t\t\t//System.out.println(\"Yes\");\n\t\t\t\t\tfor (int x = blocks.size()-1; x>= 0; x--) {\n\t\t\t\t\t\tif (blocks.get(x).getDisable()) {//if the blocks are disabled, destroy\n\t\t\t\t\t\t\tblocks.remove(x);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor (int t = 0; t<blocks.size(); t++) {//now draw the blocks.\n\t\t\t\t\t\t//System.out.printf(\"%d %d %d %d\\n\",blocks.get(t).getX(), blocks.get(t).getY(), blocks.get(t).getWidth(), blocks.get(t).getHeight());\n\t\t\t\t\t\tg.setColor(blocks.get(t).getColor());\n\t\t\t\t\t\tg.fillRect(blocks.get(t).getX(), blocks.get(t).getY(), blocks.get(t).getWidth(), blocks.get(t).getHeight());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (slider!=null) {//if the slider isnt null, draw it\n\t\t\t\t\t//System.out.printf(\"%d %d\\n\",slider.getX(), slider.getY());\n\t\t\t\t\tg.drawImage(slider.getImage(), slider.getX(), slider.getY(), this);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (ball!=null) {//draw ball.\n\t\t\t\t\tg.drawImage(ball.getImage(), ball.getX(), ball.getY(), this);\n\t\t\t\t}\n\t\t\t\tfor (PowerUp power: powerUps) {//draw all of the powerups\n\t\t\t\t\tg.drawImage(power.getImage(), power.getX(), power.getY(), this);\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\t//draw bottom frame\n\t\t\t\t\n\t\t\t\tg.setColor(new Color(0,0,0));\n\t\t\t\tg.fillRect(0, GamePlay.getScreenHeight()-h, GamePlay.getScreenWidth(), h);//this is the menu bar\n\t\t\t\t\n\t\t\t\t//draw score\n\t\t\t\tg.setColor(new Color(255,255,255));\n\t\t\t\tg.setFont(new Font(\"Helvetica\", Font.PLAIN, 32));\n\t\t\t\tg.drawString(String.format(\"Score: %d\", score), GamePlay.getScreenWidth() - 5 - g.getFontMetrics().stringWidth(String.format(\"Score: %d\", score)), GamePlay.getScreenHeight() - 5 - 32);\n\t\t\t\t\n\t\t\t\t//paused\n\t\t\t\tif (stopped) {\n\t\t\t\t\tg.drawString(\"Paused\", 10, 42);//upper left corner of the screen. just say paused so user knows\n\t\t\t\t}\n\t\t\t\t//lives\n\t\t\t\tint livesFontSize=15;\n\t\t\t\tg.setFont(new Font(\"Helvetica\", Font.PLAIN, livesFontSize));\n\t\t\t\tg.drawString(String.format(\"Lives: %d\", lives), 20+5+pauseButton.getWidth(), GamePlay.getScreenHeight()-h+(2+livesFontSize));\n\t\t\t\t\n\t\t\t\tfor (int x=0; x<lives; x++) {//draw one ball for every life they have. \n\t\t\t\t\t//System.out.println(\"hey\");\n\t\t\t\t\tg.drawImage(ball.getImage(), 5+pauseButton.getWidth()+20+(5+ball.getWidth())*x, GamePlay.getScreenHeight()-(h/2)-(ball.getHeight())+(livesFontSize/2), this);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//logo\n\t\t\t\tg.drawImage(logo.getImage(), GamePlay.getScreenWidth()/2-logo.getWidth()/2, GamePlay.getScreenHeight() - (h/2) - (logo.getHeight()/2)-10, this);\n\t\t\t\t\n\t\t\t\t//pause button\n\t\t\t\tg.drawImage(pauseButton.getImage(), 5, GamePlay.getScreenHeight() - (h/2) - pauseButton.getHeight()/2 -10 , this);\n\t\t\t\t\n\t\t\t} else {//this means the player died.\n\t\t\t\t\n\t\t\t\t//draw black background \n\t\t\t\t\n\t\t\t\t//draw logo\n\t\t\t\tlogo.resize(400,100);\n\t\t\t\tg.setColor(new Color(0,0,0));\n\t\t\t\tg.fillRect(0, 0, GamePlay.getScreenWidth(), GamePlay.getScreenHeight());\n\t\t\t\tg.drawImage(logo.getImage(), GamePlay.getScreenWidth()/2 - logo.getWidth()/2, 100, this);\n\t\t\t\t\n\t\t\t\tg.setColor(new Color(255,255,255));//draw game over text\n\t\t\t\tg.setFont(new Font(\"Helvetica\", Font.PLAIN, 60));\n\t\t\t\tg.drawString(\"Game Over!\", GamePlay.getScreenWidth()/2 - g.getFontMetrics().stringWidth(\"Game Over!\")/2, GamePlay.getScreenHeight()/2 - 30);\n\t\t\t\t\n\t\t\t\t//draw score. \n\t\t\t\tg.drawString(String.format(\"Your Score: %d\", score), GamePlay.getScreenWidth()/2 - g.getFontMetrics().stringWidth(String.format(\"Your Score: %d\", score))/2, GamePlay.getScreenHeight()/2 + 100);\n\t\t\t}\n\t\t\t\n\t\t}", "protected void paintComponent(Graphics g) {\r\n\t\tsuper.paintComponent(g);\r\n\r\n\t\t\r\n\t\tInsets ins = this.getInsets();\r\n\t\tint varX = ins.left+5;\r\n\t\tint varY = ins.top+5;\r\n\r\n\t\tif ( pozicijaIgraca.equals(\"gore\")){\t\t\t\r\n\t\t\tfor(Card karta : karte){\r\n\t\t\t\tkarta.moveTo(varX, varY);\r\n\t\t\t\tkarta.draw(g, this);\r\n\t\t\t\tvarX = varX + karta.getWidth()+5;\r\n\t\t\t}\r\n\t\t\tg.setColor(Color.RED);\r\n\t\t\tg.drawString(imeIgraca, varX - 120, varY + 100);\r\n\t\t} else {\r\n\t\t\tfor(Card karta : karte){\r\n\t\t\t\tkarta.moveTo(varX, varY);\r\n\t\t\t\tkarta.draw(g, this);\r\n\t\t\t\tvarX = varX + karta.getWidth()/2;\r\n\t\t\t\tvarY = varY + karta.getHeight()/10;\r\n\t\t\t}\r\n\t\t\tg.setColor(Color.RED);\r\n\t\t\tg.drawString(imeIgraca, varX - 100 , varY + 90);\r\n\t\t}\r\n\t\t\r\n\r\n\t}", "public void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\n\t\tGraphics2D g2 = (Graphics2D) g;\n\t\tint imageIndex = -1, x1 = 0, y1 = 0;\n\t\tPoint point;\n\t\t\n\t\tfor (int row = 0; row < matrix.length; row++) {\n\t\t\tfor (int col = 0; col < matrix[row].length; col++) {\n\t\t\t\timageIndex = matrix[row][col];\n\t\t\t\t\n\t\t\t\tif (imageIndex >= 0 && imageIndex < tiles.length) {\n\t\t\t\t\t//Paint the ground tiles\n\t\t\t\t\tif (isIsometric) {\n\t\t\t\t\t\tx1 = getIsoX(col, row);\n\t\t\t\t\t\ty1 = getIsoY(col, row);\n\t\t\t\t\t\t\n\t\t\t\t\t\tg2.drawImage(tiles[DEFAULT_IMAGE_INDEX], x1, y1, null);\n\t\t\t\t\t\tif (imageIndex > DEFAULT_IMAGE_INDEX) {\n\t\t\t\t\t\t\tg2.drawImage(tiles[imageIndex], x1, y1, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tx1 = col * TILE_WIDTH;\n\t\t\t\t\t\ty1 = row * TILE_HEIGHT;\n\t \t\t\tif (imageIndex < cartesian.length) {\n\t \t\t\t\tg2.setColor(cartesian[imageIndex]);\n\t \t\t\t}else {\n\t \t\t\t\tg2.setColor(Color.WHITE);\n\t \t\t\t}\n\t\t\t\t\t\t\n\t \t\t\tg2.fillRect(x1, y1, TILE_WIDTH, TILE_WIDTH);\n\t\t\t\t\t}\n\t\t\t\t\t//Paint the object or things on the ground\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\timageIndex = things[row][col];\n\t\t\t\t\tg2.drawImage(objects[imageIndex], x1, y1, null);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Paint the player on the ground\n\t\tpoint = getIso(player.getPosition().getX(), player.getPosition().getY());\n\t\tg2.drawImage(player.getImage(), point.getX(), point.getY(), null);\n\t}", "public void drawOn(Graphics g);", "public void draw(Graphics g){\n\t\tif(firstRepaint==false){\n\t\t\tfirstRepaint = true;\n\t\t}\n\t\tif(secondRepaint==false&&firstRepaint==true){\n\t\t\t\n\t\t\tcenterAlignPlayer();\n\t\t\tsecondRepaint = true;\n\t\t}\n\t\t\n\t\t//Tile the backgroundTile if it exists.\n\t\tif(backgroundTile != null){\n\t\t\t\n\t\t\tint width = getWidth();\n\t\t\tint height = getHeight();\n\t\t\tint imageW = darkenedTileImage.getWidth(this);\n\t\t\tint imageH = darkenedTileImage.getHeight(this);\n\t\t\t\n\t\t\t// Tile the image to fill our area.\n\t\t\tif(player != null){ //Use player offsets.\n\t\t\t\tfor (int x = roundDownWidth(offsetX)-GameConstants.TILE_WIDTH; x <= roundUpWidth(offsetX + width); x += imageW){\n\t\t\t\t\tfor (int y = roundDownHeight(offsetY)-GameConstants.TILE_HEIGHT; y <= roundUpHeight(offsetY + height); y += imageH){\n\t\t\t\t\t\tif(levelArea.contains(x, y)){\n\t\t\t\t\t\t\tg.drawImage(darkenedTileImage, x-offsetX, y-offsetY, this);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tg.drawImage(tileImage, x-offsetX, y-offsetY, this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tfor (int x = 0; x <= width; x += imageW){\n\t\t\t\t\tfor (int y = 0; y <= height; y += imageH){\n\t\t\t\t\t\tif(levelArea.contains(x, y)){\n\t\t\t\t\t\t\tg.drawImage(darkenedTileImage, x, y, this);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tg.drawImage(tileImage, x, y, this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tsuper.draw(g);\n\t\t\n\t\t//Show FPS and fly indicator if there is a reference to PuzzBlocks game.\n\t\tif(GameConstants.DEBUG_MODE){\n\t\t\tif(game != null){\n\t\t\t\tColor oldColor = g.getColor();\n\t\t\t\tg.setColor(Color.red);\n\t\t\t\t\n\t\t\t\tg.setFont( new Font(GameConstants.FPS_FONT, Font.BOLD, GameConstants.FPS_FONT_SIZE) );\n\t\t\t\tg.drawString(\"FPS: \" + game.getFPS(), 0, (int)(GameConstants.FPS_FONT_SIZE * 0.75) ); // (+ \"\") converts int to String.\n\t\t\t\t\n\t\t\t\tif(Physics.isFlyEnabled()){\n\t\t\t\t\tg.drawString(\"Flying enabled\", 0, getHeight());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tg.setColor(oldColor);\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void draw(Graphics g)\r\n\t\t{\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tint x = BORDER;\r\n\t\t\t\tint y = 2;\r\n\t\t\t\tfor(int i = 0; i < rolls.length; i++){\r\n\t\t\t\t\t// Make selected dice darker\r\n\t\t\t\t\tif(selectedDice[i]){\r\n\t\t\t\t\t\tg.setColor(Color.DARK_GRAY);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tg.setColor(Color.GRAY);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Background\r\n\t\t\t\t\tg.fillRoundRect(x, y, SLOT_WIDTH*2, SLOT_WIDTH*2, SLOT_WIDTH/2, SLOT_WIDTH/2);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Outline\r\n\t\t\t\t\tg.setColor(cantStop.getGameBoard().getCurrentPlayer().getColor());\r\n\t\t\t\t\tg.drawRoundRect(x, y, SLOT_WIDTH*2, SLOT_WIDTH*2, SLOT_WIDTH/2, SLOT_WIDTH/2);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Dots\r\n\t\t\t\t\tdrawDice(g, rolls[i], x, y);\r\n\t\t\t\t\tx+= SLOT_WIDTH*2 + BORDER*3;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tcatch(NullPointerException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tcatch(ArrayIndexOutOfBoundsException e)\r\n\t\t\t{\r\n\t\t\t\tSystem.err.println(\"The GUI tried to access a cone within\" +\r\n\t\t\t\t\t\t\" your GameBoard's tracks, but this \" +\r\n\t\t\t\t\t\t\"resulted in an ArrayIdexOutOfBounds \" +\r\n\t\t\t\t\t\t\"Exception.\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t}", "private void doDrawing(Graphics g) \n { \n //Surface specific G2D is used to paint entire \n // grid regardless of tilemap data to provide \n // background for tiles with transparent areas\n Graphics2D surfaceG2D = (Graphics2D) g.create();\n surfaceG2D.setPaint(texturePaints.get(0));\n for(int i = 0; i < MAX_ROWS; i++)\n {\n for(int j = 0; j < MAX_COLUMNS; j++)\n {\n surfaceG2D.fillRect(i*TILE_SIZE, j*TILE_SIZE, TILE_SIZE, TILE_SIZE);\n }\n }\n \n //Singular generic G2D is used for tilemap data\n Graphics2D G2D = (Graphics2D) g.create();\n \n //Paint relevant to tilemap\n for(int y = 0; y < MAX_ROWS; y++)\n {\n for(int x = 0; x < MAX_COLUMNS; x++)\n {\n //Select paint type\n G2D.setPaint(texturePaints.get(tilemap[x][y]));\n //If tile is rover, record position\n if(tilemap[x][y] == 1)\n {\n roverX = x;\n roverY = y;\n }\n //Apply paint to current tile\n G2D.fillRect(x*TILE_SIZE, y*TILE_SIZE, //Coordinates\n TILE_SIZE, TILE_SIZE); //Dimensions\n }\n } \n }", "public void draw(GraphicsContext gc) {\n // draw the base grid\n gc.setFill(Color.LIGHTGREY);\n for (int i = 0; i < board.side(); i++)\n for (int j = (i % 2 == 0) ? 1 : 0; j < board.side(); j += 2)\n gc.fillRect(startX + j * unitLength, startY + i * unitLength,\n unitLength, unitLength);\n\n // draw boundaries\n gc.setStroke(Color.BLACK);\n gc.strokeRect(startX, startY, sideLength, sideLength);\n\n // highlight legal positions\n for (BoardPos pos : legalPos) {\n gc.setFill(Color.ORANGE);\n gc.fillRect(startX + pos.getX() * unitLength,\n startY + pos.getY() * unitLength, unitLength, unitLength);\n gc.setFill(Color.LIGHTYELLOW);\n if (pos.route != null)\n for (BoardPos step : pos.route)\n gc.fillRect(startX + step.getX() * unitLength,\n startY + step.getY() * unitLength, unitLength, unitLength);\n }\n\n // draw pieces\n for (int i = 0; i < board.side(); i++)\n for (int j = 0; j < board.side(); j++)\n board.get(i, j).draw(gc, startX + i * unitLength,\n startY + j * unitLength, pieceMargin, unitLength);\n }", "public abstract WorldImage drawBoard(int blocks);", "void draw_pieces(int x, int y, char[][] _display, char[][] _board) {\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n switch (_board[i][j]) {\n case ' ':\n break;\n case 'p':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" _ \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" (_) \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" /_\\\\ \");\n break;\n case 'r':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" [###] \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" |_| \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" /___\\\\ \");\n break;\n case 'k':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" /\\\\_ \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" / o = \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" \\\\ \\\\ \");\n break;\n case 'b':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" O \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" ( ) \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" / \\\\ \");\n break;\n case 'q':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" \\\\\\\\|// \");\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" )_( \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" /___\\\\ \" );\n break;\n case 'K':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" [###] \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" (___) \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" /___\\\\ \");\n break;\n default:\n break;\n }\n }\n }\n }", "abstract void draw(Graphics g, int xoff, int yoff,\n int x, int y, int width, int height);", "@Override\n public void paintComponent(final Graphics theGraphics) {\n super.paintComponent(theGraphics);\n final Graphics2D g2d = (Graphics2D) theGraphics; \n g2d.setPaint(PowerPaintMenus.getDrawColor());\n g2d.setStroke(new BasicStroke(PowerPaintMenus.getThickness()));\n if (!myFinishedDrawings.isEmpty()) {\n for (final Drawings drawing : myFinishedDrawings) {\n g2d.setColor(drawing.getColor());\n g2d.setStroke(drawing.getStroke());\n if (PowerPaintMenus.isFilled()) {\n g2d.fill(drawing.getShape());\n } else {\n g2d.draw(drawing.getShape()); \n }\n }\n }\n if (myHasShape) {\n g2d.draw(myCurrentShape);\n }\n }", "public abstract void draw(Graphics2D graphics);", "public void paintComponent(Graphics g){\n\t\tsuper.paintComponent(g);\n\n\t\tg.setColor(Color.white);\n\t\n\t\tImageIcon bg;\n\t\ttry {\n\t\t\t//background table\n\t\t\tbg = new ImageIcon(ImageIO.read(new File(relativePath + \"pokerTableBlack.png\")));\n\t\t\t//System.out.println(System.getProperty(\"user.dir\"));\n\t\t\tbg.paintIcon(this, g, 0, 0);\n\t\t\t\n\t\t\tswitch(currentGameRound){\n\t\t\tcase WAITINGROUND:\n\t\t\t\t\tif(playerName != null && currentPlayerIs == PLAYER1){\n\t\t\t\t\t\t//player details\n\t\t\t\t\t\tdrawPlayerPicture(g, 30, 70);\n\t\t\t\t\t\tdrawPlayerDetailBox(g, 5, 158);\n\t\t\t\t\t\tg.drawString(playerName, 60, 180);\n\t\t\t\t\t\tg.drawString(\"£\" + Double.toString(p1TotalChips), 60, 200);\n\t\t\t\t\t\tg.drawString(\"£\" + Double.toString(currentPot), 400, 150);\n\t\t\t\t\t\tdrawNotification(g, \"waitingForPlayers.png\", 0, 0);\n\t\t\t\t\t\tg.drawString(\"£\" + Double.toString(getP1TotalChipsBid()), 400, 150);\n\t\t\t\t\t\tg.drawString(\"£\" + Double.toString(getP2TotalChipsBid()), 400, 170);\n\t\t\t\t\t}else if(playerName2 != null && currentPlayerIs == PLAYER2){\n\t\t\t\t\t\t//player details\n\t\t\t\t\t\tdrawPlayerPicture(g, 30, 270);\n\t\t\t\t\t\tdrawPlayerDetailBox(g, 5, 358);\n\t\t\t\t\t\tg.drawString(playerName2, 60, 380);\n\t\t\t\t\t\tg.drawString(\"£\" + Double.toString(p2TotalChips), 60, 400);\n\t\t\t\t\t\tg.drawString(\"£\" + Double.toString(currentPot), 400, 150);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\tcase PREFLOPROUND:\n\t\t\t\t\t//p1 id holder\n\t\t\t\t\tdrawPlayerPicture(g, 30, 70);\n\t\t\t\t\tdrawPlayerDetailBox(g, 5, 158);\n\t\t\t\t\tg.drawString(playerName, 60, 180);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(p1TotalChips), 60, 200);\n\t\t\t\t\t\n\t\t\t\t\t//p2 id holder\n\t\t\t\t\tdrawPlayerPicture(g, 30, 270);\n\t\t\t\t\tdrawPlayerDetailBox(g, 5, 358);\n\t\t\t\t\tg.drawString(playerName2, 60, 380);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(p2TotalChips), 60, 400);\n\t\t\t\t\t//notification\n\t\t\t\t\tdrawNotification(g, \"preFlopRound.png\", 0, 0);\n\t\t\t\t\tdrawBubbleStatus(g, 370, 0);\n\t\t\t\t\tg.drawString(getBubbleStatus(), 385, 30);\n\t\t\t\t\tif(playerName != null && currentPlayerIs == PLAYER1){\n\t\t\t\t\t\t//p1 cards\n\t\t\t\t\t\tdrawCard(relativePath, p1Card1, g, 90, 100);\n\t\t\t\t\t\tdrawCard(relativePath, p1Card2, g, 110, 100);\n\t\t\t\t\t\t//p2 facedown\n\t\t\t\t\t\tdrawFaceDown( g, 90, 300);\n\t\t\t\t\t\tdrawFaceDown( g, 110, 300);\t\t\t\t\t\t\n\t\t\t\t\t}else if(playerName2 != null && currentPlayerIs == PLAYER2){\n\t\t\t\t\t\t//p2 cards\n\t\t\t\t\t\tdrawCard(relativePath, p2Card1, g, 90, 300);\n\t\t\t\t\t\tdrawCard(relativePath, p2Card2, g, 110, 300);\n\t\t\t\t\t\t//p1 facedown\n\t\t\t\t\t\tdrawFaceDown( g, 90, 100);\n\t\t\t\t\t\tdrawFaceDown( g, 110, 100);\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(getP1TotalChipsBid()), 400, 150);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(getP2TotalChipsBid()), 400, 170);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(currentPot), 450, 160);\n\t\t\t\t\tbreak;\n\t\t\tcase FLOPROUND:\n\t\t\t\t\t//p1 id holder\n\t\t\t\t\tdrawPlayerPicture(g, 30, 70);\n\t\t\t\t\tdrawPlayerDetailBox(g, 5, 158);\n\t\t\t\t\tg.drawString(playerName, 60, 180);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(p1TotalChips), 60, 200);\n\t\t\t\t\t//p2 id holder\n\t\t\t\t\tdrawPlayerPicture(g, 30, 270);\n\t\t\t\t\tdrawPlayerDetailBox(g, 5, 358);\n\t\t\t\t\tg.drawString(playerName2, 60, 380);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(p2TotalChips), 60, 400);\n\t\t\t\t\t//table values\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(getP1TotalChipsBid()), 400, 150);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(getP2TotalChipsBid()), 400, 170);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(currentPot), 450, 160);\n\t\t\t\t\tdrawNotification(g, \"flopRound.png\", 0, 0);\n\t\t\t\t\tdrawBubbleStatus(g, 370, 0);\n\t\t\t\t\tg.drawString(getBubbleStatus(), 385, 30);\n\t\t\t\t if(playerName != null && currentPlayerIs == PLAYER1){\n\t\t\t\t \t//p1 hand card\n\t\t\t\t\t\tdrawCard(relativePath, p1Card1, g, 90, 100);\n\t\t\t\t\t\tdrawCard(relativePath, p1Card2, g, 110, 100);\n\t\t\t\t\t\t//flopCards\n\t\t\t\t\t\tdrawCard(relativePath, flop1, g, 220, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop2, g, 270, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop3, g, 320, 190);\t\t\t\t\t\n\t\t\t\t\t\t//draw p2 facedown cards\n\t\t\t\t\t\tdrawFaceDown( g, 90, 300);\n\t\t\t\t\t\tdrawFaceDown( g, 110, 300);\n\t\t\t\t }else if(playerName2 != null && currentPlayerIs == PLAYER2){\n\t\t\t\t\t\t//p1 facedown cards\n\t\t\t\t\t\tdrawFaceDown( g, 90, 100);\n\t\t\t\t\t\tdrawFaceDown( g, 110, 100);\t\n\t\t\t\t\t\t//flopCards\n\t\t\t\t\t\tdrawCard(relativePath, flop1, g, 220, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop2, g, 270, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop3, g, 320, 190);\n\t\t\t\t\t\t//draw p2 hand cards stuffs\t\n\t\t\t\t\t\tdrawCard(relativePath, p2Card1, g, 90, 300);\n\t\t\t\t\t\tdrawCard(relativePath, p2Card2, g, 110, 300);\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\tcase TURNROUND:\n\t\t\t\t//p1 id holder\n\t\t\t\t\tdrawPlayerPicture(g, 30, 70);\n\t\t\t\t\tdrawPlayerDetailBox(g, 5, 158);\n\t\t\t\t\tg.drawString(playerName, 60, 180);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(p1TotalChips), 60, 200);\n\t\t\t\t\t//p2 id holder\n\t\t\t\t\tdrawPlayerPicture(g, 30, 270);\n\t\t\t\t\tdrawPlayerDetailBox(g, 5, 358);\n\t\t\t\t\tg.drawString(playerName2, 60, 380);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(p2TotalChips), 60, 400);\n\t\t\t\t\t//table values\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(getP1TotalChipsBid()), 400, 150);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(getP2TotalChipsBid()), 400, 170);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(currentPot), 450, 160);\n\t\t\t\t\tdrawNotification(g, \"turnRound.png\", 0, 0);\n\t\t\t\t\tdrawBubbleStatus(g, 370, 0);\n\t\t\t\t\tg.drawString(getBubbleStatus(), 385, 30);\n\t\t\t\t\tif(playerName != null && currentPlayerIs == PLAYER1){\n\t\t\t\t \t//p1 hand card\n\t\t\t\t\t\tdrawCard(relativePath, p1Card1, g, 90, 100);\n\t\t\t\t\t\tdrawCard(relativePath, p1Card2, g, 110, 100);\n\t\t\t\t\t\t//flopCards\n\t\t\t\t\t\tdrawCard(relativePath, flop1, g, 220, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop2, g, 270, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop3, g, 320, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop4, g, 370, 190);\n\t\t\t\t\t\t//draw p2 facedown cards\n\t\t\t\t\t\tdrawFaceDown( g, 90, 300);\n\t\t\t\t\t\tdrawFaceDown( g, 110, 300);\n\t\t\t\t }else if(playerName2 != null && currentPlayerIs == PLAYER2){\n\t\t\t\t\t\t//p1 facedown cards\n\t\t\t\t\t\tdrawFaceDown( g, 90, 100);\n\t\t\t\t\t\tdrawFaceDown( g, 110, 100);\t\n\t\t\t\t\t\t//flopCards\n\t\t\t\t\t\tdrawCard(relativePath, flop1, g, 220, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop2, g, 270, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop3, g, 320, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop4, g, 370, 190);\n\t\t\t\t\t\t//draw p2 hand cards stuffs\t\n\t\t\t\t\t\tdrawCard(relativePath, p2Card1, g, 90, 300);\n\t\t\t\t\t\tdrawCard(relativePath, p2Card2, g, 110, 300);\n\t\t\t\t }\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t case RIVERROUND:\n\t\t\t\t //p1 id holder\n\t\t\t\t\tdrawPlayerPicture(g, 30, 70);\n\t\t\t\t\tdrawPlayerDetailBox(g, 5, 158);\n\t\t\t\t\tg.drawString(playerName, 60, 180);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(p1TotalChips), 60, 200);\n\t\t\t\t\t//p2 id holder\n\t\t\t\t\tdrawPlayerPicture(g, 30, 270);\n\t\t\t\t\tdrawPlayerDetailBox(g, 5, 358);\n\t\t\t\t\tg.drawString(playerName2, 60, 380);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(p2TotalChips), 60, 400);\n\t\t\t\t\t//table values\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(getP1TotalChipsBid()), 400, 150);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(getP2TotalChipsBid()), 400, 170);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(currentPot), 450, 160);\n\t\t\t\t\tdrawNotification(g, \"riverRound.png\", 0, 0);\n\t\t\t\t\tdrawBubbleStatus(g, 370, 0);\n\t\t\t\t\tg.drawString(getBubbleStatus(), 385, 30);\n\t\t\t\t\tif(playerName != null && currentPlayerIs == PLAYER1){\n\t\t\t\t \t//p1 hand card\n\t\t\t\t\t\tdrawCard(relativePath, p1Card1, g, 90, 100);\n\t\t\t\t\t\tdrawCard(relativePath, p1Card2, g, 110, 100);\n\t\t\t\t\t\t//flopCards\n\t\t\t\t\t\tdrawCard(relativePath, flop1, g, 220, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop2, g, 270, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop3, g, 320, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop4, g, 370, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop5, g, 420, 190);\n\t\t\t\t\t\t//draw p2 facedown cards\n\t\t\t\t\t\tdrawFaceDown( g, 90, 300);\n\t\t\t\t\t\tdrawFaceDown( g, 110, 300);\n\t\t\t\t }else if(playerName2 != null && currentPlayerIs == PLAYER2){\n\t\t\t\t\t\t//p1 facedown cards\n\t\t\t\t\t\tdrawFaceDown( g, 90, 100);\n\t\t\t\t\t\tdrawFaceDown( g, 110, 100);\t\n\t\t\t\t\t\t//flopCards\n\t\t\t\t\t\tdrawCard(relativePath, flop1, g, 220, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop2, g, 270, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop3, g, 320, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop4, g, 370, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop5, g, 420, 190);\n\t\t\t\t\t\t//draw p2 hand cards stuffs\t\n\t\t\t\t\t\tdrawCard(relativePath, p2Card1, g, 90, 300);\n\t\t\t\t\t\tdrawCard(relativePath, p2Card2, g, 110, 300);\n\t\t\t\t }\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t case FINDWINNERROUND:\n\t\t\t\t //p1 id holder\n\t\t\t\t\tdrawPlayerPicture(g, 30, 70);\n\t\t\t\t\tdrawPlayerDetailBox(g, 5, 158);\n\t\t\t\t\tg.drawString(playerName, 60, 180);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(p1TotalChips), 60, 200);\n\t\t\t\t\t//p2 id holder\n\t\t\t\t\tdrawPlayerPicture(g, 30, 270);\n\t\t\t\t\tdrawPlayerDetailBox(g, 5, 358);\n\t\t\t\t\tg.drawString(playerName2, 60, 380);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(p2TotalChips), 60, 400);\n\t\t\t\t\t//table values\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(getP1TotalChipsBid()), 400, 150);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(getP2TotalChipsBid()), 400, 170);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(currentPot), 450, 160);\n\t\t\t\t\tdrawNotification(g, \"winnerBanner.png\", 200, 270);\n\t\t\t\t\tg.drawString(getWinnerIs(), 210, 285);\n\t\t\t\t\tdrawBubbleStatus(g, 370, 0);\n\t\t\t\t\tg.drawString(getBubbleStatus(), 385, 30);\n\t\t\t\t\tif(playerName != null && currentPlayerIs == PLAYER1){\n\t\t\t\t\t//p1 hand card\n\t\t\t\t\tdrawCard(relativePath, p1Card1, g, 90, 100);\n\t\t\t\t\tdrawCard(relativePath, p1Card2, g, 110, 100);\n\t\t\t\t\tdrawCard(relativePath, p2Card1, g, 90, 300);\n\t\t\t\t\tdrawCard(relativePath, p2Card2, g, 110, 300);\n\t\t\t\t\t\n\t\t\t\t\t}else if(playerName2 != null && currentPlayerIs == PLAYER2){\n\t\t\t\t\t//draw p2 hand cards stuffs\t\n\t\t\t\t\tdrawCard(relativePath, p1Card1, g, 90, 100);\n\t\t\t\t\tdrawCard(relativePath, p1Card2, g, 110, 100);\n\t\t\t\t\tdrawCard(relativePath, p2Card1, g, 90, 300);\n\t\t\t\t\tdrawCard(relativePath, p2Card2, g, 110, 300);\n\t\t\t\t\t}\n\t\t\t\t\t//flopCards\n\t\t\t\t\tdrawCard(relativePath, flop1, g, 220, 190);\n\t\t\t\t\tdrawCard(relativePath, flop2, g, 270, 190);\n\t\t\t\t\tdrawCard(relativePath, flop3, g, 320, 190);\n\t\t\t\t\tdrawCard(relativePath, flop4, g, 370, 190);\n\t\t\t\t\tdrawCard(relativePath, flop5, g, 420, 190);\n\t\t\t break;\n\t\t\t \n\t\t\t case FOLDROUND:\n\t\t\t\t \t//p1 id holder\n\t\t\t\t\tdrawPlayerPicture(g, 30, 70);\n\t\t\t\t\tdrawPlayerDetailBox(g, 5, 158);\n\t\t\t\t\tg.drawString(playerName, 60, 180);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(p1TotalChips), 60, 200);\n\t\t\t\t\t//p2 id holder\n\t\t\t\t\tdrawPlayerPicture(g, 30, 270);\n\t\t\t\t\tdrawPlayerDetailBox(g, 5, 358);\n\t\t\t\t\tg.drawString(playerName2, 60, 380);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(p2TotalChips), 60, 400);\n\t\t\t\t\t//table values\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(getP1TotalChipsBid()), 400, 150);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(getP2TotalChipsBid()), 400, 170);\n\t\t\t\t\tg.drawString(\"£\" + Double.toString(currentPot), 450, 160);\n\t\t\t\t\t\n\t\t\t\t\tdrawBubbleStatus(g, 370, 0);\n\t\t\t\t\tg.drawString(getBubbleStatus(), 385, 30);\n\t\t\t\t\tdrawNotification(g, \"winnerBanner.png\", 200, 270);\n\t\t\t\t\tg.drawString(getWinnerIs(), 210, 285);\n\t\t\t\t\tif(playerName != null && currentPlayerIs == PLAYER1){\n\t\t\t\t \t//p1 hand card\n\t\t\t\t\t\tdrawCard(relativePath, p1Card1, g, 90, 100);\n\t\t\t\t\t\tdrawCard(relativePath, p1Card2, g, 110, 100);\n\t\t\t\t\t\t//flopCards\n\t\t\t\t\t\tdrawCard(relativePath, flop1, g, 220, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop2, g, 270, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop3, g, 320, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop4, g, 370, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop5, g, 420, 190);\n\t\t\t\t\t\t//draw p2 facedown cards\n\t\t\t\t\t\tdrawFaceDown( g, 90, 300);\n\t\t\t\t\t\tdrawFaceDown( g, 110, 300);\n\t\t\t\t }else if(playerName2 != null && currentPlayerIs == PLAYER2){\n\t\t\t\t\t\t//p1 facedown cards\n\t\t\t\t\t\tdrawFaceDown( g, 90, 100);\n\t\t\t\t\t\tdrawFaceDown( g, 110, 100);\t\n\t\t\t\t\t\t//flopCards\n\t\t\t\t\t\tdrawCard(relativePath, flop1, g, 220, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop2, g, 270, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop3, g, 320, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop4, g, 370, 190);\n\t\t\t\t\t\tdrawCard(relativePath, flop5, g, 420, 190);\n\t\t\t\t\t\t//draw p2 hand cards stuffs\t\n\t\t\t\t\t\tdrawCard(relativePath, p2Card1, g, 90, 300);\n\t\t\t\t\t\tdrawCard(relativePath, p2Card2, g, 110, 300);\n\t\t\t\t }\n\t\t\t break;\n\t\t\t \t\n\t\t\t}\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\n\t\t\n\t}", "public void paint(Graphics g) {\n\n super.paint(g);\n \n //Fill the board with black if 0, red if 1\n for(int x = 0; x < gameBoard.length; x++) {\n for (int y = 0; y < gameBoard[0].length; y++) {\n \n //Draw red\n if (gameBoard[x][y] == 1) {\n\n g.setColor(Color.BLACK);\n g.fillRect(x*24, y*24, 24, 24);\n g.setColor(Color.RED);\n g.fillRect(x*24+1, y*24+1, 22, 22);\n\n //Draw black\n } else {\n\n g.setColor(Color.BLACK);\n g.fillRect(x*24, y*24, 24, 24);\n }\n }\n } \n }", "private void drawBoard(final Graphics g) {\n Graphics2D g2 = (Graphics2D) g;\n g2.setColor(Color.black);\n g2.fill(new Rectangle2D.Double(0, 0, DRAWING_AREA_SIZE_IN_PIXELS, DRAWING_AREA_SIZE_IN_PIXELS));\n // Render the board, each gadget renders onto the canvas\n board.render(g2); \n }", "public abstract void draw(Graphics g);", "public abstract void draw(Graphics g);", "public abstract void draw(Graphics g);", "public abstract void draw(Graphics g);", "public void draw(Graphics g);", "public void draw(Graphics g);", "public void paintComponent(Graphics g) {\n\t\tDate end = new Date();\n\t\tlong points = end.getTime() - start.getTime();\n\t\t\n\t\tsuper.paintComponent(g);\n\t\tthis.setBackground(new Color(164, 242, 245));\n\t\tg.setColor(new Color(54, 140, 22));\n\t\tg.fill3DRect(0, 400, 500, 100, true); //\n\t\tfor (int i = 0; i < elements.length; i++) {\n\t\t\telements[i].draw(g);\n//\t\t\t elements[i].jump();\n\t\t\tif (player.checkCollision(elements[i])){\n\t\t\t\tanimation.stop();\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Izgubio si\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tplayer.draw(g);\n\t\tg.drawString(Long.toString(points), 50, 50);\n\t}", "public void draw(Graphics g)\r\n\t\t{\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\t//Background\r\n\t\t\t\tg.setColor(Color.DARK_GRAY);\r\n\t\t\t\tg.fillRect(0, 0, this.getWidth(), this.getHeight());\r\n\t\t\t\t\r\n\t\t\t\t// Get info\r\n\t\t\t\tGameBoard game = cantStop.getGameBoard();\r\n\t\t\t\tif ( game == null ) {\r\n\t\t\t\t\tSystem.err.println(\"There was an error in your code! Check \" +\r\n\t\t\t\t\t\t\t\"that your CantStop.getGameBoard() returns a valid \" +\r\n\t\t\t\t\t\t\t\"GameGrid instance that is not null. \" );\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\r\n\t\t\t\tTrack[] tracks = game.getTracks();\r\n\t\t\t\tif ( tracks == null ) {\r\n\t\t\t\t\tSystem.err.println(\"There was an error in your code! Check \" +\r\n\t\t\t\t\t\t\t\"that your GameBoard.getTracks() is not null.\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPlayer[] players = game.getPlayers();\r\n\t\t\t\tif ( players == null) {\r\n\t\t\t\t\tSystem.err.println(\"There was an error in your code! Check \" +\r\n\t\t\t\t\t\t\t\"that your GameBoard.getPlayers() is not null.\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Column number headers\r\n\t\t\t\tFont f = new Font(\"Arial Bold\", Font.BOLD, 24);\r\n\t\t\t\tg.setFont(f);\r\n\t\t\t\tg.setColor(Color.BLACK);\r\n\t\t\t\tint x = BORDER - 1;\r\n\t\t\t\tfor(int ci=0; ci < tracks.length; ci++ ){\r\n\t\t\t\t\tTrack t = tracks[ci];\r\n\t\t\t\t\tif ( t == null ) {\r\n\t\t\t\t\t\tSystem.err.println(\"There was an error in your code! Check \" +\r\n\t\t\t\t\t\t\t\t\"that none of your Tracks are null.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tint y = 5*BORDER/2 + Math.abs(12 - t.getLength()) * SLOT_WIDTH/2;\r\n\t\t\t\t\t\r\n\t\t\t\t\tg.drawString(String.format(\"%2d\", ci+2), x, y);\r\n\t\t\t\t\tx += SLOT_WIDTH;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//TRACKS\r\n\t\t\t\tx = BORDER + DISK_DIAMETER/2;\r\n\t\t\t\tfor (int ci=0; ci < tracks.length; ci++ )\r\n\t\t\t\t{\t\t\t\t\r\n\t\t\t\t\tTrack t = tracks[ci];\r\n\t\t\t\t\tif ( t == null ) {\r\n\t\t\t\t\t\tSystem.err.println(\"There was an error in your code! Check \" +\r\n\t\t\t\t\t\t\t\t\"that none of your Tracks are null.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tint y = BORDER + SLOT_WIDTH + Math.abs(12 - t.getLength()) * SLOT_WIDTH/2;\r\n\t\t\t\t\t//Owner spot\r\n\t\t\t\t\tdrawCrown(g, x, y, t.getOwner());\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Other spots\r\n\t\t\t\t\ty += SLOT_WIDTH;\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (int ri = t.getLength() - 1; ri >=0 ; ri--)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tchar c = t.getIdAt(ri);\r\n\t\t\t\t\t\tswitch(c)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tcase Util.EMPTY_SLOT:\r\n\t\t\t\t\t\t\tg.setColor(Color.lightGray);\r\n\t\t\t\t\t\t\tg.fillOval(x - DOT_DIAMETER/2, y - DOT_DIAMETER/2, DOT_DIAMETER, DOT_DIAMETER);\r\n\t\t\t\t\t\t\tg.setColor(Color.BLACK);\r\n\t\t\t\t\t\t\tg.drawOval(x - DOT_DIAMETER/2, y - DOT_DIAMETER/2, DOT_DIAMETER, DOT_DIAMETER);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase Util.NEUTRAL_ID:\r\n\t\t\t\t\t\t\tg.setColor(Color.WHITE);\r\n\t\t\t\t\t\t\tg.fillOval(x - DISK_DIAMETER/2, y - DISK_DIAMETER/2, DISK_DIAMETER, DISK_DIAMETER);\r\n\t\t\t\t\t\t\tg.setColor(Color.BLACK);\r\n\t\t\t\t\t\t\tg.drawOval(x - DISK_DIAMETER/2, y - DISK_DIAMETER/2, DISK_DIAMETER, DISK_DIAMETER);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tboolean valid = false;\r\n\t\t\t\t\t\t\tfor(int i = 0; i < 4; i++) valid |= c == Util.PLAYER_IDS[i];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!valid){\r\n\t\t\t\t\t\t\t\tthrow new RuntimeException(\r\n\t\t\t\t\t\t\t\t\t\t\"Unknown disk character '\"+c+\"' found at row \"+ri+\" of column \"+ci+\".\");\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//Get correct player\r\n\t\t\t\t\t\t\t//Dont assume students store them in order\r\n\t\t\t\t\t\t\tColor color = Color.BLACK;\r\n\t\t\t\t\t\t\tfor(Player p: players){\r\n\t\t\t\t\t\t\t\tif(p.getId() == c){\r\n\t\t\t\t\t\t\t\t\tcolor = p.getColor();\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tg.setColor(color);\r\n\t\t\t\t\t\t\tg.fillOval(x - DISK_DIAMETER/2, y +- DISK_DIAMETER/2, DISK_DIAMETER, DISK_DIAMETER);\r\n\t\t\t\t\t\t\tg.setColor(Color.BLACK);\r\n\t\t\t\t\t\t\tg.drawOval(x - DISK_DIAMETER/2, y +- DISK_DIAMETER/2, DISK_DIAMETER, DISK_DIAMETER);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ty += SLOT_WIDTH;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tx += SLOT_WIDTH;\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch(NullPointerException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tcatch(ArrayIndexOutOfBoundsException e)\r\n\t\t\t{\r\n\t\t\t\tSystem.err.println(\"The GUI tried to access a cone within\" +\r\n\t\t\t\t\t\t\" your GameBoard's tracks, but this \" +\r\n\t\t\t\t\t\t\"resulted in an ArrayIdexOutOfBounds \" +\r\n\t\t\t\t\t\t\"Exception.\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t}", "void showpos(pieces chesspiece)\n {if(chesspiece.alive == true)\n {\n int position = chesspiece.position;\n chesspiece.select = true;\n \n int x;int y;\n if((position+1)%8 == 0) {x = 8; y = (position+8)/8;}\n else{ x = (position+1)%8;\n y = (position+9)/8;}\n chesspiece.move(new moves(x,y));\n for( int a : chesspiece.movnum )\n {\n if ( chesspiece.color == 0)\n {\n if (Checkerboard.allWhitePositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.GRAY);\n else if (Checkerboard.allBlackPositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.RED);\n else\n panel[a-1].setBackground(Color.GREEN);\n }\n else\n {\n if (Checkerboard.allWhitePositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.RED);\n else if (Checkerboard.allBlackPositions.contains(a-1)== true)\n panel[a-1].setBackground(Color.GRAY);\n else\n panel[a-1].setBackground(Color.GREEN);\n }\n \n }\n }//if(chesspiece.alive==true) ends\n }", "public void draw(Graphics g)\n {\n for (int row = 4; row < 24; row++) {\n for (int col = 0; col < 10; col++) {\n if (cells[row][col] != null) {\n cells[row][col].draw(getCellXCoord(col), getCellYCoord(row), g);\n }\n }\n }\n }", "@Override\r\n protected void paintComponent(Graphics g) {\n paintWater(g);\r\n \r\n g.setColor(new Color(255, 255, 255, 70));\r\n g.fillRect(0, 0, 500, 500);\r\n \r\n \r\n // Paint the Grid ------------------------------------------\r\n g.setColor(Color.BLACK);\r\n \r\n for (int i = -1; i < 500; i += 50) {\r\n \r\n g.fillRect(i, 0, 2, 500);\r\n g.fillRect(0, i, 500, 2);\r\n \r\n }\r\n \r\n paintShips(g);\r\n paintHits(g);\r\n \r\n \r\n if (isPainted && shortBoard == ATTACK_BOARD && newGD.isMyTurn() && !missile.isPlaced()) {\r\n g.drawImage(Assets.imgMissile, mouseX, mouseY, null);\r\n }\r\n \r\n if (shortBoard == ATTACK_BOARD && newGD.isMyTurn() && missile.isPlaced()) {\r\n g.drawImage(Assets.imgMissile, missile.getPosition().x, missile.getPosition().y, null);\r\n }\r\n \r\n // Paint square under mouse pointer (also for testing)\r\n /*if (isPainted) {\r\n \r\n g.setColor(colorSquare);\r\n g.fillRect(mouseX, mouseY, 50, 50);\r\n \r\n }*/\r\n \r\n }", "@Override\r\n public void render(final Graphics graphics) throws Exception\r\n {\r\n if (hasGameover())\r\n {\r\n //draw the victory screen\r\n graphics.drawImage(victory, 0, 0, null);\r\n }\r\n else\r\n {\r\n if (intermission.isActive())\r\n {\r\n //draw the intermission\r\n this.intermission.render(graphics);\r\n }\r\n else\r\n {\r\n //draw the background\r\n graphics.drawImage(background, 0, 0, null);\r\n\r\n //draw the current puzzle\r\n this.puzzles.render(graphics);\r\n\r\n //draw the pieces\r\n this.pieces.render(graphics);\r\n\r\n //draw the outline of the current puzzle\r\n this.puzzles.renderOutline(graphics);\r\n\r\n //draw the cursor\r\n this.puzzles.renderCursor(graphics);\r\n }\r\n }\r\n }", "protected abstract void drawGame();", "public void draw(Graphics g) {\r\n\t\tthis.update();\r\n\t\tint drawLength = (int) (dim.getWidth()/tSize) + (int) (x/tSize);\r\n\t\tif (drawLength >= tileMap[0].length-2) {\r\n\t\t\tdrawLength = tileMap[0].length-2;\r\n\t\t}\r\n\t\tint drawHeight = (int) (dim.getHeight()/tSize)+ (int) (y/tSize);\r\n\t\tif (drawHeight>= tileMap.length-2) {\r\n\t\t\tdrawHeight = tileMap.length-2;\r\n\t\t}\r\n\t\tfor (int i = (int) (x/tSize); i < drawLength+2; i++) {\r\n\t\t\tfor (int j = (int) (y/tSize); j < drawHeight+2; j++) {\r\n\t\t\t\ttileMap[i][j].draw(g, i*tSize - (int)x, j*tSize - (int)y, tSize);\r\n\t\t\t} // End for loop\r\n\t\t} // End for loop\r\n\t\tif (bestTrap) {\r\n\t\t\tg.drawImage(hideri, (int)(dim.getWidth()/2) - 332, (int)(dim.getHeight()/2) - 250, 663, 500, null);\r\n\t\t} // End if\r\n\t}", "public BoardCell draw(Graphics g, boolean specialColor) { \n\t\tx = (width * column);\n\t\ty = (height * row);\n\n\t\tif(specialColor) {\n\t\t\tsuper.repaint();\n\t\t\tsuper.paintComponent(g);\n\t\t\tg.setColor(Color.cyan);\n\t\t\tg.fillRect(x, y, width, height);\n\t\t}\n\n\t\t//if is not doorway\n\t\tif(this.isWalkway) {\n\t\t\tsuper.repaint();\n\t\t\tsuper.paintComponent(g);\n\t\t\tg.setColor(handleColor(Color.YELLOW, specialColor));\n\t\t\t//x, y, width, height\n\t\t\tg.fillRect(x, y, width, height);\n\t\t\tg.setColor(Color.BLACK);\n\t\t\tg.drawRect(x, y, width, height);\n\t\t}\n\t\t\n\t\t//if is doorway\n\t\telse if (this.isDoorway && this.isRoom){\n\t\t\t//display doorway direction\n\t\t\tswitch (this.doorDirection) {\n\t\t\t//display each cell's direction image\n\t\t\tcase LEFT:\n\t\t\t\tsuper.paintComponent(g);\n\t\t\t\tg.setColor(handleColor(Color.GRAY, specialColor));\n\t\t\t\tg.fillRect(x, y, width + 10, height );\n\t\t\t\tg.setColor(Color.BLUE);\n\t\t\t\tg.fillRect(x , y, doorWidth, height);\n\t\t\t\tbreak;\n\t\t\tcase RIGHT:\n\t\t\t\tsuper.paintComponent(g);\n\t\t\t\tg.setColor(handleColor(Color.GRAY, specialColor));\n\t\t\t\tg.fillRect(x, y, width, height);\n\t\t\t\tg.setColor(Color.BLUE);\n\t\t\t\tg.fillRect(x + 20, y, doorWidth, height);\n\t\t\t\tbreak;\n\t\t\tcase UP:\n\t\t\t\tsuper.paintComponent(g);\n\t\t\t\tg.setColor(handleColor(Color.GRAY, specialColor));\n\t\t\t\tg.fillRect(x, y, width, height);\n\t\t\t\tg.setColor(Color.BLUE);\n\t\t\t\tg.fillRect(x, y, width, doorHeight);\n\t\t\t\tbreak;\n\t\t\tcase DOWN:\n\t\t\t\tsuper.paintComponent(g);\n\t\t\t\tg.setColor(handleColor(Color.GRAY, specialColor));\n\t\t\t\tg.fillRect(x, y, width, height);\n\t\t\t\tg.setColor(Color.BLUE);\n\t\t\t\tg.fillRect(x, y + 20, width, doorHeight);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t//if the cell is a room\n\t\tif(this.isRoom && !this.isDoorway) {\n\t\t\tsuper.paintComponent(g);\n\t\t\tg.setColor(Color.gray);\n\t\t\tg.fillRect(x, y, width, height );\n\t\t}\n\t\t//if is closet\n\t\tif(this.isCloset && !this.isDoorway) {\n\t\t\tsuper.paintComponent(g);\n\t\t\tg.setColor(Color.RED);\n\t\t\tg.fillRect(x, y, width, height);\n\t\t}\n\t\t//draw the players and the player colors\n\t\tif(this.isPlayer) {\n\t\t\tsuper.paintComponent(g);\n\t\t\tg.setColor(this.playerColor);\n\t\t\tg.fillOval(x, y, width, height);\n\t\t}\n\t\t\n\t\t//this displays the room name\n\t\tif(isNameDrawer && !this.isDoorway) {\n\t\t\tsuper.paintComponent(g);\n\t\t\tg.setColor(Color.BLUE);\n\t\t\tg.drawString(board.getLegend().get(initial), x, y);\n\t\t\treturn this;\n\t\t} \n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}", "private void paintGame(Graphics g){\n\t\tg.setColor(Color.RED);\n\t\tg.fillRect(0, 0, DIMENSIONS_SIZE, DIMENSIONS_SIZE);\n\t\t\n\t\t//Search through for the player/AI blocks, paint them blue/black.\n\t\tfor (int i = 0; i<DIVISIONS; i++){\n\t\t\tfor(int j = 0; j<DIVISIONS; j++){\n\t\t\t\tint initialXCoord = i*DIVISION_DIMENSION;\n\t\t\t\tint initialYCoord = j*DIVISION_DIMENSION;\n\t\t\t\tif (gameArray[i][j] == USER){\n\t\t\t\t\tg.setColor(Color.BLUE);\n\t\t\t\t\tg.fillRect(initialXCoord, initialYCoord, DIVISION_DIMENSION, DIVISION_DIMENSION);\n\t\t\t\t}\n\t\t\t\tif (gameArray[i][j] == AI){\n\t\t\t\t\tg.setColor(Color.BLACK);\n\t\t\t\t\tg.fillRect(initialXCoord, initialYCoord, DIVISION_DIMENSION, DIVISION_DIMENSION);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void paintComponent(Graphics g){\n super.paintComponent(g);\n if(ingame){\n\n int screenWidth = this.getWidth();\n int screenHeight = this.getHeight();\n\n\n for(int i = 0; i < end_positions.size(); i++){\n End_position item = end_positions.get(i);\n g.setColor(Color.green);\n g.fillRect(item.getDestinationX()*screenWidth/LEVEL_WIDTH,item.getDestinationY()*screenHeight/LEVEL_HEIGHT,item.getImage().getWidth(null)*screenWidth/LEVEL_WIDTH,item.getImage().getWidth(null)*screenHeight/LEVEL_HEIGHT);\n }\n\n g.setColor(Color.white);\n g.fillRect(player.getCurrentX()*screenWidth/LEVEL_WIDTH,player.getCurrentY()*screenHeight/LEVEL_HEIGHT,player.getImage().getWidth(null)*screenWidth/LEVEL_WIDTH,player.getImage().getWidth(null)*screenHeight/LEVEL_HEIGHT);\n\n\n for(int i = 0; i < boxes.size(); i++){\n Box item = boxes.get(i);\n g.setColor(Color.yellow);\n g.fillRect(item.getCurrentX()*screenWidth/LEVEL_WIDTH,item.getCurrentY()*screenHeight/LEVEL_HEIGHT,item.getImage().getWidth(null)*screenWidth/LEVEL_WIDTH,item.getImage().getWidth(null)*screenHeight/LEVEL_HEIGHT);\n }\n for(int i = 0; i < walls.size(); i++){\n Wall item = walls.get(i);\n\n g.setColor(Color.red);\n g.fillRect(item.getDestinationX()*screenWidth/LEVEL_WIDTH,item.getDestinationY()*screenHeight/LEVEL_HEIGHT,item.getImage().getWidth(null)*screenWidth/LEVEL_WIDTH,item.getImage().getWidth(null)*screenHeight/LEVEL_HEIGHT);\n\n }\n\n }\n\n }", "void draw(Graphics g)\n {\n int aliveCount = 0, deadCount = 0;\n\n boolean[][] gridArray = grid.getGrid();\n for(int row = 0; row < gridArray.length; row++){\n for(int col = 0; col < gridArray[row].length; col++){\n if(gridArray[row][col]){\n if(grid.isInverted()) {\n g.setColor(Color.white);\n } else {\n g.setColor(Color.black);\n }\n aliveCount++;\n } else {\n if(grid.isInverted()) {\n g.setColor(Color.black);\n } else {\n g.setColor(Color.white);\n }\n deadCount++;\n }\n g.fillRect(col * (grid.getCellSize() + grid.getCellInnerGap()) + grid.getCellOuterGap() , row * (grid.getCellSize() + grid.getCellInnerGap()) + grid.getCellOuterGap(), grid.getCellSize(), grid.getCellSize());\n }\n }\n\n UserInterface.infoLabel.setText(\"<html><center>Generation: \" + grid.getGeneration() + \"</center>Alive: \" + aliveCount + \" ; Dead: \" + deadCount + \"</html>\");\n }", "public void paintComponent(Graphics g){\n updateCoordinateToScreenPosition();\n\n //Paint the tileColumns\n\n paintTileColumn(g);\n }", "public void paintComponent(Graphics g){\n\t\ttry \n\t\t{\n\t\t\tImage[] img = new Image[3];\n\t\t\tfor(int y = 0; y<3; y++)\n\t\t\t\timg[y] = ImageIO.read(new File(\"Images/case\"+y+\".png\"));\n\t\t\tImage IMGgagne = ImageIO.read(new File(\"Images/gagne.png\"));\n\t\t\tImage IMGperdu = ImageIO.read(new File(\"Images/perdu.png\"));\n\t\t\t\n\t\t\tImage[] numerotation = new Image[11];\n\t\t\tfor(int n = 0; n<11; n++)\n\t\t\t\tnumerotation[n] = ImageIO.read(new File(\"Images/\"+n+\".png\"));\n\t\t\tfor(int z = 0; z <= grille.length; z++)\n\t\t\t\tg.drawImage(numerotation[z], 32*z, 0, this);\n\t\t\tfor(int p = 1; p <= grille[0].length; p++)\n\t\t\t\tg.drawImage(numerotation[p], 0, 32*p, this);\n\t\t\t\n\t\t\tfor(int i = 0; i < grille.length; i++)\n\t\t\t{\n\t\t\t\tfor(int j = 0; j < grille[0].length; j++)\n\t\t\t\t{\n\t\t\t\t\tg.drawImage(img[grille[i][j]], 32*i+32, 32*j+32, this);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(gagne)\n\t\t\t{\n\t\t\t\tg.drawImage(IMGgagne, 32, 32, this);\n\t\t\t}\n\t\t\t\n\t\t\tif(perdu)\n\t\t\t{\n\t\t\t\tg.drawImage(IMGperdu, 32, 32, this);\n\t\t\t}\n\t\t\t\n\t\t} \n\t\tcatch (IOException e) \n\t\t{\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "public void paint(Graphics g) {\n super.paint(g);\n\n //Aumento lo spessore del bordo di gioco\n g.setColor(Color.red);\n for(short i=0; i<=5;i++)\n g.drawRect(100,100,LARGHEZZA+i,ALTEZZA+i);\n\n if (in_gioco){\n g.drawImage(bersaglio, bersaglio_x, bersaglio_y, this);\n\n for (int i = 0; i < punti; i++) {\n if (i == 0)\n g.drawImage(testa, x[i], y[i], this);\n else g.drawImage(corpo_serpente, x[i], y[i], this);\n }\n }\n else game_over();\n\n }", "private void drawGame(){\n drawBackGroundImage();\n drawWalls();\n drawPowerups();\n drawBullet();\n }", "abstract public void draw(Graphics2D g);", "public void draw(Graphics gr) {\n\n //Draw the buttons\n for (int i = 0; i < buttons.length; i++) {\n\n if(buttons[i].getIsSelected()){\n gr.setColor(Color.yellow);\n gr.fillRect((int)buttons[i].getX() , (int)buttons[i].getY()\n , buttons[i].height, buttons[i].width);\n }\n else if(buttons[i].contains(Game.mousePoint)){\n gr.setColor(Color.red);\n gr.fillRect((int)buttons[i].getX() , (int)buttons[i].getY()\n , buttons[i].height, buttons[i].width);\n }\n buttons[i].draw(gr, i);\n }\n\n //Draw the stats\n for (int i = 0; i < statsElements.length ; i++) {\n if(i == 0) {\n statsElements[i].drawStats(gr, i + 6, (int) noOfCredits);\n }else if (i ==1){\n statsElements[i].drawStats(gr, i + 6, time);\n }else if( i == 2){\n statsElements[i].drawStats(gr, i + 6, unitsToWin);\n }\n }\n }", "@Override\n public void paintComponent(Graphics g) {\n //Switch para seleccionar tipo de cuadro a pintar\n switch (tipo) {\n case JUGADOR:\n g.drawImage(jugador,x,y,null);\n break;\n case OBSTACULO:\n g.drawImage(obstaculo,x,y,null);\n break;\n case OBSTACULO2:\n switch (indiceObstaculo2) {\n case 0:\n g.drawImage(obstaculo20,x,y,null);\n break;\n case 1:\n g.drawImage(obstaculo21,x,y,null);\n break;\n case 2:\n g.drawImage(obstaculo22,x,y,null);\n break;\n case 3:\n g.drawImage(obstaculo23,x,y,null);\n break;\n case 4:\n g.drawImage(obstaculo24,x,y,null);\n break;\n case 5:\n g.drawImage(obstaculo25,x,y,null);\n break;\n }\n break;\n case RECOMPENSA:\n g.drawImage(recompensa,x,y,null);\n break;\n case ADVERSARIO:\n g.drawImage(adversario,x,y,null);\n break;\n case CASA:\n g.drawImage(casa,x,y,null);\n break;\n }\n }", "public void paint(Graphics g) {\n\t\tgraficos = (Graphics2D) g;\r\n\t\tgraficos.setBackground(Color.BLACK);\r\n\t\t\tgraficos.drawImage(background.get(indexBack), 0, repetir, null);\r\n\t\t\tgraficos.drawImage(background.get(indexBack), 0, repetir - 800, null); \r\n\t\tif (jogoAndamento == true) {\r\n\t\t\tif (boolFrenesi) {\r\n\t\t\t\tgraficos.drawImage(frenesiIMG.getImage(), 500, 730,null);\r\n\t\t\t}\r\n\t\t\t// Colocamos na tela a imagem da nave com suas evidas posições.\r\n\t\t\tgraficos.drawImage(nave.getNaveImg(), nave.getX(), nave.getY(), this);\r\n\t\t\ttiros = nave.getTiros();\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < tiros.size(); i++) {\r\n\t\t\t\tTiro shoot = (Tiro) tiros.get(i);\r\n\t\t\t\tgraficos.drawImage(shoot.getTiroImg(), shoot.getX(), shoot.getY(), this);\r\n\t\t\t}\r\n\r\n\t\t\tfor (int i = 0; i < inimigos.size(); i++) {\r\n\t\t\t\tInimigos enemies = inimigos.get(i);\r\n\t\t\t\tgraficos.drawImage(enemies.getInimigosImg(), enemies.getX(), enemies.getY(), this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < addVida.size(); i++) {\r\n\t\t\t\tVida lifes = addVida.get(i);\r\n\t\t\t\tgraficos.drawImage(lifes.getVidaImg(), lifes.getX(), lifes.getY(), this);\r\n\t\t\t}\r\n\r\n\t\t\tfor (int i = 0; i < tirosBoss.size(); i++) {\r\n\t\t\t\tTiro shootBoss = (Tiro) tirosBoss.get(i);\r\n\t\t\t\tgraficos.drawImage(shootBoss.getTiroBossImg(), shootBoss.getX(), shootBoss.getY(), this);\r\n\t\t\t}\r\n\r\n\t\t\tTimer tempoTemp;\r\n\t\t\tExplosao expTemp;\r\n\r\n\t\t\tfor (int i = 0; i < tempoExplosao.size(); i++) {\r\n\t\t\t\ttempoTemp = tempoExplosao.get(i);\r\n\t\t\t\texpTemp = explosoes.get(i);\r\n\t\t\t\tif (expTemp.getContador() == 5) {\r\n\t\t\t\t\ttempoTemp.stop();\r\n\t\t\t\t\ttempoExplosao.remove(i);\r\n\t\t\t\t\texplosoes.remove(i);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tgraficos.drawImage(expTemp.getExplosaoImg(), expTemp.getX(), expTemp.getY(), this);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (boolFrenesi && addBoss != null)\r\n\t\t\t\tgraficos.drawImage(addBoss.getBossImg(), (int) addBoss.getX(), (int) addBoss.getY(), this);\r\n\r\n\t\t\tImageIcon menubar = new ImageIcon(\"res\\\\menubar.png\");\r\n\t\t\tgraficos.drawImage(menubar.getImage(), 0, 0, null);\r\n\t\t\tgraficos.setColor(Color.white);\r\n\t\t\tgraficos.setFont(pontimer);\r\n\t\t\tgraficos.drawString(\" \" + pontos, 20, 14);\r\n\t\t\t// Caso seja menor que 10 segundos no timer ele irá colocar um zero antes (ESTÉTICA)\r\n\t\t\tif (tempo.segundos < 10) {\r\n\t\t\t\tgraficos.drawString(\" \" + tempo.minutos + \":0\" + tempo.segundos, 105, 14);\r\n\t\t\t} else {\r\n\t\t\t\tgraficos.drawString(\" \" + tempo.minutos + \":\" + tempo.segundos, 105, 14);\r\n\t\t\t}\r\n\t\t\r\n\t\t\tgraficos.drawString(\" \" + vidas, 198, 14);\r\n\t\t\tif (pause == true) {\r\n\t\t\t\tImageIcon pause = new ImageIcon(\"res\\\\Pause2.png\");\r\n\t\t\t\tgraficos.drawImage(pause.getImage(), 425, 375, null);\r\n\t\t\t}\r\n\t\t\tif (mute == true) {\r\n\t\t\t\tlong end = dataMudo + 3000;\r\n\t\t\t\tif (System.currentTimeMillis() < end) {\r\n\t\t\t\t\tgraficos.drawImage(noSound.getImage(), 850, 45, null);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tlong end = dataMudo + 3000;\r\n\t\t\t\tif (System.currentTimeMillis() < end) {\r\n\t\t\t\t\tgraficos.drawImage(sound.getImage(), 850, 45, null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (bossIsDead) {\r\n\t\t\t\tlong end = dataHundred + 1500;\r\n\t\t\t\tif (System.currentTimeMillis() < end) {\r\n\t\t\t\tgraficos.drawImage(hundredPoints.getImage(), 730, 45, null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(multiPontos > 1){\r\n\t\t\t\tswitch(multiPontos){\r\n\t\t\t\t\tcase 2:graficos.drawImage(x2.getImage(), 10, 45, null);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:graficos.drawImage(x3.getImage(), 10, 45, null);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 4:graficos.drawImage(x4.getImage(), 10, 45, null);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\ttry {\r\n\t\t\t\tif (jogoApagado == false) {\r\n\t\t\t\t\tApagaGame();\r\n\t\t\t\t\tjogoApagado = true;\r\n\t\t\t\t}\r\n\t\t\t} catch (Throwable e1) {\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t\tImageIcon black = new ImageIcon(\"res\\\\black.png\");\r\n\t\t\tgraficos.drawImage(black.getImage(), 0, 0, null);\r\n\t\t\tImageIcon gameover = new ImageIcon(\"res\\\\game-over.gif\");\r\n\t\t\tgraficos.drawImage(gameover.getImage(), 160, 190, null);\r\n\t\t\tgraficos.setColor(Color.white);\r\n\t\t\t\r\n\t\t\tif(!eventKey){\r\n\t\t\t\tkeyGameOver = new EventoMenuFinal();\r\n\t\t\t\taddKeyListener(keyGameOver);\r\n\t\t\t\teventKey = true;\r\n\t\t\t}\r\n\t\t\tseta = new ImageIcon(\"res\\\\seta.gif\");\r\n\t\t\ttry {\r\n\t\t\t\tif (gravadoRc == false) {\r\n\t\t\t\t\tgravadoRc = true;\r\n\t\t\t\t\tif(tempo.segundos < 9 || tempo.segundos == 0)\r\n\t\t\t\t\t\ttempoString = Integer.toString(tempo.minutos)+\":0\"+Integer.toString(tempo.segundos);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\ttempoString = Integer.toString(tempo.minutos)+\":\"+Integer.toString(tempo.segundos);\r\n\t\t\t\t\tGravarRecord(pontos);\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tif (up == true) {\r\n\t\t\t\tgraficos.drawImage(seta.getImage(), 230, 515, null);\r\n\t\t\t\tsetFocusable(true);\r\n\t\t\t}\r\n\t\t\tif (down == true) {\r\n\t\t\t\tgraficos.drawImage(seta.getImage(), 230, 545, null);\r\n\t\t\t\tsetFocusable(true);\r\n\t\t\t}\r\n\t\t\tgraficos.setFont(pontuacaoFinal);\r\n\t\t\tgraficos.drawString(\"Jogar Novamente\", 330, 550);\r\n\t\t\tgraficos.drawString(\"Voltar ao Menu Principal\", 330, 580);\r\n\t\t\tgraficos.drawString(\"Você conseguiu incríveis \" + pontos + \" pontos!\", 330, 650);\r\n\t\t\tg.dispose();\r\n\t\t}\r\n\t\tg.dispose();// Irá repintar a tela com as novas atualizações.\r\n\t}", "private void draw(){\n GraphicsContext gc = canvasArea.getGraphicsContext2D();\n canvasDrawer.drawBoard(canvasArea, board, gc, currentCellColor, currentBackgroundColor, gridToggle);\n }", "@Override\r\n public void paint(Graphics g) {\n super.paint(g);\r\n Color col = new Color(255, 255, 255);//color gris\r\n g.drawLine(0, 20, 245, 20);//pinta una linea en la parte superior de la ventana\r\n Dimension size = getSize();//encapsula el tamñao de un objeto\r\n int parteSuperiorTablero = (int) size.getHeight() - altoTablero * alturaPieza();\r\n\r\n for (int i = 0; i < altoTablero; ++i) {\r\n for (int j = 0; j < anchoTablero; ++j) {\r\n PiezasTetris pieza = dimensionar(j, altoTablero - i - 1);\r\n if (pieza != PiezasTetris.NoPieza) {\r\n pintarPiezas(g, 0 + j * anchoPieza(),\r\n parteSuperiorTablero + i * alturaPieza(), pieza);\r\n }\r\n }\r\n }\r\n\r\n if (piezaActual.getPieza() != PiezasTetris.NoPieza) {\r\n for (int i = 0; i < 4; ++i) {\r\n int x = posicionX + piezaActual.x(i);\r\n int y = posicionY - piezaActual.y(i);\r\n pintarPiezas(g, 0 + x * anchoPieza(),\r\n parteSuperiorTablero + (altoTablero - y - 1) * alturaPieza(),\r\n piezaActual.getPieza());\r\n }\r\n }\r\n }", "public void draw(Graphics2D g) {\n\n\t\tVector size = new Vector(Main.frame.getContentPane().getWidth() + 64, 64 + 64);\n\t\tposition = new Vector(0, Main.frame.getContentPane().getHeight() - 40);\n\n\t\tg.setPaint(new GradientPaint((float)position.x, (float)position.y, new Color(46, 102, 133, 210),\n\t\t\t\t(float)position.x, (float)(position.y + 40), new Color(16, 36, 47, 210)));\n\t\t\n\t\tg.fillRect((int)position.x, (int)position.y, (int)size.x, (int)size.y);\n\t\tDraw.fillRect(g, position, size);\n\t\tg.setColor(new Color(76, 147, 179, 210));\n\t\tDraw.drawLine(g, position, position.plus(size.x, 0));\n\t\t\n\t\tdouble offset = 16;\n\n\t\tFont font = new Font(\"Crystal clear\", Font.PLAIN, 18);\n\t\tg.setFont(font);\n\t\tg.setColor(new Color(33, 189, 222));\n\t\t\n\t\tfor (int i = 0; i < PowerUp.NUM_TYPES; i++) {\n\t\t\t\n\t\t\tif (PowerUp.isPowerUpInGame(i, trilogy.game)) {\n\t\t\t\t\n\t\t\t\tint numCollected = 0;\n\t\t\t\tint numTotal = trilogy.powerUps.get(i).size();\n\t\t\t\t\n\t\t\t\tfor (PowerUp p : trilogy.powerUps.get(i)) {\n\t\t\t\t\tif (p.collected)\n\t\t\t\t\t\tnumCollected++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tImage image = PowerUp.getPowerUpIcon(i);\n\t\t\t\tif (image != null) {\n\t\t\t\t\tDraw.drawImage(g, image, position.plus(offset, -4));\n\t\t\t\t\toffset += image.getWidth(null);\n\t\t\t\t\toffset += 6;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tDraw.drawString(g, numCollected + \"/\" + numTotal, position.plus(offset, 9), Draw.ALIGN_TOP);\n\t\t\t\t\n\t\t\t\toffset += Draw.getStringSize(numCollected + \"/\" + numTotal, font).x;\n\t\t\t\t//offset += Draw.getStringSize(\"000/000\", font).x;\n\t\t\t\t\n\t\t\t\toffset += 12;\n\t\t\t}\n\t\t}\n\n\t\tfont = new Font(\"Crystal clear\", Font.PLAIN, 18);\n\t\tfont = Palette.fontEurostar.deriveFont(Font.PLAIN, 20);\n\t\tg.setFont(font);\n\t\t\n\t\tDraw.drawString(g, \"Completion:\",\n\t\t\t\tposition.plus(Main.frame.getContentPane().getWidth() - 72, 8),\n\t\t\t\tDraw.ALIGN_RIGHT | Draw.ALIGN_TOP);\n\t\t\n\t\tDraw.drawString(g, trilogy.getCompletionPercentage() + \"%\",\n\t\t//Draw.drawString(g, \"100%\",\n\t\t\t\tposition.plus(Main.frame.getContentPane().getWidth() - 16, 8),\n\t\t\t\tDraw.ALIGN_RIGHT | Draw.ALIGN_TOP);\n\t}", "public void paint(Graphics g) {\n\t\t\tif(!winning&&!losing){\n\t\t\t\t//System.out.println(\"IN PAINT\");\n\t\t\t\tsuper.paint(g);\n\t\t\t\tImage background;\n\t\t\t\tURL loc = this.getClass().getResource(\"sky.jpg\");\n\t\t\t\tImageIcon o = new ImageIcon(loc);\n\t\t\t\tbackground = o.getImage();\n\t\t\t\tg.drawImage(background,0, 0, this.getWidth(), this.getHeight(),null);\n\t\t\t\tlevel.addLevel();\n\t\t\t\tString chosen= level.getLevel(Level);\n\t\t\t\tlimit= level.getTime(Level);\n\t\t\t\t//\tg.drawRect (50, 50, 100, 100);\n\t\t\t\t//System.out.println(chosen);\n\n\t\t\t\tfor(int i=0;i<chosen.length();i++){\n\t\t\t\t\tchar c = chosen.charAt(i);\n\t\t\t\t\t//System.out.println(c);\n\t\t\t\t\tif(c==' '){\n\t\t\t\t\t\tside+=20;//add up to the x-position \n\t\t\t\t\t}\n\t\t\t\t\telse if(c=='#'){\n\t\t\t\t\t\tside+=20;\n\t\t\t\t\t\tif(number==0)//if it is the first time print out\n\t\t\t\t\t\t\twalls.add(new wall(side,upper));//add to the wall list\n\t\t\t\t\t}\n\t\t\t\t\telse if(c=='$'){\n\t\t\t\t\t\tside+=20;\n\t\t\t\t\t\tif(number==0)\n\t\t\t\t\t\t\tboxes.add(new box(side, upper));\n\n\n\t\t\t\t\t}\n\t\t\t\t\telse if(c=='\\n'){\n\t\t\t\t\t\tside=0;\n\t\t\t\t\t\tupper+=20;\n\t\t\t\t\t}\n\t\t\t\t\telse if (c=='.'){\n\t\t\t\t\t\tside+=20;\n\t\t\t\t\t\tif(number==0)\n\t\t\t\t\t\t\tareas.add(new area(side, upper));//add to the areas list\n\t\t\t\t\t}\n\t\t\t\t\telse if(c=='a'){\n\t\t\t\t\t\tside+=20;\n\t\t\t\t\t\th= new player(side+velX,upper+velY);//change the position of the player\n\t\t\t\t\t\tg.drawRect (h.getX(), h.getY(), 20, 20);\n\t\t\t\t\t\tg.drawImage(h.getP(), h.getX(),h.getY(),20,20, null);//draw the player\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tnumber++;// the number of paint times add\n\t\t\t\tside=40;//reset the initial x position\n\t\t\t\tupper=80;//reset the initial y position\n\t\t\t\t//\t\t\tSystem.out.println(\"here\");\n\t\t\t\tfor(int i=0;i<walls.size();i++){\n\t\t\t\t\t//System.out.println(\"HERE\");\n\t\t\t\t\twall a= walls.get(i);\n\t\t\t\t\t//\t\t\t\tSystem.out.println(\"X: \"+a.getX());\n\t\t\t\t\t//\t\t\t\tSystem.out.println(\"Y: \"+a.getY());\n\t\t\t\t\tg.drawRect (a.getX(), a.getY(), 20, 20);\n\t\t\t\t\t//g.drawRect(30, 30, 100, 100);\n\t\t\t\t\tg.drawImage(a.getP(), a.getX(),a.getY(), 20, 20,null);\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\t * This section is used to draw the boxes\n\t\t\t\t */\n\t\t\t\tfor(int i=0;i<boxes.size();i++){\n\t\t\t\t\tbox a= boxes.get(i);\n\t\t\t\t\tg.drawRect (a.getX(), a.getY(), 20, 20);\n\t\t\t\t\tg.drawImage(a.getP(), a.getX(),a.getY(),20,20, null);\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\t * This section is used to draw the areas\n\t\t\t\t */\n\t\t\t\tfor(int i=0; i<areas.size();i++){\n\t\t\t\t\tarea a = areas.get(i);\n\t\t\t\t\tg.drawRect (a.getX(), a.getY(), 20, 20);\n\t\t\t\t\tg.drawImage(null, a.getX(),a.getY(),20,20, null);\n\t\t\t\t}\n\t\t\t\t//System.out.println(m.getTime());\n\t\t\t\tg.drawString (\"Steps: \" + steps, 300, 400);\n\t\t\t\tg.drawString (\"Remaining steps: \" + (limit-steps), 300, 420);//show the remaining steps \n\t\t\t}\n\t\t\telse if(losing){//change the screen if you lose\n\t\t\t\tImage background;\n\t\t\t\tURL loc = this.getClass().getResource(\"over.jpg\");\n\t\t\t\tImageIcon o = new ImageIcon(loc);\n\t\t\t\tbackground = o.getImage();\n\t\t\t\tg.drawImage(background,0, 0, this.getWidth(), this.getHeight(),null);\n\t\t\t}\n\t\t\telse if(winning){//change the screen if you win\n \n\t\t\t\tImage background;\n\t\t\t\tURL loc = this.getClass().getResource(\"win.jpg\");\n\t\t\t\tImageIcon o = new ImageIcon(loc);\n\t\t\t\tbackground = o.getImage();\n\t\t\t\tg.drawImage(background,0, 0, this.getWidth(), this.getHeight(),null);\n\t\t\t}\n\n\n\t\t\n\n\n\t\t}", "public void paintComponent(Graphics arg0) {\n\t\tsuper.paintComponent(arg0);\n\t\targ0.setColor(Color.BLACK); \n\t\tboard(arg0); \n\t\tdrawStone(arg0);\n\t}", "protected abstract void paintGrid(Graphics2D g);", "@Override\n public void paint(Graphics g) {\n super.paintComponents(g);\n\n // a continuación apunto al jPanel\n Graphics2D g2 = (Graphics2D) jPanel1.getGraphics();\n\n // pinto el buffer sobre el jPanel\n g2.drawImage(buffer, 0, 0, null);\n \n \n }", "public void paint(Graphics g) {\r\n\t\tsuper.paint(g);\r\n\t\tGraphics2D g2d = (Graphics2D) g;\r\n\t\tg2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\r\n\t\t\t\tRenderingHints.VALUE_ANTIALIAS_ON);\r\n\r\n\t\tif (turn == -2) {\r\n\t\t\tthis.initialize();\r\n\t\t}\r\n\t\t\r\n\t\tfor (int row = 0; row <= turn; row++) {\r\n\t\t\tfor(int i = 0; i < 4; i++) {\t\t\r\n\t\t\t\tchar col = guessArray[row].getColorAtIndex(i);\r\n\t\t\t\tg2d.setColor(returnColorForCharacter(col));\t\r\n\t\t\t\tg2d.fill(returnGuessEllipse(row,i));\r\n\r\n\t\t\t\tcol = responseArray[row].getColorAtIndex(i);\r\n\t\t\t\tg2d.setColor(returnColorForCharacter(col));\r\n\t\t\t\tg2d.fill(returnResponseEllipse(row,i));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor(int i = 0; i < 4; i++) {\r\n\t\t\tg2d.setColor(returnColorForCharacter(guessArray[guessArray.length-1].getColorAtIndex(i)));\t\r\n\t\t\tg2d.fill(returnGuessEllipse((guessArray.length-1),i));\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tg2d.setColor(Color.red);\t\r\n\t\tg2d.fill(new Rectangle2D.Double((4*60),((guessArray.length-1)*60)+22,60,60));\r\n\t\t\r\n\t\tg2d.setColor(Color.black);\t\r\n\t\tg2d.drawString(\"GO\",(4*60)+22,((guessArray.length-1)*60)+57);\r\n\t\t\r\n\t\tif(turn == -2) {\r\n\t\t\tg2d.drawImage(menuImage, 0, 0, null);\r\n\t\t}\r\n\t\telse if(gameOver){\r\n\t\t\tif(win) {\r\n\t\t\t\tg2d.drawImage(winImage, 0, 0, null);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tg2d.drawImage(loseImage, 0, 0, null);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\r\n\t}", "private void drawPlayers(Graphics g){\n\t\tg.setColor(Color.BLACK);\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\tfor(GameMatter itm: grid[i][j].getItems()){\n\t\t\t\t\tif(itm instanceof Bandit){\n\t\t\t\t\t\tif(itm.equals(player))\n\t\t\t\t\t\t\tg.setColor(Color.MAGENTA);\n\t\t\t\t\t\tg.fillRect(j*widthBlock+padding, i*heightBlock+padding, bandit, bandit);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void makeShortComps(JPanel[] subShort){\n\t\t\tsubShort[0] = new JPanel(){ //Side Panel #1\n\t\t\t\t@Override\n\t\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\t\tsuper.paintComponent(g);\n\t\t\t\t\tGraphics2D g2d = (Graphics2D) g;\n\t\t\t\t\tg2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\n\t\t\t\t\tint w = getWidth();\n\t\t\t\t\tint h = getHeight();\n\t\t\t\t\tGradientPaint gp = new GradientPaint(0, 0, shortColors[0], 0, h, shortColors[10]);\n\t\t\t\t\tg2d.setPaint(gp);\n\t\t\t\t\tg2d.fillRect(2, 2, w, h);\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\tsubShort[1] = new JPanel(){\n\t\t\t\t@Override\n\t\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\t\tsuper.paintComponent(g);\n\t\t\t\t\tGraphics2D g2d = (Graphics2D) g;\n\t\t\t\t\tg2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\n\t\t\t\t\tint w = getWidth();\n\t\t\t\t\tint h = getHeight();\n\t\t\t\t\tGradientPaint gp = new GradientPaint(0, 0, shortColors[1], 0, h, shortColors[11]); \n\t\t\t\t\tg2d.setPaint(gp);\n\t\t\t\t\tg2d.fillRect(2, 2, w, h);\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\tsubShort[2] = new JPanel(){\n\t\t\t\t@Override\n\t\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\t\tsuper.paintComponent(g);\n\t\t\t\t\tGraphics2D g2d = (Graphics2D) g;\n\t\t\t\t\tg2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\n\t\t\t\t\tint w = getWidth();\n\t\t\t\t\tint h = getHeight();\n\t\t\t\t\tGradientPaint gp = new GradientPaint(0, 0, shortColors[2], 0, h, shortColors[12]);\n\t\t\t\t\tg2d.setPaint(gp);\n\t\t\t\t\tg2d.fillRect(2, 2, w, h);\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\tsubShort[3] = new JPanel(){\n\t\t\t\t@Override\n\t\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\t\tsuper.paintComponent(g);\n\t\t\t\t\tGraphics2D g2d = (Graphics2D) g;\n\t\t\t\t\tg2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\n\t\t\t\t\tint w = getWidth();\n\t\t\t\t\tint h = getHeight();\n\t\t\t\t\tGradientPaint gp = new GradientPaint(0, 0, shortColors[3], 0, h, shortColors[13]);\n\t\t\t\t\tg2d.setPaint(gp);\n\t\t\t\t\tg2d.fillRect(2, 2, w, h);\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\tsubShort[4] = new JPanel(){\n\t\t\t\t@Override\n\t\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\t\tsuper.paintComponent(g);\n\t\t\t\t\tGraphics2D g2d = (Graphics2D) g;\n\t\t\t\t\tg2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\n\t\t\t\t\tint w = getWidth();\n\t\t\t\t\tint h = getHeight();\n\t\t\t\t\tGradientPaint gp = new GradientPaint(0, 0, shortColors[4], 0, h, shortColors[14]);\n\t\t\t\t\tg2d.setPaint(gp);\n\t\t\t\t\tg2d.fillRect(2, 2, w, h);\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\tsubShort[5] = new JPanel(){\n\t\t\t\t@Override\n\t\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\t\tsuper.paintComponent(g);\n\t\t\t\t\tGraphics2D g2d = (Graphics2D) g;\n\t\t\t\t\tg2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\n\t\t\t\t\tint w = getWidth();\n\t\t\t\t\tint h = getHeight();\n\t\t\t\t\tGradientPaint gp = new GradientPaint(0, 0, shortColors[5], 0, h, shortColors[15]);\n\t\t\t\t\tg2d.setPaint(gp);\n\t\t\t\t\tg2d.fillRect(2, 2, w, h);\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\tsubShort[6] = new JPanel(){\n\t\t\t\t@Override\n\t\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\t\tsuper.paintComponent(g);\n\t\t\t\t\tGraphics2D g2d = (Graphics2D) g;\n\t\t\t\t\tg2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\n\t\t\t\t\tint w = getWidth();\n\t\t\t\t\tint h = getHeight();\n\t\t\t\t\tGradientPaint gp = new GradientPaint(0, 0, shortColors[6], 0, h, shortColors[16]);\n\t\t\t\t\tg2d.setPaint(gp);\n\t\t\t\t\tg2d.fillRect(2, 2, w, h);\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\tsubShort[7] = new JPanel(){\n\t\t\t\t@Override\n\t\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\t\tsuper.paintComponent(g);\n\t\t\t\t\tGraphics2D g2d = (Graphics2D) g;\n\t\t\t\t\tg2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\n\t\t\t\t\tint w = getWidth();\n\t\t\t\t\tint h = getHeight();\n\t\t\t\t\tGradientPaint gp = new GradientPaint(0, 0, shortColors[7], 0, h, shortColors[17]);\n\t\t\t\t\tg2d.setPaint(gp);\n\t\t\t\t\tg2d.fillRect(2, 2, w, h);\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\tsubShort[8] = new JPanel(){\n\t\t\t\t@Override\n\t\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\t\tsuper.paintComponent(g);\n\t\t\t\t\tGraphics2D g2d = (Graphics2D) g;\n\t\t\t\t\tg2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\n\t\t\t\t\tint w = getWidth();\n\t\t\t\t\tint h = getHeight();\n\t\t\t\t\tGradientPaint gp = new GradientPaint(0, 0, shortColors[8], 0, h, shortColors[18]);\n\t\t\t\t\tg2d.setPaint(gp);\n\t\t\t\t\tg2d.fillRect(2, 2, w, h);\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\tsubShort[9] = new JPanel(){\n\t\t\t\t@Override\n\t\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\t\tsuper.paintComponent(g);\n\t\t\t\t\tGraphics2D g2d = (Graphics2D) g;\n\t\t\t\t\tg2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\n\t\t\t\t\tint w = getWidth();\n\t\t\t\t\tint h = getHeight();\n\t\t\t\t\tGradientPaint gp = new GradientPaint(0, 0, shortColors[9], 0, h, shortColors[19]);\n\t\t\t\t\tg2d.setPaint(gp);\n\t\t\t\t\tg2d.fillRect(2, 2, w, h);\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\tsubShort[10] = new JPanel(); //Side Panel #2\n\t\t\tsubShort[11] = new JPanel(); //Side Panel #3\n\t\t}" ]
[ "0.76537657", "0.7413877", "0.71783537", "0.7134908", "0.7051029", "0.7046917", "0.69675356", "0.69070005", "0.6798479", "0.67765003", "0.6747229", "0.67084616", "0.67069274", "0.6692883", "0.6679048", "0.6620253", "0.6613795", "0.66103494", "0.6595309", "0.64839464", "0.648111", "0.64805824", "0.6477594", "0.6473665", "0.6455564", "0.64168423", "0.64154875", "0.63868344", "0.63808113", "0.63759124", "0.6357298", "0.6356277", "0.63379824", "0.63345444", "0.63256747", "0.63194346", "0.631735", "0.63043153", "0.630376", "0.630008", "0.6289223", "0.62881786", "0.6271188", "0.6269402", "0.6267387", "0.62220174", "0.62217385", "0.62216896", "0.6214313", "0.62060016", "0.61943275", "0.6193655", "0.61919457", "0.6178944", "0.61777645", "0.61749077", "0.61749005", "0.6169784", "0.6165362", "0.61612654", "0.6160421", "0.61597484", "0.61581945", "0.6147292", "0.61461616", "0.61461616", "0.61461616", "0.61461616", "0.6131135", "0.6131135", "0.61228037", "0.6122196", "0.61181587", "0.6113656", "0.6112129", "0.6107889", "0.6106961", "0.61055446", "0.61026293", "0.6098401", "0.60981524", "0.6096129", "0.6092538", "0.60912913", "0.6090214", "0.60896105", "0.60874325", "0.6085167", "0.6081526", "0.6079759", "0.6077171", "0.60738957", "0.6070473", "0.6068463", "0.60569745", "0.6056776", "0.60526097", "0.6048041", "0.6043336", "0.60423076" ]
0.82064766
0
Attempts to obtain the credential with the providedId from the item's credential context, otherwise returns token
public static String getTokenToUse(String credentialId, Item item, String token) { String response; if (StringUtils.isEmpty(credentialId)) { response = token; } else { StringCredentials credentials = lookupCredentials(StringUtils.trim(credentialId), item); if (credentials != null) { response = credentials.getSecret().getPlainText(); } else { response = token; } } if (StringUtils.isEmpty(response)) { throw new IllegalArgumentException("the token with the provided ID could not be found and no token was specified"); } return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public java.lang.String getCredentialId() {\r\n return credentialId;\r\n }", "public Object getCredential()\n {\n return this.credential;\n }", "public Object getCredential()\n {\n return this.credential;\n }", "public Object getCredential()\n {\n return this.credential;\n }", "public String getCredentialId() {\n return this.CredentialId;\n }", "public int getTokenViaClientCredentials(){\n\t\t//Do we have credentials?\n\t\tif (Is.nullOrEmpty(clientId) || Is.nullOrEmpty(clientSecret)){\n\t\t\treturn 1;\n\t\t}\n\t\ttry{\n\t\t\t//Build auth. header entry\n\t\t\tString authString = \"Basic \" + Base64.getEncoder().encodeToString((clientId + \":\" + clientSecret).getBytes());\n\t\t\t\n\t\t\t//Request headers\n\t\t\tMap<String, String> headers = new HashMap<>();\n\t\t\theaders.put(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\t\t\theaders.put(\"Authorization\", authString);\n\t\t\t\n\t\t\t//Request data\n\t\t\tString data = ContentBuilder.postForm(\"grant_type\", \"client_credentials\");\n\t\t\t\n\t\t\t//Call\n\t\t\tlong tic = System.currentTimeMillis();\n\t\t\tthis.lastRefreshTry = tic;\n\t\t\tJSONObject res = Connectors.httpPOST(spotifyAuthUrl, data, headers);\n\t\t\tStatistics.addExternalApiHit(\"SpotifyApi getTokenViaClientCredentials\");\n\t\t\tStatistics.addExternalApiTime(\"SpotifyApi getTokenViaClientCredentials\", tic);\n\t\t\t//System.out.println(res.toJSONString()); \t\t//DEBUG\n\t\t\tif (!Connectors.httpSuccess(res)){\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\tString token = JSON.getString(res, \"access_token\");\n\t\t\tString tokenType = JSON.getString(res, \"token_type\");\n\t\t\tlong expiresIn = JSON.getLongOrDefault(res, \"expires_in\", 0);\n\t\t\tif (Is.nullOrEmpty(token)){\n\t\t\t\treturn 4;\n\t\t\t}else{\n\t\t\t\tthis.token = token;\n\t\t\t\tthis.tokenType = tokenType;\n\t\t\t\tthis.tokenValidUntil = System.currentTimeMillis() + (expiresIn * 1000);\n\t\t\t}\n\t\t\treturn 0;\n\t\t\t\n\t\t}catch (Exception e){\n\t\t\tStatistics.addExternalApiHit(\"SpotifyApi-error getTokenViaClientCredentials\");\n\t\t\treturn 3;\n\t\t}\n\t}", "public Credential getCredential() {\n return this.credential;\n }", "@Override\n public Object getCredentials() {\n return token;\n }", "private String getToken() {\n String keyFilePath = System.getenv(\"APE_API_KEY\");\n if (Strings.isNullOrEmpty(keyFilePath)) {\n File globalKeyFile = GlobalConfiguration.getInstance().getHostOptions().\n getServiceAccountJsonKeyFiles().get(GLOBAL_APE_API_KEY);\n if (globalKeyFile == null || !globalKeyFile.exists()) {\n CLog.d(\"Unable to fetch the service key because neither environment variable \" +\n \"APE_API_KEY is set nor the key file is dynamically downloaded.\");\n return null;\n }\n keyFilePath = globalKeyFile.getAbsolutePath();\n }\n if (Strings.isNullOrEmpty(mApiScope)) {\n CLog.d(\"API scope not set, use flag --business-logic-api-scope.\");\n return null;\n }\n try {\n Credential credential = GoogleCredential.fromStream(new FileInputStream(keyFilePath))\n .createScoped(Collections.singleton(mApiScope));\n credential.refreshToken();\n return credential.getAccessToken();\n } catch (FileNotFoundException e) {\n CLog.e(String.format(\"Service key file %s doesn't exist.\", keyFilePath));\n } catch (IOException e) {\n CLog.e(String.format(\"Can't read the service key file, %s\", keyFilePath));\n }\n return null;\n }", "public String getToken(String name){\n\n return credentials.get(name, token);\n }", "public Credential getUsercredential(final String authCode)\n\t\t\tthrows IOException, JSONException {\n\t\tfinal GoogleTokenResponse response = flow.newTokenRequest(authCode)\n\t\t\t\t.setRedirectUri(CALLBACK_URI).execute();\n\t\tfinal Credential credential = flow.createAndStoreCredential(response,\n\t\t\t\tnull);\n\t\treturn credential;\n\t}", "public QCloudLifecycleCredentials onGetCredentialFromLocal(String secretId2, String secretKey2) throws QCloudClientException {\n long current = System.currentTimeMillis() / 1000;\n String keyTime = current + \";\" + (current + this.duration);\n return new BasicQCloudCredentials(secretId2, secretKey2SignKey(secretKey2, keyTime), keyTime);\n }", "@Override\n public ExternalCredentialsResponse getCredentials(Principal principal, DomainDetails domainDetails, String idToken, ExternalCredentialsRequest externalCredentialsRequest)\n throws ResourceException {\n\n // first make sure that our required components are available and configured\n\n if (authorizer == null) {\n throw new ResourceException(ResourceException.FORBIDDEN, \"ZTS authorizer not configured\");\n }\n\n Map<String, String> attributes = externalCredentialsRequest.getAttributes();\n final String gcpServiceAccount = getRequestAttribute(attributes, GCP_SERVICE_ACCOUNT, null);\n if (StringUtil.isEmpty(gcpServiceAccount)) {\n throw new ResourceException(ResourceException.BAD_REQUEST, \"missing gcp service account\");\n }\n\n // verify that the given principal is authorized for all scopes requested\n\n final String gcpTokenScope = getRequestAttribute(attributes, GCP_TOKEN_SCOPE, GCP_DEFAULT_TOKEN_SCOPE);\n String[] gcpTokenScopeList = gcpTokenScope.split(\" \");\n for (String scopeItem : gcpTokenScopeList) {\n final String resource = domainDetails.getName() + \":\" + scopeItem;\n if (!authorizer.access(GCP_SCOPE_ACTION, resource, principal, null)) {\n throw new ResourceException(ResourceException.FORBIDDEN, \"Principal not authorized for configured scope\");\n }\n }\n\n try {\n // first we're going to get our exchange token\n\n GcpExchangeTokenResponse exchangeTokenResponse = getExchangeToken(domainDetails, idToken, externalCredentialsRequest);\n\n final String serviceUrl = String.format(\"https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/%s@%s.iam.gserviceaccount.com:generateAccessToken\",\n gcpServiceAccount, domainDetails.getGcpProjectId());\n final String authorizationHeader = exchangeTokenResponse.getTokenType() + \" \" + exchangeTokenResponse.getAccessToken();\n\n GcpAccessTokenRequest accessTokenRequest = new GcpAccessTokenRequest();\n accessTokenRequest.setScopeList(gcpTokenScope);\n int expiryTime = externalCredentialsRequest.getExpiryTime() == null ? 3600 : externalCredentialsRequest.getExpiryTime();\n accessTokenRequest.setLifetimeSeconds(expiryTime);\n\n HttpPost httpPost = new HttpPost(serviceUrl);\n httpPost.addHeader(HttpHeaders.AUTHORIZATION, authorizationHeader);\n httpPost.setEntity(new StringEntity(jsonMapper.writeValueAsString(accessTokenRequest), ContentType.APPLICATION_JSON));\n\n final HttpDriverResponse httpResponse = httpDriver.doPostHttpResponse(httpPost);\n if (httpResponse.getStatusCode() != HttpStatus.SC_OK) {\n GcpAccessTokenError error = jsonMapper.readValue(httpResponse.getMessage(), GcpAccessTokenError.class);\n throw new ResourceException(httpResponse.getStatusCode(), error.getErrorMessage());\n }\n\n GcpAccessTokenResponse gcpAccessTokenResponse = jsonMapper.readValue(httpResponse.getMessage(), GcpAccessTokenResponse.class);\n\n ExternalCredentialsResponse externalCredentialsResponse = new ExternalCredentialsResponse();\n attributes = new HashMap<>();\n attributes.put(GCP_ACCESS_TOKEN, gcpAccessTokenResponse.getAccessToken());\n externalCredentialsResponse.setAttributes(attributes);\n externalCredentialsResponse.setExpiration(Timestamp.fromString(gcpAccessTokenResponse.getExpireTime()));\n return externalCredentialsResponse;\n\n } catch (Exception ex) {\n throw new ResourceException(ResourceException.FORBIDDEN, ex.getMessage());\n }\n }", "private GoogleCredential getGoogleCredential(String userId) {\t\t\n\t\t\n\t\ttry { \n\t\t\t// get the service account e-mail address and service account private key from property file\n\t\t\t// this email account and key file are specific for your environment\n\t\t\tif (SERVICE_ACCOUNT_EMAIL == null) {\n\t\t\t\tSERVICE_ACCOUNT_EMAIL = m_serverConfigurationService.getString(\"google.service.account.email\", \"\");\n\t\t\t}\n\t\t\tif (PRIVATE_KEY == null) {\n\t\t\t\tPRIVATE_KEY = m_serverConfigurationService.getString(\"google.private.key\", \"\");\n\t\t\t}\n\t\t\t\n\t\t\tGoogleCredential credential = getCredentialFromCredentialCache(userId);\n\t\t\treturn credential;\n\n\t\t} catch (Exception e) {\n\t\t\t// return null if an exception occurs while communicating with Google.\n\t\t\tM_log.error(\"Error creating a GoogleCredential object or requesting access token: \" + userId + \" \" + e.getMessage());\n\t\t\treturn null;\n\t\t}\n\t}", "private Credential getCredentials(final NetHttpTransport HTTP_TRANSPORT) throws IOException {\n // Build flow and trigger user authorization request.\n GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(\n HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)\n .setDataStoreFactory(new FileDataStoreFactory(new java.io.File(TOKENS_DIRECTORY_PATH)))\n .setAccessType(\"offline\")\n .build();\n LocalServerReceiver receiver = new LocalServerReceiver.Builder().setPort(8888).build();\n return new AuthorizationCodeInstalledApp(flow, receiver).authorize(\"user\");\n }", "public static synchronized Credentials getCedentialByUser_ID(int userID){\n\t\t\tConnection connection;\n\t\t\tCredentials cred = null;\n\t\t \tPreparedStatement statement = null;\n\t\t\tString preparedSQL = \"Select * From credential Where User_ID = ?\";\n\t\t\t\n\t\t try{\n\t\t \tconnection = DBConnector.getConnection();\n\t\t \tstatement = connection.prepareStatement(preparedSQL);\n\t\t \tstatement.setInt(1,userID);\n\t\t\t\tResultSet rs = statement.executeQuery();\n\t\t\t\twhile(rs.next()){\n\t\t\t\t\tcred = new Credentials();\n\t\t\t\t\tcred.setCredID(rs.getInt(1));\n\t\t\t\t\tcred.setUserID(rs.getInt(2));\n\t\t\t\t\tcred.setEmail(rs.getString(3));\n\t\t\t\t\tcred.setPass(rs.getString(4));\n\t\t\t\t\tcred.setRole(rs.getString(5));\n\t\t\t\t\tcred.setValid(rs.getInt(6));\n\t\t\t\t\tcred.setRegKey(rs.getString(7));\n\t\t\t\t}\t\n\t\t\t\trs.close();\t\t\n\t\t\t\tstatement.close();\n\t\t\t\tconnection.close();\n\t\t\t}\n\t\t catch (SQLException ex){\n\t\t\t\tSystem.out.println(\"Error: \" + ex);\n\t\t\t\tSystem.out.println(\"Query: \" + statement.toString());\n\t\t\t}\n\t\t\treturn cred;\n\t}", "@Override\r\n\tpublic Credential getCredential() {\n\t\treturn null;\r\n\t}", "String getToken(PortalControllerContext portalControllerContext);", "String getToken(String scope, String username, String password) throws AuthorizationException;", "@Nonnull\n public Credential getSPCredential() throws IOException {\n\n final ClassPathResource spKeyResource = new ClassPathResource(SP_KEY);\n Assert.assertTrue(spKeyResource.exists());\n final PrivateKey spPrivateKey = KeyPairUtil.readPrivateKey(spKeyResource.getInputStream());\n\n final ClassPathResource spCrtResource = new ClassPathResource(SP_CRT);\n Assert.assertTrue(spCrtResource.exists());\n final X509Certificate spEntityCert = (X509Certificate) CertUtil.readCertificate(spCrtResource.getInputStream());\n\n return new BasicX509Credential(spEntityCert, spPrivateKey);\n }", "static @NonNull String getAuthToken(@NonNull Context context) throws AuthException {\n final long startTime = System.currentTimeMillis();\n final GoogleApiClient googleApiClient = getClient(context);\n try {\n final ConnectionResult result = googleApiClient.blockingConnect();\n if (result.isSuccess()) {\n final GoogleSignInResult googleSignInResult = Auth.GoogleSignInApi.silentSignIn(googleApiClient).await();\n final GoogleSignInAccount account = googleSignInResult.getSignInAccount();\n if(account != null) {\n final String authToken = account.getIdToken();\n if(authToken != null) {\n Log.i(TAG, \"Got auth token in \" + (System.currentTimeMillis() - startTime) + \" ms\");\n return authToken;\n } else {\n throw new AuthException(\"Failed to get auth token\");\n }\n } else {\n throw new AuthException(\"Not signed in\");\n }\n } else {\n throw new AuthException(\"Sign in connection error\");\n }\n } finally {\n googleApiClient.disconnect();\n }\n }", "private String getCredentials() {\n String credentials = \"\";\n AccountManager accountManager = AccountManager.get(getContext());\n\n final Account availableAccounts[] = accountManager.getAccountsByType(AccountGeneral.ACCOUNT_TYPE);\n\n //there should be only one ERT account\n if(availableAccounts.length > 0) {\n Account account = availableAccounts[0];\n AccountManagerFuture<Bundle> future = accountManager.getAuthToken(account, AccountGeneral.AUTHTOKEN_TYPE_FULL_ACCESS, null, null, null, null);\n try {\n Bundle bundle = future.getResult();\n String accountName = bundle.getString(AccountManager.KEY_ACCOUNT_NAME);\n String token = bundle.getString(AccountManager.KEY_AUTHTOKEN);\n credentials = accountName + \":\" + token;\n } catch (OperationCanceledException | IOException | AuthenticatorException e) {\n Log.e(LOG_TAG, e.getMessage());\n }\n }\n return credentials;\n }", "private String getRigorCredentials(String credentialsId) {\n List<RigorCredentials> rigorCredentialsList = CredentialsProvider.lookupCredentials(RigorCredentials.class,\n Jenkins.getInstance(), ACL.SYSTEM);\n RigorCredentials rigorCredentials = CredentialsMatchers.firstOrNull(rigorCredentialsList,\n CredentialsMatchers.allOf(CredentialsMatchers.withId(credentialsId)));\n\n return rigorCredentials == null ? null : rigorCredentials.getApiKey().getPlainText();\n }", "public static synchronized Credentials getCredentialByUserIDKey(int userID, String key){\n\t\t\tConnection connection;\n\t\t\tCredentials cred = null;\n\t\t \tPreparedStatement statement = null;\n\t\t\tString preparedSQL = \"Select * From credential Where User_ID = ? And RegKey =?\";\n\t\t\t\n\t\t try{\n\t\t \tconnection = DBConnector.getConnection();\n\t\t \tstatement = connection.prepareStatement(preparedSQL);\n\t\t \tstatement.setInt(1,userID);\n\t\t \tstatement.setString(2,key);\n\t\t\t\tResultSet rs = statement.executeQuery();\n\t\t\t\twhile(rs.next()){\n\t\t\t\t\tcred = new Credentials();\n\t\t\t\t\tcred.setCredID(rs.getInt(1));\n\t\t\t\t\tcred.setEmail(rs.getString(2));\n\t\t\t\t\tcred.setPass(rs.getString(3));\n\t\t\t\t\tcred.setUserID(rs.getInt(4));\n\t\t\t\t\tcred.setRole(rs.getString(5));\n\t\t\t\t\tcred.setValid(rs.getInt(6));\n\t\t\t\t\tcred.setRegKey(rs.getString(7));\n\t\t\t\t}\t\n\t\t\t\trs.close();\t\t\n\t\t\t\tstatement.close();\n\t\t\t\tconnection.close();\n\t\t\t}\n\t\t catch (SQLException ex){\n\t\t\t\tSystem.out.println(\"Error: \" + ex);\n\t\t\t\tSystem.out.println(\"Query: \" + statement.toString());\n\t\t\t}\n\t\t\treturn cred;\n\t}", "public String getToken(int id) {\n try {\n return tkDao.getToken(id);\n } catch (SQLException ex) {\n throw new RuntimeException(\"an error occurred trying to get a token with a given id in database: \" + ex.getMessage());\n }\n }", "public AuthorizationToken retrieveToken(String token);", "public Object retrieveGrant(final String id, final String grantId) throws Exception {\r\n return null;\r\n }", "private static Tuple<Integer, String> getToken() {\n\t\tTuple<Integer, String> result = new Tuple<Integer, String>();\n\t\tresult = GETRequest(AUTH_URL, AUTH_HEADER, \"\", \"\");\n\t\treturn result;\n\t}", "private GoogleCredential getCredentialFromCredentialCache(final String userId) throws IOException{\n\t\tGoogleCredential credential = (GoogleCredential)cache.get(userId);\n\t\tif (credential != null){\n\t\t\tM_log.debug(\"Fetching credential from cache for user: \" + userId);\n\t\t\treturn credential;\n\t\t}\n\t\telse{ // Need to create credential and create access token.\n\t\t\tcredential = SakaiGoogleAuthServiceImpl.authorize(userId, SERVICE_ACCOUNT_EMAIL, PRIVATE_KEY, CalendarScopes.CALENDAR);\n\t\t\tif (credential != null){\n\t\t\t\tcredential.refreshToken(); // Populates credential with access token\n\t\t\t\taddCredentialToCache(userId, credential);\n\t\t\t}\n\t\t\treturn credential;\n\t\t}\n\t}", "public static ListBoxModel doFillCredentialsIdItems() {\n\n ListBoxModel boxModel = null;\n final ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();\n boolean changed = false;\n try {\n if (PostBuildScanDescriptor.class.getClassLoader() != originalClassLoader) {\n changed = true;\n Thread.currentThread().setContextClassLoader(PostBuildScanDescriptor.class.getClassLoader());\n }\n // Code copied from\n // https://github.com/jenkinsci/git-plugin/blob/f6d42c4e7edb102d3330af5ca66a7f5809d1a48e/src/main/java/hudson/plugins/git/UserRemoteConfig.java\n final CredentialsMatcher credentialsMatcher = CredentialsMatchers\n .anyOf(CredentialsMatchers.instanceOf(StandardUsernamePasswordCredentials.class));\n final AbstractProject<?, ?> project = null; // Dont want to limit\n // the search to a particular project for the drop\n // down menu\n boxModel = new StandardListBoxModel().withEmptySelection().withMatching(credentialsMatcher,\n CredentialsProvider.lookupCredentials(StandardCredentials.class, project, ACL.SYSTEM,\n Collections.<DomainRequirement> emptyList()));\n } finally {\n if (changed) {\n Thread.currentThread().setContextClassLoader(originalClassLoader);\n }\n }\n return boxModel;\n }", "public CredentialsModel find(int id) {\n Statement stmt = null;\n Connection connection = null;\n try {\n try {\n connection = ds.getConnection();\n try {\n stmt = connection.createStatement();\n ResultSet result = stmt\n .executeQuery(\"SELECT * FROM Credentials \"\n + \"where EmpNum = '\" + id + \"'\");\n if (result.next()) {\n CredentialsModel cred = new CredentialsModel();\n cred.setPassword(result.getString(\"EmpPassword\"));\n cred.setUserName(result.getString(\"EmpUsername\"));\n return cred;\n } else {\n return null;\n }\n } finally {\n if (stmt != null) {\n stmt.close();\n }\n\n }\n } finally {\n if (connection != null) {\n connection.close();\n }\n }\n } catch (SQLException ex) {\n System.out.println(\"Error in find \" + id);\n ex.printStackTrace();\n return null;\n }\n }", "public Credential getCredentialRefTkn(String refreshToken){\n\tCredential credential = createCredentialWithRefreshToken(HTTP_TRANSPORT,\n\t\t\tJSON_FACTORY,\n\t\t\tnew TokenResponse().setRefreshToken(refreshToken), CLIENT_ID,\n\t\t\tCLIENT_SECRET);\n\treturn credential;\n\t}", "@Nullable\n private String fetchToken() throws IOException {\n try {\n return GoogleAuthUtil.getToken(mActivity, mEmail, mScope);\n } catch (UserRecoverableAuthException ex) {\n // GooglePlayServices.apk is either old, disabled, or not present\n // so we need to show the user some UI in the activity to recover.\n // TODO: complain about old version\n Log.e(\"aqx1010\", \"required Google Play version not found\", ex);\n } catch (GoogleAuthException fatalException) {\n // Some other type of unrecoverable exception has occurred.\n // Report and log the error as appropriate for your app.\n Log.e(\"aqx1010\", \"fatal authorization exception\", fatalException);\n }\n return null;\n }", "private static String getAppTokenId() {\n if (appTokenId == null) {\n synchronized (DefaultEntityManagerImpl.class) {\n if (appTokenId == null) {\n try {\n if (OAuthProperties.isServerMode()) {\n appTokenId = OAuthServiceUtils.getAdminTokenId();\n }\n else {\n final String username =\n OAuthProperties.get(PathDefs.APP_USER_NAME);\n final String password =\n OAuthProperties.get(PathDefs.APP_USER_PASSWORD);\n appTokenId =\n OAuthServiceUtils.authenticate(username, password, false);\n }\n }\n catch (final OAuthServiceException oe) {\n Logger.getLogger(DefaultEntityManagerImpl.class.getName()).log(\n Level.SEVERE, null, oe);\n throw new WebApplicationException(oe);\n }\n }\n }\n }\n return appTokenId;\n }", "public Object retrieveCurrentGrants(final String id) throws Exception {\r\n return null;\r\n }", "public Credential getUsercredentialwithAccessToken(String accessToken) {\n\t\treturn new GoogleCredential.Builder().setTransport(HTTP_TRANSPORT)\n\t\t\t\t.setJsonFactory(new JacksonFactory())\n\t\t\t\t.setClientSecrets(CLIENT_ID, CLIENT_SECRET).build()\n\t\t\t\t.setAccessToken(accessToken);\n\t}", "OauthResource getResourceByIllegalSecret(String testId);", "private Credential getCredentials(final NetHttpTransport HTTP_TRANSPORT) throws IOException {\n // Load client secrets.\n InputStream in = EventoUtils.class.getResourceAsStream(CREDENTIALS_FILE_PATH);\n if (in == null) {\n throw new FileNotFoundException(\"Resource not found: \" + CREDENTIALS_FILE_PATH);\n }\n GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));\n\n // Build flow and trigger user authorization request.\n GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(\n HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)\n .setDataStoreFactory(new FileDataStoreFactory(new java.io.File(TOKENS_DIRECTORY_PATH)))\n .setAccessType(\"offline\")\n .build();\n LocalServerReceiver receiver = new LocalServerReceiver.Builder().setPort(8888).build();\n return new AuthorizationCodeInstalledApp(flow, receiver).authorize(\"user\");\n }", "public Object credentials() {\n return cred;\n }", "GcpExchangeTokenResponse getExchangeToken(DomainDetails domainDetails, final String idToken,\n ExternalCredentialsRequest externalCredentialsRequest) throws IOException {\n\n Map<String, String> attributes = externalCredentialsRequest.getAttributes();\n final String gcpTokenScope = getRequestAttribute(attributes, GCP_TOKEN_SCOPE, GCP_DEFAULT_TOKEN_SCOPE);\n final String gcpWorkloadPoolName = getRequestAttribute(attributes, GCP_WORKLOAD_POOL_NAME, defaultWorkloadPoolName);\n final String gcpWorkloadProviderName = getRequestAttribute(attributes, GCP_WORKLOAD_PROVIDER_NAME, defaultWorkloadProviderName);\n\n String audience = String.format(\"//iam.googleapis.com/projects/%s/locations/global/workloadIdentityPools/%s/providers/%s\",\n domainDetails.getGcpProjectNumber(), gcpWorkloadPoolName, gcpWorkloadProviderName);\n\n GcpExchangeTokenRequest exchangeTokenRequest = new GcpExchangeTokenRequest();\n exchangeTokenRequest.setGrantType(GCP_GRANT_TYPE);\n exchangeTokenRequest.setAudience(audience);\n exchangeTokenRequest.setScope(gcpTokenScope);\n exchangeTokenRequest.setRequestedTokenType(GCP_ACCESS_TOKEN_TYPE);\n exchangeTokenRequest.setSubjectToken(idToken);\n exchangeTokenRequest.setSubjectTokenType(GCP_ID_TOKEN_TYPE);\n\n HttpPost httpPost = new HttpPost(GCP_STS_TOKEN_URL);\n httpPost.setEntity(new StringEntity(jsonMapper.writeValueAsString(exchangeTokenRequest), ContentType.APPLICATION_JSON));\n\n final HttpDriverResponse httpResponse = httpDriver.doPostHttpResponse(httpPost);\n if (httpResponse.getStatusCode() != HttpStatus.SC_OK) {\n GcpExchangeTokenError error = jsonMapper.readValue(httpResponse.getMessage(), GcpExchangeTokenError.class);\n throw new ResourceException(httpResponse.getStatusCode(), error.getErrorDescription());\n }\n return jsonMapper.readValue(httpResponse.getMessage(), GcpExchangeTokenResponse.class);\n }", "public Object credential(HttpServletRequest request)\n throws URISyntaxException, OAuthSystemException {\n try {\n OAuthClientCredentialRequest oauthRequest = new OAuthClientCredentialRequest(request);\n OAuthAuthzParameters oAuthAuthzParameters = new OAuthAuthzParameters(oauthRequest);\n\n if (!oauthRequest.getGrantType().equals(Constants.OAUTH_CLIENT_CREDENTIALS)) {\n OAuthResponse response = OAuthASResponseEx\n .errorResponse(HttpServletResponse.SC_OK)\n .setError(String.valueOf(OAuthConstants.OAuthResponse.INVALID_REQUEST))\n .setErrorDescription(OAuthConstants.OAuthDescription.INVALID_GRANT_TYPE)\n .buildJSONMessage();\n logger.info(\"invalid grant type: {}, context: {}\", oauthRequest.getGrantType(), oAuthAuthzParameters);\n return new ResponseEntity<String>(response.getBody(), HttpStatus.valueOf(response.getResponseStatus()));\n }\n\n Client client = oAuthService.getClientByClientId(oAuthAuthzParameters.getClientId());\n if (client == null) {\n OAuthResponse response = OAuthASResponseEx\n .errorResponse(HttpServletResponse.SC_OK)\n .setError(String.valueOf(OAuthConstants.OAuthResponse.INVALID_CLIENT))\n .setErrorDescription(OAuthConstants.OAuthDescription.INVALID_CLIENT_DESCRIPTION)\n .buildJSONMessage();\n logger.info(\"can not get client, context: {}\", oAuthAuthzParameters);\n return new ResponseEntity<String>(response.getBody(), HttpStatus.valueOf(response.getResponseStatus()));\n }\n\n if (!client.getGrantTypes().contains(Constants.OAUTH_CLIENT_CREDENTIALS)) {\n OAuthResponse response = OAuthASResponseEx\n .errorResponse(HttpServletResponse.SC_OK)\n .setError(String.valueOf(OAuthConstants.OAuthResponse.INVALID_CLIENT_INFO))\n .setErrorDescription(OAuthConstants.OAuthDescription.INVALID_GRANT_TYPE)\n .buildJSONMessage();\n logger.info(\"no grant type, context: {}\", oAuthAuthzParameters);\n return new ResponseEntity<String>(response.getBody(), HttpStatus.valueOf(response.getResponseStatus()));\n }\n\n if (!client.getClientSecret().equals(oAuthAuthzParameters.getClientSecret())) {\n OAuthResponse response = OAuthASResponseEx\n .errorResponse(HttpServletResponse.SC_OK)\n .setError(String.valueOf(OAuthConstants.OAuthResponse.INVALID_CLIENT_INFO))\n .setErrorDescription(OAuthConstants.OAuthDescription.INVALID_CLIENT_DESCRIPTION)\n .buildJSONMessage();\n logger.info(\"invalid secret: {}, context: {}\", client.getClientSecret(), oAuthAuthzParameters);\n return new ResponseEntity<String>(response.getBody(), HttpStatus.valueOf(response.getResponseStatus()));\n }\n\n if (StringUtils.isEmpty(oAuthAuthzParameters.getScope())) {\n oAuthAuthzParameters.setScope(client.getDefaultScope());\n } else {\n oAuthAuthzParameters.setScope(\n OAuthUtils.encodeScopes(\n oAuthService.getRetainScopes(\n client.getDefaultScope(),\n oAuthAuthzParameters.getScope()\n )\n )\n );\n }\n\n OAuthIssuer oauthIssuerImpl = new OAuthIssuerImpl(new UUIDValueGeneratorEx());\n String accessToken = oauthIssuerImpl.accessToken();\n\n oAuthService.saveAccessToken(accessToken, oAuthAuthzParameters);\n\n OAuthResponse response = OAuthASResponseEx\n .tokenResponse(HttpServletResponse.SC_OK)\n .setTokenType(\"uuid\")\n .setAccessToken(accessToken)\n .setExpiresIn(String.valueOf(appConfig.tokenAccessExpire))\n .setScope(oAuthAuthzParameters.getScope())\n .buildJSONMessage();\n logger.info(\"response access token {}, context: {}\", accessToken, oAuthAuthzParameters);\n return new ResponseEntity<String>(response.getBody(), HttpStatus.valueOf(response.getResponseStatus()));\n } catch (OAuthProblemException e) {\n logger.error(\"oauth problem exception\", e);\n final OAuthResponse response = OAuthASResponseEx\n .errorResponse(HttpServletResponse.SC_OK)\n .setError(String.valueOf(OAuthConstants.OAuthResponse.INVALID_REQUEST))\n .setErrorDescription(e.getMessage())\n .buildJSONMessage();\n HttpHeaders headers = new HttpHeaders();\n return new ResponseEntity<String>(response.getBody(), headers, HttpStatus.valueOf(response.getResponseStatus()));\n }\n }", "private CdekAuthToken getAuthToken()\n {\n String authEndpoint = conf.ENDPOINT + \"/oauth/token?grant_type={grant_type}&client_id={client_id}&client_secret={client_secret}\";\n\n HttpHeaders defaultHeaders = new HttpHeaders();\n HttpEntity req = new HttpEntity(defaultHeaders);\n\n return rest.postForObject(authEndpoint, req, CdekAuthToken.class, conf.getAuthData());\n }", "public String getDriveSecretId() {return this.databaseConfig.getProperty(\"driveClientSecret\");}", "public String getCredentialsId() {\n return settings.CredentialsId;\n }", "private DigitalIDEntity getDigitalIDEntityForLogin(final String identifierType, final String identifierValue, final String correlationID) {\n val response = this.restUtils.getDigitalID(identifierType, identifierValue, correlationID);\n if (response.isEmpty()) {\n throw new SoamRuntimeException(\"Digital ID was null - unexpected error\");\n }\n return response.get();\n }", "java.lang.String getCred();", "OAuth2Token getToken();", "List<ExposedOAuthCredentialModel> readExposedOAuthCredentials();", "public void setCredentialId(String CredentialId) {\n this.CredentialId = CredentialId;\n }", "public void setCredentialId(Long credentialId) {\n this.credentialId = credentialId;\n }", "void createExposedOAuthCredential(IntegrationClientCredentialsDetailsModel integrationCCD);", "public Optional<String> getToken(final String jsonResponse) {\n\n final Optional<AccountDTO> optionalAccountDTO = jsonToAccount(jsonResponse);\n\n if (optionalAccountDTO.isPresent()) {\n\n final AccountDTO accountDTO = optionalAccountDTO.get();\n\n if (accountDTO.getId() != null) {\n final String jwt = getSignedJwt(accountDTO.getId(), accountDTO.getName(), accountDTO.getEmail(),\n accountDTO.getRole());\n return Optional.of(jwt);\n }\n }\n\n return Optional.empty();\n }", "private static Credential getCredentials(final NetHttpTransport HTTP_TRANSPORT) throws IOException {\n // Load client secrets.\n InputStream in = GoogleAuthorizeUtil.class.getResourceAsStream(CREDENTIALS_FILE_PATH);\n\n if (in == null) {\n throw new FileNotFoundException(\"Resource not found: \" + CREDENTIALS_FILE_PATH);\n }\n GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));\n\n // Build flow and trigger user authorization request.\n GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(\n HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)\n .setDataStoreFactory(new FileDataStoreFactory(new java.io.File(TOKENS_DIRECTORY_PATH)))\n .setAccessType(\"offline\")\n .build();\n LocalServerReceiver receiver = new LocalServerReceiver.Builder().setPort(8888).build();\n return new AuthorizationCodeInstalledApp(flow, receiver).authorize(\"user\");\n }", "public Credentials getCredentials(AuthScope authscope)\n {\n return credentials;\n }", "AbstractCredentialModel createOAuthCredential(EmployeeModel employee);", "public static Credential authorize() throws IOException \n\t {\n\t // Load client secrets.\n\t InputStream in = YouTubeDownloader.class.getResourceAsStream(\"/youtube/downloader/resources/clients_secrets.json\");\n\t GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader( in ));\n\n\t // Build flow and trigger user authorization request.\n\t GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(\n\t HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)\n\t .setDataStoreFactory(DATA_STORE_FACTORY)\n\t .setAccessType(\"offline\")\n\t .build();\n\t Credential credential = new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize(\"user\");\n\t System.out.println(\"Credentials saved to \" + DATA_STORE_DIR.getAbsolutePath());\n\t return credential;\n\t }", "private static Credential getCredentials(HttpTransport HTTP_TRANSPORT) throws IOException {\r\n // Load client secrets.\r\n InputStream in = SheetsQuickstart.class.getResourceAsStream(CREDENTIALS_FILE_PATH);\r\n if (in == null) {\r\n throw new FileNotFoundException(\"Resource not found: \" + CREDENTIALS_FILE_PATH);\r\n }\r\n GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));\r\n\r\n // Build flow and trigger user authorization request.\r\n GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(\r\n HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)\r\n .setDataStoreFactory(new FileDataStoreFactory(new java.io.File(TOKENS_DIRECTORY_PATH)))\r\n .setAccessType(\"offline\")\r\n .build();\r\n LocalServerReceiver receiver = new LocalServerReceiver.Builder().setPort(8888).build();\r\n return new AuthorizationCodeInstalledApp(flow, receiver).authorize(\"user\");\r\n }", "public static CredentialManager getInstance(Context context) {\n if (instance == null) {\n instance = new CredentialManager(context);\n }\n return instance;\n }", "private CredentialManager(Context context) {\n appDb = AppDB.getInstance(context);\n mContext = context;\n }", "CloudCredentialStatus create(@Nonnull AuthenticatedContext authenticatedContext);", "protected static Credentials getServiceCredentials() throws AnaplanAPIException {\n if (authType == AUTH_TYPE.CERT) {\n try {\n return new Credentials(getCertificate(), getPrivateKey());\n } catch (Exception e) {\n throw new AnaplanAPIException(\"Could not initialise service credentials\", e);\n }\n } else if (authType == AUTH_TYPE.OAUTH) {\n return new Credentials(clientId);\n }\n return new Credentials(getUsername(), getPassphrase());\n }", "CloudCredentialStatus delete(@Nonnull AuthenticatedContext authenticatedContext);", "CloudCredentialStatus verify(@Nonnull AuthenticatedContext authenticatedContext);", "public void retrieveAccessToken(Context context) {\n PBookAuth mPBookAuth = mApplicationPreferences.getPBookAuth();\n if (mPBookAuth == null || TextUtils.isEmpty(mPBookAuth.getClientName())) {\n view.onReturnAccessToken(null, false);\n return;\n }\n Ion.with(context).load(ACCESS_TOKEN_SERVICE_URL).setBodyParameter(\"client\", mPBookAuth.getClientName()).setBodyParameter(\"phoneNumber\", mPBookAuth.getPhoneNumber()).setBodyParameter(\"platform\", PLATFORM_KEY).asString().setCallback(new FutureCallback<String>() {\n @Override\n public void onCompleted(Exception e, String accessToken) {\n if (e == null || !TextUtils.isEmpty(accessToken)) {\n mApplicationPreferences.setTwilioToken(accessToken);\n view.onReturnAccessToken(accessToken, true);\n } else {\n view.onReturnAccessToken(accessToken, false);\n }\n }\n });\n }", "GoogleAuthenticatorKey createCredentials();", "public String getTokenId() {\n return tokenId;\n }", "private static Credential getCredentials(final NetHttpTransport HTTP_TRANSPORT) throws IOException {\n InputStream in = SheetsRead.class.getResourceAsStream(CREDENTIALS_FILE_PATH);\n if (in == null) {\n throw new FileNotFoundException(\"Resource not found: \" + CREDENTIALS_FILE_PATH);\n }\n GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));\n GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(\n HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)\n .setDataStoreFactory(new FileDataStoreFactory(new java.io.File(TOKENS_DIRECTORY_PATH)))\n .setAccessType(\"offline\")\n .build();\n LocalServerReceiver receiver = new LocalServerReceiver.Builder().setPort(8888).build();\n return new AuthorizationCodeInstalledApp(flow, receiver).authorize(\"user\");\n }", "private static GSSCredential getClientCredential(final Subject subject,\n final GSSManager MANAGER,\n final Oid kerboid) throws PrivilegedActionException {\n final PrivilegedExceptionAction<GSSCredential> action = new PrivilegedExceptionAction<GSSCredential>() {\n public GSSCredential run() throws GSSException {\n return MANAGER.createCredential(null // use the default principal\n , GSSCredential.DEFAULT_LIFETIME, kerboid, GSSCredential.INITIATE_ONLY);\n }\n };\n // TO support java 5, 6 we have to do this\n // The signature for Java 5 returns an object 6 returns GSSCredential, immediate casting throws \n // warning in Java 6.\n Object credential = Subject.doAs(subject, action);\n return (GSSCredential) credential;\n }", "public JSONObject requestDeviceAuthTokens(String deviceCode) {\n try {\n String response = netUtils.post(authEndpoint,\n \"client_id=\" + clientId\n + \"&client_secret=\" + clientSecret\n + \"&code=\" + deviceCode\n + \"&grant_type=\" + grantType);\n\n if (response == null) {\n LOG.log(Level.FINE, \"pending authorization from user\");\n return null;\n }\n\n JSONParser j = new JSONParser();\n JSONObject jobj = (JSONObject) j.parse(response);\n if (jobj.containsKey(\"error\")) {\n LOG.log(Level.FINE, \"pending authorization from user\");\n return null;\n }\n return jobj;\n\n } catch (ParseException e) {\n LOG.log(Level.WARNING, \"google auth response parse failed\");\n }\n\n return null;\n }", "public void setCredentialId(java.lang.String credentialId) {\r\n this.credentialId = credentialId;\r\n }", "public static Credential authorize() throws IOException {\n // Load client secrets.\n InputStream in =\n Quickstart2.class.getResourceAsStream(\"/client_secret.json\");\n GoogleClientSecrets clientSecrets =\n GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));\n\n // Build flow and trigger user authorization request.\n GoogleAuthorizationCodeFlow flow =\n new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)\n .setDataStoreFactory(DATA_STORE_FACTORY)\n .setAccessType(\"offline\")\n .build();\n \n Credential credential = new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize(\"user\");\n \n System.out.println(\"Credentials saved to \" + DATA_STORE_DIR.getAbsolutePath());\n return credential;\n }", "private static Credential getCredentials(final NetHttpTransport HTTP_TRANSPORT)\n throws IOException {\n // Load client secrets.\n InputStream in = GoogleCalendar.class.getResourceAsStream(CREDENTIALS_FILE_PATH);\n GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY,\n new InputStreamReader(in));\n\n // Build flow and trigger user authorization request.\n GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT,\n JSON_FACTORY, clientSecrets, SCOPES)\n .setDataStoreFactory(\n new FileDataStoreFactory(new java.io.File(TOKENS_DIRECTORY_PATH)))\n .setAccessType(\"offline\").build();\n LocalServerReceiver receiver = new LocalServerReceiver.Builder().setPort(8888).build();\n return new AuthorizationCodeInstalledApp(flow, receiver).authorize(\"user\");\n }", "String getComponentAccessToken();", "java.lang.String getChannelToken();", "java.lang.String getChannelToken();", "public interface CredentialConnector {\n\n /**\n * Check whether the credential (e.g public key) associated with a stack (cluster) has present on Cloud provider.\n *\n * @param authenticatedContext the authenticated context which holds the client object\n * @return the status respone of method call\n */\n CloudCredentialStatus verify(@Nonnull AuthenticatedContext authenticatedContext);\n\n\n /**\n * Create the credential (e.g public key) associated with a stack (cluster) on Cloud provider.\n *\n * @param authenticatedContext the authenticated context which holds the client object\n * @return the status respone of method call\n */\n CloudCredentialStatus create(@Nonnull AuthenticatedContext authenticatedContext);\n\n\n /**\n * Interactive login for credential creation.\n *\n * @return parameters for interactive login\n */\n Map<String, String> interactiveLogin(CloudContext cloudContext, ExtendedCloudCredential extendedCloudCredential,\n CredentialNotifier credentialNotifier);\n\n /**\n * Delete the credential (e.g public key) associated with a stack (cluster) from Cloud provider.\n *\n * @param authenticatedContext the authenticated context which holds the client object\n * @return the status respone of method call\n */\n CloudCredentialStatus delete(@Nonnull AuthenticatedContext authenticatedContext);\n\n}", "static String getToken(Context context) {\r\n SharedPreferences preferences = context.getSharedPreferences(context.getString(R.string.shared_preferences), MODE_PRIVATE);\r\n return preferences.getString(context.getString(R.string.token), null);\r\n }", "java.lang.String getRemoteToken();", "public io.lightcone.data.types.TokenIDOrBuilder getTokenIdOrBuilder() {\n return getTokenId();\n }", "public com.symantec.schemas.vip._2011._04.vipuserservices.CredentialTypeEnum getCredentialType() {\r\n return credentialType;\r\n }", "public static Credential authorize() throws IOException, GeneralSecurityException {\n // Load client secrets.\n InputStream in = GoogleIntegration.class.getResourceAsStream(\"/client_secret.json\");\n GoogleClientSecrets clientSecrets =\n GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));\n\n FileDataStoreFactory DATA_FACTORY = new FileDataStoreFactory(DATA_STORE_DIR);\n HttpTransport HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();\n\n // Build flow and trigger user authorization request.\n GoogleAuthorizationCodeFlow flow =\n new GoogleAuthorizationCodeFlow.Builder(\n HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)\n .setDataStoreFactory(DATA_FACTORY)\n .setAccessType(\"offline\")\n .build();\n Credential credential = new AuthorizationCodeInstalledApp(\n flow, new LocalServerReceiver()).authorize(\"user\");\n System.out.println(\n \"Credentials saved to \" + DATA_STORE_DIR.getAbsolutePath());\n return credential;\n }", "java.lang.String getSecret();", "TrustedIdProvider create(Context context);", "public Optional<CredentialProfile> get(StructuredTableContext context, CredentialProfileId id)\n throws IOException {\n StructuredTable table = context.getTable(CredentialProviderStore.CREDENTIAL_PROFILES);\n Collection<Field<?>> key = Arrays.asList(\n Fields.stringField(CredentialProviderStore.NAMESPACE_FIELD,\n id.getNamespace()),\n Fields.stringField(CredentialProviderStore.PROFILE_NAME_FIELD,\n id.getName()));\n return table.read(key).map(row -> GSON.fromJson(row\n .getString(CredentialProviderStore.PROFILE_DATA_FIELD), CredentialProfile.class));\n }", "Object getAuthInfoKey();", "@Override // com.tencent.qcloud.core.auth.BasicLifecycleCredentialProvider\n public QCloudLifecycleCredentials fetchNewCredentials() throws QCloudClientException {\n if (this.secretId != null && this.secretKey != null) {\n return onGetCredentialFromLocal(this.secretId, this.secretKey);\n }\n if (this.httpRequest == null) {\n return null;\n }\n try {\n return onRemoteCredentialReceived((String) ((HttpResult) QCloudHttpClient.getDefault().resolveRequest(this.httpRequest).executeNow()).content());\n } catch (QCloudServiceException e) {\n throw new QCloudClientException(\"get session json fails\", e);\n }\n }", "private String GetAccessToken() {\n final String grantType = \"password\";\n final String resourceId = \"https%3A%2F%2Fgraph.microsoft.com%2F\";\n final String tokenEndpoint = \"https://login.microsoftonline.com/common/oauth2/token\";\n\n try {\n URL url = new URL(tokenEndpoint);\n HttpURLConnection conn;\n if (configuration.isProxyUsed()) {\n Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(configuration.getProxyServer(), configuration.getProxyPort()));\n conn = (HttpURLConnection) url.openConnection(proxy);\n } else {\n conn = (HttpURLConnection) url.openConnection();\n }\n\n String line;\n StringBuilder jsonString = new StringBuilder();\n\n conn.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded; charset=UTF-8\");\n conn.setRequestMethod(\"POST\");\n conn.setDoInput(true);\n conn.setDoOutput(true);\n conn.setInstanceFollowRedirects(false);\n conn.connect();\n\n try (OutputStreamWriter outputStreamWriter = new OutputStreamWriter(conn.getOutputStream(), StandardCharsets.UTF_8)) {\n String payload = String.format(\"grant_type=%1$s&resource=%2$s&client_id=%3$s&username=%4$s&password=%5$s\",\n grantType,\n resourceId,\n clientId,\n username,\n password);\n outputStreamWriter.write(payload);\n }\n\n try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()))) {\n while((line = br.readLine()) != null) {\n jsonString.append(line);\n }\n }\n\n conn.disconnect();\n\n JsonObject res = new GsonBuilder()\n .create()\n .fromJson(jsonString.toString(), JsonObject.class);\n\n return res\n .get(\"access_token\")\n .toString()\n .replaceAll(\"\\\"\", \"\");\n\n } catch (IOException e) {\n throw new IllegalAccessError(\"Unable to read authorization response: \" + e.getLocalizedMessage());\n }\n }", "@Override\r\n public int getTokenId()\r\n {\r\n return this.tokenId;\r\n }", "public static Credential authorize() throws IOException {\n\t\t// Load client secrets.\n\t\tInputStream in = GmailDownloader.class.getResourceAsStream(\"/client_secret.json\");\n\t\tGoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));\n\n\t\t// Build flow and trigger user authorization request.\n\t\tGoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT, JSON_FACTORY,\n\t\t\t\tclientSecrets, SCOPES).setDataStoreFactory(DATA_STORE_FACTORY).setAccessType(\"offline\").build();\n\t\tCredential credential = new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize(\"user\");\n\t\tSystem.out.println(\"Credentials saved to \" + DATA_STORE_DIR.getAbsolutePath());\n\t\treturn credential;\n\t}", "@Nullable\n private TokenCredentials getCredentials(String header) {\n if (header == null) {\n return null;\n } else {\n int space = header.indexOf(32);\n if (space <= 0) {\n return null;\n } else {\n String method = header.substring(0, space);\n if (!this.prefix.equalsIgnoreCase(method)) {\n return null;\n } else {\n String decoded;\n try {\n decoded = new String(BaseEncoding.base64().decode(header.substring(space + 1)), StandardCharsets.UTF_8);\n } catch (IllegalArgumentException var8) {\n this.logger.warn(\"Error decoding credentials\", var8);\n return null;\n }\n\n int i = decoded.indexOf(58);\n if (i <= 0) {\n return null;\n } else {\n String token = decoded.substring(i + 1);\n String username = decoded.substring(0, i);\n return new TokenCredentials(token, username);\n }\n }\n }\n }\n }", "public Future<CtxModelObject> retrieve(CtxIdentifier identifier);", "public static Task<String> getUserToken(String userId) {\n return FirebaseFirestore.getInstance()\n .collection(Const.USERS_COLLECTION)\n .document(userId)\n .get()\n .continueWith(new Continuation<DocumentSnapshot, String>() {\n @Override\n public String then(@NonNull Task<DocumentSnapshot> task) {\n DocumentSnapshot result = task.getResult();\n if (result != null && result.contains(Const.USER_TOKEN_KEY)) {\n return (String) result.get(Const.USER_TOKEN_KEY);\n }\n return \"\";\n }\n });\n }", "private CompletableFuture<LinkedList<JsonObject>> searchCredentials(final io.enmasse.iot.infinispan.device.CredentialKey key) {\n\n final QueryFactory queryFactory = Search.getQueryFactory(this.managementCache);\n\n final Query query = queryFactory\n .create(String.format(\"from %s d where d.tenantId=:tenantId and d.credentials.authId=:authId and d.credentials.type=:type\", DeviceInformation.class.getName()),\n IndexedQueryMode.BROADCAST)\n .setParameter(\"tenantId\", key.getTenantId())\n .setParameter(\"authId\", key.getAuthId())\n .setParameter(\"type\", key.getType());\n\n return CompletableFuture\n .supplyAsync(query::<DeviceInformation>list, this.executor)\n .thenApply(result -> mapCredentials(key, result));\n\n }", "public JWT getIDToken() {\n return idToken;\n }", "@Override\n public String refresh() {\n\n // Override the existing token\n setToken(null);\n\n // Get the identityId and token by making a call to your backend\n // (Call to your backend)\n\n // Call the update method with updated identityId and token to make sure\n // these are ready to be used from Credentials Provider.\n\n update(identityId, token);\n return token;\n\n }", "public void getToken(Context context) {\n FirebaseInstanceId.getInstance().getInstanceId()\r\n .addOnCompleteListener(new OnCompleteListener<InstanceIdResult>() {\r\n @Override\r\n public void onComplete(@NonNull Task<InstanceIdResult> task) {\r\n if (!task.isSuccessful()) {\r\n Log.w(TAG, \"getInstanceId failed\", task.getException());\r\n return;\r\n }\r\n\r\n // Get new Instance ID token\r\n String token = task.getResult().getToken();\r\n\r\n // Log and toast\r\n String msg = context.getString(R.string.msg_token_fmt, token);\r\n Log.d(TAG, msg);\r\n //Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();\r\n }\r\n });\r\n // [END retrieve_current_token]\r\n }", "public String getAuthToken() throws Exception {\n _log.info(\"3PARDriver:getAuthToken enter, after expiry\");\n String authToken = null;\n ClientResponse clientResp = null;\n String body= \"{\\\"user\\\":\\\"\" + _user + \"\\\", \\\"password\\\":\\\"\" + _password + \"\\\"}\";\n\n try {\n clientResp = _client.post_json(_baseUrl.resolve(URI_LOGIN), body);\n if (clientResp == null) {\n _log.error(\"3PARDriver:There is no response from 3PAR\");\n throw new HP3PARException(\"There is no response from 3PAR\");\n } else if (clientResp.getStatus() != 201) {\n String errResp = getResponseDetails(clientResp);\n throw new HP3PARException(errResp);\n } else {\n JSONObject jObj = clientResp.getEntity(JSONObject.class);\n authToken = jObj.getString(\"key\");\n }\n this._authToken = authToken;\n return authToken;\n } catch (Exception e) {\n throw e;\n } finally {\n if (clientResp != null) {\n clientResp.close();\n }\n _log.info(\"3PARDriver:getAuthToken leave, after expiry\");\n } //end try/catch/finally\n }", "private Drive authentication() throws IOException {\n\t\t// Request a new access token using the refresh token.\n\t\tGoogleCredential credential = new GoogleCredential.Builder()\n\t\t\t\t.setTransport(HTTP_TRANSPORT)\n\t\t\t\t.setJsonFactory(JSON_FACTORY)\n\t\t\t\t.setClientSecrets(CLIENT_ID, CLIENT_SECRET).build()\n\t\t\t\t.setFromTokenResponse(new TokenResponse().setRefreshToken(REFRESH_TOKEN));\n\t\tcredential.refreshToken();\n\t\treturn new Drive.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential)\n\t\t\t\t.setApplicationName(\"tp3\").build();\n\t}", "Lock getComponentAccessTokenLock();", "public String getIdToken() throws IOException {\n return (String)userInfo.get(\"id_token\");\n }" ]
[ "0.57563305", "0.5628312", "0.5628312", "0.5628312", "0.5626243", "0.5583455", "0.5575706", "0.55495113", "0.5534773", "0.54443175", "0.54226226", "0.5363292", "0.5336145", "0.5311026", "0.52953565", "0.52662176", "0.5263295", "0.5259943", "0.5237195", "0.5235839", "0.5187575", "0.5170232", "0.5153406", "0.51452374", "0.5074511", "0.5067841", "0.5062939", "0.5057515", "0.50548977", "0.5028091", "0.501916", "0.49792868", "0.49114755", "0.49071544", "0.49050644", "0.48946887", "0.488943", "0.48803118", "0.4866645", "0.48494342", "0.48473594", "0.48267314", "0.48203668", "0.48118588", "0.47982413", "0.47909233", "0.47810072", "0.47807625", "0.4767418", "0.47590756", "0.47519827", "0.47476995", "0.4746149", "0.4744182", "0.4741431", "0.4739079", "0.4723484", "0.4715475", "0.47019854", "0.4684606", "0.46839035", "0.46804452", "0.4670469", "0.4659483", "0.4653027", "0.46495175", "0.46424857", "0.46395794", "0.4639228", "0.4636542", "0.4631923", "0.4626549", "0.4624431", "0.46206868", "0.46206868", "0.4610979", "0.46021667", "0.46017477", "0.46007425", "0.4598868", "0.45912835", "0.45801187", "0.45785597", "0.4553713", "0.45510384", "0.4549353", "0.4545443", "0.45406577", "0.45259854", "0.452592", "0.4523227", "0.44952396", "0.44918007", "0.44866177", "0.44805494", "0.447863", "0.44775048", "0.4467861", "0.4466291", "0.44633925" ]
0.73353446
0
Created by Filip on 03/03/2016.
public interface TrackingStatsHelper { void addDistanceFromNewLocationToTotalDistance(Location currentLocation); void setCurrentSessionStats(Stats stats); Stats getCurrentSessionStats(); void setLastLocation(Location location); Location getLastLocation(); void addTimeSpentWhileTrackingLastStarted(long startTime, long endTime); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void anular() {\n\n\t}", "private void poetries() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\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 }", "@Override\n protected void initialize() {\n\n \n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n void init() {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n public void init() {}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "public void gored() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n protected void initialize() \n {\n \n }", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {}", "private void m50366E() {\n }", "@Override\n\tprotected void initialize() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n protected void init() {\n }", "@Override\r\n\tprotected void doF4() {\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 public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n public void initialize() { \n }", "@Override\n public void memoria() {\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}", "private void init() {\n\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override public int describeContents() { return 0; }", "@Override\n\tpublic void init() {\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "private MetallicityUtils() {\n\t\t\n\t}", "Consumable() {\n\t}", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n public int getSize() {\n return 1;\n }", "private void kk12() {\n\n\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "Petunia() {\r\n\t\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }" ]
[ "0.6040723", "0.5828868", "0.57807714", "0.57660246", "0.5698867", "0.5698867", "0.5672173", "0.5664371", "0.56049824", "0.5602479", "0.559569", "0.5587577", "0.55623", "0.55611414", "0.5551353", "0.5542757", "0.5534909", "0.5519338", "0.5509852", "0.549246", "0.5489146", "0.54706174", "0.54706174", "0.54706174", "0.54706174", "0.54706174", "0.54706174", "0.54623044", "0.54561585", "0.54538393", "0.54538393", "0.54538393", "0.54538393", "0.54538393", "0.54523474", "0.54477704", "0.54409415", "0.54409415", "0.54401976", "0.5425757", "0.542378", "0.5421031", "0.5416939", "0.5400366", "0.53959596", "0.5391414", "0.5391414", "0.5389919", "0.53870904", "0.5383935", "0.5383915", "0.5375429", "0.5370577", "0.5359829", "0.5358503", "0.53542316", "0.53380764", "0.5319885", "0.5318575", "0.5318575", "0.5318575", "0.5316457", "0.5316457", "0.52974117", "0.52974117", "0.52974117", "0.52968895", "0.5295872", "0.5293518", "0.52923423", "0.52918667", "0.529147", "0.52889705", "0.52884716", "0.52884716", "0.52884716", "0.5286914", "0.5265856", "0.52639997", "0.52639467", "0.5262595", "0.5261443", "0.5251778", "0.5251778", "0.524942", "0.524942", "0.524942", "0.52446735", "0.5241776", "0.52330184", "0.5230522", "0.52200687", "0.5217591", "0.5214244", "0.52082074", "0.5201869", "0.5201465", "0.51994497", "0.51861805", "0.5183463", "0.5183463" ]
0.0
-1
An Http Reactive Channel with several accessor related to HTTP flow : headers, params, URI, method, websocket...
public interface HttpChannel extends NettyChannel, HttpOutbound, HttpInbound { /** * add the passed cookie * @return this */ HttpChannel addResponseCookie(Cookie cookie); /** * * @param name * @param value * @return */ HttpChannel addResponseHeader(CharSequence name, CharSequence value); /** * * @param key * @return */ Object param(CharSequence key); /** * * @return */ Map<String, Object> params(); /** * * @param headerResolver * @return */ HttpChannel paramsResolver(Function<? super String, Map<String, Object>> headerResolver); /** * */ HttpChannel responseTransfer(boolean chunked); /** * * @param name * @param value * @return */ HttpChannel responseHeader(CharSequence name, CharSequence value); /** * * @return */ HttpChannel sse(); /** * * @param status * @return */ HttpChannel status(HttpResponseStatus status); /** * * @param status * @return */ default HttpChannel status(int status){ return status(HttpResponseStatus.valueOf(status)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void handleHttpRequest(ChannelHandlerContext ctx, FullHttpRequest req) throws Exception {\n if (!req.getDecoderResult().isSuccess()) {\n sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, BAD_REQUEST));\n return;\n }\n\n // Allow only GET methods.\n if (req.getMethod() != GET) {\n sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, FORBIDDEN));\n return;\n }\n\n // Send the demo page and favicon.ico\n if (\"/\".equals(req.getUri())) {\n ByteBuf content = getContent(getWebSocketLocation(req));\n FullHttpResponse res = new DefaultFullHttpResponse(HTTP_1_1, OK, content);\n res.headers().set(CONTENT_TYPE, \"text/html; charset=UTF-8\");\n setContentLength(res, content.readableBytes());\n sendHttpResponse(ctx, req, res);\n return;\n }\n if (\"/favicon.ico\".equals(req.getUri())) {\n FullHttpResponse res = new DefaultFullHttpResponse(HTTP_1_1, NOT_FOUND);\n sendHttpResponse(ctx, req, res);\n return;\n }\n\n Channel channel = ctx.channel();\n\n QueryStringDecoder dec = new QueryStringDecoder(req.getUri());\n String username = dec.parameters().get(\"username\").get(0);\n String page = dec.parameters().get(\"page\").get(0);\n channel.attr(WebSocketServer.USERNAME).set(username);\n Archon.getInstance().getLogger().warning(Thread.currentThread().getName() + \" [WS] channel username for \" + channel + \": \" + username + \" - page=\" + page);\n\n // Handshake\n WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(getWebSocketLocation(req), null, false);\n handshaker = wsFactory.newHandshaker(req);\n if (handshaker == null) {\n WebSocketServerHandshakerFactory.sendUnsupportedWebSocketVersionResponse(ctx.channel());\n } else {\n handshaker.handshake(ctx.channel(), req).addListener((ChannelFutureListener) future -> {\n Channel channel1 = future.channel();\n if (future.isSuccess()) {\n channel1.attr(WebSocketServer.REGISTERED).set(true);\n server.addChannel(channel1);\n } else {\n future.channel().attr(WebSocketServer.REGISTERED).set(false);\n Archon.getInstance().getLogger().log(Level.WARNING, Thread.currentThread().getName() + \" [WS] Failed to register channel (handshake): \" + channel1, future.cause());\n }\n });\n }\n }", "public interface NettyTransportRequestProcessor {\n\n /**\n * process transport request\n *\n * @param ctx context\n * @param request request\n * @return response packet\n */\n Packet process(final ChannelHandlerContext ctx, final Packet request);\n}", "@Override\n public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) {\n if (msg instanceof HttpResponse) {\n //clear the buffer.\n _responseBodyBuf.clear();\n //\n HttpResponse response = (HttpResponse) msg;\n //get HTTP Response code.\n this._hcr._responseStatus = response.getStatus();\n //\n //print header.\n Set<String> headers = response.headers().names();\n for (Iterator<String> keyIter = headers.iterator(); keyIter.hasNext();) {\n String keyName = keyIter.next();\n //System.out.println(keyName + \":\" + response.headers().get(keyName));\n this._hcr._responseHeaderMap.put(keyName, response.headers().get(keyName));\n }\n }\n //content or lastContent\n if (msg instanceof HttpContent) {\n HttpContent content = (HttpContent) msg;\n _responseBodyBuf.writeBytes(content.content());\n //if is last content fire done.\n if (content instanceof LastHttpContent) {\n try {\n fireDone(_responseBodyBuf.toString(this._hcr._responseBodyCharset));\n } finally {\n ctx.close();\n releaseResource();\n }\n }\n }\n }", "public interface IRouteChannel {\n\n /**发送消息及时刷新,*/\n public void writeAndFlush(Object msg);\n /**发送消息,先不刷新*/\n public void write(Object msg);\n /**刷新消息*/\n public void flush();\n\n /**关闭连接*/\n public void close();\n}", "public interface NettyHttpRequestBuilder {\n /**\n * Converts this object to a full http request.\n *\n * @return a full http request\n */\n @NonNull\n FullHttpRequest toFullHttpRequest();\n\n /**\n * Converts this object to a streamed http request.\n * @return The streamed request\n */\n @NonNull\n StreamedHttpRequest toStreamHttpRequest();\n\n /**\n * Converts this object to the most appropriate http request type.\n * @return The http request\n */\n @NonNull\n HttpRequest toHttpRequest();\n\n /**\n * @return Is the request a stream.\n */\n boolean isStream();\n\n /**\n * Convert the given request to a full http request.\n * @param request The request\n * @return The full request.\n */\n static @NonNull HttpRequest toHttpRequest(@NonNull io.micronaut.http.HttpRequest<?> request) {\n Objects.requireNonNull(request, \"The request cannot be null\");\n while (request instanceof HttpRequestWrapper) {\n request = ((HttpRequestWrapper<?>) request).getDelegate();\n }\n if (request instanceof NettyHttpRequestBuilder) {\n return ((NettyHttpRequestBuilder) request).toHttpRequest();\n }\n // manual conversion\n HttpRequest nettyRequest;\n ByteBuf byteBuf = request.getBody(ByteBuf.class).orElse(null);\n if (byteBuf != null) {\n nettyRequest = new DefaultFullHttpRequest(\n HttpVersion.HTTP_1_1,\n HttpMethod.valueOf(request.getMethodName()),\n request.getUri().toString(),\n byteBuf\n );\n } else {\n nettyRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1,\n HttpMethod.valueOf(request.getMethodName()),\n request.getUri().toString()\n );\n }\n\n request.getHeaders()\n .forEach((s, strings) -> nettyRequest.headers().add(s, strings));\n return nettyRequest;\n }\n\n}", "public interface SocketControl {\n\n /**\n * 获取服务的IP和端口\n * @return 格式:ip:port,如127.0.0.1:8080\n */\n String getIpPort();\n\n /**\n * 获取服务的ServiceId\n * @return 服务的ServiceId\n */\n String getServiceId();\n\n /**\n * 获取服务的InstanceId\n * @return 服务的InstanceId\n */\n String getInstanceId();\n\n\n /**\n * 获取模块名称,也可以直接调用getIpPort()\n * @return 模块名称\n */\n String getModelName();\n\n\n /**\n * 模块下连接的标示\n * @param channel 管道对象\n * @return uk\n */\n String getUniqueKey(Channel channel);\n\n\n /**\n * 模块下连接的标示\n * @param ctx 管道对象\n * @return uk\n */\n String getUniqueKey(ChannelHandlerContext ctx);\n\n\n /**\n * 绑定key\n * @param ctx 当前连接对象\n * @param key key\n */\n void bindKey(ChannelHandlerContext ctx,String key);\n\n /**\n * 绑定key\n * @param ctx 当前连接对象\n * @param key key\n */\n void bindKey(Channel ctx,String key);\n\n /**\n * 获取key\n * @param ctx 当前链接对象\n * @return key\n */\n String getKey(Channel ctx);\n\n /**\n * 获取key\n * @param ctx 当前链接对象\n * @return key\n */\n String getKey(ChannelHandlerContext ctx);\n\n\n /**\n * 重置心跳时间\n * @param ctx 当前连接对象\n * @param heartTime 心跳时间(秒)\n */\n void resetHeartTime(Channel ctx,int heartTime);\n\n\n\n}", "@Override\n\tprotected void channelRead0(ChannelHandlerContext ctx, WsClientMessage msg) throws Exception {\n\t}", "public interface HttpHandler {\n public void handle(HttpExchange httpExchange) throws IOException;\n}", "public interface HttpMessage {\n\n\n /**\n * Checks if a certain header is present in this message. Header values are\n * ignored.\n *\n * @param name the header name to check for.\n * @return true if at least one header with this name is present.\n */\n boolean containsHeader(String name);\n\n\n /**\n * Returns the first header with a specified name of this message. Header\n * values are ignored. If there is more than one matching header in the\n * message the first element of {@link #getHeaders(String)} is returned.\n * If there is no matching header in the message <code>null</code> is\n * returned.\n *\n * @param name the name of the header to return.\n * @return the first header whose name property equals <code>name</code>\n * or <code>null</code> if no such header could be found.\n */\n default Header getFirstHeader(String name) {\n return getHeaders(name).stream().findFirst().orElse(null);\n }\n\n /**\n * Returns all the headers with a specified name of this message. Header values\n * are ignored. Headers are ordered in the sequence they will be sent over a\n * connection.\n *\n * @param name the name of the headers to return.\n * @return the headers whose name property equals <code>name</code>.\n */\n List<? extends Header> getHeaders(String name);\n\n /**\n * Returns all the headers of this message. Headers are ordered in the sequence\n * they will be sent over a connection.\n *\n * @return all the headers of this message\n */\n List<? extends Header> getAllHeaders();\n\n\n}", "public interface Channel\r\n{\r\n /**\r\n * Get a duplex connection for this channel. This method must be called for each request-response message exchange.\r\n * @param msgProps message specific properties\r\n * @param xmlOptions XML formatting options\r\n * @return connection\r\n * @throws IOException on I/O error\r\n * @throws WsConfigurationException on configuration error\r\n */\r\n DuplexConnection getDuplex(MessageProperties msgProps, XmlOptions xmlOptions) throws IOException, \r\n WsConfigurationException;\r\n \r\n /**\r\n * Get a send-only connection for this channel. This method must be called for each message to be sent without a\r\n * response.\r\n * @param msgProps message specific properties\r\n * @param xmlOptions XML formatting options\r\n * @return connection\r\n * @throws IOException on I/O error\r\n * @throws WsConfigurationException on configuration error\r\n */\r\n OutConnection getOutbound(MessageProperties msgProps, XmlOptions xmlOptions) throws IOException, \r\n WsConfigurationException;\r\n \r\n /**\r\n * Get a receive-only connection for this channel. This method must be called for each message to be received, and\r\n * will wait for a message to be available before returning.\r\n * \r\n * @return connection\r\n * @throws IOException on I/O error\r\n * @throws WsConfigurationException on configuration error\r\n */\r\n InConnection getInbound() throws IOException, WsConfigurationException;\r\n \r\n /**\r\n * Close the channel. Implementations should disconnect and free any resources allocated to the channel.\r\n * @throws IOException on I/O error\r\n */\r\n void close() throws IOException;\r\n}", "public interface Handle {\n public void handle(HttpExchange httpExchange);\n}", "public interface Router {\n\n interface Message {\n /**\n * The reply-to header\n *\n * @return the reply-to header\n */\n default String replyTo() {\n return (String) metadata().get(\"reply-to\");\n }\n\n /**\n * The host header\n *\n * @return the host header\n */\n default String host() {\n return (String) metadata().get(\"x-host\");\n }\n\n /**\n * Get the name of the reply queue to send the message to\n *\n * @return the reply queue\n */\n default String replyQueue() {\n return (String) metadata().get(\"x-reply-queue\");\n }\n\n\n /**\n * The uri header\n *\n * @return the uri header\n */\n default String uri() {\n\n return (String) metadata().get(\"x-uri\");\n }\n\n /**\n * The scheme header\n *\n * @return the scheme header\n */\n default String scheme() {\n return (String) metadata().get(\"x-scheme\");\n }\n\n /**\n * The method header\n *\n * @return the method header\n */\n default String method() {\n String m = (String) metadata().get(\"x-method\");\n if (null == m) {\n m = \"get\";\n }\n return m.toLowerCase();\n }\n\n /**\n * Get the port... may be String, Number, or null\n *\n * @return get the port\n */\n default Object port() {\n return metadata().get(\"server-port\");\n }\n\n /**\n * get the protocol for the request\n *\n * @return\n */\n default String protocol() {\n return (String) metadata().get(\"x-server-protocol\");\n }\n\n /**\n * Get the uri args for the request\n *\n * @return the uri args for the request\n */\n default String args() {\n return (String) metadata().get(\"x-uri-args\");\n }\n\n /**\n * The content-type header\n *\n * @return the content-type header\n */\n default String contentType() {\n return (String) metadata().get(\"content-type\");\n }\n\n /**\n * The remote address of the client\n *\n * @return remote address\n */\n default String remoteAddr() {\n return (String) metadata().get(\"x-remote-addr\");\n }\n\n /**\n * The\n *\n * @return\n */\n Map<String, Object> metadata();\n\n Object body();\n\n byte[] rawBody();\n\n MessageBroker.ReceivedMessage underlyingMessage();\n }\n\n /**\n * Convert the message from the more generic one from the MessageBroker into\n * something that can be routed\n *\n * @param message\n * @return\n */\n default Message brokerMessageToRouterMessage(MessageBroker.ReceivedMessage message) {\n return new Message() {\n\n @Override\n public Map<String, Object> metadata() {\n return message.metadata();\n }\n\n @Override\n public Object body() {\n return message.body();\n }\n\n @Override\n public byte[] rawBody() {\n return message.rawBody();\n }\n\n @Override\n public MessageBroker.ReceivedMessage underlyingMessage() {\n return message;\n }\n };\n }\n\n /**\n * Route the message. This may cause the message to be queued to the next handler (Runner)\n * or route it to the handler Func.\n *\n * @param message the Message to route\n * @return the result of the Message application or void if this Router forwards the message\n */\n Object routeMessage(Message message) throws IOException;\n\n\n /**\n * Release any resources that the Router has... for example, any database pool connections\n */\n void endLife();\n\n /**\n * Get the host that this Router is listening for\n *\n * @return the name of the host. May be null\n */\n String host();\n\n /**\n * Get the base path for this Router\n *\n * @return the base path for the router\n */\n String basePath();\n\n /**\n * Return the name of the queue that is associated with the host/path combination\n *\n * @return the name of the queue associated with the host/path combination\n */\n String nameOfListenQueue();\n\n /**\n * Get the swagger for this Router\n *\n * @return the Swagger information for the router\n */\n Map<String, Object> swagger();\n\n}", "public JsonHttpChannel() {\n this.defaultConstructor = new JsonHttpEventFactory();\n }", "HttpPipeline getHttpPipeline();", "public interface HttpRequest {\n\n /**\n * Gets the HTTP request {@link URL}.\n */\n URL getUrl();\n\n /**\n * Gets the HTTP request method.\n */\n String getMethod();\n\n /**\n * Gets an immutable map containing the request headers and their values.\n */\n Map<String, List<String>> getHeaders();\n\n /**\n * Gets the header's value.\n *\n * @param name Header name for which to retrieve the value.\n *\n * @return The header's value, which might also be {@code null} if not set.\n */\n String getHeader(String name);\n\n /**\n * Sets an HTTP header or overwrites an existing HTTP header with new value.\n * <p>\n * Trying to set an HTTP header with null name will return immediately.\n * Trying to set one of the following restricted headers will also return immediately.\n * </p>\n * <ul>\n * <li>{@code Access-Control-Request-Headers}</li>\n * <li>{@code Access-Control-Request-Method}</li>\n * <li>{@code Connection}</li>\n * <li>{@code Content-Length}</li>\n * <li>{@code Content-Transfer-Encoding}</li>\n * <li>{@code Host}</li>\n * <li>{@code Keep-Alive}</li>\n * <li>{@code Origin}</li>\n * <li>{@code Trailer}</li>\n * <li>{@code Transfer-Encoding}</li>\n * <li>{@code Upgrade}</li>\n * <li>{@code Via}</li>\n * </ul>\n *\n * @param name The header's name, which must not be {@code null} or any of the restricted headers.\n * @param value The header's value\n */\n void setHeader(String name, String value);\n}", "public interface HttpClientable {\n\n void get(String url);\n\n void get(String url, ParamStore params);\n\n void get(String url, ParamStore params, String tag);\n\n void post(String url, SparseArray<String> params);\n\n void post(String url, SparseArray<String> params, String tag);\n\n void upload(String url, HashMap<String, Object> params);\n\n void upload(String url, HashMap<String, Object> params, String tag);\n\n void download(String url);\n\n void download(String url, String tag);\n\n void cancelAll();\n\n void cancel(String tag);\n\n}", "public interface IHttpRequest {\n Map<String, String> getHeaders();\n\n Map<String, String> getBodyParams();\n\n Map<String, String> getCookies();\n\n String getMethod();\n\n void setMethod(String method);\n\n String getUrl();\n\n void setUrl(String url);\n\n void addHeader(String header, String value);\n\n void addBodyParam(String bodyParam, String value);\n\n boolean isResource();\n}", "public interface HttpRequestService {\n\n String get(String url,HashMap<String,String> params) throws IOException;\n\n String get(String url) throws IOException;\n\n String post(String url,HashMap<String,String> params) throws Exception;\n\n}", "private void handleHttpRequest(ChannelHandlerContext ctx, FullHttpRequest req) throws Exception {\n if (!req.decoderResult().isSuccess()) {\n sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, BAD_REQUEST));\n return;\n }\n\n // Allow only GET methods.\n if (req.method() != GET) {\n sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, FORBIDDEN));\n return;\n }\n\n // route handler\n if (\"/ws\".equals(req.uri())) {\n WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(\n \"ws://\" + req.headers().get(HOST) + \"/ws\", null, false);\n handshaker = wsFactory.newHandshaker(req);\n if (handshaker == null) {\n WebSocketServerHandshakerFactory.sendUnsupportedVersionResponse(ctx.channel());\n } else {\n handshaker.handshake(ctx.channel(), req);\n addCtx(ctx, req.headers());\n }\n } else {\n handleFileRequest(ctx, req);\n }\n }", "SocketChannel getChannel();", "public int GetChannel();", "@Override\n public void channelActive(final ChannelHandlerContext ctx) throws Exception {\n ioContext = new IoContext(\n endpointContext,\n ctx.channel().localAddress(),\n ctx.channel().remoteAddress(),\n endpointContext.bucket()\n );\n\n channelContext = new HttpChannelContext(ctx.channel().id());\n\n remoteHost = endpoint.remoteHostname() + \":\" + endpoint.remotePort();\n ctx.pipeline().get(HttpObjectAggregator.class).channelActive(ctx);\n ctx.fireChannelActive();\n }", "@Override\n public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {\n String body = (String) msg;\n System.out.println(body);\n System.out.println(\"第\"+ ++count + \"次收到服务器回应\");\n }", "public interface NettyProxyService {\n /**\n * 心跳\n *\n * @param msg\n * @throws Exception\n */\n void processHeartbeatMsg(HeartbeatMsg msg) throws Exception;\n\n /**\n * 上传位置\n *\n * @param msg\n * @throws Exception\n */\n void processLocationMsg(LocationMsg msg) throws Exception;\n\n /**\n * 离线\n *\n * @param deviceNumber\n */\n void processInactive(String deviceNumber);\n}", "java.lang.String getChannel();", "netty.framework.messages.TestMessage.TestRequest getRequest();", "@Override\n public int getChannel()\n {\n return channel;\n }", "private void handleHttpRequest(ChannelHandlerContext ctx, HttpRequest req) throws Exception {\n\t\tif (req.getMethod() != HttpMethod.GET) {\n\t\t\tresponseSender.sendResponse(ctx.getChannel(), HttpResponseStatus.FORBIDDEN);\n\t\t\treturn;\n\t\t}\n\n\t\t// Send the demo page and favicon.ico\n\t\tif (req.getUri().equals(\"/\")) {\n\t\t\tresponseSender.sendResponse(ctx.getChannel(), HttpResponseStatus.OK, WebSocketServerIndexPage.getContent(getWebSocketLocation(req)), \"UTF-8\",\n\t\t\t\t\t\"text/html; charset=UTF-8\");\n\t\t\treturn;\n\t\t} else if (req.getUri().equals(\"/favicon.ico\")) {\n\t\t\tresponseSender.sendResponse(ctx.getChannel(), HttpResponseStatus.NOT_FOUND);\n\t\t\treturn;\n\t\t}\n\n\t\t// Handshake\n\t\tWebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(getWebSocketLocation(req), null, false);\n\t\thandshaker = wsFactory.newHandshaker(req);\n\t\tif (handshaker == null) {\n\t\t\twsFactory.sendUnsupportedWebSocketVersionResponse(ctx.getChannel());\n\t\t} else {\n\t\t\thandshaker.handshake(ctx.getChannel(), req).addListener(WebSocketServerHandshaker.HANDSHAKE_LISTENER);\n\t\t}\n\t}", "@Override\n public void handle(HttpChannel<?> connection) throws IOException, ServletException {\n throw new UnsupportedOperationException();\n }", "public interface Http2Client extends Closeable {\n\n /**\n * connect to remote address asynchronously\n * @return CompletableFuture contains {@link Void}\n */\n CompletableFuture<Void> connect();\n\n /**\n * send http request to remote address asynchronously\n * @param request http2 request\n * @return CompletableFuture contains response\n */\n CompletableFuture<HttpResponse> sendRequest(HttpRequest request);\n\n /**\n * send http request to remote address asynchronously,\n * and not wait far response\n * @param request http2 request\n * @return CompletableFuture contains nothing\n */\n CompletableFuture<Void> sendRequestOneWay(HttpRequest request);\n\n /**\n * send server-push ack to remote address asynchronously\n * @param pushAck server-push ack\n * @param streamId http2 streamId\n * @return CompletableFuture contains nothing\n */\n CompletableFuture<Void> sendPushAck(HttpPushAck pushAck, int streamId);\n}", "public Channel getChannel() {\n return channel;\n }", "public interface HttpTxnHandle\n{\n\n void respond(String data);\n\n void reject(int status, String reason);\n\n String path();\n\n default void reject(int code)\n {\n reject(code, \"Unknown\");\n }\n\n String host();\n\n void send(FullHttpResponse res);\n\n String cookie(String name);\n\n String method();\n\n String uri();\n\n Map<String, List<String>> query();\n\n InputStream input();\n\n Map<String, List<String>> headers();\n\n Runnable schedule(Duration timeout, Runnable callback);\n\n}", "@Override\r\n\tprotected void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\r\n\r\n if (isSSL) {\r\n SSLEngine engine = SecureSSLContextFactory.getServerContext().createSSLEngine();\r\n engine.setUseClientMode(false);\r\n pipeline.addLast(\"ssl\", new SslHandler(engine));\r\n }\r\n\r\n pipeline.addLast(\"decoder\", new HttpRequestDecoder());\r\n pipeline.addLast(\"encoder\", new HttpResponseEncoder());\r\n\r\n // Remove the following line if you don't want automatic content\r\n // compression.\r\n pipeline.addLast(\"deflater\", new HttpContentCompressor());\r\n \r\n pipeline.addLast( \"http-aggregator\", new HttpObjectAggregator( Integer.MAX_VALUE ) );\r\n\t\t\r\n pipeline.addLast(\"chunkedWriter\",new ChunkedWriteHandler());\r\n\r\n pipeline.addLast(\"handler\", receiveHandler);\r\n\t\t\r\n\t}", "@Override\n public void channelActive(ChannelHandlerContext ctx) throws Exception {\n super.channelActive(ctx);\n \n }", "@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n\n // add HTTP decoder and encoder\n pipeline.addLast(\"logger\", new LoggingHandler());\n pipeline.addLast(new HttpServerCodec());\n pipeline.addLast(new HttpObjectAggregator(Integer.MAX_VALUE));\n pipeline.addLast(new MockServerServerCodec(false));\n\n // add handlers\n pipeline.addLast(new HttpProxyHandler(logFilter, HttpProxy.this, securePort != null ? new InetSocketAddress(securePort) : null));\n }", "@Override\n\tprotected void channelRead0(ChannelHandlerContext ctx, TextWebSocketFrame frame) throws Exception\n\t{\n\t\tci.invoke(frame.text());\n\t}", "public interface ChannelConnection {\n public Channel getChannel();\n public Connector getConnector();\n}", "public interface ChannelREST {\n public static final String ENDPOINT = \"http://92.222.72.89:8080/\";\n\n @GET(\"/club/{idClub}/channels/{idChannel}/messages\")\n Call<List<Message>> getAllMessageFromChannel(@Path(\"idClub\") Integer id, @Path(\"idChannel\") Integer idChannel);\n @GET(\"/club/{idClub}/channels\")\n Call<List<Channel>> getAllChannelFromClub(@Path(\"idClub\") Integer id);\n @FormUrlEncoded\n @POST(\"/club/{idClub}/channels/{idChannel}/postMessage\")\n Call<Message> postMessage(@Path(\"idClub\") Integer id, @Path(\"idChannel\") Integer idChannel, @Field(\"idUser\") Integer idUser, @Field(\"content\")String content);\n}", "public interface MessageInputChannel extends\r\n Channel<MessageInput, MessageInputChannelAPI>, OneDimensional, MessageCallback {\r\n\r\n}", "@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n\n // add HTTPS support\n SSLEngine engine = SSLFactory.getInstance().sslContext().createSSLEngine();\n engine.setUseClientMode(false);\n pipeline.addLast(new SslHandler(engine));\n\n // add HTTP decoder and encoder\n pipeline.addLast(new HttpServerCodec());\n pipeline.addLast(new HttpObjectAggregator(Integer.MAX_VALUE));\n pipeline.addLast(new MockServerServerCodec(true));\n\n // add handlers\n pipeline.addLast(new HttpProxyHandler(logFilter, HttpProxy.this, securePort != null ? new InetSocketAddress(securePort) : null));\n }", "public interface WebSocketMessageTransmitter {\n /**\n * Transmits WEB SOCKET messages\n *\n * @param protocol\n * message protocol\n * @param message\n * message body\n */\n void transmit(String protocol, String message);\n}", "@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n NettyCodecAdapter adapter = new NettyCodecAdapter();\n\n ch.pipeline()\n .addLast(\"logging\", new LoggingHandler(LogLevel.INFO))//for debug\n .addLast(\"decoder\", adapter.getDecoder())\n// .addLast(\"http-aggregator\", new HttpObjectAggregator(65536))\n .addLast(\"encoder\", adapter.getEncoder())\n// .addLast(\"http-chunked\", new ChunkedWriteHandler())\n// .addLast(\"server-idle-handler\", new IdleStateHandler(0, 0, 60 * 1000, MILLISECONDS))\n .addLast(\"handler\", nettyServerHandler);\n }", "@Override\n public Single<StreamingHttpResponse> handle(HttpServiceContext ctx,\n StreamingHttpRequest request,\n StreamingHttpResponseFactory responseFactory) {\n request.context().put(CLIENT_CTX, request.headers().get(header(CLIENT_CTX)));\n request.context().put(CLIENT_FILTER_OUT_CTX, request.headers().get(header(CLIENT_FILTER_OUT_CTX)));\n // Set server-side values:\n request.context().put(SERVER_FILTER_IN_CTX, value(SERVER_FILTER_IN_CTX));\n request.context().put(SERVER_FILTER_IN_TRAILER_CTX, value(SERVER_FILTER_IN_TRAILER_CTX));\n return delegate().handle(ctx, request, responseFactory).map(response -> {\n HttpHeaders headers = response.headers();\n // Take the first two values from context:\n headers.set(header(SERVER_FILTER_IN_CTX),\n requireNonNull(response.context().get(SERVER_FILTER_IN_CTX)));\n headers.set(header(SERVER_CTX), requireNonNull(response.context().get(SERVER_CTX)));\n // Set the last value explicitly:\n assertThat(response.context().containsKey(SERVER_FILTER_OUT_CTX), is(false));\n headers.set(header(SERVER_FILTER_OUT_CTX), value(SERVER_FILTER_OUT_CTX));\n\n // For Trailers-Only response put everything into headers:\n if (headers.contains(GRPC_STATUS)) {\n setTrailers(response.context(), headers);\n return response;\n }\n return response.transform(new StatelessTrailersTransformer<Buffer>() {\n @Override\n protected HttpHeaders payloadComplete(HttpHeaders trailers) {\n setTrailers(response.context(), trailers);\n return trailers;\n }\n });\n });\n }", "interface ChatterService {\n\n @GET(\"me\")\n @Headers({\n \"Content-Type: application/json\"\n })\n Observable<User> getMe();\n\n @GET(\"user/{userId}/conversations\")\n @Headers({\n \"Content-Type: application/json\"\n })\n Observable<String[]> getConversations(@Path(\"userId\") String userId);\n\n @GET(\"conversations/{convoId}/messages\")\n @Headers({\n \"Content-Type: application/json\"\n })\n Observable<Message[]> getMessages(@Path(\"convoId\") String convoId);\n\n @POST(\"conversations/{convoId}/messages\")\n @Headers({\n \"Content-Type: application/json\"\n })\n Observable<Message> writeMessage(@Body MessageBody body, @Path(\"convoId\") String convoId);\n\n\n}", "@Override\n\tpublic void channelRead(ChannelHandlerContext ctx, Object msg)\n\t\t\tthrows Exception {\n\t\thandleRequestWithsingleThread(ctx, msg);\n\t}", "@Override\n\tprotected void channelRead0(ChannelHandlerContext ctx, HttpObject msg) throws Exception {\n\t\t\n\t\t// This is all debugging...\n\t\tif (msg instanceof HttpResponse) {\n\t\t\tHttpResponse response = (HttpResponse) msg;\n\n\t\t\tlogger.debug(\"STATUS: \" + response.status());\n\t\t\tlogger.debug(\"VERSION: \" + response.protocolVersion());\n\n\t\t\tif (!response.headers().isEmpty()) {\n\t\t\t\tfor (CharSequence name : response.headers().names()) {\n\t\t\t\t\tfor (CharSequence value : response.headers().getAll(name)) {\n\t\t\t\t\t\tlogger.debug(\"HEADER: \" + name + \" = \" + value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (HttpUtil.isTransferEncodingChunked(response)) {\n\t\t\t\tlogger.debug(\"CHUNKED CONTENT {\");\n\t\t\t} else {\n\t\t\t\tlogger.debug(\"CONTENT {\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// This is where the work happens. This handler gets called MULTIPLE times.\n\t\tif (msg instanceof HttpContent) {\n\t\t\t// The data from the server\n\t\t\tHttpContent content = (HttpContent) msg;\n\n\t\t\t// Gather all the chunks.\n\t\t\tif (null == chunks) {\n\t\t\t\tlogger.debug(\"Chunks initialized.\");\n\t\t\t\tchunks = copiedBuffer(content.content());\n\t\t\t} else {\n\t\t\t\tlogger.debug(\"Adding chunks\");\n\t\t\t\tchunks = copiedBuffer(chunks, content.content());\n\t\t\t}\n\n\t\t\tlogger.debug(content.content().toString(CharsetUtil.UTF_8));\n\n\t\t\tif (content instanceof LastHttpContent) {\n\t\t\t\tlogger.debug(\"} END OF CONTENT\");\n\t\t\t\tlogger.debug(\"Subscriber in handler: {}\", this.subscriber);\n\t\t\t\tlogger.debug(\"Chunks: {}\", this.chunks);\n\t\t\t\tsubscriber.onNext(chunks.toString(CharsetUtil.UTF_8));\n\t\t\t\tctx.close();\n\t\t\t}\n\t\t}\n\t}", "EzyChannel getChannel();", "interface Connection {\n\n void prefetchXsrfToken();\n\n /** Send a POST request. TODO(mmuller): change to sendPostRequest() */\n String send(\n String endpoint, Map<String, ?> params, MediaType contentType, @Nullable byte[] payload)\n throws IOException;\n\n String sendGetRequest(String endpoint, Map<String, ?> params) throws IOException;\n\n Map<String, Object> sendJson(String endpoint, Map<String, ?> object) throws IOException;\n\n String getServerUrl();\n }", "@Override\n public void channelActive(ChannelHandlerContext ctx) throws Exception {\n }", "Channel channel() {\n return channel;\n }", "public interface HttpRequestHandler {\n public boolean canHandle(String uri);\n public httpResponse handle(httpRequest request);\n}", "@Override\n\tprotected void channelRead0(ChannelHandlerContext ctx, RpcRequest msg) throws Exception {\n\t\tRpcResponse response = new RpcResponse();\n\t\tresponse.setRequestId(msg.getRequestId());\n\t\ttry {\n\t\t\tObject result = handle(msg);\n\t\t\tresponse.setResult(result);\n\t\t} catch (Throwable t) {\n\t\t\tLOGGER.debug(\"handle ocurred error ==> {}\", t);\n\t\t\tresponse.setError(t);\n\t\t}\n\t\tctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);//写完然后关闭channel\n\t}", "public interface HttpConnection extends SocketModalCloseable {\n\n /**\n * Closes this connection gracefully. This method will attempt to flush the internal output\n * buffer prior to closing the underlying socket. This method MUST NOT be called from a\n * different thread to force shutdown of the connection. Use {@link #close shutdown} instead.\n */\n @Override\n void close() throws IOException;\n\n /**\n * Returns this connection's endpoint details.\n *\n * @return this connection's endpoint details.\n */\n EndpointDetails getEndpointDetails();\n\n /**\n * Returns this connection's local address or {@code null} if it is not bound yet.\n *\n * @return this connection's local address or {@code null} if it is not bound yet.\n * @since 5.0\n */\n SocketAddress getLocalAddress();\n\n /**\n * Returns this connection's remote address or {@code null} if it is not connected yet or\n * unconnected.\n *\n * @return this connection's remote address or {@code null} if it is not connected yet or\n * unconnected.\n * @since 5.0\n */\n SocketAddress getRemoteAddress();\n\n /**\n * Returns this connection's protocol version or {@code null} if unknown.\n *\n * @return this connection's protocol version or {@code null} if unknown.\n * @since 5.0\n */\n ProtocolVersion getProtocolVersion();\n\n /**\n * Returns this connection's SSL session or {@code null} if TLS has not been activated.\n *\n * @return this connection's SSL session or {@code null} if TLS has not been activated.\n */\n SSLSession getSSLSession();\n\n /**\n * Checks if this connection is open.\n *\n * @return true if it is open, false if it is closed.\n */\n boolean isOpen();\n\n}", "@Override\n public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {\n String body = msg.toString();\n System.out.println(\"返回值:\" + body + \", count = \" + counter.getAndIncrement());\n }", "@Override\r\n\t\t\t\t\tpublic void initChannel(SocketChannel ch)throws Exception {\n\t\t\t\t ChannelPipeline pipeline = ch.pipeline();\r\n\t\t\t\t \r\n\t\t\t\t /**\r\n\t\t\t\t * http-request解码器\r\n\t\t\t\t * http服务器端对request解码\r\n\t\t\t\t */\r\n\t\t\t\t pipeline.addLast(\"decoder\", new HttpRequestDecoder());\r\n\t\t\t\t /**\r\n\t\t\t\t * http-response解码器\r\n\t\t\t\t * http服务器端对response编码\r\n\t\t\t\t */\r\n\t\t\t\t pipeline.addLast(\"encoder\", new HttpResponseEncoder());\r\n\t\t\t\t \r\n\t\t\t\t /**\r\n\t\t\t\t * 压缩\r\n\t\t\t\t * Compresses an HttpMessage and an HttpContent in gzip or deflate encoding\r\n\t\t\t\t * while respecting the \"Accept-Encoding\" header.\r\n\t\t\t\t * If there is no matching encoding, no compression is done.\r\n\t\t\t\t */\r\n\t\t\t\t //pipeline.addLast(\"deflater\", new HttpContentCompressor());\r\n\t\t\t\t /* pipeline.addLast(new LoggingDiyHandler(InternalLogLevel.INFO));\r\n\t\t\t\t \r\n\t\t\t\t pipeline.addLast(\"handler\", new HttpServerHandler());*/\r\n\t\t\t\t\t}", "public interface HttpContract {\n\n WelfareService welfareHttp();\n\n}", "protected Channel getChannel()\n {\n return mChannel;\n }", "public interface HttpResponseListener extends AsyncListener {\n /** The http header has been sent. \n * @param response the HttpHeader that was read\n * @param bufferHandle the BufferHandle that may or may not hold unread data.\n * @param keepalive if the sender want to use keepalive.\n * @param isChunked if false content is not chunked, \n * if true content is chunked.\n * @param dataSize the contents size or -1 if size is unknown.\n */\n void httpResponse (HttpHeader response, BufferHandle bufferHandle, \n\t\t boolean keepalive, boolean isChunked, long dataSize);\n \n}", "public void handle(HttpExchange exch) {\n\n }", "public Channel getChannel()\n {\n return channel;\n }", "public interface EndpointBase {\n\n boolean isIdleNow();\n\n /**\n * @param connectionTimeout\n * @param methodTimeout\n */\n void setTimeouts(int connectionTimeout, int methodTimeout);\n\n /**\n * @param alwaysMainThread\n */\n void setCallbackThread(boolean alwaysMainThread);\n\n /**\n * @param flags\n */\n void setDebugFlags(int flags);\n\n int getDebugFlags();\n\n /**\n * @param delay\n */\n void setDelay(int delay);\n\n void addErrorLogger(ErrorLogger logger);\n\n void removeErrorLogger(ErrorLogger logger);\n\n void setOnRequestEventListener(OnRequestEventListener listener);\n\n\n void setPercentLoss(float percentLoss);\n\n int getThreadPriority();\n\n void setThreadPriority(int threadPriority);\n\n\n ProtocolController getProtocolController();\n\n void setUrlModifier(UrlModifier urlModifier);\n\n /**\n * No log.\n */\n int NO_DEBUG = 0;\n\n /**\n * Log time of requests.\n */\n int TIME_DEBUG = 1;\n\n /**\n * Log request content.\n */\n int REQUEST_DEBUG = 2;\n\n /**\n * Log response content.\n */\n int RESPONSE_DEBUG = 4;\n\n /**\n * Log cache behavior.\n */\n int CACHE_DEBUG = 8;\n\n /**\n * Log request code line.\n */\n int REQUEST_LINE_DEBUG = 16;\n\n /**\n * Log request and response headers.\n */\n int HEADERS_DEBUG = 32;\n\n /**\n * Log request errors\n */\n int ERROR_DEBUG = 64;\n\n /**\n * Log cancellations\n */\n int CANCEL_DEBUG = 128;\n\n /**\n * Log cancellations\n */\n int THREAD_DEBUG = 256;\n\n /**\n * Log everything.\n */\n int FULL_DEBUG = TIME_DEBUG | REQUEST_DEBUG | RESPONSE_DEBUG | CACHE_DEBUG | REQUEST_LINE_DEBUG | HEADERS_DEBUG | ERROR_DEBUG | CANCEL_DEBUG;\n\n int INTERNAL_DEBUG = FULL_DEBUG | THREAD_DEBUG;\n\n /**\n * Created by Kuba on 17/07/14.\n */\n interface UrlModifier {\n\n String createUrl(String url);\n\n }\n\n interface OnRequestEventListener {\n\n void onStart(Request request, int requestsCount);\n\n void onStop(Request request, int requestsCount);\n\n }\n}", "public interface TermStatusApi {\n\n /**\n * 初始化终端参数\n * @return\n */\n @Headers(RetrofitManager.CACHE_CONTROL_AGE + RetrofitManager.CACHE_STALE_SHORT)\n @GET(\"mcReset\")\n Observable<CommonResponse<TermInitResult>> mcReset(@Query(\"mc_no\") String mc_no, @Query(\"time\") long time, @Query(\"sign\") String sign);\n\n @Headers(RetrofitManager.CACHE_CONTROL_AGE + RetrofitManager.CACHE_STALE_SHORT)\n @GET(\"mcInit\")\n Observable<CommonResponse<TermInitResult>> mcInit(@Query(\"mc_no\") String mc_no, @Query(\"time\") long time, @Query(\"sign\") String sign);\n\n\n}", "@Override\n public ChannelPipeline getPipeline() throws Exception {\n ChannelPipeline pipeline = Channels.pipeline();\n pipeline.addLast(\"framer\", new DelimiterBasedFrameDecoder(8192, Delimiters.lineDelimiter()));\n pipeline.addLast(\"decoder\", new StringDecoder());\n pipeline.addLast(\"encoder\", new StringEncoder());\n // and then business logic.\n pipeline.addLast(\"AuthHandler\", new AuthHandlerHandler());\n pipeline.addLast(\"handler\", new DiscardServerHandler()); \n return pipeline;\n }", "public interface HttpRequest extends Serializable {\n\n\tpublic HttpResponse send() throws BackendConnectionException;\n\t\n\tpublic GoalContext getGoalContext();\n\t\n\tpublic HttpRequest setGoalContext(GoalContext _ctx);\n\n\tpublic void saveToDisk() throws IOException;\n\n\tpublic void savePayloadToDisk() throws IOException;\n\t\n\tpublic void loadFromDisk() throws IOException;\n\t\n\tpublic void loadPayloadFromDisk() throws IOException;\n\n\tpublic void deleteFromDisk() throws IOException;\n\n\tpublic void deletePayloadFromDisk() throws IOException;\n\n\tpublic String getFilename();\n}", "public interface HttpClientInterface {\n byte[] post(String url, byte[] body);\n}", "public Channel channel()\r\n/* 36: */ {\r\n/* 37: 68 */ return this.channel;\r\n/* 38: */ }", "public interface AsynchChannelsGateway {\n\n public Message<String> send(Message<String> message);\n\n}", "@Override\n public void handle(HttpExchange exchange) throws IOException {\n print( \"\\n\\nClient: \" + exchange.getLocalAddress() );\n print( \"Method: \" + exchange.getRequestMethod() );\n print( \"URI: \" + exchange.getRequestURI().toString() );\n print( \"Content Length: \" + exchange.getRequestHeaders().getFirst(\"Content-Length\"));\n\n switch( exchange.getRequestMethod() ) {\n case \"GET\":\n handleGet( exchange );\n break;\n case \"PUT\":\n handlePut( exchange );\n break;\n case \"DELETE\":\n handleDel( exchange );\n break;\n case \"POST\":\n handlePost( exchange );\n break;\n default:\n String body = htmlBuilder( \"Not Implemented\", \"Http Error 501: Not Implemented\");\n sendResponse(exchange, body.getBytes(), 501);\n break;\n }\n }", "@Override\n public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {\n\n log.info( ctx.channel().id().asLongText()+\"-> channelRead , msg={}\" , msg.getClass().getName());\n\n ctx.fireChannelRead( msg ) ;\n }", "public interface ZmoteHTTPDRequestHandler{\n\tpublic String getURI();\n\tpublic Response serve(String uri, String method, Properties header, Properties parms, Properties files, ZmoteHTTPD httpd);\t\n\tpublic ZmoteHTTPDRequestHandler clone();\n}", "public interface IHttpRequestHandler extends INamedObject\r\n{\t\r\n public HandlerResponse handleRequest( HttpRequestData httpRequest ) throws IOException;\r\n}", "public interface Channels {\n \n public void createChannel();\n\n}", "interface OnProxyConnectedCallback {\n void onConnected(ChannelHandlerContext ctx);\n //void onError(ChannelHandlerContext ctx, Throwable reason);\n }", "@Override\n public void channelRead0(ChannelHandlerContext ctx, String request) throws Exception {\n final JsonObject json = (JsonObject) parser.parse(request);\n if(json.has(\"operation\") && ((json.get(\"operation\").getAsString()).equals(\"data\"))) {\n final DataToProcess obj = GSON.fromJson(json, DataToProcess.class);\n QueuerManager.getInstance().pushPacket(ctx.channel().id().asShortText(), obj);\n// System.out.println(\"REC Data Received \" + ctx.channel().id().asShortText());\n }\n else {\n// System.out.println(\"REC hello packet\");\n }\n }", "public interface RequestModifier {\n\n /**\n * Set HTTP request method, only support get, post,put , delete method.\n *\n * @param method\n *\n */\n public void setMethod(HTTPMethod method);\n\n /**\n * Set HTTP Protocol.\n *\n * @param protocol\n *\n */\n public void setProtocol(String protocol);\n\n /**\n * Set HTTP version , such as HTTP1.1.\n *\n * @param version\n *\n */\n public void setVersion(String version);\n\n /**\n * Set HTTP domain.\n *\n * @param domain\n *\n */\n public void setDomain(String domain);\n\n /**\n * Set path in the url.\n *\n * @param path\n *\n */\n public void setPath(String path);\n\n /**\n * Set web server port\n *\n * @param port\n *\n */\n public void setPort(int port);\n\n /**\n * Set HTTP url\n *\n * @param url\n *\n */\n public void setUrl(URL url);\n\n /**\n * Set HTTP url string\n *\n * @param url\n *\n */\n public void setUrl(String url);\n\n /**\n * Modify the exist argument in url.\n *\n * @param urlArg\n *\n * @return boolean, if success to modfiy this argument, return true.\n * if fail to modfiy this argument, return false.\n */\n public boolean modifyURIArgContent(URLArg urlArg);\n\n /**\n * Modify the exist header in HTTP request headers.\n *\n * @param header\n *\n * @return boolean, if success to modfiy this argument, return true.\n * if fail to modfiy this argument, return false.\n */\n public boolean modifyHeaderContent(Header header);\n\n /**\n * Add the request header, if this header is exist, modfiy this value.\n *\n * @param key\n *\n * @param header\n *\n */\n public void addHeader(String key, String header);\n\n /**\n * Add the request header, if this header is exist, modfiy this value.\n *\n * @param key\n *\n * @param header\n *\n */\n public void delHeader(String key);\n\n /**\n * Add the post arg in request header, if this argument is exist, modfiy this value.\n *\n * @param key\n *\n * @param value\n *\n */\n public void addPostArg(String key, String value);\n\n /**\n * Add the url arg in request url, if this argument is exist, modfiy this value.\n *\n * @param key\n *\n * @param value\n *\n */\n public void addUrlArg(String key, String value);\n}", "R get() throws IOException, ClientProtocolException;", "private static void sendGets(HttpClient httpClient) {\n HttpTextResponse httpResponse = httpClient.get(\"/hello/mom\");\n puts(httpResponse);\n\n\n /* Send one param get. */\n httpResponse = httpClient.getWith1Param(\"/hello/singleParam\", \"hi\", \"mom\");\n puts(\"single param\", httpResponse);\n\n\n /* Send two param get. */\n httpResponse = httpClient.getWith2Params(\"/hello/twoParams\",\n \"hi\", \"mom\", \"hello\", \"dad\");\n puts(\"two params\", httpResponse);\n\n\n /* Send two param get. */\n httpResponse = httpClient.getWith3Params(\"/hello/3params\",\n \"hi\", \"mom\",\n \"hello\", \"dad\",\n \"greetings\", \"kids\");\n puts(\"three params\", httpResponse);\n\n\n /* Send four param get. */\n httpResponse = httpClient.getWith4Params(\"/hello/4params\",\n \"hi\", \"mom\",\n \"hello\", \"dad\",\n \"greetings\", \"kids\",\n \"yo\", \"pets\");\n puts(\"4 params\", httpResponse);\n\n /* Send five param get. */\n httpResponse = httpClient.getWith5Params(\"/hello/5params\",\n \"hi\", \"mom\",\n \"hello\", \"dad\",\n \"greetings\", \"kids\",\n \"yo\", \"pets\",\n \"hola\", \"neighbors\");\n puts(\"5 params\", httpResponse);\n\n\n /* Send six params with get. */\n\n final HttpRequest httpRequest = httpRequestBuilder().addParam(\"hi\", \"mom\")\n .addParam(\"hello\", \"dad\")\n .addParam(\"greetings\", \"kids\")\n .addParam(\"yo\", \"pets\")\n .addParam(\"hola\", \"pets\")\n .addParam(\"salutations\", \"all\").build();\n\n httpResponse = httpClient.sendRequestAndWait(httpRequest);\n puts(\"6 params\", httpResponse);\n\n\n /* Using Async support with lambda. */\n httpClient.getAsync(\"/hi/async\", (code, contentType, body) -> puts(\"Async text with lambda\", body));\n\n Sys.sleep(100);\n\n\n /* Using Async support with lambda. */\n httpClient.getAsyncWith1Param(\"/hi/async\", \"hi\", \"mom\", (code, contentType, body) -> puts(\"Async text with lambda 1 param\\n\", body));\n\n Sys.sleep(100);\n\n\n\n /* Using Async support with lambda. */\n httpClient.getAsyncWith2Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n (code, contentType, body) -> puts(\"Async text with lambda 2 params\\n\", body));\n\n Sys.sleep(100);\n\n\n\n\n /* Using Async support with lambda. */\n httpClient.getAsyncWith3Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n \"p3\", \"v3\",\n (code, contentType, body) -> puts(\"Async text with lambda 3 params\\n\", body));\n\n Sys.sleep(100);\n\n\n /* Using Async support with lambda. */\n httpClient.getAsyncWith4Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n \"p3\", \"v3\",\n \"p4\", \"v4\",\n (code, contentType, body) -> puts(\"Async text with lambda 4 params\\n\", body));\n\n Sys.sleep(100);\n\n\n /* Using Async support with lambda. */\n httpClient.getAsyncWith5Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n \"p3\", \"v3\",\n \"p4\", \"v4\",\n \"p5\", \"v5\",\n (code, contentType, body) -> puts(\"Async text with lambda 5 params\\n\", body));\n\n Sys.sleep(100);\n }", "public interface SinaApiService {\n\n @GET(\"cgi-bin/pitu_open_access_for_youtu.fcg\")\n Observable<MoveListBean> faceMerge(@Header(\"Authorization\") String appSign,\n @Body RequestBody body);\n}", "public interface QChatApi {\n @GET(\"users/all\")\n Observable<Users> getUsers();\n\n @GET(\"users/{user}\")\n Observable<User> getUser(@Path(\"user\") String user);\n\n @Headers(\"Content-Type: application/json\")\n @POST(\"user/new\")\n Observable<User> newUser(@Body User user);\n\n @Headers(\"Content-Type: application/json\")\n @PUT(\"user/update\")\n Observable<User> updateUser(@Body User user);\n\n @Headers(\"Content-Type: application/json\")\n @POST(\"users/{user}/message/new\")\n Observable<Message> newMessage(@Path(\"user\") String user, @Body Message message);\n\n @GET(\"users/{user}/messages/all\")\n Observable<Messages> getMessages(@Path(\"user\") int user, @Query(\"is_sent\") boolean isSent);\n\n @Headers(\"Content-Type: application/json\")\n @POST(\"users/{user}/friends/new\")\n Observable<Friend> newFriend(@Path(\"user\") String user, @Body Friend friend);\n\n @GET(\"users/{user}/friends/all\")\n Observable<Friend> getFriends(@Path(\"user\") String user);\n}", "private void httpHeader(String method) throws Exception {\n if(outputStream==null){\n throw new Exception(\"socket未打开\");\n }\n //直接遍历Request的头就行\n HashMap<String, String> headers = request.getHeaders();\n \n //httpHeader用来发送的http头部。\n StringBuilder httpHeader = new StringBuilder();\n \n \n //GET /PCcontrolServer/ImageGet?pwd=5678 HTTP/1.1\n //首先是对方法的判断,先只支持get和post方法\n URL url = connection.getUrl();\n if(request.getMethod().equals(\"get\")\n \t\t||request.getMethod().equals(\"GET\")){\n \t\n \tif(url.getQuery()!=null){\n \t\thttpHeader.append(\"GET \" + url.getPath()+\"?\"\n \t\t\t+url.getQuery() + \" HTTP/1.1\\r\\n\");\n \t}else{\n \t\thttpHeader.append(\"GET \" + url.getPath()+\" HTTP/1.1\\r\\n\");\n \t}\n\n }else if(request.getMethod().equals(\"POST\")||\n \t\trequest.getMethod().equals(\"post\")){\n \thttpHeader.append(\"POST \" + url.getPath() + \" HTTP/1.1\\r\\n\");\n \n \tcontentLength = CalcDataLength();\n \t\n \t//如果是post则默认使用这个content-Type发送\n \thttpHeader.append(\"Content-Type: multipart/form-data; boundary=\"\n \t\t\t+boundary+\"\\r\\n\");\n \t\n \thttpHeader.append(\"Content-Length: \" + contentLength + \"\\r\\n\");\n \n }\n \n //其次对其他header头参数进行拼接。其中contentlength这个只有post方法才支持。要独立判断\n Iterator<Entry<String, String>> iterator = headers.entrySet().iterator();\n \n //Cache-Control: max-age=0\n while(iterator.hasNext()){\n \tEntry<String, String> current = iterator.next();\n \thttpHeader.append(current.getKey()+\n \t\t\t\": \" + current.getValue() + \"\\r\\n\");\n }\n \n //Log.E(httpHeader.toString());\n //这个/r/n表示消息头结束,否则服务器会一直阻塞在那里不会将结果返回。\n httpHeader.append(\"\\r\\n\");\n //将Http头写入socket,发起http请求\n outputStream.write(httpHeader.toString().getBytes());\n \n\n// URL url = connection.getUrl();\n// //决定是get还是post方法,如果是get方法的话,\n// //则非常简单直接。\n// String requestMethod = \"\";\n// if(method.equals(\"get\")){\n// requestMethod = \"GET \"+ url.getPath() +\"?\"+ url.getQuery()+\" HTTP/1.1\\r\\n\";\n// }else{\n// requestMethod = \"POST \" + url.getPath() +\" HTTP/1.1\\r\\n\";\n// }\n//\n// outputStream.write(requestMethod.getBytes());\n// String language = \"Accept-Language: zh-CN\\r\\n\";\n\n\n }", "@Override\n public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {\n }", "@Override\n\tpublic void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {\n\t\tctx.write(msg);\n\t}", "public interface IHttpInterface {\n\n\n // 轮播图(焦点图)\n @GET(\"feng/imglst\")\n Observable<BannerResult> getBannerView();\n\n @GET(\"feng/huoyuanlst\")\n Observable<GoodsBean> getListView(@Query(\"num\") String num, @Query(\"page\") String page);\n\n //发布货源\n @GET(\"feng/huoyuanadd\")\n Call<String> getGoodsInfo(@QueryMap Map<String, String> paramsMap);\n\n //上拉加载\n @GET(\"feng/huoyuanlst/\")\n Observable<GoodsBean> getMoreView(@Query(\"num\") String num, @Query(\"page\") String page);\n // @GET(\"rank\")\n // Call<RankBean> getRank2(@QueryMap Map<String,String> params);\n\n // @GET(\"/banner\")\n // Observable<BannerResult> getBannerView();\n}", "@Override\n public void channelRead(final ChannelHandlerContext ctx, final Object msg) {\n try {\n if (msg instanceof FullHttpResponse) {\n try {\n currentRequest.context().dispatchLatency(System.nanoTime() - dispatchTimingStart);\n if (currentDispatchSpan != null) {\n currentDispatchSpan.end();\n }\n FullHttpResponse httpResponse = (FullHttpResponse) msg;\n ResponseStatus responseStatus = HttpProtocol.decodeStatus(httpResponse.status());\n if (!currentRequest.completed()) {\n if (responseStatus == ResponseStatus.SUCCESS) {\n Response response = currentRequest.decode(httpResponse, channelContext);\n currentRequest.succeed(response);\n } else {\n String body = httpResponse.content().toString(StandardCharsets.UTF_8);\n Exception error = currentRequest.bypassExceptionTranslation()\n ? failRequestWithHttpStatusCodeException(httpResponse.status(), body, currentRequest)\n : failRequestWith(httpResponse.status(), body, currentRequest);\n currentRequest.fail(error);\n }\n } else {\n ioContext.environment().orphanReporter().report(currentRequest);\n }\n } catch (Throwable ex) {\n currentRequest.fail(ex);\n } finally {\n currentRequest = null;\n currentDispatchSpan = null;\n endpoint.markRequestCompletion();\n }\n } else {\n ioContext.environment().eventBus().publish(\n new UnsupportedResponseTypeReceivedEvent(ioContext, msg)\n );\n closeChannelWithReason(ioContext, ctx, ChannelClosedProactivelyEvent.Reason.INVALID_RESPONSE_FORMAT_DETECTED);\n }\n } finally {\n ReferenceCountUtil.release(msg);\n }\n }", "public interface ApiServer {\n//\n @GET(\"umIPmfS6c83237d9c70c7c9510c9b0f97171a308d13b611?uri=homepage\")\n Observable<HomeBean> getHome();\n @POST\n Observable<Login> getDengLu(@Url String name, @QueryMap Map<String, String> paw);\n @GET(\"product/getCatagory\")\n Observable<Sort_lift> lift();\n @GET\n Observable<Sort_right> right(@Url String s);\n @GET\n Observable<Commodity_pagingBean> xia(@Url String s);\n @GET\n Observable<detailsBean> spxq(@Url String ss);\n @GET\n Observable<AddcartBean> add(@Url String s);\n @GET\n Observable<QurryBean> qurry(@Url String s);\n @GET\n Observable<AddcartBean> delete(@Url String s);\n @GET\n Observable<AddcartBean> addDd(@Url String s);\n @GET\n Observable<OrderBean> Ddlb(@Url String s);\n\n\n\n\n\n\n}", "Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next);", "@Override\n public void channelRead(final ChannelHandlerContext ctx, final Object msg) throws Exception {\n\n ByteBuf nettyBuffer = ((ByteBuf) msg);\n if (SYSTEM_OUT_DEBUG) {\n debugInput(nettyBuffer);\n }\n readFrame(nettyBuffer);\n\n if (SYSTEM_OUT_DEBUG) {\n System.out.println(\"performative:\" + currentPerformative);\n }\n\n switch (currentPerformative.getPerformativeType()) {\n case OPEN:\n handleOpen((Open) currentPerformative);\n break;\n case CLOSE:\n handleClose((Close) currentPerformative);\n break;\n case BEGIN:\n handleBegin((Begin) currentPerformative);\n break;\n case END:\n handleEnd((End) currentPerformative);\n break;\n case ATTACH:\n handleAttach((Attach) currentPerformative);\n break;\n default:\n System.out.println(\"Normative \" + currentPerformative + \" not implemented yet\");\n ctx.channel().writeAndFlush(nettyBuffer);\n }\n\n //parser.parse(new ProtonTransportHandlerContext(\"test\", null, null), buffer);\n\n //ctx.fireChannelRead(msg);\n\n //ctx.write(nettyBuffer.readerIndex(0).retain());\n //ctx.flush();\n }", "protected abstract ClassicHttpResponse execute(ClassicHttpRequest request, HttpClientContext context) throws IOException;", "public interface RecommendedServer {\n\n @GET(\"/\")\n Observable<String> getRecommended();\n\n}", "@Override\n\t\t\t\t\t\tpublic void channelActive(ChannelHandlerContext ctx) {\n\t\t\t\t\t\t\tSystem.out.println(RestResult.success(\"channel active!\"));\n\t\t\t\t\t\t}", "public Route http() {\n return route(\n pathEndOrSingleSlash(() ->\n redirect(Uri.create(\"index.html\"), StatusCodes.PERMANENT_REDIRECT)\n ),\n pathPrefix(\"conversations\", () ->\n conversations()\n ),\n getFromResourceDirectory(\"http\")\n );\n }", "@Override\n\tpublic void read(ChannelHandlerContext ctx) throws Exception {\n\t\tLog.i(\"MySocketHandler\", \"read\");\n\t\tsuper.read(ctx);\n\t}", "public interface API {\n\n// String BASE_URL = \"https://www.apiopen.top/\";\n String BASE_URL = \"http://gc.ditu.aliyun.com/\";\n\n\n @GET\n Observable<Response<ResponseBody>> doGet(@Url String Url);\n\n @FormUrlEncoded\n @POST\n Observable<Response<ResponseBody>> doPost(@Url String Url, @FieldMap HashMap<String, String> map);\n\n @Streaming\n @GET\n Observable<Response<ResponseBody>> doDownload(@Url String Url);\n}", "@Override\n public void channelRead(ChannelHandlerContext ctx, Object msg) {\n if (ctx.channel().attr(AUTH).get() != AuthStep.STEP_AUTHED) {\n return;\n }\n\n AbstractRealmClientPacket request = (AbstractRealmClientPacket) msg;\n\n AbstractRealmServerPacket response = null;\n\n logger.info(msg.toString());\n\n switch (request.getOpcode()) {\n case CMSG_PING:\n response = new SMSG_PING(Opcodes.SMSG_PING);\n\n int ping = ((CMSG_PING) request).getPing();\n\n ((SMSG_PING) response).setPing(ping);\n\n break;\n case CMSG_CHAR_ENUM:\n response = new SMSG_CHAR_ENUM(Opcodes.SMSG_CHAR_ENUM);\n\n // Adding character list.\n ((SMSG_CHAR_ENUM) response).addCharacters(characterService.getCharactersForAccount(ctx.channel().attr(ACCOUNT).get()));\n\n break;\n case CMSG_CHAR_CREATE:\n response = new SMSG_CHAR_CREATE(Opcodes.SMSG_CHAR_CREATE);\n\n ((SMSG_CHAR_CREATE) response).setResult(\n characterService.createChar(\n ((CMSG_CHAR_CREATE) request).getName(),\n ((CMSG_CHAR_CREATE) request).getRace(),\n ((CMSG_CHAR_CREATE) request).getCharClass(),\n ((CMSG_CHAR_CREATE) request).getGender(),\n ((CMSG_CHAR_CREATE) request).getSkin(),\n ((CMSG_CHAR_CREATE) request).getFace(),\n ((CMSG_CHAR_CREATE) request).getHairStyle(),\n ((CMSG_CHAR_CREATE) request).getHairColor(),\n ((CMSG_CHAR_CREATE) request).getFacialHair(),\n ctx.pipeline().get(RealmAuthHandler.class).getAccount()\n )\n );\n\n break;\n case CMSG_CHAR_DELETE:\n response = new SMSG_CHAR_DELETE(Opcodes.SMSG_CHAR_DELETE);\n\n ((SMSG_CHAR_DELETE) response).setResult(\n characterService.deleteChar(\n ((CMSG_CHAR_DELETE) request).getId(),\n ctx.pipeline().get(RealmAuthHandler.class).getAccount(),\n false\n )\n );\n\n break;\n\n case CMSG_PLAYER_LOGIN:\n if (characterService.loginChar(((CMSG_PLAYER_LOGIN) request).getId(), \n ctx.pipeline().get(RealmAuthHandler.class).getAccount())) {\n SMSG_LOGIN_VERIFY_WORLD packet = new SMSG_LOGIN_VERIFY_WORLD();\n \n /**packet.setMap(characterService.getLoggedCharacter().getFkDbcMap());\n packet.setPosX(characterService.getLoggedCharacter().getPositionX());\n packet.setPosY(characterService.getLoggedCharacter().getPositionY());\n packet.setPosZ(characterService.getLoggedCharacter().getPositionZ());\n packet.setOrientation(characterService.getLoggedCharacter().getOrientation());*/\n \n ctx.write(packet);\n \n SMSG_ACCOUNT_DATA_TIMES data = new SMSG_ACCOUNT_DATA_TIMES();\n \n ctx.write(data);\n \n \n } else {\n // Kick unknown client. \n ctx.close();\n }\n\n break;\n\n default:\n logger.error(\"Packet received, opcode not handled: \" + request.getOpcode());\n break;\n }\n\n if(response != null){ \n ctx.writeAndFlush(response);\n } else {\n // Let pass this to other handlers.\n ctx.fireChannelRead(msg);\n }\n }", "public interface HttpRequest {\n // MIME types\n public static final String JNLP_MIME_TYPE = \"application/x-java-jnlp-file\";\n public static final String ERROR_MIME_TYPE = \"application/x-java-jnlp-error\";\n public static final String JAR_MIME_TYPE = \"application/x-java-archive\";\n public static final String JARDIFF_MIME_TYPE = \"application/x-java-archive-diff\";\n public static final String GIF_MIME_TYPE = \"image/gif\";\n public static final String JPEG_MIME_TYPE = \"image/jpeg\";\n \n // Low-level interface\n HttpResponse doHeadRequest(URL url) throws IOException;\n HttpResponse doGetRequest (URL url) throws IOException;\n \n HttpResponse doHeadRequest(URL url, String[] headerKeys, String[] headerValues) throws IOException;\n HttpResponse doGetRequest (URL url, String[] headerKeys, String[] headerValues) throws IOException;\n}", "void onSomething(org.jboss.netty.buffer.ChannelBuffer buffer);", "public interface HTTPFilter {\n\n\t/**\n\t * Checks the validity of the http event given\n\t */\n\tpublic boolean isValid(HTTPProxyEvent event);\n\n\t/**\n\t * @param event\n\t * Event to get response from\n\t * @return A response with the valid status code of accoding to the request\n\t */\n\tpublic ByteBuffer getErrorResponse(HTTPProxyEvent event);\n}", "@Override\n public Flux<Response> statefulChannel(Publisher<Request> messages, ByteBuf metadata) {\n Flux.from(messages).limitRate(8).subscribe(processor::onNext);\n return responseFlux;\n }", "public interface HttpConnectionCovid {\n\n /**\n * Gets all statistics from the api.\n *\n * @return the all statistics\n * @throws UnirestException the unirest exception\n */\n public JSONObject getAllStatistics() throws UnirestException;\n\n /**\n * Gets statistics of country by its name from the api .\n *\n * @param country the country\n * @return the statistics of country\n * @throws UnirestException the unirest exception\n */\n public JSONObject getStatisticsOfCountry(String country) throws UnirestException;\n\n /**\n * Gets cords of any country.\n *\n * @param Country the country\n * @return the cords of the country\n * @throws UnirestException the unirest exception\n */\n public JSONArray getCordsOfCountry(String Country) throws UnirestException;\n\n}", "IHttpService getHttpService();" ]
[ "0.6302797", "0.59385985", "0.5936328", "0.5862313", "0.58127177", "0.5807018", "0.5786179", "0.5783403", "0.57593536", "0.57327217", "0.5702142", "0.5689352", "0.5688714", "0.56544137", "0.5640786", "0.56118727", "0.5599013", "0.55797684", "0.5571807", "0.5570954", "0.5568754", "0.5557837", "0.5535939", "0.55126655", "0.5500946", "0.54897785", "0.54438347", "0.5422182", "0.54010814", "0.5400997", "0.5397906", "0.53960073", "0.538301", "0.53821385", "0.53716946", "0.53708506", "0.5353574", "0.5352073", "0.53438437", "0.53409976", "0.53364396", "0.5334275", "0.5330983", "0.53226876", "0.5322117", "0.5320741", "0.53118193", "0.5304527", "0.53034145", "0.5301773", "0.5296491", "0.52951175", "0.52769077", "0.5269356", "0.52682424", "0.5266887", "0.52640504", "0.5259093", "0.52514106", "0.52403915", "0.5234429", "0.52062595", "0.5193709", "0.5190052", "0.51855236", "0.5177824", "0.51750135", "0.51727676", "0.51701677", "0.51662254", "0.5163596", "0.5152455", "0.51519257", "0.51503897", "0.514613", "0.51415473", "0.5140378", "0.51370555", "0.513508", "0.5130192", "0.51202524", "0.5113029", "0.51052195", "0.50887525", "0.5087165", "0.50844216", "0.5081899", "0.5081364", "0.5074314", "0.5072691", "0.50593925", "0.5057039", "0.5049545", "0.5049333", "0.50451356", "0.5042579", "0.50425684", "0.5020268", "0.50175196", "0.5017025" ]
0.7608607
0
add the passed cookie
HttpChannel addResponseCookie(Cookie cookie);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addCookie(Cookie cookie) {\n\t\t\n\t}", "@Override\n\t\tpublic void addCookie(Cookie cookie) {\n\t\t\t\n\t\t}", "@Override\n\tpublic void addCookie(Cookie cookie) {\n\t}", "@Override\n public void addCookie(Cookie arg0) {\n\n }", "void addCookie(HttpServletResponse response, Cookie cookie);", "HttpClientRequest addCookie(Cookie cookie);", "private int addCookie(String cookie) {\n\t\tif (cookies.contains(cookie)) return 0; //we have this exact cookie\n\n\t\tString newCookieName = cookie.split(\"=\")[0];\n\t\tif (cookies.contains(newCookieName)) replaceCookies(newCookieName); //we have a cookie with the same name as the new cookie, swap them\n\n\t\tprocessor.printSys(\"New Cookie: \" + cookie);\n\t\tcookies += (cookie + \"; \"); //add the new cookie followed by a semicolon\n\n\t\treturn 1;\n\t}", "public HttpsConnection addCookie(final String cookie) {\n return setHeader(\"Cookie\", this.mHeaders.get(\"Cookie\") + \"; \");\n }", "@Override\n public void addCookie(Cookie cookie) {\n this._getHttpServletResponse().addCookie(cookie);\n }", "public void addRCCookie(RCCookie cookie) {\r\n\t\toutputCookies.add(cookie);\r\n\t}", "public void createCookie(final String cookie);", "public void addCookie(final Cookie cookie)\n\t{\n\t\tif (httpServletResponse != null)\n\t\t{\n\t\t\thttpServletResponse.addCookie(cookie);\n\t\t}\n\t}", "public JsonResponse<?> addCookie(String name, String value) {\n return addCookie(new NewCookie(name, value));\n }", "public void createCookie(final String cookie, final String options);", "protected void addSaveCookie() {\n if (getLookup().lookup(SaveCookie.class) == null) {\n getCookieSet().add(this.saveCookie);\n }\n }", "Builder withCookie(long cookie);", "public JsonResponse<T> addCookie(NewCookie newCookie) {\n if (cookies == null) {\n cookies = new ArrayList<>();\n }\n cookies.add(newCookie);\n\n return this;\n }", "protected void addFlashCookie(SlingHttpServletResponse response, Form form) {\n final String name = this.getGetLookupKey(form.getName());\n final String value = getQueryParameterValue(form);\n final Cookie cookie = new Cookie(name, value);\n cookie.setMaxAge(COOKIE_MAX_AGE);\n CookieUtil.addCookie(cookie, response);\n }", "public static void addCookie(String name, String value, String path, String domain, String comment, int maxAge, boolean secure, boolean httpOnly) {\n HttpResponse response = ResteasyProviderFactory.getContextData(HttpResponse.class);\n StringBuffer cookieBuf = new StringBuffer();\n ServerCookie.appendCookieValue(cookieBuf, 1, name, value, path, domain, comment, maxAge, secure, httpOnly);\n String cookie = cookieBuf.toString();\n response.getOutputHeaders().add(HttpHeaders.SET_COOKIE, cookie);\n }", "public void addSetCookie(Cookie cookie, ZonedDateTime expires, Path path, \n\t\t\tboolean httpOnly, boolean secure)\n\t{\n\t\tif (cookie == null)\n\t\t\treturn;\n\t\t\n\t\tStringBuilder s = new StringBuilder(cookie.toString());\n\t\t\n\t\tif (expires != null)\n\t\t\ts.append(\"; \" + expires.format(DateTimeFormatter.RFC_1123_DATE_TIME));\n\t\tif (path != null)\n\t\t\ts.append(\"; /\" + path.toString());\n\t\tif (httpOnly)\n\t\t\ts.append(\"; HttpOnly\");\n\t\tif (secure)\n\t\t\ts.append(\"; Secure\");\n\t\t\n\t\taddHeader(SET_COOKIE, s.toString());\n\t}", "public static void addCookieWebUser (HttpServletRequest request, HttpServletResponse response, String webUser)\n\t{\n\t\tCookie cookie = new Cookie(COOKIE_NAME, webUser);\n\t\tcookie.setComment(\"Compiere Web User\");\n\t\tcookie.setPath(request.getContextPath());\n\t\tcookie.setMaxAge(2592000); // 30 days in seconds 60*60*24*30\n\t\tresponse.addCookie(cookie);\n\t}", "public static void addCookieWebUser (HttpServletRequest request, HttpServletResponse response, String webUser)\n\t{\n\t\tCookie cookie = new Cookie(COOKIE_NAME, webUser);\n\t\tcookie.setComment(\"Compiere Web User\");\n\t\tcookie.setPath(request.getContextPath());\n\t\tcookie.setMaxAge(2592000); // 30 days in seconds 60*60*24*30\n\t\tresponse.addCookie(cookie);\n\t}", "public static void addCookieWebUser (HttpServletRequest request, HttpServletResponse response, String webUser)\n\t{\n\t\tCookie cookie = new Cookie(COOKIE_NAME, webUser);\n\t\tcookie.setComment(\"Compiere Web User\");\n\t\tcookie.setPath(request.getContextPath());\n\t\tcookie.setMaxAge(2592000); // 30 days in seconds 60*60*24*30\n\t\tresponse.addCookie(cookie);\n\t}", "public static void addCookieWebUser (HttpServletRequest request, HttpServletResponse response, String webUser)\n\t{\n\t\tCookie cookie = new Cookie(COOKIE_NAME, webUser);\n\t\tcookie.setComment(\"Compiere Web User\");\n\t\tcookie.setPath(request.getContextPath());\n\t\tcookie.setMaxAge(2592000); // 30 days in seconds 60*60*24*30\n\t\tresponse.addCookie(cookie);\n\t}", "@RunPrivileged\n\tprivate void addRoutedokterCookie() {\n\n\t\tStringBuilder value = new StringBuilder();\n\t\tvalue.append(\"email:\" + object.getEmail());\n\n\t\t// Lege waardes hoeven niet te worden opgeslagen in cookie\n\t\tif (StringUtils.isNotEmpty(object.getVoornaam())) {\n\t\t\tvalue.append(COOKIE_VALUE_SEPERATOR + \"voornaam:\"\n\t\t\t\t\t+ object.getVoornaam());\n\t\t}\n\n\t\tif (StringUtils.isNotEmpty(object.getNaam())) {\n\t\t\tvalue.append(COOKIE_VALUE_SEPERATOR + \"naam:\" + object.getNaam());\n\t\t}\n\n\t\tif (StringUtils.isNotEmpty(object.getTelefoon())) {\n\t\t\tvalue.append(COOKIE_VALUE_SEPERATOR + \"tel:\" + object.getTelefoon());\n\t\t}\n\n\t\tMap<String, Object> properties = new HashMap<String, Object>();\n\t\tproperties.put(\"maxAge\", MAX_COOKIE_AGE);\n\t\tproperties.put(\"domain\", FacesContext.getCurrentInstance()\n\t\t\t\t.getExternalContext().getRequestServerName());\n\t\tproperties.put(\"path\", FacesContext.getCurrentInstance()\n\t\t\t\t.getExternalContext().getRequestContextPath());\n\n\t\tFacesContext.getCurrentInstance().getExternalContext()\n\t\t\t\t.addResponseCookie(COOKIE_NAME, value.toString(), properties);\n\t}", "public void part2(){\n Cookie c1 = new Cookie(\"uid\", \"2018\", 1800,false);\n Cookie c2 = new Cookie(\"PICK_KEY\", \"ahmd13ldsws8cw\",10800,true);\n Cookie c3 = new Cookie(\"REMEMBER_ME\",\"true\",10800,true);\n }", "public void eatCookie(){\n}", "public final void addSessionCookie(Map<String, String> headers) {\n\t\tString[] projection = { CookieTable.COLUMN_ID,\n\t\t\t\tCookieTable.COLUMN_MOBILE, CookieTable.COLUMN_P };\n\t\tCursor cursor = getApplicationContext().getContentResolver().query(GeneralContentProvider.COOKIE_CONTENT_URI, projection, null,\n\t\t\t\tnull, null);\n\t\tif (cursor != null && cursor.moveToFirst()) {\n\t\t\tif (cursor.getCount() > 0) {\n\t\t\t\tcursor.moveToFirst();\n\t\t\t\tLong uid = (long) cursor.getInt(cursor.getColumnIndexOrThrow(CookieTable.COLUMN_ID));\n\t\t\t\tString mobile = cursor.getString(cursor.getColumnIndexOrThrow(CookieTable.COLUMN_MOBILE));\n\t\t\t\tString p = cursor.getString(cursor.getColumnIndexOrThrow(CookieTable.COLUMN_P));\n\t\t\t\tStringBuilder builder = new StringBuilder();\n\t\t\t\tbuilder.append(\"uid=\");\n\t\t\t\tbuilder.append(uid);\n\t\t\t\tbuilder.append(\"\\n\");\n\t\t\t\tbuilder.append(\"p=\");\n\t\t\t\tbuilder.append(p);\n\t\t\t\tbuilder.append(\"\\n\");\n\t\t\t\tif (mCookie_T != null) {\n\t\t\t\t\tbuilder.append(\"t=\");\n\t\t\t\t\tbuilder.append(mCookie_T);\n\t\t\t\t\tbuilder.append(\"\\n\");\n\t\t\t\t}\n\t\t\t\tbuilder.append(\"mobile=\");\n\t\t\t\tbuilder.append(mobile);\n\n\t\t\t\theaders.put(GlobalConstants.COOKIE_KEY, builder.toString());\n\t\t\t\tLogcat.d(TAG, headers.toString());\n\t\t\t} else {\n\t\t\t\tLogcat.d(TAG, \" < 000000000000000000\");\n\t\t\t}\n\t\t\t// always close the cursor\n\t\t\tcursor.close();\n\t\t}\n\t\t\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tCookie[] cookies = req.getCookies();\n\t\tif (cookies != null) {\n\t\t\tfor (Cookie cookie : cookies) {\n\t\t\t\tif (cookie.getName().equals(\"hello-cookie\")) {\n\t\t\t\t\t// cookie has already been created\n\t\t\t\t\tSystem.out.println(\"Replacing old cookie value: \" + cookie.getValue());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Cookie cookie = req.getCookie(\"hello-cookie\"); // Java EE 7\n\n\t\t// creating cookies\n\t\tCookie cook = new Cookie(\"hello-cookie\", req.getParameter(\"cookie\"));\n\t\tcook.setMaxAge(2_000_000_000); // expiry\n\t\tresp.addCookie(cook);\n\n\t}", "@Override\r\n public void getCookie(String name)\r\n {\n\r\n }", "public void buildCookie(Map<String,String> map){\n map.put(\"PHPSESSID\", cookie);\n }", "@Override\r\n\tpublic void setCookie(Date expirationDate, String nameAndValue, String path, String domain, boolean isSecure) {\n\t}", "private void createLoginCookie(HttpServletResponse response, String userName, String password) {\n Cookie appCookie = new Cookie(\"costsManager\", userName + \"_\" + password);\n appCookie.setMaxAge(99999);\n response.addCookie(appCookie);\n }", "public BladeController setCookie(Cookie cookie) {\n\t\tresponse.addCookie(cookie);\n\t\treturn this;\n\t}", "public void setCookie(String name, String value) throws IOException {\r\n cookies.put(name, value);\r\n }", "public void doCookieStuff(Users user)\n {\n HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();\n if (userSession.isRemember())\n {\n String uuid = UUID.randomUUID().toString();\n rememberDAOImpl.saveLogin(uuid, user);\n addCookie(response, \"remember\", uuid, 2592000); //thats 30 days in seconds\n } else {\n rememberDAOImpl.removeLogin(user);\n removeCookie(response, \"remember\");\n }\n }", "protected void setHasCookie (boolean aHasCookie)\n\t{\n\t\thasCookie = aHasCookie;\n\t}", "@GetMapping(\"/createcookie\")\n\tpublic String createCookie(HttpServletResponse response) {\n\t\tCookie cookie = new Cookie(\"name\", \"Akshay\");\n\t\tresponse.addCookie(cookie);\n\t\treturn \"createcookie\";\n\t}", "protected static void addCookies(HttpURLConnection urlConnection) {\n for (String cookie : cookies) {\n urlConnection.addRequestProperty(\"Cookie\", cookie.split(\";\", 2)[0]);\n }\n }", "protected void doPost(HttpServletRequest r, HttpServletResponse s) throws ServletException, IOException {\n Cookie ck=new Cookie(\"auth\",\"\"); \n ck.setMaxAge(0);\n s.addCookie(ck); \n RequestDispatcher rd = r.getRequestDispatcher(\"index.jsp\");\n rd.forward(r, s);\n \n }", "public static boolean setCookie(HttpSession session, Cookie cookie) {\n boolean status = false;\n\n // Make sure the list of sent cookies is created if necessary\n Vector cookiesPending = (Vector) getObject(session, COOKIES_PENDING);\n if (cookiesPending == null) {\n cookiesPending = new Vector();\n cookiesPending.add(cookie);\n\n // Make sure the sent vector exists in the session\n setObject(session, COOKIES_PENDING, cookiesPending);\n return true;\n } else {\n // If the cookie is already pending, replace it\n for (int idx = 0; idx < cookiesPending.size(); idx++) {\n Cookie current = (Cookie) cookiesPending.get(idx);\n // Cookies flagged for deletion should remain deleted\n if ((current.getMaxAge() != 0) && (current.getName().equals(cookie.getName()))) {\n cookiesPending.set(idx, cookie);\n return true;\n }\n }\n\n // Else cookies does not exist and should be added\n cookiesPending.add(cookie);\n return true;\n }\n\n }", "private static void cookieMonster (HTTPRequest request)\n\t{\n\t /*if (!request.isCookiesParsed ())\n\t {\n\t \t retVal = request.cookieMonster ();\n\t }*/\n\t \n\t}", "CookieValue(Cookie cookie)\n {\n valuesAsString = cookie.getValue();\n /* XXX Not sure if this works */\n if (DBG.isDebugEnabled()) DBG.debug(\"Cookie values: \" +\n valuesAsString);\n if (valuesAsString.indexOf('=') != -1) \n {\n Map hashValues = ParseQueryString.parse(valuesAsString);\n /* Lowercase the value keys */\n for (Iterator i = hashValues.keySet().iterator(); i.hasNext();)\n {\n String key = (String)i.next();\n String value[] = (String[])hashValues.get(key);\n if (DBG.isDebugEnabled()) {\n DBG.debug(\"Key: \" + key);\n DBG.debug(\"Value: \" + value[0]);\n }\n cookieValues.put(new IdentNode(key), value[0]);\n }\n }\n }", "public void saveLocalCookie(HttpServletResponse response,\r\n\t\tString ckName, String ckValue) {\r\n\t\tCookie ck = new Cookie(ckName, ckValue);\r\n\t\tck.setDomain(\".bccard.com\");\r\n\t\tck.setPath(\"/\");\r\n\t\tck.setMaxAge(60*60*24*365*10);\r\n\t\tresponse.addCookie(ck);\r\n\t}", "private int storeCookies(URLConnection con) {\n\t\tString headerName = null;\n\n\t\tint totalNewCookies = 0;\n\n\t\tfor (int i = 1; (headerName = con.getHeaderFieldKey(i)) != null; i++) if (headerName.equals(\"Set-Cookie\")) totalNewCookies += addCookie(con.getHeaderField(i)); //add to the total the number of new cookies found by add cookie for each cookie\n\n\t\treturn totalNewCookies;\n\t}", "private void setCookies(HttpServletRequest request, HttpServletResponse response, int currentPage, int recordsOnPage) {\n CookieManager cookieManager = new CookieManager(request);\n String currentPageString = Integer.toString(currentPage);\n response.addCookie(cookieManager.makeCookie(CookieName.USERS_CURRENT_PAGE, currentPageString));\n\n String recordsOnPageString = Integer.toString(recordsOnPage);\n response.addCookie(cookieManager.makeCookie(CookieName.RECORDS_ON_USERS_PAGE, recordsOnPageString));\n }", "public void setCookies(Series<Cookie> cookies) {\n this.cookies = cookies;\n }", "public void setSessionId(String cookie) {\n\t\t\r\n\t}", "public void setCookies(Map<String, String> cookies) throws IOException {\r\n if (cookies == null)\r\n return;\r\n this.cookies.putAll(cookies);\r\n }", "GroupKey appCookie();", "public void setSeCookie(String seCookie) {\n this.seCookie = seCookie;\n }", "@SuppressWarnings(\"deprecation\")\n @Override\n public native void set(String key, String value) /*-{\n $doc.cookie = @org.jboss.pressgang.belay.oauth2.gwt.client.OAuthCookieStoreImpl::COOKIE_PREFIX +\n encodeURIComponent(key) + '=' + encodeURIComponent(value);\n }-*/;", "public Builder cookie(final String name, final String value) {\n cookies.put(name, value);\n return this;\n }", "public void setCookies(String[] cookies) throws IOException {\r\n if (cookies == null)\r\n return;\r\n for (int i = 0; i < cookies.length - 1; i += 2) {\r\n setCookie(cookies[i], cookies[i + 1]);\r\n }\r\n }", "@Override\r\n public void getAllCookies()\r\n {\n\r\n }", "@RequestMapping(\"/\")\n public String home(HttpServletResponse response){\n CookieGenerator cookieGenerator = new CookieGenerator();\n cookieGenerator.setCookieName(\"myTestCookie\");\n cookieGenerator.addCookie(response, \"myValue\");\n\n return \"cookie\";\n }", "public static void appendCookieValue(StringBuffer buf,\n int version,\n String name,\n String value,\n String path,\n String domain,\n String comment,\n int maxAge,\n boolean isSecure,\n boolean encode) {\n if (encode) {\n try {\n buf.append(URLEncoder.encode(name, \"UTF-8\"));\n buf.append(\"=\");\n /* PWC 6392327\n maybeQuote(version, buf, URLEncoder.encode(value, \"UTF-8\"));\n */\n // START PWC 6392327\n if (value != null) {\n maybeQuote(version, buf,\n URLEncoder.encode(value, \"UTF-8\"));\n } else {\n maybeQuote(version, buf,\n URLEncoder.encode(ServerCookie.NULL_VALUE,\n \"UTF-8\"));\n }\n // END PWC 6392327\n } catch (UnsupportedEncodingException e) {\n buf.append(URLEncoder.encode(name));\n buf.append(\"=\");\n /* PWC 6392327\n maybeQuote(version, buf, URLEncoder.encode(value));\n */\n // START PWC 6392327\n if (value != null) {\n maybeQuote(version, buf,\n URLEncoder.encode(value));\n } else {\n maybeQuote(version, buf,\n URLEncoder.encode(ServerCookie.NULL_VALUE));\n }\n // END PWC 6392327\n }\n } else {\n buf.append( name );\n buf.append(\"=\");\n /* PWC 6392327\n maybeQuote(version, buf, value);\n */\n // START PWC 6392327\n if (value != null) {\n maybeQuote(version, buf, value);\n } else {\n maybeQuote(version, buf, ServerCookie.NULL_VALUE);\n }\n // END PWC 6392327\n }\n\n\t// XXX Netscape cookie: \"; \"\n \t// add version 1 specific information\n\tif (version == 1) {\n\t // Version=1 ... required\n\t buf.append (\"; Version=1\");\n\n\t // Comment=comment\n\t if (comment!=null) {\n buf.append (\"; Comment=\");\n if (encode) {\n try {\n maybeQuote(version, buf,\n URLEncoder.encode(comment, \"UTF-8\"));\n } catch(UnsupportedEncodingException e) {\n maybeQuote(version, buf,\n URLEncoder.encode(comment));\n }\n\t } else {\n maybeQuote (version, buf, comment);\n }\n }\n }\n\t\n\t// add domain information, if present\n\n\tif (domain!=null) {\n\t buf.append(\"; Domain=\");\n\t maybeQuote (version, buf, domain);\n\t}\n\n\t// Max-Age=secs/Discard ... or use old \"Expires\" format\n\tif (maxAge >= 0) {\n\t if (version == 0) {\n\t\t// XXX XXX XXX We need to send both, for\n\t\t// interoperatibility (long word )\n\t\tbuf.append (\"; Expires=\");\n\t\t// Wdy, DD-Mon-YY HH:MM:SS GMT ( Expires netscape format )\n\t\t// To expire we need to set the time back in future\n\t\t// ( [email protected] )\n if (maxAge == 0)\n\t\t buf.append( ANCIENT_DATE );\n\t\telse\n DateTool.formatOldCookie\n (new Date( System.currentTimeMillis() +\n maxAge *1000L), buf,\n new FieldPosition(0));\n\n\t } else {\n\t\tbuf.append (\"; Max-Age=\");\n\t\tbuf.append (maxAge);\n\t }\n\t}\n\n\t// Path=path\n\tif (path!=null) {\n\t buf.append (\"; Path=\");\n\t maybeQuote (version, buf, path);\n\t}\n\n\t// Secure\n\tif (isSecure) {\n\t buf.append (\"; Secure\");\n\t}\n\t\n\t\n }", "private void setCookies(URLConnection conn) {\n\t\tif (cookies.isEmpty()) {conn.setRequestProperty(\"Cookie\", \"\"); return;}\n\n\t\tconn.setRequestProperty(\"Cookie\", cookies);\n\t\tprocessor.printSys(\"Cookies Set: \" + cookies);\n\t}", "public static void saveCookie(String cookieName,String cookieValue,HttpServletResponse response) {\r\n\t\tCookie cookie =new Cookie(cookieName, cookieValue);\r\n\t\tcookie.setDomain(COOKIE_DOMAIN);\r\n\t\tcookie.setHttpOnly(true);\r\n\t\tcookie.setPath(\"/\");//代表设置在根目录\r\n\t\t //单位是秒。\r\n //如果这个maxage不设置的话,cookie就不会写入硬盘,而是写在内存。只在当前页面有效\r\n\t\tcookie.setMaxAge(60 * 60 * 24 * 360); ////如果是-1,代表永久\r\n\t\tlog.info(\"write cookieName:{},cookieValue:{}\",cookie.getName(),cookie.getValue());\r\n\t response.addCookie(cookie);\r\n\t}", "public Builder cookies(final Map<String, String> cookies) {\n this.cookies.putAll(cookies);\n return this;\n }", "@Override\r\n public void delCookie(String name)\r\n {\n\r\n }", "@Override\n public void filter(ContainerRequestContext requestContext,\n ContainerResponseContext responseContext) throws IOException {\n HttpSession session = requestManager.getHttpSession();\n\n session.keepAlive();\n sessionManager.save(session);\n\n NewCookie sessionCookie = new NewCookie(COOKIE_NAME, session.getSessionId(),\n \"/\", null, null, -1, true, true);\n\n\n logger.trace(\"Request completed with session id {}\", sessionCookie);\n responseContext.getHeaders().add(HttpHeaders.SET_COOKIE, sessionCookie);\n }", "@Override\n public void itemClicked(long id) {\n CookieFragment frag = new CookieFragment(); // create new fragment to add/replace\n FragmentTransaction ft = getFragmentManager().beginTransaction();\n frag.setCookie(id);\n ft.replace(R.id.fragment_container, frag);\n ft.addToBackStack(null);\n ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);\n ft.commit();\n }", "public void storeCookies(URLConnection conn) throws IOException {\n\n\t\t// let's determine the domain from where these cookies are being sent\n\t\tString domain = getDomainFromHost(conn.getURL().getHost());\n\n\t\tMap<String, Map<String, String>> domainStore; // this is where we will\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// store cookies for\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// this domain\n\n\t\t// now let's check the store to see if we have an entry for this domain\n\t\tif (store.containsKey(domain)) {\n\t\t\t// we do, so lets retrieve it from the store\n\t\t\tdomainStore = store.get(domain);\n\t\t} else {\n\t\t\t// we don't, so let's create it and put it in the store\n\t\t\tdomainStore = new HashMap<String, Map<String, String>>();\n\t\t\tstore.put(domain, domainStore);\n\t\t}\n\n\t\t// OK, now we are ready to get the cookies out of the URLConnection\n\n\t\tString headerName = null;\n\t\tfor (int i = 1; (headerName = conn.getHeaderFieldKey(i)) != null; i++) {\n\t\t\tif (headerName.equalsIgnoreCase(SET_COOKIE)) {\n\t\t\t\tMap<String, String> cookie = new HashMap<String, String>();\n\t\t\t\tStringTokenizer st = new StringTokenizer(\n\t\t\t\t\t\tconn.getHeaderField(i), COOKIE_VALUE_DELIMITER);\n\n\t\t\t\t// the specification dictates that the first name/value pair\n\t\t\t\t// in the string is the cookie name and value, so let's handle\n\t\t\t\t// them as a special case:\n\n\t\t\t\tif (st.hasMoreTokens()) {\n\t\t\t\t\tString token = st.nextToken();\n\t\t\t\t\tString name = token.substring(0,\n\t\t\t\t\t\t\ttoken.indexOf(NAME_VALUE_SEPARATOR));\n\t\t\t\t\tString value = token.substring(\n\t\t\t\t\t\t\ttoken.indexOf(NAME_VALUE_SEPARATOR) + 1,\n\t\t\t\t\t\t\ttoken.length());\n\t\t\t\t\tdomainStore.put(name, cookie);\n\t\t\t\t\tcookie.put(name, value);\n\t\t\t\t}\n\n\t\t\t\twhile (st.hasMoreTokens()) {\n\t\t\t\t\tString t1 = \"\";\n\t\t\t\t\tString t2 = \"\";\n\t\t\t\t\tString token = st.nextToken();\n\t\t\t\t\tint seperatorPosition = token.indexOf(NAME_VALUE_SEPARATOR);\n\t\t\t\t\tif (seperatorPosition >= 0) {\n\t\t\t\t\t\tt1 = token.substring(0,\n\t\t\t\t\t\t\t\ttoken.indexOf(NAME_VALUE_SEPARATOR))\n\t\t\t\t\t\t\t\t.toLowerCase();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tt1 = \"\";\n\t\t\t\t\t}\n\t\t\t\t\tt2 = token.substring(\n\t\t\t\t\t\t\ttoken.indexOf(NAME_VALUE_SEPARATOR) + 1,\n\t\t\t\t\t\t\ttoken.length());\n\t\t\t\t\t/*\n\t\t\t\t\t * cookie.put(token.substring(0,\n\t\t\t\t\t * token.indexOf(NAME_VALUE_SEPARATOR)).toLowerCase(),\n\t\t\t\t\t * token.substring(token.indexOf(NAME_VALUE_SEPARATOR) + 1,\n\t\t\t\t\t * token.length()));\n\t\t\t\t\t */\n\t\t\t\t\tcookie.put(t1, t2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void checkAddAuthCookies(DnCxt cxt, DnRequestHandler handler) throws DnException {\n UserAuthHook.prepAuthCookies.callHook(cxt, this, handler);\n if (handler.setAuthCookie && handler.userAuthCookie != null) {\n var authCookie = handler.userAuthCookie;\n String cookieString = authCookie.toString();\n String cookieVal = coreNode.encryptString(cookieString);\n // Let old cookies hang out for 400 days, even if the cookie only provides a login\n // for day or so.\n Date cookieExpireDate = DnDateUtil.addDays(authCookie.modifiedDate, 400);\n handler.addResponseCookie(AUTH_COOKIE_NAME, cookieVal, cookieExpireDate);\n }\n }", "@DOMSupport(DomLevel.ONE)\r\n @Property String getCookie();", "@Override\n\tpublic void saveUserCookieWithTx(UserCookieVO userCookie,HttpServletRequest req) {\n\n\t\tCacheUser cacheUser = (CacheUser) req.getAttribute(\"ut\");\n //设置有效时间\n // 生成失效时间\n Calendar timeout = Calendar.getInstance();\n timeout.setTime(new Date());\n timeout.add(Calendar.DAY_OF_YEAR, 30);\n userCookie.setExpirationTime(timeout.getTime());\n \n UserCookieDTO userCookieDTO = userCookieFacade.getbyUserId(userCookie.getUserId());\n if(userCookieDTO == null){\n\t\t\tuserCookie.setCreateTime(new Date());\t\t\n\t\t\tString ip = CommonUtils.getUserIp(req);\n\t\t\tuserCookie.setCreateUserip(ip);\n\t\t\tuserCookie.setCreateUsermac(CommonUtils.getMACAddress(ip));\n\t\t\tuserCookie.setCreateUsername(cacheUser.getName());\n \tuserCookieFacade.saveUserCookieWithTx(UserCookieConverter.toDTO(userCookie));\n }else{\n \tuserCookie.setUpdateTime(new Date());\n \tString ip = CommonUtils.getUserIp(req);\n \tuserCookie.setUpdateUserip(ip);\n \tuserCookie.setUpdateUsermac(CommonUtils.getMACAddress(ip));\n \tuserCookie.setUpdateUsername(cacheUser.getName());\n \tuserCookieFacade.saveUserCookieWithTx(UserCookieConverter.toDTO(userCookie));\n }\n\n \n \n\t\t\n\t}", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n // if request has language parameter save cookie\n String cookieLang = req.getParameter(\"lang\");\n if (cookieLang != null) {\n // request from changing the language, save cookie\n Cookie theCookie = new Cookie(\"MyDictionaryLanguage\", cookieLang);\n theCookie.setMaxAge(9999999 * 99);\n resp.addCookie(theCookie);\n RequestDispatcher dispatcher = req.getRequestDispatcher(\"/input.jsp\");\n dispatcher.forward(req, resp);\n }\n\n }", "public static void deleteCookieWebUser (HttpServletRequest request, HttpServletResponse response)\n\t{\n\t\tCookie cookie = new Cookie(COOKIE_NAME, \" \");\n\t\tcookie.setComment(\"Compiere Web User\");\n\t\tcookie.setPath(request.getContextPath());\n\t\tcookie.setMaxAge(1); // second\n\t\tresponse.addCookie(cookie);\n\t}", "public static void deleteCookieWebUser (HttpServletRequest request, HttpServletResponse response)\n\t{\n\t\tCookie cookie = new Cookie(COOKIE_NAME, \" \");\n\t\tcookie.setComment(\"Compiere Web User\");\n\t\tcookie.setPath(request.getContextPath());\n\t\tcookie.setMaxAge(1); // second\n\t\tresponse.addCookie(cookie);\n\t}", "public static void deleteCookieWebUser (HttpServletRequest request, HttpServletResponse response)\n\t{\n\t\tCookie cookie = new Cookie(COOKIE_NAME, \" \");\n\t\tcookie.setComment(\"Compiere Web User\");\n\t\tcookie.setPath(request.getContextPath());\n\t\tcookie.setMaxAge(1); // second\n\t\tresponse.addCookie(cookie);\n\t}", "public static void deleteCookieWebUser (HttpServletRequest request, HttpServletResponse response)\n\t{\n\t\tCookie cookie = new Cookie(COOKIE_NAME, \" \");\n\t\tcookie.setComment(\"Compiere Web User\");\n\t\tcookie.setPath(request.getContextPath());\n\t\tcookie.setMaxAge(1); // second\n\t\tresponse.addCookie(cookie);\n\t}", "Cookie(){\n number = 0;\n bakeTemp = 0;\n bakeTime = 0;\n isReady = false;\n\n }", "StoreResponse add(CACHE_ELEMENT e);", "void addHeader(HttpServletResponse response, String name, String value);", "protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\n\t\t\r\n\t\t\r\n\t\tString id = \"방그리\";\r\n\t\t\r\n\t\tid = URLEncoder.encode(id, \"utf-8\");\r\n\t\t\r\n\t\tCookie cookie = new Cookie(\"loginId\", id);\r\n\t\tcookie.setMaxAge(60*60*24*30); // 단위는 초단위 \r\n\t\t//cookie.setDomain(\"http://www.naver.com\");\r\n//\t\tcookie.setPath(\"/\");\r\n\t\t\r\n\t\t//쿠키를 헤더에 밀어넣는 작업\r\n//\t\tresponse.setHeader(\"Set-Cookie\",\".......\");\r\n\t\t//밀어넣고~\r\n\t\tresponse.addCookie(cookie);\r\n\t\t// 보내주고~\r\n\t\tresponse.sendRedirect(\"hello2\");\r\n\t\t\r\n\t}", "private static Cookie getCookie() {\n if (cookie == null) {\n synchronized (DefaultEntityManagerImpl.class) {\n if (cookie == null) {\n cookie = new Cookie(cookieName, getAppTokenId());\n }\n }\n }\n return cookie;\n }", "public void inject(@NotNull ApiRequestMessage message) {\n String key = getHashKey(message);\n Map<String, String> cookies = redisTemplate.<String, String>opsForHash().entries(key);\n StringBuilder sb = new StringBuilder();\n for (Map.Entry<String, String> cookie : cookies.entrySet()) {\n sb.append(cookie.getKey()).append(\"=\\\"\").append(cookie.getValue()).append(\"\\\";\");\n }\n // delete last <code>;</code>\n sb.deleteCharAt(sb.length() - 1);\n ApiRequestMessageHelper.addCookies(message, sb.toString());\n }", "void add(RiceCooker riceCooker);", "public static synchronized void setCookieInfo(URL u, String value)\n {\n\tinitialize();\t\n\n\tTrace.msgNetPrintln(\"cookiehandler.server\", new Object[] {u, value});\n\n\ttry\n\t{\n\t cookieHandler.setCookieInfo(u.toString(), value);\n\t}\n\tcatch (ServiceUnavailableException e)\n\t{\n\t System.out.println(ResourceHandler.getMessage(\"cookiehandler.ignore.setcookie\"));\n\t}\n }", "public static String generateHeader(Cookie cookie) {\r\n int version = cookie.getVersion();\r\n String value = cookie.getValue();\r\n String path = cookie.getPath();\r\n String domain = cookie.getDomain();\r\n String comment = cookie.getComment();\r\n\r\n if (version == 0) {\r\n // Check for the things that require a v1 cookie\r\n if (needsQuotes(value) || comment != null || needsQuotes(path) || needsQuotes(domain)) {\r\n version = 1;\r\n }\r\n }\r\n\r\n // Now build the cookie header\r\n StringBuffer buf = new StringBuffer(); // can't use StringBuilder due to DateFormat\r\n\r\n // Just use the name supplied in the Cookie\r\n buf.append(cookie.getName());\r\n buf.append(\"=\");\r\n\r\n // Value\r\n maybeQuote(buf, value);\r\n\r\n // Add version 1 specific information\r\n if (version == 1) {\r\n // Version=1 ... required\r\n buf.append (\"; Version=1\");\r\n\r\n // Comment=comment\r\n if (comment != null) {\r\n buf.append (\"; Comment=\");\r\n maybeQuote(buf, comment);\r\n }\r\n }\r\n\r\n // Add domain information, if present\r\n if (domain != null) {\r\n buf.append(\"; Domain=\");\r\n maybeQuote(buf, domain);\r\n }\r\n\r\n // Max-Age=secs ... or use old \"Expires\" format\r\n int maxAge = cookie.getMaxAge();\r\n if (maxAge >= 0) {\r\n if (version > 0) {\r\n buf.append (\"; Max-Age=\");\r\n buf.append (maxAge);\r\n }\r\n // IE6, IE7 and possibly other browsers don't understand Max-Age.\r\n // They do understand Expires, even with V1 cookies!\r\n if (version == 0 || ALWAYS_ADD_EXPIRES) {\r\n // Wdy, DD-Mon-YY HH:MM:SS GMT ( Expires Netscape format )\r\n buf.append (\"; Expires=\");\r\n // To expire immediately we need to set the time in past\r\n if (maxAge == 0) {\r\n buf.append( ancientDate );\r\n } else {\r\n OLD_COOKIE_FORMAT.get().format(\r\n new Date(System.currentTimeMillis() + maxAge * 1000L),\r\n buf,\r\n new FieldPosition(0));\r\n }\r\n }\r\n }\r\n\r\n // Path=path\r\n if (path!=null) {\r\n buf.append (\"; Path=\");\r\n maybeQuote(buf, path);\r\n }\r\n\r\n // Secure\r\n if (cookie.getSecure()) {\r\n buf.append (\"; Secure\");\r\n }\r\n\r\n // HttpOnly\r\n if (cookie.isHttpOnly()) {\r\n buf.append(\"; HttpOnly\");\r\n }\r\n return buf.toString();\r\n }", "protected final void addCache(Cache cache)\r\n/* 33: */ {\r\n/* 34:59 */ this.cacheMap.put(cache.getName(), cache);\r\n/* 35:60 */ this.cacheNames.add(cache.getName());\r\n/* 36: */ }", "public Result withCookies(Cookie... newCookies) {\n List<Cookie> finalCookies =\n Stream.concat(\n cookies.stream()\n .filter(\n cookie -> {\n for (Cookie newCookie : newCookies) {\n if (cookie.name().equals(newCookie.name())) return false;\n }\n return true;\n }),\n Stream.of(newCookies))\n .collect(Collectors.toList());\n return new Result(header, body, session, flash, finalCookies);\n }", "public void setCookies(URLConnection conn) throws IOException {\n\n\t\t// let's determine the domain and path to retrieve the appropriate\n\t\t// cookies\n\t\tURL url = conn.getURL();\n\t\tString domain = getDomainFromHost(url.getHost());\n\t\tString path = url.getPath();\n\n\t\tMap<String, Map<String, String>> domainStore = store.get(domain);\n\t\tif (domainStore == null)\n\t\t\treturn;\n\t\tStringBuffer cookieStringBuffer = new StringBuffer();\n\n\t\tIterator<String> cookieNames = domainStore.keySet().iterator();\n\t\twhile (cookieNames.hasNext()) {\n\t\t\tString cookieName = cookieNames.next();\n\t\t\tMap<String, String> cookie = (Map<String, String>) domainStore\n\t\t\t\t\t.get(cookieName);\n\t\t\t// check cookie to ensure path matches and cookie is not expired\n\t\t\t// if all is cool, add cookie to header string\n\t\t\tif (comparePaths((String) cookie.get(PATH), path)\n\t\t\t\t\t&& isNotExpired((String) cookie.get(EXPIRES))) {\n\t\t\t\tcookieStringBuffer.append(cookieName);\n\t\t\t\tcookieStringBuffer.append(\"=\");\n\t\t\t\tcookieStringBuffer.append((String) cookie.get(cookieName));\n\t\t\t\tif (cookieNames.hasNext())\n\t\t\t\t\tcookieStringBuffer.append(SET_COOKIE_SEPARATOR);\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tconn.setRequestProperty(COOKIE, cookieStringBuffer.toString());\n\t\t} catch (java.lang.IllegalStateException ise) {\n\t\t\tIOException ioe = new IOException(\n\t\t\t\t\t\"Illegal State! Cookies cannot be set on a URLConnection that is already connected. \"\n\t\t\t\t\t\t\t+ \"Only call setCookies(java.net.URLConnection) AFTER calling java.net.URLConnection.connect().\");\n\t\t\tthrow ioe;\n\t\t}\n\t}", "public void put(Object key, Object value) throws AspException\n {\n throw new AspReadOnlyException(\"Request.Cookies\");\n }", "public Cookie() {\n }", "public static void acceptCookies() {\n WebElement acceptButton = Browser.driver.findElement(ACCEPT_COOKIES_BUTTON);\n if(acceptButton.isDisplayed()){\n click(ACCEPT_COOKIES_BUTTON);\n }\n }", "@Override\n\tpublic CookieDTO cookieView(CookieDTO cookieDTO) throws Exception {\n\t\tSystem.out.println(\"cookie service 실행 CookieView\");\n\t\treturn cookie.cookieView(cookieDTO);\n\t}", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:32:41.967 -0500\", hash_original_method = \"D5A9FC7DDB356B7F9D175C82B50A2AF1\", hash_generated_method = \"24C7574FF957618A543446AAAEE4BC4D\")\n \nprivate void setCookies(String url, String value) {\n if (value.contains(\"\\r\") || value.contains(\"\\n\")) {\n // for security reason, filter out '\\r' and '\\n' from the cookie\n int size = value.length();\n StringBuilder buffer = new StringBuilder(size);\n int i = 0;\n while (i != -1 && i < size) {\n int ir = value.indexOf('\\r', i);\n int in = value.indexOf('\\n', i);\n int newi = (ir == -1) ? in : (in == -1 ? ir : (ir < in ? ir\n : in));\n if (newi > i) {\n buffer.append(value.subSequence(i, newi));\n } else if (newi == -1) {\n buffer.append(value.subSequence(i, size));\n break;\n }\n i = newi + 1;\n }\n value = buffer.toString();\n }\n CookieManager.getInstance().setCookie(url, value);\n }", "public void put(Object key, Object value) throws AspException\n {\n throw new AspReadOnlyException(\"Request.Cookies\");\n }", "private String createCookies() {\n\n String bengLoginID = uid + \"\";\n String timeStr = MyApplication.getInstance().authorTime;\n ToastUtil.toast(timeStr + \"\");\n String cookes = MyApplication.getInstance().bengLoginId + \"; \" + MyApplication.getInstance().userHit + \"; \" + MyApplication.getInstance().authorID + \"; \" + timeStr + \"; \" + MyApplication.getInstance().phpSessid;\n ToastUtil.toast(cookes);\n return cookes;\n\n }", "Cookie[] getCookies();", "private String cookieOutput(RCCookie cookie) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(SET_COOKIE_TAG);\n\t\tsb.append(' ');\n\t\tif (cookie.name != null) {\n\t\t\tsb.append(cookie.name);\n\t\t\tsb.append(\"=\\\"\");\n\t\t\tsb.append(cookie.value);\n\t\t\tsb.append(\"\\\"; \");\n\t\t}\n\t\tif (cookie.domain != null) {\n\t\t\tsb.append(DOMAIN_TAG);\n\t\t\tsb.append('=');\n\t\t\tsb.append(cookie.domain);\n\t\t\tsb.append(\"; \");\n\t\t}\n\t\tif (cookie.path != null) {\n\t\t\tsb.append(\"Path=\");\n\t\t\tsb.append(cookie.path);\n\t\t\tsb.append(\"; \");\n\t\t}\n\t\tif (cookie.maxAge != null) {\n\t\t\tsb.append(MAX_AGE_TAG);\n\t\t\tsb.append('=');\n\t\t\tsb.append(cookie.maxAge);\n\t\t\tsb.append(\"; \");\n\t\t}\n\t\tif (cookie.isHTTPOnly) {\n\t\t\tsb.append(\"HttpOnly \");\n\t\t}\n\n\t\treturn sb.toString().substring(0, sb.length() - 2);\n\t}", "@NonNull\n public Runnable addCookieChangedCallback(\n @NonNull Uri uri, @Nullable String name, @NonNull CookieChangedCallback callback) {\n ThreadCheck.ensureOnUiThread();\n if (name != null && name.isEmpty()) {\n throw new IllegalArgumentException(\n \"Name cannot be empty, use null to listen for all cookie changes.\");\n }\n try {\n return ObjectWrapper.unwrap(mImpl.addCookieChangedCallback(uri.toString(), name,\n new CookieChangedCallbackClientImpl(callback)),\n Runnable.class);\n } catch (RemoteException e) {\n throw new APICallException(e);\n }\n }", "public static void addRequestWindowIdCookie(FacesContext context, String requestToken, String windowId)\n {\n context.getExternalContext().addResponseHeader(\"Set-Cookie\",\n Cookies.REQUEST_WINDOW_ID_PREFIX + requestToken + \"=\" + windowId +\n \"; path=/; maxAge=30; SameSite=Strict\");\n }", "public FCLAccountAuthorizationProvider(String cookieValue) {\r\n\t\tthis.cookieValue = cookieValue;\r\n\t}", "public void addFavorite(String google_id, String store_name, Integer account_id){\r\n Map<String, String> params = new HashMap<>();\r\n params.put(\"google_id\", google_id);\r\n params.put(\"name\", store_name);\r\n params.put(\"account_id\", String.valueOf(account_id));\r\n String url = API_DOMAIN + STORE_EXT + ADD_FAVORITE_ACTION;\r\n this.makeVolleyRequest( url, params );\r\n }", "private void addVariableToZ3(QFLanVariable var) throws Z3Exception {\n\t}", "public static void appendEncodedCookieValue( StringBuffer buf,\n\t\t\t\t\t int version,\n\t\t\t\t\t String name,\n\t\t\t\t\t String value,\n\t\t\t\t\t String path,\n\t\t\t\t\t String domain,\n\t\t\t\t\t String comment,\n\t\t\t\t\t int maxAge,\n\t\t\t\t\t boolean isSecure) {\n appendCookieValue(buf, version, name, value, path, domain, comment,\n maxAge, isSecure, true);\n }", "private Cookie getLoginCookie(boolean rememberMe,String login){\r\n\t\tCookie loginCookie=null;\r\n\t\tif(rememberMe)\r\n\t\t{\r\n\t\t\tloginCookie = new Cookie(CookieKeys.LOGIN, login);\r\n\t\t\tloginCookie.setPath(\"/\");\r\n\t\t\tloginCookie.setMaxAge(CookieKeys.MAX_AGE);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tloginCookie = new Cookie(CookieKeys.LOGIN, null);\r\n\t\t\tloginCookie.setMaxAge(0);\r\n\t\t}\r\n\t\treturn loginCookie;\r\n\t}" ]
[ "0.8660201", "0.8499245", "0.8345891", "0.8221618", "0.79349244", "0.7839446", "0.77797556", "0.7707236", "0.7584981", "0.70540017", "0.6991697", "0.68730927", "0.6574792", "0.64462143", "0.64081997", "0.631016", "0.61388946", "0.6068703", "0.6059516", "0.60573274", "0.59572846", "0.59572846", "0.59572846", "0.59572846", "0.5952693", "0.58730215", "0.5860235", "0.585212", "0.5845677", "0.5815352", "0.5814616", "0.5742168", "0.5554722", "0.5549107", "0.5510986", "0.55104995", "0.5490344", "0.5464412", "0.5431413", "0.5360625", "0.5344961", "0.5288551", "0.5282302", "0.5243461", "0.52232903", "0.5194941", "0.5192635", "0.51426667", "0.51145846", "0.5095639", "0.5090305", "0.5085707", "0.5081371", "0.507341", "0.5047221", "0.50288445", "0.50246847", "0.5018274", "0.5002303", "0.5001453", "0.499962", "0.4995048", "0.49871445", "0.49577746", "0.49462992", "0.49462333", "0.4938458", "0.49193552", "0.4913579", "0.4913579", "0.4913579", "0.4913579", "0.49006057", "0.48830003", "0.4849529", "0.48331717", "0.48268422", "0.48253426", "0.48240668", "0.47893548", "0.47744587", "0.47741523", "0.47535625", "0.4752741", "0.47459507", "0.4745404", "0.47373864", "0.47286537", "0.4722308", "0.47195053", "0.47125074", "0.46939382", "0.46876225", "0.4679141", "0.46727324", "0.46661004", "0.46426415", "0.46367842", "0.46304357", "0.46214598" ]
0.7187289
9
Instantiates a new security question with masked answer widget.
public SecurityQuestionWithMaskedAnswerWidget() { answer1.getElement().setId("answer1TextBox"); answer2.getElement().setId("answer2TextBox"); answer3.getElement().setId("answer3TextBox"); securityQuestion1.getElement().setId("securityQuestion1ListBoxMVP"); securityQuestion2.getElement().setId("securityQuestion2ListBoxMVP"); securityQuestion3.getElement().setId("securityQuestion3ListBoxMVP"); /* FlowPanel container = new FlowPanel(); container.getElement().setId("container_FlowPanel"); FlowPanel fp = addSecurityQuestionAnsertRules(); container.add(fp); container.add(new SpacerWidget());*/ /*container.add(LabelBuilder.buildLabel(securityQuestion1, "Security Question 1")); container.add(wrap(securityQuestion1)); container.add(LabelBuilder.buildLabel(answer1, "Security Answer 1")); container.add(wrap(answer1)); answer1.setFocus(false); container.add(new SpacerWidget()); container.add(LabelBuilder.buildLabel(securityQuestion2, "Security Question 2")); container.add(wrap(securityQuestion2)); container.add(LabelBuilder.buildLabel(answer2, "Security Answer 2")); container.add(wrap(answer2)); answer2.setFocus(false); container.add(new SpacerWidget()); container.add(LabelBuilder.buildLabel(securityQuestion3, "Security Question 3")); container.add(wrap(securityQuestion3)); container.add(LabelBuilder.buildLabel(answer3, "Security Answer 3")); container.add(wrap(answer3)); answer3.setFocus(false);*/ rulesGroup.add(addSecurityQuestionAnsertRules()); FormLabel labelQns1 = new FormLabel(); labelQns1.setText("Security Question 1"); labelQns1.setTitle("Security Question 1"); labelQns1.setId("SecurityQnsLabel1"); labelQns1.setFor("securityQuestion1ListBoxMVP"); labelQns1.setShowRequiredIndicator(true); FormLabel labelQns2 = new FormLabel(); labelQns2.setText("Security Question 2"); labelQns2.setTitle("Security Question 2"); labelQns2.setId("SecurityQnsLabel2"); labelQns2.setFor("securityQuestion2ListBoxMVP"); labelQns2.setShowRequiredIndicator(true); FormLabel labelQns3 = new FormLabel(); labelQns3.setText("Security Question 3"); labelQns3.setTitle("Security Question 3"); labelQns3.setId("SecurityQnsLabel3"); labelQns3.setFor("securityQuestion3ListBoxMVP"); labelQns3.setShowRequiredIndicator(true); FormLabel labelAnswer1 = new FormLabel(); labelAnswer1.setText("Security Answer 1"); labelAnswer1.setTitle("Security Answer 1"); labelAnswer1.setId("SecurityAnswerLabel1"); labelAnswer1.setFor("answer1TextBox"); labelAnswer1.setShowRequiredIndicator(true); FormLabel labelAnswer2 = new FormLabel(); labelAnswer2.setText("Security Answer 2"); labelAnswer2.setTitle("Security Answer 2"); labelAnswer2.setId("SecurityAnswerLabel2"); labelAnswer2.setFor("answer2TextBox"); labelAnswer2.setShowRequiredIndicator(true); FormLabel labelAnswer3 = new FormLabel(); labelAnswer3.setText("Security Answer 3"); labelAnswer3.setTitle("Security Answer 3"); labelAnswer3.setId("SecurityAnswerLabel3"); labelAnswer3.setFor("answer3TextBox"); labelAnswer3.setShowRequiredIndicator(true); securityQuestion1.setWidth("320px"); securityQuestion2.setWidth("320px"); securityQuestion3.setWidth("320px"); answer1.setPlaceholder("Enter Answer 1 here."); answer1.setWidth("320px"); answer1.setMaxLength(100); answer2.setWidth("320px"); answer2.setMaxLength(100); answer2.setPlaceholder("Enter Answer 2 here."); answer3.setWidth("320px"); answer3.setMaxLength(100); answer3.setPlaceholder("Enter Answer 3 here."); Question1FormGroup.add(labelQns1); Question1FormGroup.add(securityQuestion1); labelAnswer1.setMarginTop(10.00); Ans1FormGroup.add(labelAnswer1); Ans1FormGroup.add(answer1); Question2FormGroup.add(labelQns2); Question2FormGroup.add(securityQuestion2); labelAnswer2.setMarginTop(10.00); Ans2FormGroup.add(labelAnswer2); Ans2FormGroup.add(answer2); Question3FormGroup.add(labelQns3); Question3FormGroup.add(securityQuestion3); labelAnswer3.setMarginTop(10.00); Ans3FormGroup.add(labelAnswer3); Ans3FormGroup.add(answer3); /*container.add(new SpacerWidget()); container.setStyleName("securityQuestions"); initWidget(container);*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DecideQuestion(){\n\t\tsuper(0); /** call relation -> PromptQuestion.java */\n\t}", "public Question(String text, String type, String crrAnswer)\n {\n this.type = type;\n this.text = text;\n this.textCrrAnswer = crrAnswer;\n\n this.mcCrrAnswer = -1;\n this.id = Utility.generateUUID();\n }", "public void setSecurity_answer(String security_answer);", "public Question(){}", "public QuestionPanel (int surveyId)\n {\n this(surveyId, -1);\n }", "public Question() {\r\n // This is the defult constructor b/c it takes no parameters\r\n firstPrompt = \"Please enter something:\";\r\n minScale = 1;\r\n maxScale = 10;\r\n secondPrompt = \"Additional comments:\";\r\n }", "public void setSecurity_question(String security_question);", "public ReAuthAnswer createReAuthAnswer(Answer answer) {\n return null;\r\n }", "public QuestionTF() {}", "public Question() {\n\n }", "public Question(String text, String type, String[] answers, int crrAnswer)\n {\n this.type = type;\n this.text = text;\n this.answers = answers;\n this.mcCrrAnswer = crrAnswer;\n\n this.id = Utility.generateUUID();\n }", "public void setSecurityAnswer(String securityAnswer) {\n this.securityAnswer = securityAnswer;\n }", "public Question() {\n\t\tthis(\"QUESTION\", null);\n\t}", "public LyricAnswer() {\n }", "public AttemptAnswer() {\n }", "public Answer() {\n\t\t// TODO Auto-generated constructor stub\n\t}", "public QuestionPaper() {\n initComponents();\n setText();\n }", "private void creatingNewQuestion() {\r\n AbstractStatement<?> s;\r\n ListQuestions lq = new ListQuestions(ThemesController.getThemeSelected());\r\n switch ((String) typeQuestion.getValue()) {\r\n case \"TrueFalse\":\r\n // just to be sure the answer corresponds to the json file\r\n Boolean answer = CorrectAnswer.getText().equalsIgnoreCase(\"true\");\r\n s = new TrueFalse<>(Text.getText(), answer);\r\n break;\r\n\r\n case \"MCQ\":\r\n s = new MCQ<>(Text.getText(), TextAnswer1.getText(), TextAnswer2.getText(), TextAnswer3.getText(), CorrectAnswer.getText());\r\n break;\r\n\r\n default:\r\n s = new ShortAnswer<>(Text.getText(), CorrectAnswer.getText());\r\n break;\r\n }\r\n lq.addQuestion(new Question(s, ThemesController.getThemeSelected(), Difficulty.fromInteger((Integer) difficulty.getValue()) ));\r\n lq.writeJson(ThemesController.getThemeSelected());\r\n }", "public Question(String statement, String answer){\n this.statement = statement;\n this.answer = answer;\n }", "public AddQuestion() {\n initComponents();\n setResizable(false);\n }", "public QuestionContentRequest() {\n\t\tsuper();\n\t}", "public Answers()\r\n {\r\n \r\n }", "public Question(final String questionString) \n {\n originalQuestionString = questionString;\n final String[] questionParts = questionString.split(Constants.SEMI_COLON_SEPARATOR);\n questionId = questionParts[0];\n if (questionParts.length > 1) \n {\n questionFlags = questionParts[1];\n widgets = questionParts[2];\n try \n {\n backgroundColor = questionParts[3];\n } \n catch (final ArrayIndexOutOfBoundsException e) \n {\n backgroundColor = \"\";\n }\n } \n else \n {\n questionFlags = \"\";\n widgets = \"\";\n backgroundColor = \"\";\n }\n followUp = Constants.CLOSE;\n }", "private void initSecurityQuestionModel() {\n for (Integer i = 1; i <= NUMBER_SECURITY_QUESTIONS; i++) {\n final StringBuffer key = new StringBuffer(\"SecurityQuestion.\").append(i.toString());\n securityQuestionModel.addElement(getString(key.toString()));\n }\n }", "public void createTrueFalse() {\n Question q = new TrueFalse(this.in,this.o);\n this.o.setDisplay(\"Enter the prompt for your True/False question:\\n\");\n this.o.getDisplay();\n\n q.setPrompt(this.in.getUserInput());\n\n if (isTest) {\n Test t = (Test)this.survey;\n RCA ca = new RCA(this.in,this.o);\n\n this.o.setDisplay(\"Enter the correct answer (T/F):\\n\");\n this.o.getDisplay();\n\n ca.addResponse();\n\n while (!ca.getResponses().get(0).contains(\"T\") && !ca.getResponses().get(0).contains(\"F\")) {\n ca.removeResponse(0);\n this.o.setDisplay(\"Enter a valid answer (T/F):\\n\");\n this.o.getDisplay();\n ca.addResponse();\n }\n\n t.addAnswer(ca);\n }\n this.survey.addQuestion(q);\n }", "public void createShortAnswer() {\n Question q = new ShortAnswer(this.in,this.o);\n this.o.setDisplay(\"Enter the prompt for your Short Answer question:\\n\");\n this.o.getDisplay();\n\n q.setPrompt(this.in.getUserInput());\n\n int charlimit = 0;\n while (charlimit == 0) {\n this.o.setDisplay(\"Enter character limit\\n\");\n this.o.getDisplay();\n\n try {\n charlimit = Integer.parseInt(this.in.getUserInput());\n if (charlimit < 1) {\n charlimit = 0;\n } else {\n ((ShortAnswer) q).setCharLimit(charlimit);\n }\n } catch (NumberFormatException e) {\n charlimit = 0;\n }\n }\n\n int numAns = 0;\n while (numAns == 0) {\n this.o.setDisplay(\"How many answers does this question have?\\n\");\n this.o.getDisplay();\n\n try {\n numAns = Integer.parseInt(this.in.getUserInput());\n if (numAns > numChoices || numAns < 1) {\n numAns = 0;\n } else {\n q.setMaxResponses(numAns);\n }\n } catch (NumberFormatException e) {\n numAns = 0;\n }\n }\n\n if (isTest) {\n RCA ca = new RCA(this.in,this.o);\n Test t = (Test)this.survey;\n String ans;\n\n for (int j=0; j < q.getMaxResponses(); j++){\n this.o.setDisplay(\"Enter correct answer(s):\\n\");\n this.o.getDisplay();\n\n ans = this.in.getUserInput();\n\n while (ans.length() > ((ShortAnswer) q).getCharLimit()) {\n this.o.setDisplay(\"Answer must be less then \" + ((ShortAnswer) q).getCharLimit() + \" characters \\n\");\n this.o.getDisplay();\n ans = this.in.getUserInput();\n }\n\n ca.addResponse(ans);\n }\n t.addAnswer(ca);\n }\n this.survey.addQuestion(q);\n }", "public AnswerIF newAnswer(boolean correct, SourceIF text) {\n\t\tif (text == null)\n\t\t\tthrow new NullPointerException(\"The argument text cannot be null\");\n\t\treturn new Answer(correct, text);\n\t}", "public seViewAnswerUI() {\n initComponents();\n }", "public Question(String firstPrompt) {\r\n this(); //Calling method (defualt constuctor) that takes no parameters\r\n this.firstPrompt = firstPrompt;\r\n //or public Question(String p) and firstPrompt = p\r\n }", "public void setQuestion(){\n\n\n triggerReport(); //Check if max questions are displayed, if yes then show report\n\n MyDatabase db = new MyDatabase(QuizCorner.this);\n Cursor words = db.getQuizQuestion();\n TextView question_text = (TextView) findViewById(R.id.question_text);\n RadioButton rb;\n resetOptions();\n disableCheck();\n enableRadioButtons();\n hideAnswer();\n words.moveToFirst();\n word = words.getString(words.getColumnIndex(\"word\"));\n correct_answer = words.getString(words.getColumnIndex(\"meaning\"));\n question_text.setText(word + \" means:\");\n for (int i = 0; i < 4; i++){\n answers[i] = words.getString(words.getColumnIndex(\"meaning\"));\n words.moveToNext();\n }\n answers = randomizeArray(answers);\n for (int i = 0; i < 4; i++){\n rb = (RadioButton) findViewById(options[i]);\n rb.setText(answers[i]);\n }\n question_displayed_count++;\n }", "public QuizCreatorView() {\n answerInput1.setText(\"\");\n answerInput2.setText(\"\");\n answerInput3.setText(\"\");\n answerInput4.setText(\"\");\n optionsGroup = new ButtonGroup();\n optionsGroup.add(OptionA);\n optionsGroup.add(OptionB);\n optionsGroup.add(OptionC);\n optionsGroup.add(OptionD);\n }", "public Question(String q, String a){ //initializes the question and answer\n\t\t\tquestion = q;\n\t\t\tanswer = a;\n\t\t}", "public void setSecurityQuestion(String securityQuestion) {\n this.securityQuestion = securityQuestion;\n }", "private void initAnswerBox(){\n\t\tanswerBox = new JTextField(\"\", ANSWER_BOX_SIZE);\n\t\tanswerBox.setBackground(Color.WHITE);\n\t\tanswerBox.setFont(FontMaker.getDefaultFont(32));\n\t\tanswerBox.setOpaque(true);\n\t\t\n\t\t//answerBox had to be placed into a container, because its background color was falling\n\t\t// through to mainWindow's background layer(answerBox was transparent).\n\t\tanswerBoxContainer = new ContentPane(answerBox.getPreferredSize().width,\n\t\t\t\t\t\t\t\tanswerBox.getPreferredSize().height, false, false);\n\t\tanswerBoxContainer.addComponent(answerBox, 0, 0);\n\t\tanswerBoxContainer.setBackground(Color.WHITE);\n\t\tanswerBoxContainer.setOpaque(false);\n\t\t\n\t\t//Find mainWindow's center and answerBox's offset.\n\t\tint windowCenter = (int)(mainWindow.getPreferredSize().getWidth() / 2);\n\t\tint answerBoxCenter = (int)(answerBox.getPreferredSize().getWidth() / 2);\n\t\tint xOrigin = windowCenter - answerBoxCenter;\n\t\t\n\t\tmainWindow.addLayer(answerBoxContainer, ANSWER_BOX_LAYER, xOrigin, 200);\n\t}", "public Question(String question, String answer, boolean isMP, boolean isBP) {\n\t\tis_multiple_choice = false;\n\t\toption_a = null;\n\t\toption_b = null;\n\t\toption_c = null;\n\t\toption_d = null;\n\t\toption_e = null;\n\t\tis_mp_question = isMP;\n\t\tis_bp_question = isBP;\n\t\tthis.question = question;\n\t\tanswer_to_question_explanation = answer;\n\t}", "protected Answer(){\r\n\t\t\r\n\t}", "public Question(String question, String answer, List<String> mcAnswers) {\n\t\tis_multiple_choice = false;\n\t\t\n\t\t/* pads the list if less than total answers */\n\t\tif (mcAnswers.size() < 5) {\n\t\t\tmcAnswers.add(null);\n\t\t}\n\t\toption_a = mcAnswers.get(0);\n\t\toption_b = mcAnswers.get(1);\n\t\toption_c = mcAnswers.get(2);\n\t\toption_d = mcAnswers.get(3);\n\t\toption_e = mcAnswers.get(4);\n\t\tis_mp_question = false;\n\t\tis_bp_question = true;\n\t\tthis.question = question;\n\t\tanswer_to_question_explanation = answer;\n\t}", "FactoryQuestion(String textA, String textB, ArrayList<String> textOps, ArrayList<String> rightAns, ArrayList<String> answers, String topic, int bloom){\n\t\tthis.rightAns = new ArrayList<String>();\n\t\tthis.textOps = new ArrayList<String>();\n\t\tthis.answers = new ArrayList<String>();\n\t\tthis.textA = textA;\n\t\tthis.textB = textB;\n\t\t\n\t\tfor(String t : textOps){\n\t\t\tthis.textOps.add(t);\n\t\t}\n\t\tfor(String r : rightAns){\n\t\t\tthis.rightAns.add(r);\n\t\t}\n\t\tfor(String a : answers){\n\t\t\tthis.answers.add(a);\n\t\t}\n\t\t\n\t\t//asked = false;\n\t\tthis.topic = topic;\n\t\tthis.bloom = bloom;\n\t}", "private String extractSecurityAnswer() {\n return SwingUtil.extract(securityAnswerJTextField, Boolean.TRUE);\n }", "public Builder clearCorrectAnswer() {\n bitField0_ = (bitField0_ & ~0x00000002);\n correctAnswer_ = getDefaultInstance().getCorrectAnswer();\n onChanged();\n return this;\n }", "@AutoEscape\n\tpublic String getSecurity_answer();", "private void setQuestionView() {\n\n if (currentQ.getIsImageQuestion()) {\n\n radioGroup.clearCheck();\n\n byte [] imageInByte = questionList.get(qid).getImageResource();\n\n ByteArrayInputStream imageStream = new ByteArrayInputStream(imageInByte);\n Bitmap theImage = BitmapFactory.decodeStream(imageStream);\n imageView.setImageBitmap(theImage);\n imageView.setVisibility(View.VISIBLE);\n\n txtQuestionNumber.setText(\"Question \" + (qid + 1));\n question.setText(currentQ.getQuestion());\n radio0.setText(currentQ.getA1());\n radio1.setText(currentQ.getA2());\n radio2.setText(currentQ.getA3());\n radio3.setText(currentQ.getA4());\n\n qid++;\n\n }else {\n\n radioGroup.clearCheck();\n\n imageView.setVisibility(View.GONE);\n\n txtQuestionNumber.setText(\"Question \" + (qid + 1));\n question.setText(currentQ.getQuestion());\n radio0.setText(currentQ.getA1());\n radio1.setText(currentQ.getA2());\n radio2.setText(currentQ.getA3());\n radio3.setText(currentQ.getA4());\n\n qid++;\n\n\n }\n }", "public Question(String firstPrompt, int minScale, int maxScale, String secondPrompt){\r\n this.firstPrompt = firstPrompt;\r\n this.minScale = minScale;\r\n this.maxScale = maxScale;\r\n this.secondPrompt = secondPrompt;\r\n }", "Radian createRadian();", "public MultipleChoiceQuestion(String question, String answer) {\n super(question, answer);\n }", "public Menutable(String question, String answer) {\r\n\t\tthis.question = question;\r\n\t\tthis.answer = answer;\r\n\t}", "public AnswerRecord(Integer id, Integer seq, String answer, String correctText, String incorrectText, String selectedText, Boolean isCorrect, Integer questionId) {\n super(Answer.ANSWER);\n\n set(0, id);\n set(1, seq);\n set(2, answer);\n set(3, correctText);\n set(4, incorrectText);\n set(5, selectedText);\n set(6, isCorrect);\n set(7, questionId);\n }", "public Question(String alias) {\n\t\tthis(alias, QUESTION);\n\t}", "public void createQuestion(int sid,int qid,String qtype,String qtitle,String answer_a,String answer_b,String answer_c,String answer_d);", "public FAQ(String question, String answer){\n\t\tthis.question = question;\n\t\tthis.answer = answer;\n\t}", "public ManageAllianceQuestion(Creature aResponder, String aTitle, String aQuestion, long aTarget) {\n/* 47 */ super(aResponder, aTitle, aQuestion, 19, aTarget);\n/* */ }", "public static SelectionFragment newInstance(Question question) {\n Bundle args = new Bundle();\n args.putString(QUESTION_TEXT, question.getQuestion());\n //args.putStringArray(QUESTION_ANSWERS, answersToArray);\n args.putInt(QUESTION_ID, question.getId());\n\n // create a fragment and set arguements to it\n SelectionFragment fragment = new SelectionFragment();\n fragment.setArguments(args);\n return fragment;\n\n }", "public Question(String question, String[] options, String correctAnswer, String type) {\r\n this.question = question;\r\n this.correctAnswer = correctAnswer;\r\n this.type = \"Multiple Choice\";\r\n this.options = options;\r\n }", "public QuestionPanel (int surveyId, final int questionIndex)\n {\n setStyleName(\"question\");\n setWidth(\"100%\");\n setSpacing(10);\n\n // show a loading message and load em up\n add(MsoyUI.createLabel(_msgs.loadingSurvey(), null));\n _cache.getQuestions(surveyId, new AsyncCallback<SurveyWithQuestions>() {\n public void onSuccess(SurveyWithQuestions result) {\n clear();\n _questionIndex = questionIndex;\n init(result.survey, result.getQuestion(questionIndex));\n }\n public void onFailure(Throwable caught) {\n clear();\n add(MsoyUI.createLabel(_msgs.errSurveyNotLoaded(caught.getMessage()), null));\n }\n });\n }", "public static PossibleAnswer setUpPossibleAnswer(String questionStr,\n\t\t\tString textStr) {\n\t\tList<Sentence> sents= TestUtil.setUpSentences(textStr);\n\t\tText text= new Text(sents);\n\t\tText questionText= new Text(TestUtil.setUpSentences(questionStr));\n\t\tQuestion question= new Question(questionStr);\n\t\tquestion.setAnnotatedText(questionText);\n\t\tPossibleAnswer possibleAnswer= new PossibleAnswer(question, textStr);\n\t\tpossibleAnswer.setAnnotatedText(text);\n\t\t\n\t\treturn possibleAnswer;\n\t}", "public MultipleAnswerQuestion(String question ,boolean isSingleAnswered)\r\n {\r\n super(question,isSingleAnswered);\r\n this.answers = new ArrayList<>(); //Initializing the HashSet\r\n }", "public void createEssay() {\n Question q = new Essay(this.in,this.o);\n this.o.setDisplay(\"Enter the prompt for your Essay question:\\n\");\n this.o.getDisplay();\n\n q.setPrompt(this.in.getUserInput());\n\n int numAns = 0;\n while (numAns == 0) {\n this.o.setDisplay(\"How many answers does this question have?\\n\");\n this.o.getDisplay();\n\n try {\n numAns = Integer.parseInt(this.in.getUserInput());\n if (numAns > numChoices || numAns < 1) {\n numAns = 0;\n } else {\n q.setMaxResponses(numAns);\n }\n } catch (NumberFormatException e) {\n numAns = 0;\n }\n }\n\n if (isTest) {\n RCA ca = new RCA(this.in,this.o);\n Test t = (Test)this.survey;\n String ans;\n\n this.o.setDisplay(\"Enter correct answer(s)\\n\");\n this.o.getDisplay();\n\n for (int j=0; j < q.getMaxResponses(); j++){\n\n ans = this.in.getUserInput();\n\n ca.addResponse(ans);\n }\n t.addAnswer(ca);\n }\n\n this.survey.addQuestion(q);\n }", "public Riddle(String initQuestion, String initAnswer)\n {\n // set the instance variables to the init parameter variables\n\n }", "@AutoEscape\n\tpublic String getSecurity_question();", "public Question(String id, String description, String correctAnswer,\n List<String> options) {\n super();\n this.id = id;\n this.description = description;\n this.correctAnswer = correctAnswer;\n this.options = options;\n }", "public BooleanChoiceAnswer(Question question, boolean choice) {\n this(question);\n this.answer = choice;\n }", "public SurveyInstance createSurveyInstance() {\n return new SurveyInstance();\n }", "public void setQuestion(){\n Random rand = new Random();\n a = rand.nextInt(maxRange)+1;\n b = rand.nextInt(maxRange)+1;\n int res = rand.nextInt(4);\n equation.setText(a +\"+\"+ b);\n for(int i=0; i<4; i++){\n if(i == res)\n arr[i] = a+b;\n else {\n int answer = rand.nextInt(2*maxRange)+1;\n while(answer == a+b)\n answer = rand.nextInt(2*maxRange)+1;\n arr[i] = answer;\n }\n }\n for(int i=0; i<4; i++)\n buttons[i].setText(String.valueOf(arr[i]));\n }", "public ChoiceQuestion() {\n m_choices = new ArrayList<>();\n }", "public QuestionDropPanel() {\n\t\tthis(Color.orange);\n\t}", "public QuestionGroup.Builder question(final String questionCode) {\n\t\t\tConsumer<QuestionGroup> f = obj -> {\n\t\t\t\tmanagedInstance.questionGroup = obj;\n\t\t\t};\n\t\t\tmanagedInstance.questionCode = questionCode;\n\t\t\treturn new QuestionGroup.Builder(this, f, questionCode);\n\t\t}", "public SurveyPanel ()\n {\n setWidth(\"100%\");\n setStyleName(\"survey\");\n\n init(new SurveyWithQuestions(\n new SurveyMetaData(), Lists.<SurveyQuestion>newArrayList()));\n }", "private void secQuestionInput()\n {\n if(textBox1.getText().equals(user.getSecretQAns()))\n {\n secQuestion = false;\n password = true;\n\n textBox1.setText(\"\");\n textBox1.promptTextProperty().set(\"New Password\");\n labelHeader.setText(\"Input new password\");\n\n textBox2Label.setVisible(true);\n textBox2Label.setText(\"Confirm New Password\");\n textBox2.setVisible(true);\n textBox1Label.setText(\"New Password\");\n }\n else\n {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setContentText(\"Security answer does not match!\");\n alert.show();\n }\n }", "Question() {\n ques = opt1 = opt2 = opt3 = opt4 = null; // initializing to null\n }", "public Question(int id, String question_text) {\n\n this.questionText = question_text;\n\n this.pictureId = id;\n }", "public QuestionaireImpl() {\n\t\t//cannot use working constructor because title could not be set\n\t\t//to an empty string through setTitle\n\t\tfTitle = \"\";\n\t\tsetQuestions(QuestionFactory.createCollection());\n\t\tsetAuthor(PersonFactory.getNullPerson());\n\t}", "public static CareerPortalQuestionnaireQuestion createEntity(EntityManager em) {\n CareerPortalQuestionnaireQuestion careerPortalQuestionnaireQuestion = new CareerPortalQuestionnaireQuestion()\n .careerPortalQuestionnaireQuestionId(DEFAULT_CAREER_PORTAL_QUESTIONNAIRE_QUESTION_ID)\n .careerPortalQuestionnaireId(DEFAULT_CAREER_PORTAL_QUESTIONNAIRE_ID)\n .text(DEFAULT_TEXT)\n .minimumLength(DEFAULT_MINIMUM_LENGTH)\n .maximumLength(DEFAULT_MAXIMUM_LENGTH)\n .requir(DEFAULT_REQUIR)\n .position(DEFAULT_POSITION)\n .siteId(DEFAULT_SITE_ID)\n .type(DEFAULT_TYPE);\n return careerPortalQuestionnaireQuestion;\n }", "public Puzzles(String question, int answer, int level) {\n\t\tsuper();\n\t\tthis.question = question;\n\t\tthis.answer = answer;\n\t\tthis.isAsked = false;\n\t}", "@WebMethod Question createQuestion(Event event, String question, float betMinimum) throws EventFinished, QuestionAlreadyExist;", "protected DistributionFinder(String inputMatrix, int qValue, JRadioButton button, JTextArea textArea) {\n this.inputMatrix = inputMatrix;\n this.qValue = qValue;\n this.button = button;\n this.textArea = textArea;\n }", "private void initQuestionBox() throws IOException{\n\t\tBufferedImage questionBoxImage = ImageLoader.getBufferedImage(QUESTION_BOX_IMAGE_PATH);\n\t\tquestionBox = new ContentPane(questionBoxImage, false, false){\n\t\t\t@Override\n\t\t public void paintComponent(Graphics g) {\n\t\t\t\tsuper.paintComponent(g);\n\t\t\t\t\n\t\t\t\t//Paint the equation line, if the current question is an equation.\n\t\t if(isEquation) {\n\t\t Graphics2D g2 = (Graphics2D) g;\n\t\t Color oldColor = g2.getColor();\n\t\t Stroke oldStroke = g2.getStroke();\n\t\t \n\t\t g2.setColor(Color.WHITE);\n\t\t g2.setStroke(new BasicStroke(3));\n\t\t g2.draw(new Line2D.Double(lineXStart, lineY, lineXEnd, lineY));\n\t\t \n\t\t g2.setColor(oldColor);\n\t\t g2.setStroke(oldStroke);\n\t\t }\n\t\t }\n\t\t};\n\t\tquestionBox.setName(QUESTION_BOX_NAME);\n\t\tmainWindow.addLayer(questionBox, TEXT_LAYER, 80, 300);\n\t}", "public TextQuestionHolder(View view) {\n super(view);\n questionTextView = view.findViewById(R.id.questionTextView);\n questionIcon = view.findViewById(R.id.questionIcon);\n answerEditText = view.findViewById(R.id.answerEditText);\n answerDisplayer = view.findViewById(R.id.answerDisplayerTextView);\n possibleSolutionLayout = view.findViewById(R.id.solutionDisplayerLayout);\n //can't change theme in exams, so this can be done once, here\n if (ThemeUtils.isDarkTheme()) {\n int accent = ContextCompat.getColor(view.getContext(), R.color.colorPrimaryDark_Dark);\n view.findViewById(R.id.questionSep1).setBackgroundColor(accent);\n view.findViewById(R.id.questionSep2).setBackgroundColor(accent);\n view.setBackground(ContextCompat.getDrawable(view.getContext(), R.drawable.question_background_dark));\n }\n }", "@Override\n public void setQuestion(Question question) {\n super.setQuestion(question);\n\n options = ((MultipleChoiceQuestionResponse) question.getCorrectAnswer()).getChoices();\n for (int i = 0; i < options.size(); i ++) {\n String option = options.get(i);\n RadioButton button = new RadioButton(option);\n button.setToggleGroup(group);\n\n button.setLayoutY(i * 30);\n choices.getChildren().add(button);\n }\n }", "@WebMethod Question createQuestion(Event event, String question, double betMinimum) throws EventFinished, QuestionAlreadyExist;", "@FXML\n\tprivate void answerQuestion() {\n\t\tint correctAnsID = 0;\n\t\ttry {\n\t\t\tswitch (((RadioButton) answerGroup.getSelectedToggle()).getId()) {\n\t\t\tcase \"ans1Check\":\n\t\t\t\tcorrectAnsID = 1;\n\t\t\t\tbreak;\n\t\t\tcase \"ans2Check\":\n\t\t\t\tcorrectAnsID = 2;\n\t\t\t\tbreak;\n\t\t\tcase \"ans3Check\":\n\t\t\t\tcorrectAnsID = 3;\n\t\t\t\tbreak;\n\t\t\tcase \"ans4Check\":\n\t\t\t\tcorrectAnsID = 4;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\terrorLabel.setVisible(true);\n\t\t}\n\n\t\t// nothing is selected\n\t\tif (correctAnsID == 0) { \n\t\t\terrorLabel.setVisible(true);\n\t\t\t// correct answer\n\t\t} else if (question.getCorrect_ans() == correctAnsID) {\n\t\t\tcontrol.setScore(control.getScore() + question.getScore());\n\t\t\thandleAlertAndWindow(AlertType.INFORMATION, \"Congrats! :D\",\n\t\t\t\t\t\"You received \" + question.getScore() + \" points\");\n\t\t\t// wrong answer\n\t\t} else {\n\t\t\tcontrol.setScore(control.getScore() + question.getPenalty());\n\n\t\t\thandleAlertAndWindow(AlertType.ERROR, \"Uh oh! :(\",\n\t\t\t\t\t\"You lost \" + question.getPenalty() + \" points\");\n\t\t}\n\n\t\t// reset the eaten question\n\t\tViewLogic.playGameController.getControl().setQuestionEaten(null);\n\t}", "@Override\n\tpublic Answer create(long answerId) {\n\t\tAnswer answer = new AnswerImpl();\n\n\t\tanswer.setNew(true);\n\t\tanswer.setPrimaryKey(answerId);\n\n\t\tanswer.setCompanyId(CompanyThreadLocal.getCompanyId());\n\n\t\treturn answer;\n\t}", "protected QuestionNGram() {/* intentionally empty block */}", "public QuestionDetailExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public QcmQuestion (java.lang.Integer _idQcmquestion) {\r\n\t\tsuper(_idQcmquestion);\r\n\t}", "private void initialize(ReadYaml quiz) {\r\n\t\tString title = \"Score: \" + TestGui.SCORE + \"/\" + TestGui.ATTEMPTS + \" - \" + quiz.getTitle();\r\n\t\tfrmMultipleChoiceQuestion = new JDialog(null, title, Dialog.ModalityType.APPLICATION_MODAL);\r\n\t\tfrmMultipleChoiceQuestion.setLocationRelativeTo(null);\r\n\t\tfrmMultipleChoiceQuestion.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);\r\n\t\tGridBagLayout gridBagLayout = new GridBagLayout();\r\n\t\tfrmMultipleChoiceQuestion.getContentPane().setLayout(gridBagLayout);\r\n\r\n\t\t// This is the question\r\n\t\tString question = \"<html>\"+quiz.getQuestion().replaceAll(\"(\\r\\n|\\n)\", \"<br />\")+\"</html>\";\r\n\t\tJLabel label = new JLabel(question);\r\n\t\tGridBagConstraints gbc_label = new GridBagConstraints();\r\n\t\tgbc_label.gridx = 0;\r\n\t\tgbc_label.gridy = 0;\r\n\t\tfrmMultipleChoiceQuestion.getContentPane().add(label, gbc_label);\r\n\r\n\t\t// These are the answers\r\n\t\tint i=0;\r\n\t\tfor (String s : quiz.getAnswers()) {\r\n\t\t\trdbtnAnswers.add(new JRadioButton(s));\r\n\t\t\trdbtnAnswers.get(i).setActionCommand(String.valueOf(i));\r\n\t\t\tbuttonGroup.add(rdbtnAnswers.get(i));\r\n\t\t\tgbc_rdbtnAnswers.add(new GridBagConstraints());\r\n\t\t\tgbc_rdbtnAnswers.get(i).anchor = GridBagConstraints.WEST;\r\n\t\t\tgbc_rdbtnAnswers.get(i).gridx = 0;\r\n\t\t\tgbc_rdbtnAnswers.get(i).gridy = i+1;\r\n\t\t\tfrmMultipleChoiceQuestion.getContentPane().add(rdbtnAnswers.get(i), gbc_rdbtnAnswers.get(i));\r\n\t\t\ti++;\r\n\t\t}\r\n\t\ti++;\r\n\t\t// Confirm button\r\n\t\tJButton btnConfirm = new JButton(\"Confirm\");\r\n\t\tbtnConfirm.addActionListener(new Confirm());\r\n\t\tGridBagConstraints gbc_btnConfirm = new GridBagConstraints();\r\n\t\tgbc_btnConfirm.gridx = 0;\r\n\t\tgbc_btnConfirm.gridy = i;\r\n\t\tfrmMultipleChoiceQuestion.getContentPane().add(btnConfirm, gbc_btnConfirm);\r\n\r\n\t\t// Hint button, will only be displayed if there is a hint\r\n\t\tif (quiz.getHintText() != null || quiz.getHintImage() != null) {\r\n\t\t\tJButton btnHint = new JButton(\"Hint\");\r\n\t\t\tbtnHint.addActionListener(new Hint(quiz));\r\n\t\t\tGridBagConstraints gbc_btnHint = new GridBagConstraints();\r\n\t\t\tgbc_btnHint.gridx = 1;\r\n\t\t\tgbc_btnHint.gridy = i;\r\n\t\t\tfrmMultipleChoiceQuestion.getContentPane().add(btnHint, gbc_btnHint);\r\n\t\t}\r\n\t\t// Citation button\r\n\t\tif (quiz.getAuthor() != null && quiz.getUrl() != null) {\r\n\t\t\tbtnCitation = new JButton(\"Citation\");\r\n\t\t\tbtnCitation.addActionListener(new Citation(quiz));\r\n\t\t\tGridBagConstraints gbc_btnCitation = new GridBagConstraints();\r\n\t\t\tgbc_btnCitation.gridx = 2;\r\n\t\t\tgbc_btnCitation.gridy = i;\r\n\t\t\tfrmMultipleChoiceQuestion.getContentPane().add(btnCitation, gbc_btnCitation);\r\n\t\t}\r\n\t}", "public QuestionInfo (String pergunta){\r\n this.question = pergunta;\r\n }", "public CandyQuestion(Image image) {\n\t\t\tsuper(image, Constants.QUESTION_CANDY_INITIAL_POINTS);\n\t\t\tsetQuestion(new PopsQuestion());\n\t\t}", "private void fetchNewQuestion()\r\n\t{\r\n\t\t//Gets question and answers from model\r\n\t\tString[] question = quizModel.getNewQuestion();\r\n\t\t\r\n\t\t//Allocates answers to a new ArrayList then shuffles them randomly\r\n\t\tArrayList<String> answers = new ArrayList<String>();\r\n\t\tanswers.add(question[1]);\r\n\t\tanswers.add(question[2]);\r\n\t\tanswers.add(question[3]);\r\n\t\tanswers.add(question[4]);\r\n\t\tCollections.shuffle(answers);\r\n\t\t\r\n\t\t//Allocates north label to the question\r\n\t\tnorthLabel.setText(\"<html><div style='text-align: center;'>\" + question[0] + \"</div></html>\");\r\n\t\t\r\n\t\t//Allocates each radio button to a possible answer. Based on strings, so randomly generated questions...\r\n\t\t//...which by chance repeat a correct answer in two slots, either will award the user a point.\r\n\t\toption1.setText(answers.get(0));\r\n\t\toption2.setText(answers.get(1));\r\n\t\toption3.setText(answers.get(2));\r\n\t\toption4.setText(answers.get(3));\r\n\t\toption1.setActionCommand(answers.get(0));\r\n\t\toption2.setActionCommand(answers.get(1));\r\n\t\toption3.setActionCommand(answers.get(2));\r\n\t\toption4.setActionCommand(answers.get(3));\r\n\t\toption1.setSelected(true);\r\n\t\t\r\n\t\t//Update score\r\n\t\tscoreLabel.setText(\"<html><div style='text-align: center;'>\" + \"Score = \" + quizModel.getScore() + \"</div></html>\");\r\n\t}", "public static void hitQuiz()\n\t{\n\t\tQuestion q = Home.questionList.get((int)(Math.random()*Home.questionList.size()));\n\t\tQuizQuestion q1= new QuizQuestion(q);\n\t\tq1.setAlwaysOnTop(true);\n\t\tq1.setVisible(true);\n\t\tsuspend();\n\t}", "@SuppressWarnings(\"unused\")\r\n\tprivate SWTRadioButtonView() {\r\n\t\tthis.containingForm = null;\r\n\t}", "public QATrackerView(){\n initComponents();\n addPanel();\n }", "public Question(String questionText, boolean correctAns, int i) {\n this.questionText = questionText;\n this.correctAns = correctAns;\n imageName = i;\n }", "private void initQuestionDialog() {\n\t\tquestion = true;\n\t\tchangeDirBehaviour(Values.DETECT_INIT);\n\t}", "protected AnswerList() {/* intentionally empty block */}", "public Builder setCorrectAnswer(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n correctAnswer_ = value;\n onChanged();\n return this;\n }", "protected void constructNewQuestion(){\n arabicWordScoreItem = wordScoreTable.whatWordToLearn();\n arabicWord = arabicWordScoreItem.word;\n correctAnswer = dictionary.get(arabicWord);\n\n for (int i=0;i<wrongAnswers.length;i++){\n int wrongAnswerId;\n String randomArabicWord;\n String wrongAnswer;\n do {\n wrongAnswerId = constructQuestionRandom.nextInt(next_word_index);\n randomArabicWord = dictionary_key_list.get(wrongAnswerId);\n wrongAnswer = dictionary.get(randomArabicWord);\n } while (wrongAnswer.equals(correctAnswer));\n wrongAnswers[i] = wrongAnswer;\n }\n }", "public QuestionSet() {\n\t\tsuper();\n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\tmyQuestions = (RemoteQuestions) Naming.lookup(\"rmi://localhost/quizepathservice\");\n//\t\t\tmyQuestions.addQuestionToSurvey(questionDesc, option, status);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"A problem occured: \"+e.toString());\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Is your server running?\");\n\t\t} \n\t}", "public ProposalSpecialReviewForm() {\r\n }", "public void setAnswer(MCQChoice answer)\n\t{\n\t\tmcqAnswer = answer;\n\t}", "private void setquestion() {\n qinit();\n question_count++;\n\n if (modeflag == 3) {\n modetag = (int) (Math.random() * 3);\n } else {\n modetag = modeflag;\n }\n\n WordingIO trueword = new WordingIO(vocabulary);\n\n if (modetag == 0) {\n\n MCmode(trueword);\n }\n\n if (modetag == 1) {\n BFmode(trueword);\n }\n\n if (modetag == 2) {\n TLmode(trueword);\n }\n\n if (time_limit != 0) {\n timingtoanswer(time_limit, jLabel2, answer_temp, jLabel5, jLabel6, jButton1);\n }\n }" ]
[ "0.57734877", "0.55654395", "0.5513602", "0.53839815", "0.53732646", "0.5355851", "0.5346428", "0.53216165", "0.5311132", "0.5247848", "0.5244645", "0.52420765", "0.5200158", "0.51961046", "0.5188813", "0.51725656", "0.51608896", "0.5157867", "0.51516175", "0.5151389", "0.511658", "0.5091986", "0.50654274", "0.5028404", "0.50267303", "0.49949068", "0.4990593", "0.4974484", "0.49532887", "0.49427763", "0.49365285", "0.4922377", "0.4920858", "0.49089852", "0.49066636", "0.48956457", "0.48895124", "0.4868645", "0.4807546", "0.48062962", "0.48010296", "0.48005447", "0.4797115", "0.4788795", "0.47875515", "0.47705197", "0.47702676", "0.4759783", "0.47464958", "0.47221234", "0.47214496", "0.4712466", "0.47114804", "0.47087473", "0.47016606", "0.4695902", "0.46958223", "0.46904695", "0.46885395", "0.46821314", "0.4678488", "0.4674527", "0.4660087", "0.4657031", "0.46512386", "0.46346727", "0.46339756", "0.4622062", "0.46080226", "0.46011925", "0.4595235", "0.45894638", "0.45890108", "0.45842177", "0.45817217", "0.45772728", "0.45721352", "0.45680356", "0.4562815", "0.45483768", "0.453521", "0.45342833", "0.4533323", "0.4532743", "0.45298427", "0.4528455", "0.45258254", "0.45250964", "0.4523447", "0.45144203", "0.4511873", "0.45109105", "0.45097762", "0.45096487", "0.45095733", "0.45069996", "0.45047197", "0.45034596", "0.45016056", "0.44919577" ]
0.6900944
0
Sets the security question1.
public void setSecurityQuestion1(ListBoxMVP securityQuestion1) { this.securityQuestion1 = securityQuestion1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setSecurity_question(String security_question);", "public void setAnswer1(String answer1) {\r\n this.answer1 = answer1;\r\n }", "public void setForgottenPasswordQuestion1(String forgottenPasswordQuestion1) {\n\t\tthis.forgottenPasswordQuestion1 = forgottenPasswordQuestion1;\n\t}", "public boolean setQuiz1(double quiz1)\n\t{\n\t\tboolean isValid;\n\t\t\n\t\tisValid = isValidQuiz1(quiz1);\n\t\t\n\t\tif(isValid)\n\t\t{\n\t\t\tthis.quiz1 = quiz1;\n\t\t}\n\t\t\n\t\treturn isValid;\n\t}", "public void setSecurity_answer(String security_answer);", "public void setSecurityQuestion(String securityQuestion) {\n this.securityQuestion = securityQuestion;\n }", "public void setAnswerText1(String answerText1) {\r\n\t\tthis.answerText1 = answerText1;\r\n\t}", "public void setQ1Label(java.lang.String q1Label) {\n this.q1Label = q1Label;\n }", "void setQuestionType(QuestionType type);", "public void setForgottenPasswordAnswer1(String forgottenPasswordAnswer1) {\n\t\tthis.forgottenPasswordAnswer1 = forgottenPasswordAnswer1;\n\t}", "private void setQuestion() {\n Question.setText(gen.getQuestion() + \"\\t\\tProblem # \" + currentQuestion + \"/\" + numQuestions);\n }", "public void setSecurityQuestion2(ListBoxMVP securityQuestion2) {\r\n\t\tthis.securityQuestion2 = securityQuestion2;\r\n\t}", "public void setQuestion(String newQuestion) {\n question = newQuestion;\n }", "public void setTrait1(String trait1) {\n \t\tthis.trait1 = trait1;\n \t}", "public void setQuestion(Question q)\n {\n currentQuestion=q;\n questionLabel.setText(q.getQuestion());\n feedbackLabel.setVisible(false);\n }", "public void setSecurityAnswer(String securityAnswer) {\n this.securityAnswer = securityAnswer;\n }", "public void setQuestion(){\n txt_question.setText(arrayList.get(quesAttempted).getQuestion());\n txt_optionA.setText(arrayList.get(quesAttempted).getOptionA());\n txt_optionB.setText(arrayList.get(quesAttempted).getOptionB());\n txt_optionC.setText(arrayList.get(quesAttempted).getOptionC());\n txt_optionD.setText(arrayList.get(quesAttempted).getOptionD());\n txt_que_count.setText(\"Que: \"+(quesAttempted+1)+\"/\"+totalQues);\n txt_score.setText(\"Score: \"+setScore);\n }", "public String getSecurity_question() \r\n {\r\n return security_question;\r\n }", "public void setQuestion(String question) {\n\t\tthis.question = question;\n\t}", "public void setQuestion(String question) {\n this.question = question;\n }", "private void setquestion() {\n qinit();\n question_count++;\n\n if (modeflag == 3) {\n modetag = (int) (Math.random() * 3);\n } else {\n modetag = modeflag;\n }\n\n WordingIO trueword = new WordingIO(vocabulary);\n\n if (modetag == 0) {\n\n MCmode(trueword);\n }\n\n if (modetag == 1) {\n BFmode(trueword);\n }\n\n if (modetag == 2) {\n TLmode(trueword);\n }\n\n if (time_limit != 0) {\n timingtoanswer(time_limit, jLabel2, answer_temp, jLabel5, jLabel6, jButton1);\n }\n }", "public void setInput1(int input1) {\n this.input1 = input1;\n }", "private void setQuestion(int resID){\n questionView.setText(resID);\n ecaFragment.sendToECAToSpeak(getResources().getString(resID));\n }", "public String getSecurityQuestion() {\n return securityQuestion;\n }", "public void setOkToEditQuestion(String string) {\r\n\t\t_okToEditQuestion = string;\r\n\t}", "public String getForgottenPasswordQuestion1() {\n\t\treturn forgottenPasswordQuestion1;\n\t}", "public void setIdQuestion(int value) {\n this.idQuestion = value;\n }", "@AutoEscape\n\tpublic String getSecurity_question();", "public void setQuestionType(int questionType) {\r\n\t\tthis.questionType = questionType;\r\n\t}", "public void setQuestion(){\n\n\n triggerReport(); //Check if max questions are displayed, if yes then show report\n\n MyDatabase db = new MyDatabase(QuizCorner.this);\n Cursor words = db.getQuizQuestion();\n TextView question_text = (TextView) findViewById(R.id.question_text);\n RadioButton rb;\n resetOptions();\n disableCheck();\n enableRadioButtons();\n hideAnswer();\n words.moveToFirst();\n word = words.getString(words.getColumnIndex(\"word\"));\n correct_answer = words.getString(words.getColumnIndex(\"meaning\"));\n question_text.setText(word + \" means:\");\n for (int i = 0; i < 4; i++){\n answers[i] = words.getString(words.getColumnIndex(\"meaning\"));\n words.moveToNext();\n }\n answers = randomizeArray(answers);\n for (int i = 0; i < 4; i++){\n rb = (RadioButton) findViewById(options[i]);\n rb.setText(answers[i]);\n }\n question_displayed_count++;\n }", "public void setCurrentQuestion(Question question) {\n\t\tcurrentQuestion = question;\n\t}", "public void setQuestionType(Integer questionType) {\n this.questionType = questionType;\n }", "public void setInput1(final String input1) {\n this.input1 = input1;\n }", "public void setSide1(String side1) {\n \tthis.side1 = side1;\n }", "public void setQuestion(){\n String welcomeTextString = \"Welcome \" + getIntent().getStringExtra(\"name\") + \"!\";\n welcomeText.setText(welcomeTextString);\n\n //Setting Question title, description, and answers\n questionTitle.setText(questions[currentQuestion-1][0]);\n questionDescription.setText(questions[currentQuestion-1][1]);\n ans1.setText(questions[currentQuestion-1][2]);\n ans2.setText(questions[currentQuestion-1][3]);\n ans3.setText(questions[currentQuestion-1][4]);\n\n //Save correct answer\n correctAnswer = questions[currentQuestion-1][5];\n\n //Set progress bar and progress text\n progressBar.setProgress(currentQuestion);\n progressText.setText(currentQuestion.toString() + \"/5\");\n\n //Clear selection of buttons if any are already selected\n ans1.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n ans2.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n ans3.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n }", "public void setQuestions() {\n\t\tString question1 = str1 + _QwdQuestionFst;\n\t\tSpannableString sb1 = new SpannableString(question1);\n\t\tsb1.setSpan(new ForegroundColorSpan(Color.BLACK), str1.length() ,\n\t\t\t\tsb1.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);\n\t\t_FPTV_Question_1.setText(sb1);\n\n\t\tString question2 = str2 + _QwdQuestionSec;\n\t\tSpannableString sb2 = new SpannableString(question2);\n\t\tsb2.setSpan(new ForegroundColorSpan(Color.BLACK), str2.length() ,\n\t\t\t\tsb2.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);\n\t\t_FPTV_Question_2.setText(sb2);\n\t}", "public ListBoxMVP getSecurityQuestion2() {\r\n\t\treturn securityQuestion2;\r\n\t}", "private void ans1Option() {\n RadioButton radioButtonA = (RadioButton) findViewById(R.id.radio_button_A);\n RadioButton radioButtonB = (RadioButton) findViewById(R.id.radio_button_B);\n RadioButton radioButtonC = (RadioButton) findViewById(R.id.radio_Button_C);\n RadioButton radioButtonD = (RadioButton) findViewById(R.id.radio_Button_D);\n radioButtonA.setText(R.string.que1Opt1);\n radioButtonB.setText(R.string.que1Opt2);\n radioButtonC.setText(R.string.que1Opt3);\n radioButtonD.setText(R.string.que1Opt4);\n }", "public void setValue1(final java.lang.String value1) {\n this.value1 = value1;\n }", "public void setSecurityQuestion3(ListBoxMVP securityQuestion3) {\r\n\t\tthis.securityQuestion3 = securityQuestion3;\r\n\t}", "public void setQuestionText(String questionText) {\n this.questionText = questionText;\n }", "public void setQuestionNumber(int questionNumber) {\r\n\t\tthis.questionNumber = questionNumber;\r\n\t}", "public boolean setQuiz2(double quiz2)\n\t{\n\t\tboolean isValid;\n\t\t\n\t\tisValid = isValidQuiz2(quiz2);\n\t\t\n\t\tif(isValid)\n\t\t{\n\t\t\tthis.quiz2 = quiz2;\n\t\t}\n\t\t\n\t\treturn isValid;\n\t}", "@Override\n public void setQuestion(Question question) {\n super.setQuestion(question);\n\n options = ((MultipleChoiceQuestionResponse) question.getCorrectAnswer()).getChoices();\n for (int i = 0; i < options.size(); i ++) {\n String option = options.get(i);\n RadioButton button = new RadioButton(option);\n button.setToggleGroup(group);\n\n button.setLayoutY(i * 30);\n choices.getChildren().add(button);\n }\n }", "private void setCurrentQuestion(){\n\tfor(int i=0; i<QuestionsTree.length;i++){\n\t\tif(QuestionsTree[i][0].equals(currentRule)){\n\t\t\tcurrentQuestion = QuestionsTree[i][1];\n\t\t}\n\t}\n}", "public void setOkToAddQuestion(String string) {\r\n\t\t_okToAddQuestion = string;\r\n\t}", "public void setTaxNumber1(\n @Nullable\n final String taxNumber1) {\n rememberChangedField(\"TaxNumber1\", this.taxNumber1);\n this.taxNumber1 = taxNumber1;\n }", "private void secQuestionInput()\n {\n if(textBox1.getText().equals(user.getSecretQAns()))\n {\n secQuestion = false;\n password = true;\n\n textBox1.setText(\"\");\n textBox1.promptTextProperty().set(\"New Password\");\n labelHeader.setText(\"Input new password\");\n\n textBox2Label.setVisible(true);\n textBox2Label.setText(\"Confirm New Password\");\n textBox2.setVisible(true);\n textBox1Label.setText(\"New Password\");\n }\n else\n {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setContentText(\"Security answer does not match!\");\n alert.show();\n }\n }", "public void setForgottenPasswordQuestion2(String forgottenPasswordQuestion2) {\n\t\tthis.forgottenPasswordQuestion2 = forgottenPasswordQuestion2;\n\t}", "public String getAnswerText1() {\r\n\t\treturn answerText1;\r\n\t}", "private void setS1Ip(int value) {\n \n s1Ip_ = value;\n }", "public void setSingleChoices() {\r\n Random randomGenerator = new Random();\r\n int singleAnswer = randomGenerator.nextInt(4);\r\n studentAnswer.add(singleAnswer); }", "public void setQuestion(Question v) {\n if (Problem_Type.featOkTst && ((Problem_Type)jcasType).casFeat_question == null)\n jcasType.jcas.throwFeatMissing(\"question\", \"hw1.qa.Problem\");\n jcasType.ll_cas.ll_setRefValue(addr, ((Problem_Type)jcasType).casFeatCode_question, jcasType.ll_cas.ll_getFSRef(v));}", "public void setX1(int x1) {\n\t\tthis.x1 = x1;\n\t\tfireListenerSignal();\n\t}", "public void setP1Card1(Card p1Card1){\n\t\tthis.p1Card1 = p1Card1;\n\t\trepaint();\n\t}", "private void setQuestion(int number) {\n questionPlaceholder.setText(questionsList.get(number).getQuestion());\n }", "public Builder setS1(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n s1_ = value;\n onChanged();\n return this;\n }", "public void setA1(int a1)\n {\n this.a1 = a1;\n }", "public void setQuestionType(String questionType) {\n this.questionType = questionType;\n }", "private void setS1Rsp(PToP.S1Rsp value) {\n if (value == null) {\n throw new NullPointerException();\n }\n rsp_ = value;\n rspCase_ = 22;\n }", "public void setName(String name1) {\r\n this.name = name1;\r\n }", "public DecideQuestion(){\n\t\tsuper(0); /** call relation -> PromptQuestion.java */\n\t}", "public int questionOne() {\n RadioButton answerOne = findViewById ( R.id.q1_a1 );\n\n if (answerOne.isChecked ()) {\n score = 1;\n } else score = 0;\n return score;\n }", "public void setQuestion(int index, String question){\n if (question == null || question.equals(\"\")) {\n System.out.println(\"Question cannot be empty.\");\n }\n else {\n questionList.set(index, question);\n }\n }", "public void question() {\n\t\tlead.answer(this);\n\t}", "public String getForgottenPasswordAnswer1() {\n\t\treturn forgottenPasswordAnswer1;\n\t}", "public void configSurvey() {\n if (isTest) {\n this.o.setDisplay(\"Please enter name for test: \");\n } else {\n this.o.setDisplay(\"Please enter name for survey \");\n }\n this.o.getDisplay();\n this.survey.setName(this.in.getUserInput());\n }", "private void setQuestion(int number){\n tv_question.setText(questionsList.get(number).getQuestion());\n\n }", "public void setQuestionID(int questionID) {\n this.questionID = questionID;\n }", "private void setQuestionView()\n\t{\n txtQNumber.setText(qid + 1 + \"/\" + numberOfQuestions);\n\t\ttxtQuestion.setText(currentQ.getQUESTION());\n\t\ttxtReference.setText(currentQ.getREFERENCE());\n\t\trda.setText(currentQ.getOPTA());\n\t\trdb.setText(currentQ.getOPTB());\n\t\trdc.setText(currentQ.getOPTC());\n\t\trdd.setText(currentQ.getOPTD());\n\t\tqid++;\n\t}", "public String getPollAnswer1() {\n return pollAnswer1;\n }", "private void updateStudentSecurityInfo() {\n\t\t\n\t\tstudent.setPassword(sPasswordPF1.getPassword());\n\t\tstudent.setSecuirtyAnswer1(sSecurityQ1TF.getText());\n\t\tstudent.setSecurityQuestion1((String)sSecurityList1.getSelectedItem());\n\t\tstudent.setSecurityAnswer2(sSecurityQ2TF.getText());\n\t\tstudent.setSecurityQuestion2((String)sSecurityList1.getSelectedItem());\n\t\t\n\t\t//Update Student security information in database\n\t\t\n\t}", "public void setQuestions(Vector<Question> q){\n\t\t\tquestions = q;\n\t\t}", "public void setUser1_ID(int User1_ID) {\n\t\tif (User1_ID <= 0)\n\t\t\tset_Value(\"User1_ID\", null);\n\t\telse\n\t\t\tset_Value(\"User1_ID\", new Integer(User1_ID));\n\t}", "public void setP1(Player p1) {\n this.p1 = p1;\n }", "Question(String ques, String opt1, String opt2, String opt3, String opt4) {\n this.ques = ques;\n this.opt1 = opt1;\n this.opt2 = opt2;\n this.opt3 = opt3;\n this.opt4 = opt4;\n }", "public void setQuestion(final List<Question> question) {\n\t\tthis.question = question;\n\t}", "public void setExaminationType(ExaminationType_type1 param){\n \n this.localExaminationType=param;\n \n\n }", "public ListBoxMVP getSecurityQuestion3() {\r\n\t\treturn securityQuestion3;\r\n\t}", "private void initSecurityQuestionModel() {\n for (Integer i = 1; i <= NUMBER_SECURITY_QUESTIONS; i++) {\n final StringBuffer key = new StringBuffer(\"SecurityQuestion.\").append(i.toString());\n securityQuestionModel.addElement(getString(key.toString()));\n }\n }", "public void setPra1(String pra1) {\n this.pra1 = pra1 == null ? null : pra1.trim();\n }", "public void setSide1(double side1) {\r\n\t\tthis.side1 = side1;\r\n\t}", "public void setJoueur1(String joueur1) {\r\n\t\tthis.joueur1 = joueur1;\r\n\t}", "private void setP1( Point p1 ){\n this.p1=p1;\n }", "public void setReserved1(boolean value)\n {\n field_1_options = reserved1.setShortBoolean(field_1_options, value);\n }", "private void updateQuestion()//update the question each time\n\t{\n\t\tInteger num = random.nextInt(20);\n\t\tcurrentAminoAcid = FULL_NAMES[num];\n\t\tcurrentShortAA= SHORT_NAMES[num];\n\t\tquestionField.setText(\"What is the ONE letter name for:\");\n\t\taminoacid.setText(currentAminoAcid);\n\t\tanswerField.setText(\"\");\n\t\tvalidate();\n\t}", "@FXML\n\tprivate void answerQuestion() {\n\t\tint correctAnsID = 0;\n\t\ttry {\n\t\t\tswitch (((RadioButton) answerGroup.getSelectedToggle()).getId()) {\n\t\t\tcase \"ans1Check\":\n\t\t\t\tcorrectAnsID = 1;\n\t\t\t\tbreak;\n\t\t\tcase \"ans2Check\":\n\t\t\t\tcorrectAnsID = 2;\n\t\t\t\tbreak;\n\t\t\tcase \"ans3Check\":\n\t\t\t\tcorrectAnsID = 3;\n\t\t\t\tbreak;\n\t\t\tcase \"ans4Check\":\n\t\t\t\tcorrectAnsID = 4;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\terrorLabel.setVisible(true);\n\t\t}\n\n\t\t// nothing is selected\n\t\tif (correctAnsID == 0) { \n\t\t\terrorLabel.setVisible(true);\n\t\t\t// correct answer\n\t\t} else if (question.getCorrect_ans() == correctAnsID) {\n\t\t\tcontrol.setScore(control.getScore() + question.getScore());\n\t\t\thandleAlertAndWindow(AlertType.INFORMATION, \"Congrats! :D\",\n\t\t\t\t\t\"You received \" + question.getScore() + \" points\");\n\t\t\t// wrong answer\n\t\t} else {\n\t\t\tcontrol.setScore(control.getScore() + question.getPenalty());\n\n\t\t\thandleAlertAndWindow(AlertType.ERROR, \"Uh oh! :(\",\n\t\t\t\t\t\"You lost \" + question.getPenalty() + \" points\");\n\t\t}\n\n\t\t// reset the eaten question\n\t\tViewLogic.playGameController.getControl().setQuestionEaten(null);\n\t}", "@Override\n\tpublic void onQaQuestion(QaQuestion arg0, int arg1) {\n\t\t\n\t}", "private void setOperand1() {\n\t\ttext_Result.setText(\"\"); // Any change of an operand probably invalidates\n\t\tlabel_Result.setText(\"Result\"); // the result, so we clear the old result.\n\t\tlabel_errResult.setText(\"\");\n\t\tif (perform.setOperand1(text_Operand1.getText())) { // Set the operand and see if there was an error\n\t\t\tlabel_errOperand1.setText(\"\"); // If no error, clear this operands error\n\t\t\toperand1ErrPart1.setText(\"\"); // Clear the first term of error part\n\t\t\toperand1ErrPart2.setText(\"\"); // Clear the second term of error part\n\t\t\tif (text_Operand2.getText().length() == 0) // If the other operand is empty, clear its error\n\t\t\t\tlabel_errOperand2.setText(\"\"); // as well.\n\t\t} else // If there's a problem with the operand, display\n\t\t\terr1();\n\t}", "public java.lang.String getQ1Label() {\n return q1Label;\n }", "public void setQuestion(int questionId) {\n\n if (questionId < 10) {\n TextView questionNumber = (TextView) findViewById(R.id.QuestionNumber);\n questionNumber.setText(\"Question \" + (questionId + 1));\n TextView question = (TextView) findViewById(R.id.txtQuestion);\n question.setText(roundOne[questionId].getQuestion());\n // set coins\n TextView coinsTextView = (TextView)findViewById(R.id.TxtCoins);\n\n //better approuch than .tostring()\n coinsTextView.setText(String.valueOf(score));\n } else {\n //make new preferences for score\n sharePrefsScore = contextScore.getSharedPreferences(SCORE_PREFS, contextScore.MODE_PRIVATE);\n editorScore = sharePrefsScore.edit();\n\n // Score to pass it trough shared prefs\n editor.putString(\"SCORE\", String.valueOf(score) );\n editor.commit();\n\n //go to new Activity\n Intent roudnTwoActivty = new Intent(getApplicationContext(), RoundTwoActivity.class);\n startActivity(roudnTwoActivty);\n\n }\n\n }", "@Override\n\tpublic int getAnswerNum() {\n\t\treturn 1;\n\t}", "public void setCsp_General_1(java.lang.String csp_General_1) {\n this.csp_General_1 = csp_General_1;\n }", "public void setSpare1(String spare1) {\r\n this.spare1 = spare1;\r\n }", "@Click(R.id.bt_answer1)\n void clickAnswer1() {\n selectedAnswer = questionList.get(questionProgress - 1).getAnswers().get(0);\n showResult();\n }", "public void setOkToCancelQuestion(String string) {\r\n\t\t_okToCancelQuestion = string;\r\n\t}", "public void hintMessage1(View view) {\n makeAToast(R.string.question_1_hint);\n }", "public void selectChangeSecurityQuestionsOption() {\n\t\ttry {\n\t\t\n\t\t\t//Utility.wait(changeSecurityQuestions);\n\t\t\tchangeSecurityQuestions.click();\n\t\t\tUtility.simpleWait(6000);\n\t\t\tLog.addMessage(\"Change Security Questions option selected\");\n\t\t}catch(Exception e) {\n\t\t\tLog.addMessage(\"Failed to select Change Security Questions option\");\n\t\t\tSystem.out.println(e.getMessage().toString());\n\t\t\tAssert.assertTrue(false, \"Failed to slect Change Security Questions option\");\n\t\t}\n\t}", "public Question(String firstPrompt, int minScale, int maxScale, String secondPrompt){\r\n this.firstPrompt = firstPrompt;\r\n this.minScale = minScale;\r\n this.maxScale = maxScale;\r\n this.secondPrompt = secondPrompt;\r\n }", "public void setTestQuestion(java.lang.String testQuestion) {\r\n this.testQuestion = testQuestion;\r\n }" ]
[ "0.7492301", "0.734865", "0.6841181", "0.6808831", "0.66929024", "0.66602886", "0.6595231", "0.6242315", "0.6228239", "0.6199963", "0.6179311", "0.60861975", "0.6004494", "0.59767896", "0.5968999", "0.5940167", "0.5915046", "0.5893182", "0.5892916", "0.58756465", "0.5859934", "0.5822836", "0.5782806", "0.5766404", "0.5761785", "0.5759651", "0.5752452", "0.57505834", "0.57496", "0.5718832", "0.5695865", "0.5690795", "0.564706", "0.56381536", "0.5623486", "0.5602639", "0.55996495", "0.5592434", "0.55430466", "0.5542169", "0.553326", "0.5509841", "0.55051225", "0.54871535", "0.5469788", "0.54562193", "0.54522", "0.54516256", "0.5449103", "0.54442966", "0.5443578", "0.5438265", "0.5436108", "0.54346645", "0.5426705", "0.54244274", "0.5410502", "0.5409617", "0.54046893", "0.5369843", "0.5369475", "0.5363588", "0.5358575", "0.5355964", "0.5352177", "0.53414917", "0.53398585", "0.5329386", "0.5318187", "0.53092945", "0.5305143", "0.5301744", "0.5287944", "0.5278715", "0.5277185", "0.5273706", "0.52656007", "0.5265048", "0.5250207", "0.5243256", "0.52414304", "0.5238551", "0.52375776", "0.5230901", "0.52307814", "0.5217877", "0.5215772", "0.5201652", "0.5197482", "0.5193206", "0.5191381", "0.5175787", "0.51756525", "0.5172775", "0.5168163", "0.5162538", "0.5148548", "0.5147201", "0.51468545", "0.5144943" ]
0.7039467
2
Gets the security question2.
public ListBoxMVP getSecurityQuestion2() { return securityQuestion2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getQuiz2()\n\t{\n\t\treturn this.quiz2;\n\t}", "public String getSecurity_question() \r\n {\r\n return security_question;\r\n }", "public String getPollAnswer2() {\n return pollAnswer2;\n }", "public String getAnswerText2() {\r\n\t\treturn answerText2;\r\n\t}", "public String getForgottenPasswordQuestion2() {\n\t\treturn forgottenPasswordQuestion2;\n\t}", "public String getSecurityQuestion() {\n return securityQuestion;\n }", "public ListBoxMVP getSecurityQuestion3() {\r\n\t\treturn securityQuestion3;\r\n\t}", "public String getSecurityAnswer() {\n return securityAnswer;\n }", "public String getHint2() {\n return this.hint2;\n }", "public String getForgottenPasswordAnswer2() {\n\t\treturn forgottenPasswordAnswer2;\n\t}", "public java.lang.String getSecondary2() {\n return secondary2;\n }", "@AutoEscape\n\tpublic String getSecurity_question();", "public PToP.S2InfoReq getS2InfoReq() {\n return instance.getS2InfoReq();\n }", "public java.lang.String getQ2Label() {\n return q2Label;\n }", "public String getPra2() {\n return pra2;\n }", "public PToP.S2ARsp getS2Rsp() {\n return instance.getS2Rsp();\n }", "public int getInput2() {\n return input2;\n }", "public String getInput2() {\n return input2;\n }", "public String getRemarks2() {\n return remarks2;\n }", "public PToP.S2ARsp getS2Rsp() {\n if (rspCase_ == 23) {\n return (PToP.S2ARsp) rsp_;\n }\n return PToP.S2ARsp.getDefaultInstance();\n }", "public String getTrait2_j() {\n \t\treturn trait2;\n \t}", "public String getExtra2() {\n return extra2;\n }", "@AutoEscape\n\tpublic String getSecurity_answer();", "public PToP.AS2Req getAS2Req() {\n return instance.getAS2Req();\n }", "@Override\n\tpublic String toString() {\n\t\treturn security_questionId+\" \"+security_question;\n\t}", "public java.lang.String getLevel2Eligible() {\r\n return level2Eligible;\r\n }", "public ResourcesOrPoints getGive2() {\n\t\treturn give2;\n\t}", "public byte getP2() {\n return this.apdu_buffer[P2];\n }", "public PToP.S2InfoReq getS2InfoReq() {\n if (reqCase_ == 17) {\n return (PToP.S2InfoReq) req_;\n }\n return PToP.S2InfoReq.getDefaultInstance();\n }", "public ResultPoint getRp2() {\n return rp2;\n }", "private String extractSecurityQuestion() {\n // NOTE JComboBox.getSelectedItem() will not catch keyboard edits as they are typed,\n // so JComboBox.getEditor().getItem() is used.\n String securityQuestion = ((String) securityQuestionJComboBox.getEditor().getItem()).trim();\n if (isEmpty(securityQuestion)) {\n return null;\n } else {\n return securityQuestion;\n }\n }", "public PToP.S2InfoRelay getS2InfoRsp() {\n return instance.getS2InfoRsp();\n }", "public java.lang.String getRemark2()\r\n {\r\n return _remark2;\r\n }", "public double getOperand2()\r\n\t{\r\n\t\tSystem.out.println(\"enter the operand 2:\");\r\n\t\tdouble op2=sc.nextDouble();\r\n\t\treturn op2;\r\n\t}", "public int getRecord2(){\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.getContext()); return prefs.getInt(\"record2\", -1);\n }", "public String getApellido2() {\r\n\t\treturn apellido2;\r\n\t}", "private String extractSecurityAnswer() {\n return SwingUtil.extract(securityAnswerJTextField, Boolean.TRUE);\n }", "public String getDescription2() {\r\n return description2;\r\n }", "public long[][] getS2() {\n\t\treturn S2;\n\t}", "public void setSecurityQuestion2(ListBoxMVP securityQuestion2) {\r\n\t\tthis.securityQuestion2 = securityQuestion2;\r\n\t}", "PToP.S2InfoReq getS2InfoReq();", "public java.lang.String getValue2() {\n return this.value2;\n }", "public double getSide2() {\r\n\t\treturn side2;\r\n\t}", "public String getINSTRUCTIONS2() {\r\n return INSTRUCTIONS2;\r\n }", "public void setForgottenPasswordQuestion2(String forgottenPasswordQuestion2) {\n\t\tthis.forgottenPasswordQuestion2 = forgottenPasswordQuestion2;\n\t}", "public java.lang.String getCsp_General_2() {\n return csp_General_2;\n }", "public String getOther2() {\n return other2;\n }", "public String getSupBytxt2() {\n return supBytxt2;\n }", "public String getFreeuse2() {\n return freeuse2;\n }", "public String getUser2()\n {\n return userInput2;\n }", "public int getScorePlayer2() {\n\t\treturn this.scorePlayer2;\n\t}", "public java.lang.String getS2() {\n java.lang.Object ref = s2_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n s2_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getId2() {\n return id2;\n }", "public int getSt2() {\r\n\t\treturn this.st2;\r\n\t}", "@Click(R.id.bt_answer2)\n void clickAnswer2() {\n selectedAnswer = questionList.get(questionProgress - 1).getAnswers().get(1);\n showResult();\n }", "public String getSide2() { return side2; }", "public String getFreeuse2() {\n\t\treturn freeuse2;\n\t}", "public PToP.AS2Req getAS2Req() {\n if (reqCase_ == 16) {\n return (PToP.AS2Req) req_;\n }\n return PToP.AS2Req.getDefaultInstance();\n }", "public String getSpare2() {\r\n return spare2;\r\n }", "public ResourcesOrPoints getReceive2() {\n\t\treturn receive2;\n\t}", "public String getAttribute2() {\n return (String) getAttributeInternal(ATTRIBUTE2);\n }", "public String getAttribute2() {\n return (String)getAttributeInternal(ATTRIBUTE2);\n }", "public String getAttribute2() {\n return (String)getAttributeInternal(ATTRIBUTE2);\n }", "public String getAttribute2() {\n return (String)getAttributeInternal(ATTRIBUTE2);\n }", "public String getAttribute2() {\n return (String)getAttributeInternal(ATTRIBUTE2);\n }", "public String getAttribute2() {\n return (String)getAttributeInternal(ATTRIBUTE2);\n }", "public PToP.S2InfoRelay getS2InfoRsp() {\n if (rspCase_ == 25) {\n return (PToP.S2InfoRelay) rsp_;\n }\n return PToP.S2InfoRelay.getDefaultInstance();\n }", "public String getAttribute2()\n {\n return (String)getAttributeInternal(ATTRIBUTE2);\n }", "public Alternatives getAlternatives_2() { return cAlternatives_2; }", "public Alternatives getAlternatives_2() { return cAlternatives_2; }", "public byte getP2() {\n\treturn (byte) (header[3] & 0xFF);\n }", "public java.lang.String getReference2() {\n return reference2;\n }", "public java.lang.String getS2() {\n java.lang.Object ref = s2_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n s2_ = s;\n }\n return s;\n }\n }", "public String reservedString2() {\n return this.reservedString2;\n }", "public String reservedString2() {\n return this.reservedString2;\n }", "public java.lang.Integer getPRTNO2() {\n return PRTNO2;\n }", "public String getAttribute2() {\n return attribute2;\n }", "public java.lang.String getCurr2() {\n\treturn curr2;\n}", "public ServerPlayer getP2() {\r\n\t\treturn p2;\r\n\t}", "public byte[] getChallenge(HwKeyGenParameterSpec mSpec2) {\n return mSpec2.getAttestationChallenge();\n }", "public int getY2() {\n\t\treturn y2;\n\t}", "public String getText2() {\n return text2;\n }", "public String getPollAnswer1() {\n return pollAnswer1;\n }", "public Integer getSecurity() {\n return security;\n }", "public String getCVV2()\n\t{\n\t\tif(response.containsKey(\"CVV2\")) {\n\t\t\treturn response.get(\"CVV2\");\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public java.lang.String getControlNumberLevel2() {\n return controlNumberLevel2;\n }", "public String getCategory2() {\n return category2;\n }", "public java.lang.String getControlNumberLevel2() {\n return controlNumberLevel2;\n }", "public String getJoueur2() {\r\n\t\treturn joueur2;\r\n\t}", "public double getQuiz1()\n\t{\n\t\treturn this.quiz1;\n\t}", "public int getData2() {\n return data2_;\n }", "public int getData2() {\n return data2_;\n }", "public Point2D getPoint2() {\n return this.point2;\n }", "public java.lang.Integer getParameterType2() {\r\n return parameterType2;\r\n }", "public void setAnswerText2(String answerText2) {\r\n\t\tthis.answerText2 = answerText2;\r\n\t}", "public String getImg_2() {\n return img_2;\n }", "public String getChoice2(int a){\n String choice1 = choices[a][1];\n return choice1;\n }", "public Integer getWishPosTypeid2() {\n return wishPosTypeid2;\n }", "public Double getY2() {\n\t\treturn y2;\n\t}", "public double getSolutionX2() {\n this.polySolve();\n if (this.real) {\n return this.x2;\n } else {\n return 0010;\n }\n\n }" ]
[ "0.70728046", "0.70387876", "0.69565934", "0.68308663", "0.68240416", "0.6762272", "0.66466475", "0.66275644", "0.6600405", "0.6422495", "0.6265956", "0.6260931", "0.62550074", "0.61796397", "0.61625916", "0.6068399", "0.6010646", "0.6007135", "0.6005774", "0.5961819", "0.5950657", "0.59365827", "0.59331053", "0.59179074", "0.5897605", "0.58767474", "0.58749115", "0.58740276", "0.58637685", "0.5863493", "0.58632207", "0.5855097", "0.58532494", "0.5827923", "0.5817234", "0.5800984", "0.5784926", "0.57701397", "0.5770073", "0.57506716", "0.57372916", "0.5736334", "0.5732976", "0.57284325", "0.57145494", "0.5714035", "0.5692731", "0.5687418", "0.5684699", "0.5681353", "0.5676276", "0.565626", "0.56448346", "0.5642735", "0.5640923", "0.5636749", "0.5628148", "0.5626047", "0.56108797", "0.56105745", "0.5586219", "0.55814254", "0.55814254", "0.55814254", "0.55814254", "0.55814254", "0.55713356", "0.5568815", "0.5567725", "0.5567725", "0.5556497", "0.5550732", "0.55479395", "0.55476165", "0.55476165", "0.55467385", "0.5541327", "0.553547", "0.553419", "0.55328894", "0.553218", "0.553149", "0.5526477", "0.55236334", "0.55142844", "0.55133384", "0.5509304", "0.55082434", "0.550639", "0.54653585", "0.5464919", "0.5464919", "0.545691", "0.54555064", "0.54552954", "0.545178", "0.5451557", "0.5432529", "0.5426452", "0.5421289" ]
0.80205625
0
Sets the security question2.
public void setSecurityQuestion2(ListBoxMVP securityQuestion2) { this.securityQuestion2 = securityQuestion2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setSecurity_question(String security_question);", "public ListBoxMVP getSecurityQuestion2() {\r\n\t\treturn securityQuestion2;\r\n\t}", "public boolean setQuiz2(double quiz2)\n\t{\n\t\tboolean isValid;\n\t\t\n\t\tisValid = isValidQuiz2(quiz2);\n\t\t\n\t\tif(isValid)\n\t\t{\n\t\t\tthis.quiz2 = quiz2;\n\t\t}\n\t\t\n\t\treturn isValid;\n\t}", "public void setForgottenPasswordQuestion2(String forgottenPasswordQuestion2) {\n\t\tthis.forgottenPasswordQuestion2 = forgottenPasswordQuestion2;\n\t}", "public void setSecurity_answer(String security_answer);", "public void setAnswerText2(String answerText2) {\r\n\t\tthis.answerText2 = answerText2;\r\n\t}", "public void setSecurityQuestion(String securityQuestion) {\n this.securityQuestion = securityQuestion;\n }", "public void setSecurityAnswer(String securityAnswer) {\n this.securityAnswer = securityAnswer;\n }", "public void setForgottenPasswordAnswer2(String forgottenPasswordAnswer2) {\n\t\tthis.forgottenPasswordAnswer2 = forgottenPasswordAnswer2;\n\t}", "public void setSecurityQuestion1(ListBoxMVP securityQuestion1) {\r\n\t\tthis.securityQuestion1 = securityQuestion1;\r\n\t}", "public void setTrait2(String trait2) {\n \t\tthis.trait2 = trait2;\n \t}", "public void setInput2(int input2) {\n this.input2 = input2;\n }", "public void setQ2Label(java.lang.String q2Label) {\n this.q2Label = q2Label;\n }", "public void setSide2(String side2) {\n \tthis.side2 = side2;\n }", "public void setP2Card2(Card p2Card2){\n\t\tthis.p2Card2 = p2Card2;\n\t\trepaint();\n\t}", "public String getSecurity_question() \r\n {\r\n return security_question;\r\n }", "private void updateStudentSecurityInfo() {\n\t\t\n\t\tstudent.setPassword(sPasswordPF1.getPassword());\n\t\tstudent.setSecuirtyAnswer1(sSecurityQ1TF.getText());\n\t\tstudent.setSecurityQuestion1((String)sSecurityList1.getSelectedItem());\n\t\tstudent.setSecurityAnswer2(sSecurityQ2TF.getText());\n\t\tstudent.setSecurityQuestion2((String)sSecurityList1.getSelectedItem());\n\t\t\n\t\t//Update Student security information in database\n\t\t\n\t}", "public void setInput2(final String input2) {\n this.input2 = input2;\n }", "public void setSecurityQuestion3(ListBoxMVP securityQuestion3) {\r\n\t\tthis.securityQuestion3 = securityQuestion3;\r\n\t}", "private void setP2( Point p2 ){\n this.p2=p2;\n }", "public String getForgottenPasswordQuestion2() {\n\t\treturn forgottenPasswordQuestion2;\n\t}", "public void setTaxNumber2(\n @Nullable\n final String taxNumber2) {\n rememberChangedField(\"TaxNumber2\", this.taxNumber2);\n this.taxNumber2 = taxNumber2;\n }", "public void setValue2(final java.lang.String value2) {\n this.value2 = value2;\n }", "private void updateTeacherSecurityInfo() {\n\t\t\n\t\tteacher.setPassword(tOldPasswordPF.getPassword());\n\t\tteacher.setSecuirtyAnswer1(tSecurityQ1TF.getText());\n\t\tteacher.setSecurityQuestion1((String)tSecurityList1.getSelectedItem());\n\t\tteacher.setSecurityAnswer2(tSecurityQ2TF.getText());\n\t\tteacher.setSecurityQuestion2((String)tSecurityList1.getSelectedItem());\n\t\t\n\t\t//Update Teacher security information in database\n\t\t\n\t}", "public void setA2(int a2)\n {\n this.a2 = a2;\n }", "public String getSecurityQuestion() {\n return securityQuestion;\n }", "public void setIndustryCode2(\n @Nullable\n final String industryCode2) {\n rememberChangedField(\"IndustryCode2\", this.industryCode2);\n this.industryCode2 = industryCode2;\n }", "public String getPollAnswer2() {\n return pollAnswer2;\n }", "public Builder setS2(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n s2_ = value;\n onChanged();\n return this;\n }", "public void setX2(int x2) {\n\t\tthis.x2 = x2;\n\t\tfireListenerSignal();\n\t}", "public void setAnswer1(String answer1) {\r\n this.answer1 = answer1;\r\n }", "@Click(R.id.bt_answer2)\n void clickAnswer2() {\n selectedAnswer = questionList.get(questionProgress - 1).getAnswers().get(1);\n showResult();\n }", "private void secQuestionInput()\n {\n if(textBox1.getText().equals(user.getSecretQAns()))\n {\n secQuestion = false;\n password = true;\n\n textBox1.setText(\"\");\n textBox1.promptTextProperty().set(\"New Password\");\n labelHeader.setText(\"Input new password\");\n\n textBox2Label.setVisible(true);\n textBox2Label.setText(\"Confirm New Password\");\n textBox2.setVisible(true);\n textBox1Label.setText(\"New Password\");\n }\n else\n {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setContentText(\"Security answer does not match!\");\n alert.show();\n }\n }", "public ListBoxMVP getSecurityQuestion3() {\r\n\t\treturn securityQuestion3;\r\n\t}", "public void setY2(int y2) {\n\t\tthis.y2 = y2;\n\t\tfireListenerSignal();\n\t}", "public void setSide2(double side2) {\r\n\t\tthis.side2 = side2;\r\n\t}", "public String getAnswerText2() {\r\n\t\treturn answerText2;\r\n\t}", "public void setP2(Player p2) {\n this.p2 = p2;\n }", "@Override\n\tpublic void setField2(boolean field2) {\n\t\t_second.setField2(field2);\n\t}", "public String getSecurityAnswer() {\n return securityAnswer;\n }", "public void setUser2_ID(int User2_ID) {\n\t\tif (User2_ID <= 0)\n\t\t\tset_Value(\"User2_ID\", null);\n\t\telse\n\t\t\tset_Value(\"User2_ID\", new Integer(User2_ID));\n\t}", "public void setNomorSK2 (String NomorSK2);", "public void setP2Card1(Card p2Card1){\n\t\tthis.p2Card1 = p2Card1;\n\t\trepaint();\n\t}", "@AutoEscape\n\tpublic String getSecurity_question();", "public void setP2(ServerPlayer p2) {\r\n\t\tthis.p2 = p2;\r\n\t}", "public void setSecondary2(java.lang.String secondary2) {\n this.secondary2 = secondary2;\n }", "public void setExtra2(String extra2) {\n this.extra2 = extra2;\n }", "public String getForgottenPasswordAnswer2() {\n\t\treturn forgottenPasswordAnswer2;\n\t}", "protected void setP2(byte p2) {\n\theader[3] = p2;\n }", "private void setOperand2() {\n\t\ttext_Result.setText(\"\");\n\t\tlabel_Result.setText(\"Result\");\n\t\tlabel_errResult.setText(\"\");\n\t\tif (perform.setOperand2(text_Operand2.getText())) {\n\t\t\tlabel_errOperand2.setText(\"\");\n\t\t\toperand2ErrPart1.setText(\"\"); // Clear the first term of error part\n\t\t\toperand2ErrPart2.setText(\"\"); // Clear the second term of error part\n\t\t\tif (text_Operand1.getText().length() == 0)\n\t\t\t\tlabel_errOperand1.setText(\"\");\n\t\t} else\n\t\t\terr2();\n\t}", "public double getQuiz2()\n\t{\n\t\treturn this.quiz2;\n\t}", "public void setC2(java.lang.String c2)\n {\n this.c2 = c2;\n }", "public void setImg_2(String img_2) {\n this.img_2 = img_2;\n }", "public void setQuestion(String newQuestion) {\n question = newQuestion;\n }", "public void setValue2(Object value2) { this.value2 = value2; }", "public void setC2(Boolean c2) {\n\t\tthis.c2 = c2;\n\t}", "public void setDescription2(String description2) {\r\n this.description2 = description2;\r\n }", "void setPos2(Vector2 pos2) {\n\t\tthis.pos2 = pos2;\n\t}", "private void setS2InfoReq(PToP.S2InfoReq value) {\n if (value == null) {\n throw new NullPointerException();\n }\n req_ = value;\n reqCase_ = 17;\n }", "public void setAttr2(String attr2) {\n this.attr2 = attr2;\n }", "public void setAttr2(String attr2) {\n this.attr2 = attr2;\n }", "private void setVoterID(String[] voterID2)\n\t{\n\t\tthis.voterID = voterID2;\n\t}", "public void selectChangeSecurityQuestionsOption() {\n\t\ttry {\n\t\t\n\t\t\t//Utility.wait(changeSecurityQuestions);\n\t\t\tchangeSecurityQuestions.click();\n\t\t\tUtility.simpleWait(6000);\n\t\t\tLog.addMessage(\"Change Security Questions option selected\");\n\t\t}catch(Exception e) {\n\t\t\tLog.addMessage(\"Failed to select Change Security Questions option\");\n\t\t\tSystem.out.println(e.getMessage().toString());\n\t\t\tAssert.assertTrue(false, \"Failed to slect Change Security Questions option\");\n\t\t}\n\t}", "public void setSpare2(String spare2) {\r\n this.spare2 = spare2;\r\n }", "public void setReserved2(short value)\n {\n field_1_options = reserved2.setShortValue(field_1_options, value);\n }", "public void setResolution2(org.astrogrid.stc.coords.v1_10.beans.Size2Type resolution2)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.astrogrid.stc.coords.v1_10.beans.Size2Type target = null;\n target = (org.astrogrid.stc.coords.v1_10.beans.Size2Type)get_store().find_element_user(RESOLUTION2$0, 0);\n if (target == null)\n {\n target = (org.astrogrid.stc.coords.v1_10.beans.Size2Type)get_store().add_element_user(RESOLUTION2$0);\n }\n target.set(resolution2);\n }\n }", "public void setPassword2(String password2);", "public void setTipo(Object tipo2) {\n\t\t\n\t}", "@Override\n\tpublic void setPlayerTwoScore(int playerTwoScore) {\n\t\tsuper.setPlayerTwoScore(playerTwoScore);\n\t}", "private void setS2Rsp(PToP.S2ARsp value) {\n if (value == null) {\n throw new NullPointerException();\n }\n rsp_ = value;\n rspCase_ = 23;\n }", "public void setCsp_General_2(java.lang.String csp_General_2) {\n this.csp_General_2 = csp_General_2;\n }", "void setP2p(int p2p);", "public void setPra2(String pra2) {\n this.pra2 = pra2 == null ? null : pra2.trim();\n }", "private void setAS2Req(PToP.AS2Req value) {\n if (value == null) {\n throw new NullPointerException();\n }\n req_ = value;\n reqCase_ = 16;\n }", "public String getHint2() {\n return this.hint2;\n }", "void setQuestionType(QuestionType type);", "public void setWork2(Number work2)\r\n {\r\n m_work2 = work2;\r\n }", "public void setContactPhone2(String contactPhone2) {\n this.contactPhone2 = contactPhone2;\n }", "public void setText2(String text2) {\n this.text2 = text2 == null ? null : text2.trim();\n }", "public void setSecurity(Security security)\n {\n __m_Security = security;\n }", "public void setLine2(java.lang.String line2) {\r\n this.line2 = line2;\r\n }", "@Override\n\tpublic void setStreet2(java.lang.String street2) {\n\t\t_candidate.setStreet2(street2);\n\t}", "private void setS2InfoRsp(PToP.S2InfoRelay value) {\n if (value == null) {\n throw new NullPointerException();\n }\n rsp_ = value;\n rspCase_ = 25;\n }", "@Override\n\tpublic void setField2(boolean field2) {\n\t\t_employee.setField2(field2);\n\t}", "public void setAxis2xml(String axis2xml) {\r\n this.axis2xml = axis2xml;\r\n }", "public void setLine2(String line2) {\n this.line2 = line2;\n }", "public void setActividad2(Actividad actividad2) {\r\n\t\tthis.actividad2 = actividad2;\r\n\t}", "public void setAddr2(String addr2) {\r\n this.addr2 = addr2;\r\n }", "private void SetSecondQues(int positionToMoveTo) {\n\n\t\ttxtquestion.setText(allArrayQuestion[positionToMoveTo]);\n\t\tbtnopta.setText(allArrayOptionA[positionToMoveTo]);\n\t\tbtnoptb.setText(allArrayOptionB[positionToMoveTo]);\n\t\tbtnoptc.setText(allArrayOptionC[positionToMoveTo]);\n\t\tbtnoptd.setText(allArrayOptionD[positionToMoveTo]);\n\t\tcurrentPosition=positionToMoveTo;\n\t}", "@Override\n\tpublic void setNode_2(java.lang.String node_2) {\n\t\t_dictData.setNode_2(node_2);\n\t}", "public void setTest2(String test2) {\r\n this.test2 = test2 == null ? null : test2.trim();\r\n }", "public void setLevel2Eligible(java.lang.String level2Eligible) {\r\n this.level2Eligible = level2Eligible;\r\n }", "public void setP1Card2(Card p1Card2){\n\t\tthis.p1Card2 = p1Card2;\n\t\trepaint();\n\t}", "public void q2Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q2option3);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ2) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ2 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }", "public void setRemarks2(String remarks2) {\n this.remarks2 = remarks2 == null ? null : remarks2.trim();\n }", "public void setY2(Double y2) {\n\t\tthis.y2 = y2;\n\t}", "@AutoEscape\n\tpublic String getSecurity_answer();", "public void setApellido2(String apellido2) {\r\n\t\tthis.apellido2 = apellido2;\r\n\t}", "public void setRsv2(String rsv2) {\r\n this.rsv2 = rsv2;\r\n }", "public void setAttribute2(String attribute2) {\n this.attribute2 = attribute2 == null ? null : attribute2.trim();\n }" ]
[ "0.72248346", "0.6989475", "0.697066", "0.6920655", "0.68267363", "0.6589471", "0.63637745", "0.63571024", "0.6271154", "0.62220085", "0.620746", "0.6171518", "0.60840344", "0.60287976", "0.5969093", "0.59483993", "0.5920542", "0.5836807", "0.5831486", "0.5829595", "0.58255464", "0.5816827", "0.58118254", "0.5799226", "0.5756078", "0.57408285", "0.57339615", "0.57305974", "0.5725302", "0.57243145", "0.571774", "0.5708896", "0.5705181", "0.56883806", "0.5669177", "0.56679493", "0.5660739", "0.56586987", "0.5636687", "0.56158596", "0.5599808", "0.55990314", "0.55930054", "0.558233", "0.55646324", "0.55463666", "0.55460167", "0.5546005", "0.55393136", "0.55269855", "0.5513851", "0.55129343", "0.5504085", "0.5502878", "0.5502565", "0.5501301", "0.54983306", "0.5495241", "0.5489171", "0.5477768", "0.5477768", "0.54607314", "0.54584837", "0.54566723", "0.54509974", "0.54507387", "0.54428935", "0.54399335", "0.54368496", "0.5433255", "0.5432128", "0.5422818", "0.5422721", "0.5417974", "0.54072", "0.540015", "0.5393697", "0.53901213", "0.53805506", "0.5368952", "0.5364617", "0.53607637", "0.5354616", "0.53496385", "0.5343106", "0.5337806", "0.5334127", "0.5323482", "0.530609", "0.5297072", "0.5296919", "0.5283394", "0.5281944", "0.52769005", "0.5275572", "0.52714145", "0.52673304", "0.52645105", "0.52204823", "0.5207537" ]
0.7405542
0
Gets the security question3.
public ListBoxMVP getSecurityQuestion3() { return securityQuestion3; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getQuiz3()\n\t{\n\t\treturn this.quiz3;\n\t}", "public String getAnswerText3() {\r\n\t\treturn answerText3;\r\n\t}", "public String getPollAnswer3() {\n return pollAnswer3;\n }", "public String getForgottenPasswordQuestion3() {\n\t\treturn forgottenPasswordQuestion3;\n\t}", "public String getSecurity_question() \r\n {\r\n return security_question;\r\n }", "public String getForgottenPasswordAnswer3() {\n\t\treturn forgottenPasswordAnswer3;\n\t}", "public String getPra3() {\n return pra3;\n }", "public String getInput3() {\n return input3;\n }", "public String getSecurityQuestion() {\n return securityQuestion;\n }", "public java.lang.String getQ3Label() {\n return q3Label;\n }", "public int getRecord3(){\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.getContext()); return prefs.getInt(\"record3\", -1);\n }", "public String getChoice3(int a){\n String choice2 = choices[a][2];\n return choice2;\n }", "public java.lang.String getSecondary3() {\n return secondary3;\n }", "public double getSide3() {\r\n\t\treturn side3;\r\n\t}", "public String getCol3radio() {\n return col3radio;\n }", "public ResultPoint getRp3() {\n return rp3;\n }", "public void setSecurityQuestion3(ListBoxMVP securityQuestion3) {\r\n\t\tthis.securityQuestion3 = securityQuestion3;\r\n\t}", "public double getSolutionX3() {\n this.polySolve();\n if (this.degree < 3) {\n return 0010;\n } else {\n if (this.real) {\n return this.x3;\n } else {\n return 0010;\n }\n }\n }", "public java.lang.String getRemark3()\r\n {\r\n return _remark3;\r\n }", "public String getExtra3() {\n return extra3;\n }", "public java.lang.String getLevel3Eligible() {\r\n return level3Eligible;\r\n }", "@AutoEscape\n\tpublic String getSecurity_question();", "public T3 _3() {\n return _3;\n }", "public ListBoxMVP getSecurityQuestion2() {\r\n\t\treturn securityQuestion2;\r\n\t}", "public String getFreeuse3() {\n return freeuse3;\n }", "public String getFreeuse3() {\n\t\treturn freeuse3;\n\t}", "@Click(R.id.bt_answer3)\n void clickAnswer3() {\n selectedAnswer = questionList.get(questionProgress - 1).getAnswers().get(2);\n showResult();\n }", "public String getText3() {\n return text3;\n }", "public String getSpare3() {\r\n return spare3;\r\n }", "public Boolean getC3() {\n\t\treturn c3;\n\t}", "public Alternatives getAlternatives_3() { return cAlternatives_3; }", "public void setAnswerText3(String answerText3) {\r\n\t\tthis.answerText3 = answerText3;\r\n\t}", "private String getCampo3() {\r\n String campo = this.campoLivre.substring(15);\r\n return boleto.getDigitoCampo(campo);\r\n }", "public String getAttribute3()\n {\n return (String)getAttributeInternal(ATTRIBUTE3);\n }", "public String getAttribute3() {\n return (String)getAttributeInternal(ATTRIBUTE3);\n }", "public String getAttribute3() {\n return (String)getAttributeInternal(ATTRIBUTE3);\n }", "public String getAttribute3() {\n return (String)getAttributeInternal(ATTRIBUTE3);\n }", "public String getAttribute3() {\n return (String)getAttributeInternal(ATTRIBUTE3);\n }", "public String getAttribute3() {\n return (String)getAttributeInternal(ATTRIBUTE3);\n }", "public java.lang.String getCsp_General_3() {\n return csp_General_3;\n }", "public void setForgottenPasswordQuestion3(String forgottenPasswordQuestion3) {\n\t\tthis.forgottenPasswordQuestion3 = forgottenPasswordQuestion3;\n\t}", "public String getOther3() {\n return other3;\n }", "public String getValue3() { return this.value3; }", "public String getAttribute3() {\n return (String) getAttributeInternal(ATTRIBUTE3);\n }", "public String getAttribute3() {\n return attribute3;\n }", "public String getSnmpv3Securitylevel() {\r\n return snmpv3Securitylevel;\r\n }", "public String getSupBytxt3() {\n return supBytxt3;\n }", "public String getThirdNumber() {\n return thirdNumber;\n }", "public java.lang.String getDirection3() {\r\n return direction3;\r\n }", "public String getMlSdef3() {\n return mlSdef3;\n }", "public java.lang.Long getC3()\n {\n return this.c3;\n }", "private String extractSecurityQuestion() {\n // NOTE JComboBox.getSelectedItem() will not catch keyboard edits as they are typed,\n // so JComboBox.getEditor().getItem() is used.\n String securityQuestion = ((String) securityQuestionJComboBox.getEditor().getItem()).trim();\n if (isEmpty(securityQuestion)) {\n return null;\n } else {\n return securityQuestion;\n }\n }", "public String getAttr3() {\n return attr3;\n }", "public String getAttr3() {\n return attr3;\n }", "public String getImg_3() {\n return img_3;\n }", "double getside3(){\n\t\treturn side3;\n\t}", "private String getCampo3() {\n String campo = this.campoLivre.substring(15);\n System.out.println(\"campo3 \" + campo);\n return boleto.getDigitoCampo(campo);\n }", "public java.lang.Double getVar3() {\n return var3;\n }", "public java.lang.String getC3() {\n java.lang.Object ref = c3_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n c3_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public Point getP3(){\n return this.p3;\n }", "public String getLine3() {\n return line3;\n }", "public String getQuestion() {\n\t\treturn question;\n\t}", "public String getRpfBak3() {\r\n return rpfBak3;\r\n }", "public String getRsv3() {\n\t\treturn rsv3;\n\t}", "public SurveyQuestion getQuestion (int idx)\n {\n if (idx >= 0 && idx < questions.size()) {\n return questions.get(idx);\n }\n return null;\n }", "Question getQuestion();", "public Double getMouse3()\n {\n return this.mouse3;\n }", "public java.lang.String getC3() {\n java.lang.Object ref = c3_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n c3_ = s;\n }\n return s;\n }\n }", "public java.lang.Double getVar3() {\n return var3;\n }", "public String getSecurityAnswer() {\n return securityAnswer;\n }", "public String getSnmpv3Securityname() {\r\n return snmpv3Securityname;\r\n }", "public Problem getProblem3(MathConfiguration mathConfig) {\r\n\t\t\r\n\t\tCreateProblem cProblem = new CreateProblem();\r\n\t\tAnswer answ = new Answer();\r\n\t\tMessageSource mSource = mathConfig.getmSource();\r\n\t\t\r\n\t\tList<QuestionLine> questionList = new LinkedList<QuestionLine>();\r\n\r\n\t\tint base = MathUtilities.getRandomNumber(2, 8);\r\n\t\tint pow = MathUtilities.getRandomNumber(2,4);\r\n\t\t\r\n\t\tint base1 = MathUtilities.getRandomNumber(2, 8);\r\n\t\tint pow1 = MathUtilities.getRandomNumber(2,4);\r\n\t\t\t\r\n\t\tint ans = (int)Math.pow(base1, pow1) + (int)Math.pow(base, pow);\r\n\t\tString question = \"$\" + Integer.toString(base1) + \"^{\" + Integer.toString(pow1)+ \"}\" + \" + \" + Integer.toString(base) + \"^{\" + Integer.toString(pow)+ \"}\" + \"$\";\r\n\t\t\r\n\t\tQuestionLine qLine1 = new QuestionLine(mSource.getMessage(Constants.FIND_EXPRESSION, null, Locale.ENGLISH));\r\n\t\tQuestionLine qLine2 = new QuestionLine(question);\r\n\r\n\t\tquestionList.add(qLine1);\r\n\t\tquestionList.add(qLine2);\r\n\r\n\t\tString heading = mSource.getMessage(Constants.GRADE_7_INTEGER_EXPONENTIATION, null, Locale.ENGLISH);\r\n\t\tansw.setAnswer(Integer.toString(ans));\r\n\r\n\t\tProblem problem = cProblem.constructProblem(questionList, heading, Constants.RANK_ONE, Constants.PROBLEM_TYPE_FRACTION);\r\n\t\tproblem.setAnswer(answ);\r\n\r\n\t\treturn problem;\r\n\t}", "java.lang.String getC3();", "public boolean setQuiz3(double quiz3)\n\t{\n\t\tboolean isValid;\n\t\t\n\t\tisValid = isValidQuiz3(quiz3);\n\t\t\n\t\tif(isValid)\n\t\t{\n\t\t\tthis.quiz3 = quiz3;\n\t\t}\n\t\t\n\t\treturn isValid;\n\t}", "public Integer getWishPosTypeid3() {\n return wishPosTypeid3;\n }", "public java.lang.String getReserve3() {\n return reserve3;\n }", "com.google.protobuf.ByteString\n getC3Bytes();", "public java.lang.String getExt3()\n {\n return this.ext3;\n }", "public CvssV30 getCvssV3() {\n return cvssV3;\n }", "public double getField3() {\n return field3_;\n }", "public Question getQuestion() {\n if (Problem_Type.featOkTst && ((Problem_Type)jcasType).casFeat_question == null)\n jcasType.jcas.throwFeatMissing(\"question\", \"hw1.qa.Problem\");\n return (Question)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Problem_Type)jcasType).casFeatCode_question)));}", "public java.lang.String getNAME3()\n {\n \n return __NAME3;\n }", "public ReportContainer getReport3() {\n\t\treturn this.report3;\n\t}", "public java.lang.String getUDP3() {\n return UDP3;\n }", "public boolean getWeek3() {\n return week3_;\n }", "public String getLine3() {\n return line3;\n }", "public double getField3() {\n return field3_;\n }", "private boolean checkAnswerThree() {\n CheckBox correctAnswer1Q3 = findViewById(R.id.qs3Ans1);\n correctAnswer1Q3.setTextColor(Color.parseColor(\"green\"));\n return correctAnswer1Q3.isChecked();\n }", "public boolean getWeek3() {\n return week3_;\n }", "public String getQuestion() {\n return question;\n }", "public String getRsv3() {\r\n return rsv3;\r\n }", "public String getParameter3() {\n return parameter3;\n }", "public int getQuestionNumber() {\r\n\t\treturn questionNumber;\r\n\t}", "public JTextField getjTextField3() {\n return jTextField3;\n }", "public float getW3 () {\r\n return w3;\r\n }", "public Integer getQuestionNumber()\n {\n return questionNumber;\n }", "public String getQuestion() {\n return question;\n }", "public void setForgottenPasswordAnswer3(String forgottenPasswordAnswer3) {\n\t\tthis.forgottenPasswordAnswer3 = forgottenPasswordAnswer3;\n\t}", "public IPoint getThirdPoint()\n {\n\n Set<IPoint> vertices = this.getVertices();\n Object[] verticesArray = vertices.toArray();\n IPoint thirdPoint = (IPoint)verticesArray[2];\n\n return thirdPoint;\n }", "public String getADD_NUMBER3_PROTECTED() {\r\n return ADD_NUMBER3_PROTECTED;\r\n }" ]
[ "0.73706234", "0.71156746", "0.69802797", "0.68254036", "0.66043043", "0.64785326", "0.6444271", "0.63907003", "0.6299743", "0.6256544", "0.61928236", "0.61453116", "0.6137567", "0.6133004", "0.61309177", "0.6123273", "0.6104916", "0.6067187", "0.6060522", "0.60463995", "0.60209084", "0.59989774", "0.5986262", "0.5969286", "0.59689575", "0.5962328", "0.5939586", "0.59294105", "0.59086764", "0.58956796", "0.5881725", "0.5861503", "0.5856089", "0.58535856", "0.58266395", "0.58266395", "0.58266395", "0.58266395", "0.58266395", "0.58242387", "0.5807867", "0.57946897", "0.57818687", "0.57793814", "0.5758572", "0.5746093", "0.5743667", "0.57404757", "0.5712861", "0.57076675", "0.5704367", "0.570365", "0.56952107", "0.56952107", "0.56611353", "0.565739", "0.56231624", "0.5623051", "0.56124264", "0.5606038", "0.55838025", "0.5577225", "0.5561974", "0.5561636", "0.55537224", "0.5547369", "0.5544293", "0.5539379", "0.55198956", "0.5519342", "0.5516275", "0.5514522", "0.55094796", "0.550529", "0.5488277", "0.5487137", "0.5476222", "0.54756904", "0.5469268", "0.5465123", "0.5454972", "0.5445935", "0.54340464", "0.5426789", "0.54222566", "0.5420421", "0.541632", "0.5415957", "0.5402313", "0.54022884", "0.53936744", "0.5393243", "0.53929985", "0.5391976", "0.5380495", "0.53791106", "0.5379059", "0.5368731", "0.53606194", "0.53584224" ]
0.80000263
0
Sets the security question3.
public void setSecurityQuestion3(ListBoxMVP securityQuestion3) { this.securityQuestion3 = securityQuestion3; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean setQuiz3(double quiz3)\n\t{\n\t\tboolean isValid;\n\t\t\n\t\tisValid = isValidQuiz3(quiz3);\n\t\t\n\t\tif(isValid)\n\t\t{\n\t\t\tthis.quiz3 = quiz3;\n\t\t}\n\t\t\n\t\treturn isValid;\n\t}", "public void setSecurity_question(String security_question);", "public void setForgottenPasswordQuestion3(String forgottenPasswordQuestion3) {\n\t\tthis.forgottenPasswordQuestion3 = forgottenPasswordQuestion3;\n\t}", "public ListBoxMVP getSecurityQuestion3() {\r\n\t\treturn securityQuestion3;\r\n\t}", "public void setAnswerText3(String answerText3) {\r\n\t\tthis.answerText3 = answerText3;\r\n\t}", "public void setForgottenPasswordAnswer3(String forgottenPasswordAnswer3) {\n\t\tthis.forgottenPasswordAnswer3 = forgottenPasswordAnswer3;\n\t}", "public void setInput3(final String input3) {\n this.input3 = input3;\n }", "public void setSecurity_answer(String security_answer);", "public void setSecurityQuestion(String securityQuestion) {\n this.securityQuestion = securityQuestion;\n }", "public void setValue3(String value3) { this.value3 = value3; }", "public void setSide3(double side3) {\r\n\t\tthis.side3 = side3;\r\n\t}", "private void setP3( Point p3 ){\n this.p3=p3;\n }", "public void setQ3Label(java.lang.String q3Label) {\n this.q3Label = q3Label;\n }", "public void setTaxNumber3(\n @Nullable\n final String taxNumber3) {\n rememberChangedField(\"TaxNumber3\", this.taxNumber3);\n this.taxNumber3 = taxNumber3;\n }", "public void setThirdSSN(float num3){\n\t\t ThirdSSN = ((num3>0 && num3<=9999)?num3:0);\n\t\t }", "@Click(R.id.bt_answer3)\n void clickAnswer3() {\n selectedAnswer = questionList.get(questionProgress - 1).getAnswers().get(2);\n showResult();\n }", "public String getAnswerText3() {\r\n\t\treturn answerText3;\r\n\t}", "public void setSecurityQuestion1(ListBoxMVP securityQuestion1) {\r\n\t\tthis.securityQuestion1 = securityQuestion1;\r\n\t}", "public void setC3(Boolean c3) {\n\t\tthis.c3 = c3;\n\t}", "public void setSpare3(String spare3) {\r\n this.spare3 = spare3;\r\n }", "public void setAttr3(String attr3) {\n this.attr3 = attr3;\n }", "public void setAttr3(String attr3) {\n this.attr3 = attr3;\n }", "public void setText3(String text3) {\n this.text3 = text3 == null ? null : text3.trim();\n }", "public void setQuestion(){\n txt_question.setText(arrayList.get(quesAttempted).getQuestion());\n txt_optionA.setText(arrayList.get(quesAttempted).getOptionA());\n txt_optionB.setText(arrayList.get(quesAttempted).getOptionB());\n txt_optionC.setText(arrayList.get(quesAttempted).getOptionC());\n txt_optionD.setText(arrayList.get(quesAttempted).getOptionD());\n txt_que_count.setText(\"Que: \"+(quesAttempted+1)+\"/\"+totalQues);\n txt_score.setText(\"Score: \"+setScore);\n }", "@Override\n\tpublic void setField3(int field3) {\n\t\t_second.setField3(field3);\n\t}", "public void setIndustryCode3(\n @Nullable\n final String industryCode3) {\n rememberChangedField(\"IndustryCode3\", this.industryCode3);\n this.industryCode3 = industryCode3;\n }", "public void setPra3(String pra3) {\n this.pra3 = pra3 == null ? null : pra3.trim();\n }", "public double getQuiz3()\n\t{\n\t\treturn this.quiz3;\n\t}", "public void setExtra3(String extra3) {\n this.extra3 = extra3;\n }", "public void SetSocialSecuritynumber(float num1, float num2, float num3){\n\t\t setFirstSSN(num1);\n\t\t setSecondSSN(num2);\n\t\t setThirdSSN(num3);\n\t\t }", "private void setquestion() {\n qinit();\n question_count++;\n\n if (modeflag == 3) {\n modetag = (int) (Math.random() * 3);\n } else {\n modetag = modeflag;\n }\n\n WordingIO trueword = new WordingIO(vocabulary);\n\n if (modetag == 0) {\n\n MCmode(trueword);\n }\n\n if (modetag == 1) {\n BFmode(trueword);\n }\n\n if (modetag == 2) {\n TLmode(trueword);\n }\n\n if (time_limit != 0) {\n timingtoanswer(time_limit, jLabel2, answer_temp, jLabel5, jLabel6, jButton1);\n }\n }", "public void setSecurityQuestion2(ListBoxMVP securityQuestion2) {\r\n\t\tthis.securityQuestion2 = securityQuestion2;\r\n\t}", "public void setCol3radio(String col3radio) {\n this.col3radio = col3radio == null ? null : col3radio.trim();\n }", "public void setFlop3(Card flop3){\n\t\tthis.flop3 = flop3;\n\t\trepaint();\n\t}", "public void setAttribute3(String attribute3) {\n this.attribute3 = attribute3 == null ? null : attribute3.trim();\n }", "public String getPollAnswer3() {\n return pollAnswer3;\n }", "@Override\n\tpublic void setStreet3(java.lang.String street3) {\n\t\t_candidate.setStreet3(street3);\n\t}", "public void setLine3(String line3) {\n this.line3 = line3;\n }", "public String getForgottenPasswordQuestion3() {\n\t\treturn forgottenPasswordQuestion3;\n\t}", "@Override\n\tpublic void setField3(int field3) {\n\t\t_employee.setField3(field3);\n\t}", "public void setCsp_General_3(java.lang.String csp_General_3) {\n this.csp_General_3 = csp_General_3;\n }", "public void setQuestion(Question q)\n {\n currentQuestion=q;\n questionLabel.setText(q.getQuestion());\n feedbackLabel.setVisible(false);\n }", "@Step(\"Choose answer number {ans} for the 3rd question\")\r\n public ResendPageSteps sendThirdAnswer(int ans) {\r\n switch (ans) {\r\n case 1:\r\n getVisibleWebElement(resendPage.ANS3_1).click();\r\n break;\r\n case 2:\r\n getVisibleWebElement(resendPage.ANS3_2).click();\r\n break;\r\n case 3:\r\n getVisibleWebElement(resendPage.ANS3_3).click();\r\n WebElement commentField = getVisibleWebElement(resendPage.ANS3_3_COMMENT);\r\n commentField.clear();\r\n commentField.sendKeys(RandomStringUtils.randomAlphabetic(10));\r\n break;\r\n }\r\n return this;\r\n }", "@Override\n\tpublic void setNode_3(java.lang.String node_3) {\n\t\t_dictData.setNode_3(node_3);\n\t}", "private void setQuestion() {\n Question.setText(gen.getQuestion() + \"\\t\\tProblem # \" + currentQuestion + \"/\" + numQuestions);\n }", "public void setQuestion(){\n\n\n triggerReport(); //Check if max questions are displayed, if yes then show report\n\n MyDatabase db = new MyDatabase(QuizCorner.this);\n Cursor words = db.getQuizQuestion();\n TextView question_text = (TextView) findViewById(R.id.question_text);\n RadioButton rb;\n resetOptions();\n disableCheck();\n enableRadioButtons();\n hideAnswer();\n words.moveToFirst();\n word = words.getString(words.getColumnIndex(\"word\"));\n correct_answer = words.getString(words.getColumnIndex(\"meaning\"));\n question_text.setText(word + \" means:\");\n for (int i = 0; i < 4; i++){\n answers[i] = words.getString(words.getColumnIndex(\"meaning\"));\n words.moveToNext();\n }\n answers = randomizeArray(answers);\n for (int i = 0; i < 4; i++){\n rb = (RadioButton) findViewById(options[i]);\n rb.setText(answers[i]);\n }\n question_displayed_count++;\n }", "public void setAttribute3(String value)\n {\n setAttributeInternal(ATTRIBUTE3, value);\n }", "public void setSecurityAnswer(String securityAnswer) {\n this.securityAnswer = securityAnswer;\n }", "public void setImg_3(String img_3) {\n this.img_3 = img_3;\n }", "void setQuestionType(QuestionType type);", "public void setRecord3(int value){\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.getContext());\n SharedPreferences.Editor editor = prefs.edit(); editor.putInt(\"record3\", value);\n editor.commit();\n }", "public void setQuestions(Vector<Question> q){\n\t\t\tquestions = q;\n\t\t}", "public void setSkill(int skill){\n\t\tskillSelection = skill;\n\t}", "public void setAttribute3(String value) {\n setAttributeInternal(ATTRIBUTE3, value);\n }", "public void setAttribute3(String value) {\n setAttributeInternal(ATTRIBUTE3, value);\n }", "public void setAttribute3(String value) {\n setAttributeInternal(ATTRIBUTE3, value);\n }", "public void setAttribute3(String value) {\n setAttributeInternal(ATTRIBUTE3, value);\n }", "public void setAttribute3(String value) {\n setAttributeInternal(ATTRIBUTE3, value);\n }", "public void setAttribute3(String value) {\n setAttributeInternal(ATTRIBUTE3, value);\n }", "public void setQuestion(String newQuestion) {\n question = newQuestion;\n }", "public void setSecondary3(java.lang.String secondary3) {\n this.secondary3 = secondary3;\n }", "public void setQuestion(String question) {\n\t\tthis.question = question;\n\t}", "public void setCurrentQuestion(Question question) {\n\t\tcurrentQuestion = question;\n\t}", "public void setFreeuse3(String freeuse3) {\n\t\tthis.freeuse3 = freeuse3 == null ? null : freeuse3.trim();\n\t}", "public void setQuestion(Question v) {\n if (Problem_Type.featOkTst && ((Problem_Type)jcasType).casFeat_question == null)\n jcasType.jcas.throwFeatMissing(\"question\", \"hw1.qa.Problem\");\n jcasType.ll_cas.ll_setRefValue(addr, ((Problem_Type)jcasType).casFeatCode_question, jcasType.ll_cas.ll_getFSRef(v));}", "public Builder setC3(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n c3_ = value;\n onChanged();\n return this;\n }", "private boolean isValidQuiz3(double quiz3)\n\t{\n\t\treturn quiz3 >= 0 && quiz3 <= 10;\n\t}", "public void q3Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q3option1);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ3) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ3 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }", "public String getForgottenPasswordAnswer3() {\n\t\treturn forgottenPasswordAnswer3;\n\t}", "public void setReserved3(short value)\n {\n field_1_options = reserved3.setShortValue(field_1_options, value);\n }", "public String getSecurity_question() \r\n {\r\n return security_question;\r\n }", "public void setC3(java.lang.Long c3)\n {\n this.c3 = c3;\n }", "public void setQuestion(String question) {\n this.question = question;\n }", "public void setLevel3Eligible(java.lang.String level3Eligible) {\r\n this.level3Eligible = level3Eligible;\r\n }", "public void setFreeuse3(String freeuse3) {\n this.freeuse3 = freeuse3 == null ? null : freeuse3.trim();\n }", "public void setRemark3(java.lang.String _remark3)\r\n {\r\n this._remark3 = _remark3;\r\n }", "public void setQ(int q) {\n/* 590 */ getCOSObject().setInt(COSName.Q, q);\n/* */ }", "public void setSnmpv3Securityname(String snmpv3Securityname) {\r\n this.snmpv3Securityname = snmpv3Securityname == null ? null : snmpv3Securityname.trim();\r\n }", "public void setUDP3(java.lang.String UDP3) {\n this.UDP3 = UDP3;\n }", "public void setParameter3(String parameter3) {\n this.parameter3 = parameter3 == null ? null : parameter3.trim();\n }", "public void setSnmpv3Securitylevel(String snmpv3Securitylevel) {\r\n this.snmpv3Securitylevel = snmpv3Securitylevel == null ? null : snmpv3Securitylevel.trim();\r\n }", "public void setQuestion(final List<Question> question) {\n\t\tthis.question = question;\n\t}", "private void setCurrentQuestion(){\n\tfor(int i=0; i<QuestionsTree.length;i++){\n\t\tif(QuestionsTree[i][0].equals(currentRule)){\n\t\t\tcurrentQuestion = QuestionsTree[i][1];\n\t\t}\n\t}\n}", "public void setQuestion(int index, String question){\n if (question == null || question.equals(\"\")) {\n System.out.println(\"Question cannot be empty.\");\n }\n else {\n questionList.set(index, question);\n }\n }", "private void settingQuestion() {\n\n int[] setWord = {0, 0, 0, 0, 0};\n int[] setPos = {0, 0, 0, 0};\n int[] setBtn = {0, 0, 0, 0};\n\n Random ans = new Random();\n int wordNum = ans.nextInt(vocabularyLesson.size());\n //answer = vocabularyLesson.get(wordNum).getMean();\n word = vocabularyLesson.get(wordNum).getWord();\n vocabularyID = vocabularyLesson.get(wordNum).getId();\n answer = word;\n\n Practice practice = pc.getPracticeById(vocabularyID);\n if (practice != null) {\n Log.d(\"idVocabulary\", practice.getSentence());\n question.setText(practice.getSentence());\n }\n\n\n // Random position contain answer\n setWord[wordNum] = 1;\n Random p = new Random();\n int pos = p.nextInt(4);\n if (pos == 0) {\n word1.setText(word);\n setBtn[0] = 1;\n }\n if (pos == 1) {\n word2.setText(word);\n setBtn[1] = 1;\n }\n if (pos == 2) {\n word3.setText(word);\n setBtn[2] = 1;\n }\n if (pos == 3) {\n word4.setText(word);\n setBtn[3] = 1;\n }\n setPos[pos] = 1;\n\n // Random 3 position contain 3 answer\n for (int i = 0; i < 3; i++) {\n Random ques = new Random();\n int num = ques.nextInt(5);\n int p1 = ques.nextInt(4);\n while (setWord[num] == 1 || setPos[p1] == 1) {\n num = ques.nextInt(5);\n p1 = ques.nextInt(4);\n }\n String wordIncorrect = vocabularyLesson.get(num).getWord();\n setWord[num] = 1;\n setPos[p1] = 1;\n if (setBtn[p1] == 0 && p1 == 0) {\n word1.setText(wordIncorrect);\n setBtn[0] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 1) {\n word2.setText(wordIncorrect);\n setBtn[1] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 2) {\n word3.setText(wordIncorrect);\n setBtn[2] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 3) {\n word4.setText(wordIncorrect);\n setBtn[3] = 1;\n }\n }\n\n }", "public void setMlSdef3(String mlSdef3) {\n this.mlSdef3 = mlSdef3;\n }", "public void setNode_3(String node_3);", "public void setQ(int q) {\n System.out.println(\"set q is: \" + q);\n this.q = q;\n }", "public void setRsv3(String rsv3) {\r\n this.rsv3 = rsv3;\r\n }", "public void setRsv3(String rsv3) {\n\t\tthis.rsv3 = rsv3 == null ? null : rsv3.trim();\n\t}", "public abstract void setPhone3(String sValue);", "Question(String ques, String opt1, String opt2, String opt3, String opt4) {\n this.ques = ques;\n this.opt1 = opt1;\n this.opt2 = opt2;\n this.opt3 = opt3;\n this.opt4 = opt4;\n }", "public void setThirdNumber(String thirdNumber) {\n this.thirdNumber = thirdNumber == null ? null : thirdNumber.trim();\n }", "public void setQtyPeriod3 (java.math.BigDecimal QtyPeriod3)\r\n {\r\n set_Value (\"QtyPeriod3\", QtyPeriod3);\r\n \r\n }", "public void setDirection3(java.lang.String direction3) {\r\n this.direction3 = direction3;\r\n }", "public void setOther3(String other3) {\n this.other3 = other3 == null ? null : other3.trim();\n }", "public void setStar3Count(Integer star3Count) {\n this.star3Count = star3Count;\n }", "public void mo55256a(C3586j3 j3Var) {\n }", "public void mo55256a(C3586j3 j3Var) {\n }", "public void mo55256a(C3586j3 j3Var) {\n }" ]
[ "0.7223316", "0.6964387", "0.6946363", "0.68608505", "0.6787541", "0.64344126", "0.6371984", "0.63066596", "0.6275927", "0.62273896", "0.61781347", "0.61536056", "0.6119634", "0.6084522", "0.6040219", "0.6004378", "0.5954629", "0.5938227", "0.59224963", "0.59159756", "0.5894955", "0.5894955", "0.5891283", "0.5886011", "0.58491516", "0.58480203", "0.58396447", "0.58245873", "0.58198434", "0.58149576", "0.57547456", "0.571739", "0.56893426", "0.56890225", "0.56845254", "0.56675595", "0.5665223", "0.5664556", "0.5655627", "0.5638045", "0.5628934", "0.5615556", "0.5574528", "0.5571905", "0.5556493", "0.55521184", "0.55493104", "0.5548052", "0.55456066", "0.554305", "0.55290806", "0.55223083", "0.55183667", "0.5506261", "0.5506261", "0.5506261", "0.5506261", "0.5506261", "0.5506261", "0.5506212", "0.5503429", "0.548011", "0.547456", "0.54580975", "0.54456717", "0.54438055", "0.54407775", "0.5429085", "0.5424801", "0.542349", "0.5417994", "0.5415644", "0.53995275", "0.53799635", "0.53785616", "0.53770834", "0.5360347", "0.53597903", "0.5355867", "0.53520757", "0.5350106", "0.53448635", "0.53360045", "0.5327552", "0.5324983", "0.5324906", "0.5311719", "0.53059727", "0.53043807", "0.5299685", "0.52977407", "0.52910006", "0.5269488", "0.52688366", "0.5266159", "0.5264219", "0.5260672", "0.52481407", "0.52481407", "0.52481407" ]
0.75121784
0
Gets the answer text1.
public String getAnswerText1() { return answerText1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getAnswerText2() {\r\n\t\treturn answerText2;\r\n\t}", "public void setAnswerText1(String answerText1) {\r\n\t\tthis.answerText1 = answerText1;\r\n\t}", "java.lang.String getCorrectAnswer();", "public String getAnswerText3() {\r\n\t\treturn answerText3;\r\n\t}", "public String getPollAnswer1() {\n return pollAnswer1;\n }", "public String getTextTF1() {\n\t\treturn tf1.getText();\n\t}", "public String getCrrAnswerString() {\n if (type.equals(\"txt\")) {\n return getTextCrrAnswer();\n }\n else {\n return answers[mcCrrAnswer - 1];\n }\n }", "public String getAnswer(){\n\t\tString result = new String(answer);\n\t\tanswer = \"\"; //reset answer after every read\n\t\treturn result;\n\t}", "public void setAnswer1(String answer1) {\r\n this.answer1 = answer1;\r\n }", "public String getHint1() {\n return this.hint1;\n }", "String getAnswerResponse();", "public String getSelectedAnswer() {\n\t\tList<Integer> selected = getSelectedIndexes();\n\t\treturn this.value.get(selected.get(0));\n\t}", "@Click(R.id.bt_answer1)\n void clickAnswer1() {\n selectedAnswer = questionList.get(questionProgress - 1).getAnswers().get(0);\n showResult();\n }", "public java.lang.String getQ1Label() {\n return q1Label;\n }", "public String getAnswerText()\r\n\t {\r\n\t return spinner.getValue().toString();\r\n\t }", "public String getAnswer(int index){\n return answerList.get(index);\n }", "public String getAnAnswer() {\n\t\t\n\t\tString answer = \"\";\n\t\t\n\t\t\n\t\tRandom randomGenerator = new Random(); //Construct a new random number generator\n\t\tint randomNumber = randomGenerator.nextInt(mAnswers.length);\n\t\t\n\t\tanswer = mAnswers[randomNumber];\n\t\t\n\t\treturn answer;\n\t}", "public String getAnAnswer() {\n\n\t\tString answer = \" \";\n\n\t\t// Randomly select one of the answers\n\t\t// Construct a random number using the Random class and the\n\t\t// nextInt method\n\t\tRandom randomGenerator = new Random();\n\t\tint randomNumber = randomGenerator.nextInt(mAnswers.length);\n\n\t\t// Assign a randomly generated number to an answer\n\t\tanswer = mAnswers[randomNumber];\n\n\t\t// Return the result\n\t\treturn answer;\n\t}", "public String getText3() {\n return text3;\n }", "public String getAnswer() {\n return answer;\n }", "public double getQuiz1()\n\t{\n\t\treturn this.quiz1;\n\t}", "@Nullable\n public final CharSequence getLabel1() {\n return mLabel1;\n }", "public String getAnswerByNumber(int n) {\n return this.answers.get(n);\n }", "public String getText2() {\n return text2;\n }", "public String getInput1() {\n return input1;\n }", "public String getForgottenPasswordAnswer1() {\n\t\treturn forgottenPasswordAnswer1;\n\t}", "public String getChoice1(int a){\n String choice0 = choices[a][0];\n return choice0;\n }", "private int getTextAns() {\n EditText tempAns = findViewById(R.id.answer0);\n if (tempAns.getText().toString().toLowerCase().equals(\"addition\")) {\n return 1;\n } else {\n return 0;\n }\n }", "public int input1(){\n int Input1 = Integer.parseInt(numerator1.getText());\n return Input1;\n }", "public int questionOne() {\n RadioButton answerOne = findViewById ( R.id.q1_a1 );\n\n if (answerOne.isChecked ()) {\n score = 1;\n } else score = 0;\n return score;\n }", "public JLabel getLblQnt1() {\r\n\t\treturn lblQnt1;\r\n\t}", "public String getPollAnswer2() {\n return pollAnswer2;\n }", "public String retA()\n\t{\n\t\treturn answers[correctAns]; \t\n\t}", "public String getQuestion(int a) {\n String question = textQuestions[a];\n return question;\n }", "public void setAnswerText2(String answerText2) {\r\n\t\tthis.answerText2 = answerText2;\r\n\t}", "private int getAnswer() throws IOException {\n String w = next();\n while (w.equals(\"\")) {\n w = next();\n }\n // System.out.println(w + \" is the answer key\");\n c = r.read();\n if (w.equals(\"b\")) {\n return 1;\n } else {\n return 0;\n }\n }", "public String getAnswer(){\n return this.answer;\n }", "public String getCorrectAnswer(int a){\n String answer = correctAnswers[a];\n return answer;\n }", "public String getCorrect() {\n\t\treturn new String(correctAnswer);\n\t}", "public void choicesText() {\n\t\tmcqChoicesText1 = answerChoice.get(0).getText().trim();\n\t\tmcqChoicesText2 = answerChoice.get(1).getText().trim();\n\t\tmcqChoicesText3 = answerChoice.get(2).getText().trim();\n\t\tmcqChoicesText4 = answerChoice.get(3).getText().trim();\n\t\tmcqChoicesText5 = answerChoice.get(4).getText().trim();\n\t\tmcqChoicesText6 = answerChoice.get(5).getText().trim();\n\t}", "public String getAnswercontent() {\n return answercontent;\n }", "public String getPollAnswer3() {\n return pollAnswer3;\n }", "@Override\n\tpublic int getAnswerNum() {\n\t\treturn 1;\n\t}", "public String getCorrectedText() {\n return this.computeCorrectedText();\n }", "public String getPra1() {\n return pra1;\n }", "public java.lang.String getValue1() {\n return this.value1;\n }", "public int getInput1() {\n return input1;\n }", "public String getApellido1() {\n\t\treturn apellido1;\n\t}", "public String getApellido1() {\r\n\t\treturn apellido1;\r\n\t}", "public String getTxt_potencia() {\r\n\t\treturn txt_potencia.getText();\r\n\t}", "Integer getTxtOrent();", "@Override\n public String ask(String question) {\n return answers[position++];\n }", "public String getString1() {\n return string1;\n }", "String getText();", "String getText();", "String getText();", "String getText();", "String getText();", "String getText();", "String getText();", "public String getTitular() {\n\t\treturn this.jTextArea1.getText();\r\n\t}", "public java.lang.String getRemark1()\r\n {\r\n return _remark1;\r\n }", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "public String getCorrectAnswer(int a) {\n String answer = mCorrectAnswers[a];\n return answer;\n }", "public java.lang.String getTestAnswer() {\r\n return testAnswer;\r\n }", "public String ordaindu() {\r\n\t\treturn textField_1.getText();\r\n\t}", "public String getForgottenPasswordQuestion1() {\n\t\treturn forgottenPasswordQuestion1;\n\t}", "public String singleSelect() throws IOException{\n\t\t int count = 0;\t\t\t\t\t\t// count variable is used for count lines in file\n\t\t Fin = new FileReader(\"Survey.txt\");// to read form text file\n\t\t \n\t\t bufferReader = new BufferedReader(Fin);\t// take contents of file in bufferReader\n\t\t\n\t\t String[] questionArray = new String[6];\n\t\t while( count != 6 ) \t\t // starting 6 lines of files contains data for single select question. so it reads only six line\n\t\t {\n\t\t\t\n\t\t\t String line = bufferReader.readLine();\n\t\t\t System.out.println(line);\n\t\t\t questionArray[count] = line;\t// questionArray holds sentence with its option of single select question\n\t\t\t \n\t\t\t count++;\n\t\t }\n\t\t int flag = 0;\n\t\t String answer = new String();\t// string ans which holds the resultant option given by the user\n while( flag == 0 )\n {\n \t answer = sc.nextLine();\n \n\t for( int i=1; i<6; i++ )\n\t {\n\t if( questionArray[i].equals(answer) )\t// check whether user select answer is available or not\n\t {\n\t \t flag = 1;\t\t\t\t\t// if yes than make flag=1\n\t \t break;\n\t }\n\t }\n\t if( flag == 0 )\n\t {\n\t System.out.println(\"Enter Valid ans\");\t // otherwise continue the loop until answer is valid\n\t \n\t }\n }\n return answer;\t\t\t// return output\n\t }", "@Click(R.id.bt_answer2)\n void clickAnswer2() {\n selectedAnswer = questionList.get(questionProgress - 1).getAnswers().get(1);\n showResult();\n }", "public int getAnswer()\n {\n return answer;\n }", "private void ans1Option() {\n RadioButton radioButtonA = (RadioButton) findViewById(R.id.radio_button_A);\n RadioButton radioButtonB = (RadioButton) findViewById(R.id.radio_button_B);\n RadioButton radioButtonC = (RadioButton) findViewById(R.id.radio_Button_C);\n RadioButton radioButtonD = (RadioButton) findViewById(R.id.radio_Button_D);\n radioButtonA.setText(R.string.que1Opt1);\n radioButtonB.setText(R.string.que1Opt2);\n radioButtonC.setText(R.string.que1Opt3);\n radioButtonD.setText(R.string.que1Opt4);\n }", "public String getQuestion(int index){\n return questionList.get(index);\n }", "private void convertAnswerString() {\n currentAnswer = \"\";\n int count = 0;\n while (count < this.answerLayout.getChildCount()) {\n ImageView iv = (ImageView) this.answerLayout.getChildAt(count);\n currentAnswer += iv.getContentDescription();\n count++;\n }\n }", "public java.lang.String getCurr1() {\n\treturn curr1;\n}", "public String getChoice2(int a){\n String choice1 = choices[a][1];\n return choice1;\n }", "public java.lang.String getCorrectAnswer() {\n java.lang.Object ref = correctAnswer_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n correctAnswer_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "protected SpeechletResponse getAskSpeechletResponse (String speechText) {\n SimpleCard card = new SimpleCard();\r\n card.setTitle(\"Carkak Temperature\");\r\n card.setContent(speechText);\r\n\r\n // Create the plain text output.\r\n PlainTextOutputSpeech speech = new PlainTextOutputSpeech();\r\n speech.setText(speechText);\r\n\r\n Reprompt reprompt = new Reprompt();\r\n reprompt.setOutputSpeech(speech);\r\n\r\n return newAskResponse(card, speech, reprompt);\r\n }", "public BigDecimal getSMART_OPTION_TEXT1() {\r\n return SMART_OPTION_TEXT1;\r\n }", "public BigDecimal getSMART_OPTION_TEXT1() {\r\n return SMART_OPTION_TEXT1;\r\n }", "public String getQuestion(int i) { \n\t\ttry {\n\t\t\treturn myQuestions.getQuestion(i).getQuestionText();\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn \"no connection to server\"; \n\t\t} \n\t}", "@Override\n\tpublic String getAnswer() {\n\t\treturn \"\" + IntStream.iterate(1, i->i+1)\n\t\t\t\t.mapToObj(i -> Tuple.of(i, sort(DigitsUtils.getDigits(i))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(2*tuple.getKey()))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(3*tuple.getKey()))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(4*tuple.getKey()))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(5*tuple.getKey()))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(6*tuple.getKey()))))\n\t\t\t\t.findFirst()\n\t\t\t\t.orElseThrow(SolutionNotFoundException::new)\n\t\t\t\t.getKey();\n\t}", "public int getAnswer() {\n return answer;\n }", "public abstract String getLastAnswer();", "@Override\n\t public String solve() {\n\t if (count == 0) {\n\t answer1 = getVariable2()*getVariable3();\n\t setAnswer(answer1 + \"\");\n\t } else if (count == 1) {\n\t answer1 = getVariable1()/getVariable2();\n\t setAnswer(answer1 + \"\");\n\t }else if (count == 2) {\n\t answer1 = getVariable1()/getVariable3();\n\t setAnswer(answer1 + \"\");\n\t }\n\t return getAnswer();\n\t }", "public String getText();", "public String getText();", "public String getText();", "public String getText();", "String getText ();", "public String getText() {\n if (Language.isEnglish()) {\n return textEn;\n } else {\n return textFr;\n }\n }", "public String read() {\n synchronized (this) {\n while (!answerReady) {\n try {\n wait();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }\n answerReady = false;\n return answer;\n }", "public P getText() {\n return this.slp.getProduction(text);\n }", "@Override\n\tpublic String getQuestionAnswerText() {\n\t\treturn null;\n\t}" ]
[ "0.74427366", "0.71657586", "0.6946193", "0.6934232", "0.6886666", "0.6829237", "0.67616016", "0.6643322", "0.6629256", "0.6614711", "0.64571905", "0.6452738", "0.64262927", "0.6388623", "0.637843", "0.6359896", "0.6339932", "0.63324493", "0.6327062", "0.6314603", "0.6305125", "0.6304527", "0.62793285", "0.62613606", "0.6261233", "0.6224091", "0.61750376", "0.61157155", "0.6091791", "0.6078749", "0.60763264", "0.607485", "0.60529864", "0.60168684", "0.60160774", "0.6006616", "0.6004448", "0.5985366", "0.5981824", "0.59614366", "0.59517056", "0.59465194", "0.5915319", "0.5875536", "0.5872482", "0.58604985", "0.5848291", "0.5827699", "0.58132946", "0.58130574", "0.58121026", "0.57964766", "0.57932615", "0.57923645", "0.57923645", "0.57923645", "0.57923645", "0.57923645", "0.57923645", "0.57923645", "0.5786777", "0.5781156", "0.57794726", "0.57794726", "0.57794726", "0.57794726", "0.57794726", "0.57794726", "0.57794726", "0.57794726", "0.5778682", "0.57762384", "0.5769895", "0.5753016", "0.5745944", "0.57455194", "0.57424146", "0.57416284", "0.574", "0.57319903", "0.5728866", "0.57279384", "0.572344", "0.5722337", "0.57145226", "0.57145226", "0.5706283", "0.56905156", "0.56536865", "0.5651412", "0.5648249", "0.5644723", "0.5644723", "0.5644723", "0.5644723", "0.56212115", "0.5602732", "0.5601072", "0.5597938", "0.55973995" ]
0.8619557
0
Sets the answer text1.
public void setAnswerText1(String answerText1) { this.answerText1 = answerText1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setAnswer1(String answer1) {\r\n this.answer1 = answer1;\r\n }", "public String getAnswerText1() {\r\n\t\treturn answerText1;\r\n\t}", "public void setAnswerText2(String answerText2) {\r\n\t\tthis.answerText2 = answerText2;\r\n\t}", "public void setAnswerText3(String answerText3) {\r\n\t\tthis.answerText3 = answerText3;\r\n\t}", "@Click(R.id.bt_answer1)\n void clickAnswer1() {\n selectedAnswer = questionList.get(questionProgress - 1).getAnswers().get(0);\n showResult();\n }", "public void updateAnswer(String text) {\n\t\tclearAnswer();\n\t\t\n\t\t// Add new label with the string\n\t\tlbl.setText(text);\n\t\tvPanel.add(lbl);\n\n\t\treturn;\n\t}", "private void ans1Option() {\n RadioButton radioButtonA = (RadioButton) findViewById(R.id.radio_button_A);\n RadioButton radioButtonB = (RadioButton) findViewById(R.id.radio_button_B);\n RadioButton radioButtonC = (RadioButton) findViewById(R.id.radio_Button_C);\n RadioButton radioButtonD = (RadioButton) findViewById(R.id.radio_Button_D);\n radioButtonA.setText(R.string.que1Opt1);\n radioButtonB.setText(R.string.que1Opt2);\n radioButtonC.setText(R.string.que1Opt3);\n radioButtonD.setText(R.string.que1Opt4);\n }", "public String getAnswerText2() {\r\n\t\treturn answerText2;\r\n\t}", "public void setQ1Label(java.lang.String q1Label) {\n this.q1Label = q1Label;\n }", "private void setQuestion() {\n Question.setText(gen.getQuestion() + \"\\t\\tProblem # \" + currentQuestion + \"/\" + numQuestions);\n }", "public void setQuestion(){\n txt_question.setText(arrayList.get(quesAttempted).getQuestion());\n txt_optionA.setText(arrayList.get(quesAttempted).getOptionA());\n txt_optionB.setText(arrayList.get(quesAttempted).getOptionB());\n txt_optionC.setText(arrayList.get(quesAttempted).getOptionC());\n txt_optionD.setText(arrayList.get(quesAttempted).getOptionD());\n txt_que_count.setText(\"Que: \"+(quesAttempted+1)+\"/\"+totalQues);\n txt_score.setText(\"Score: \"+setScore);\n }", "public void setQuestion(){\n String welcomeTextString = \"Welcome \" + getIntent().getStringExtra(\"name\") + \"!\";\n welcomeText.setText(welcomeTextString);\n\n //Setting Question title, description, and answers\n questionTitle.setText(questions[currentQuestion-1][0]);\n questionDescription.setText(questions[currentQuestion-1][1]);\n ans1.setText(questions[currentQuestion-1][2]);\n ans2.setText(questions[currentQuestion-1][3]);\n ans3.setText(questions[currentQuestion-1][4]);\n\n //Save correct answer\n correctAnswer = questions[currentQuestion-1][5];\n\n //Set progress bar and progress text\n progressBar.setProgress(currentQuestion);\n progressText.setText(currentQuestion.toString() + \"/5\");\n\n //Clear selection of buttons if any are already selected\n ans1.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n ans2.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n ans3.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n }", "private void setOperand1() {\n\t\ttext_Result.setText(\"\"); // Any change of an operand probably invalidates\n\t\tlabel_Result.setText(\"Result\"); // the result, so we clear the old result.\n\t\tlabel_errResult.setText(\"\");\n\t\tif (perform.setOperand1(text_Operand1.getText())) { // Set the operand and see if there was an error\n\t\t\tlabel_errOperand1.setText(\"\"); // If no error, clear this operands error\n\t\t\toperand1ErrPart1.setText(\"\"); // Clear the first term of error part\n\t\t\toperand1ErrPart2.setText(\"\"); // Clear the second term of error part\n\t\t\tif (text_Operand2.getText().length() == 0) // If the other operand is empty, clear its error\n\t\t\t\tlabel_errOperand2.setText(\"\"); // as well.\n\t\t} else // If there's a problem with the operand, display\n\t\t\terr1();\n\t}", "public void choicesText() {\n\t\tmcqChoicesText1 = answerChoice.get(0).getText().trim();\n\t\tmcqChoicesText2 = answerChoice.get(1).getText().trim();\n\t\tmcqChoicesText3 = answerChoice.get(2).getText().trim();\n\t\tmcqChoicesText4 = answerChoice.get(3).getText().trim();\n\t\tmcqChoicesText5 = answerChoice.get(4).getText().trim();\n\t\tmcqChoicesText6 = answerChoice.get(5).getText().trim();\n\t}", "public void modifyQuestion(String text) {\n // TODO implement here\n }", "public void setQuestions() {\n\t\tString question1 = str1 + _QwdQuestionFst;\n\t\tSpannableString sb1 = new SpannableString(question1);\n\t\tsb1.setSpan(new ForegroundColorSpan(Color.BLACK), str1.length() ,\n\t\t\t\tsb1.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);\n\t\t_FPTV_Question_1.setText(sb1);\n\n\t\tString question2 = str2 + _QwdQuestionSec;\n\t\tSpannableString sb2 = new SpannableString(question2);\n\t\tsb2.setSpan(new ForegroundColorSpan(Color.BLACK), str2.length() ,\n\t\t\t\tsb2.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);\n\t\t_FPTV_Question_2.setText(sb2);\n\t}", "public void hintMessage1(View view) {\n makeAToast(R.string.question_1_hint);\n }", "public void setP1Van() {\n p1Points.setText(\"Ad\");\n }", "public void setForgottenPasswordAnswer1(String forgottenPasswordAnswer1) {\n\t\tthis.forgottenPasswordAnswer1 = forgottenPasswordAnswer1;\n\t}", "private void setAnswers()\n {\n StringBuilder answers = new StringBuilder(256);\n String[] correctAnswers = getResources().getStringArray(R.array.correct_answers);\n TextView answer_view = (TextView) findViewById(R.id.answers);\n for(int i = 0 ; i < correctAnswers.length; i++)\n {\n answers.append(correctAnswers[i]);\n }\n answer_view.setText(answers.toString());\n }", "private void updateQuestion(){\n\t\tint question = mQuestionBank[mCurrentIndex].getQuestion();\n\t\tmQuestionTextView.setText(question);\n\t}", "public void setAnswer(String newAnswer){\n this.answer = newAnswer; \n }", "private void setquestion() {\n qinit();\n question_count++;\n\n if (modeflag == 3) {\n modetag = (int) (Math.random() * 3);\n } else {\n modetag = modeflag;\n }\n\n WordingIO trueword = new WordingIO(vocabulary);\n\n if (modetag == 0) {\n\n MCmode(trueword);\n }\n\n if (modetag == 1) {\n BFmode(trueword);\n }\n\n if (modetag == 2) {\n TLmode(trueword);\n }\n\n if (time_limit != 0) {\n timingtoanswer(time_limit, jLabel2, answer_temp, jLabel5, jLabel6, jButton1);\n }\n }", "public String getAnswerText3() {\r\n\t\treturn answerText3;\r\n\t}", "private void updateQuestion(){\n int question = mQuestionBank[mCurrentIndex].getmQuestion();\n mQuestionTextView.setText(question);\n }", "@FXML\n\tprivate void answerQuestion() {\n\t\tint correctAnsID = 0;\n\t\ttry {\n\t\t\tswitch (((RadioButton) answerGroup.getSelectedToggle()).getId()) {\n\t\t\tcase \"ans1Check\":\n\t\t\t\tcorrectAnsID = 1;\n\t\t\t\tbreak;\n\t\t\tcase \"ans2Check\":\n\t\t\t\tcorrectAnsID = 2;\n\t\t\t\tbreak;\n\t\t\tcase \"ans3Check\":\n\t\t\t\tcorrectAnsID = 3;\n\t\t\t\tbreak;\n\t\t\tcase \"ans4Check\":\n\t\t\t\tcorrectAnsID = 4;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\terrorLabel.setVisible(true);\n\t\t}\n\n\t\t// nothing is selected\n\t\tif (correctAnsID == 0) { \n\t\t\terrorLabel.setVisible(true);\n\t\t\t// correct answer\n\t\t} else if (question.getCorrect_ans() == correctAnsID) {\n\t\t\tcontrol.setScore(control.getScore() + question.getScore());\n\t\t\thandleAlertAndWindow(AlertType.INFORMATION, \"Congrats! :D\",\n\t\t\t\t\t\"You received \" + question.getScore() + \" points\");\n\t\t\t// wrong answer\n\t\t} else {\n\t\t\tcontrol.setScore(control.getScore() + question.getPenalty());\n\n\t\t\thandleAlertAndWindow(AlertType.ERROR, \"Uh oh! :(\",\n\t\t\t\t\t\"You lost \" + question.getPenalty() + \" points\");\n\t\t}\n\n\t\t// reset the eaten question\n\t\tViewLogic.playGameController.getControl().setQuestionEaten(null);\n\t}", "public void clearAnswer(){\r\n textField1.setText(\"\");\r\n }", "private void settingQuestion() {\n\n int[] setWord = {0, 0, 0, 0, 0};\n int[] setPos = {0, 0, 0, 0};\n int[] setBtn = {0, 0, 0, 0};\n\n Random ans = new Random();\n int wordNum = ans.nextInt(vocabularyLesson.size());\n //answer = vocabularyLesson.get(wordNum).getMean();\n word = vocabularyLesson.get(wordNum).getWord();\n vocabularyID = vocabularyLesson.get(wordNum).getId();\n answer = word;\n\n Practice practice = pc.getPracticeById(vocabularyID);\n if (practice != null) {\n Log.d(\"idVocabulary\", practice.getSentence());\n question.setText(practice.getSentence());\n }\n\n\n // Random position contain answer\n setWord[wordNum] = 1;\n Random p = new Random();\n int pos = p.nextInt(4);\n if (pos == 0) {\n word1.setText(word);\n setBtn[0] = 1;\n }\n if (pos == 1) {\n word2.setText(word);\n setBtn[1] = 1;\n }\n if (pos == 2) {\n word3.setText(word);\n setBtn[2] = 1;\n }\n if (pos == 3) {\n word4.setText(word);\n setBtn[3] = 1;\n }\n setPos[pos] = 1;\n\n // Random 3 position contain 3 answer\n for (int i = 0; i < 3; i++) {\n Random ques = new Random();\n int num = ques.nextInt(5);\n int p1 = ques.nextInt(4);\n while (setWord[num] == 1 || setPos[p1] == 1) {\n num = ques.nextInt(5);\n p1 = ques.nextInt(4);\n }\n String wordIncorrect = vocabularyLesson.get(num).getWord();\n setWord[num] = 1;\n setPos[p1] = 1;\n if (setBtn[p1] == 0 && p1 == 0) {\n word1.setText(wordIncorrect);\n setBtn[0] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 1) {\n word2.setText(wordIncorrect);\n setBtn[1] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 2) {\n word3.setText(wordIncorrect);\n setBtn[2] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 3) {\n word4.setText(wordIncorrect);\n setBtn[3] = 1;\n }\n }\n\n }", "public void q1Submit(View view) {\n\n EditText editText = (EditText) findViewById(R.id.q1enterEditText);\n String q1answer = editText.getText().toString().trim();\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if ((q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck1))) || (q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck2)))) {\n if (isNotAnsweredQ1) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct1), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ1 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }", "public void changeText(String s) {\n textArea1.setText(s);\n\n }", "public void setQuestionText(String questionText) {\n this.questionText = questionText;\n }", "public void setText( String text );", "public void setOptionText(String newText) {\n this.option = newText;\n\n this.database.update(\"AnswerOptions\", \"option = '\" + option + \"'\", \"optionId = \" + this.optionId);\n }", "private void btnSpeaker2ActionPerformed(java.awt.event.ActionEvent evt) {\n txtSpeaker2.setText(Dialog());\n \n }", "@Click(R.id.bt_answer2)\n void clickAnswer2() {\n selectedAnswer = questionList.get(questionProgress - 1).getAnswers().get(1);\n showResult();\n }", "public void setText(String text);", "public void setText(String text) {\n\t\t\n\t}", "public void setText(String text) {\r\n\r\n\t}", "private void setText(Text text) {\n \t\tthis.text = text;\n \t}", "public void actionPerformed(ActionEvent e){\n\t\t\t\t\tif (q2.isAnswerCorrect(getattempt.getText())){ //if you get the 2nd question correct\n\t\t\t\t\t\tforq2 = 1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tint score = forq1 + forq2; //score is the sum of the individual questions\n\t\t\t\t\tattempt2 = getattempt.getText(); //removes all the own components to make way for the new ones\n\t\t\t\t\tquestionarea.setVisible(false);\n\t\t\t\t\tenter.setVisible(false);\n\t\t\t\t\tgetattempt.setVisible(false);\n\t\t\t\t\tJLabel result = new JLabel(\"RESULT: \" + score + \"/2\"); //the result of your quizz\n\t\t\t\t\tresult.setFont(new Font(\"Serif\", Font.BOLD, 50));\n\t\t\t\t\tresult.setBounds(110,15, 400,50);\n\t\t\t\t\tJTextArea question1 = new JTextArea(q1.question);\n\t\t\t\t\tJTextArea question2 = new JTextArea(q2.question);\n\t\t\t\t\n\t\t\t\t\t//displays the correct answer your answer, and the question\n\t\t\t\t\tJLabel header = new JLabel(\"Question Your Answer Correct Ans.\");\n\t\t\t\t\theader.setFont(new Font(\"Serif\", Font.BOLD, 15));\n\t\t\t\t\theader.setBounds(10, 65,500,50);\n\t\t\t\t\t\n\t\t\t\t\tquestion1.setBounds(10,110, 280,50);\n\t\t\t\t\tquestion1.setLineWrap(true);\n\t\t\t\t\tJTextArea youranswer = new JTextArea (attempt);\n\t\t\t\t\tyouranswer.setBounds(300, 110, 50,30);\n\t\t\t\t\tJTextArea theanswer = new JTextArea(q1.answer);\n\t\t\t\t\ttheanswer.setBounds(410, 110,50,30);\n\t\t\t\t\t\n\t\t\t\t\tquestion2.setBounds(10,160, 280,50);\n\t\t\t\t\tquestion2.setLineWrap(true);\n\t\t\t\t\tJTextArea youranswer2 = new JTextArea (attempt2);\n\t\t\t\t\tyouranswer2.setBounds(300, 160 ,50,30);\n\t\t\t\t\tJTextArea theanswer2 = new JTextArea(q2.answer);\n\t\t\t\t\ttheanswer2.setBounds(410, 160,50,30);\n\t\t\t\t\t//adds everything to the JPanel\n\t\t\t\t\tadd(result);\n\t\t\t\t\tadd(question1);\n\t\t\t\t\tadd(question2);\n\t\t\t\t\tadd(header);\n\t\t\t\t\tadd(youranswer);\n\t\t\t\t\tadd(theanswer);\n\t\t\t\t\tadd(youranswer2);\n\t\t\t\t\tadd(theanswer2);\n\t\t\t\t\t\n\t\t\t\t\tJButton quit = new JButton(\"Exit\"); //the button that allows you to quit\n\t\t\t\t\tquit.setBounds(50,230,65,20);\n\t\t\t\t\tquit.addActionListener(new Quitter());\n\t\t\t\t\tadd(quit);\n\t\t\t\t\tif(type == 0){ //the type - if after u win a level, then you only need 1 right to pass, but if you lost, then u need 2 questins to pass, type == 0 is for loss\n\t\t\t\t\t\tif (score == 2){\n\t\t\t\t\t\t\tJButton retrylevel = new JButton(\"Retry\");\n\t\t\t\t\t\t\tretrylevel.setBounds(350,230,65,20);\n\t\t\t\t\t\t\tretrylevel.addActionListener(new Retry());\n\t\t\t\t\t\t\tadd(retrylevel);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tJButton retrylevel = new JButton(\"New Game\");\n\t\t\t\t\t\t\tretrylevel.setBounds(350,210,100,20);\n\t\t\t\t\t\t\tretrylevel.addActionListener(new Retry());\n\t\t\t\t\t\t\tadd(retrylevel);\t\n\t\t\t\t\t\t\tnumplanes = 1;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\thealth = finalhealth;\n\t\t\t\t\t}\n\t\t\t\t\telse if (type == 1){ //if you just cleared a wave of planes, this pops up\n\t\t\t\t\t\tif (score == 2){\n\t\t\t\t\t\t\tJButton retrylevel = new JButton(\"Continue\");\n\t\t\t\t\t\t\tretrylevel.setBounds(330,230,100,20);\n\t\t\t\t\t\t\tretrylevel.addActionListener(new Retry());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfinalhealth++;\n\t\t\t\t\t\t\thealth = finalhealth;\n\t\t\t\t\t\t\tadd(retrylevel);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (score==1){ //lets you pass on but no health bonus\n\t\t\t\t\t\t\tJButton retrylevel = new JButton(\"Continue\");\n\t\t\t\t\t\t\tretrylevel.setBounds(330,230,100,20);\n\t\t\t\t\t\t\tretrylevel.addActionListener(new Retry());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\thealth = finalhealth;\n\t\t\t\t\t\t\tadd(retrylevel);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse { //forces you to restart\n\t\t\t\t\t\t\tJButton retrylevel = new JButton(\"Restart Level\");\n\t\t\t\t\t\t\tretrylevel.setBounds(350,210,120,20);\n\t\t\t\t\t\t\tretrylevel.addActionListener(new Retry());\n\t\t\t\t\t\t\tadd(retrylevel);\n\t\t\t\t\t\t\thealth=finalhealth;\n\t\t\t\t\t\t\tnumplanes--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void setText(String promptText) {\n super.setText(promptText); \n if (promptText != null) {\n ResizeUtils.updateSize(this, actions);\n }\n }", "public void actionPerformed(ActionEvent e){\n\t\t\t\t\tif (q1.isAnswerCorrect(getattempt.getText())){ //if its correct\n\t\t\t\t\t\tforq1 = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse forq1 = 0; //if it is incorrect\n\t\t\t\t\tattempt = getattempt.getText();\n\t\t\t\t\t\n\t\t\t\t\tquestionarea.setText(q2.question);//changes everything for the 2nd question after entering the first question\n\t\t\t\t\tgetattempt.setText(\"Enter your answer here\");\n\t\t\t\t\t//enter.remove(et);\n\t\t\t\t\tenter.addActionListener(ft);\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void setText(String text) {\n label.setText(text);\n textArea.setText(text);\n }", "public final void setLabel1(@Nullable CharSequence label) {\n mLabel1 = label;\n }", "void setQuestion(){\n int numberRange = currentLevel * 3;\n Random randInt = new Random();\n\n int partA = randInt.nextInt(numberRange);\n partA++;//not zero\n\n int partB = randInt.nextInt(numberRange);\n partB++;//not zero\n\n correctAnswer = partA * partB;\n int wrongAnswer1 = correctAnswer-2;\n int wrongAnswer2 = correctAnswer+2;\n\n textObjectPartA.setText(\"\"+partA);\n textObjectPartB.setText(\"\"+partB);\n\n //set the multi choice buttons\n //A number between 0 and 2\n int buttonLayout = randInt.nextInt(3);\n switch (buttonLayout){\n case 0:\n buttonObjectChoice1.setText(\"\"+correctAnswer);\n buttonObjectChoice2.setText(\"\"+wrongAnswer1);\n buttonObjectChoice3.setText(\"\"+wrongAnswer2);\n break;\n\n case 1:\n buttonObjectChoice2.setText(\"\"+correctAnswer);\n buttonObjectChoice3.setText(\"\"+wrongAnswer1);\n buttonObjectChoice1.setText(\"\"+wrongAnswer2);\n break;\n\n case 2:\n buttonObjectChoice3.setText(\"\"+correctAnswer);\n buttonObjectChoice1.setText(\"\"+wrongAnswer1);\n buttonObjectChoice2.setText(\"\"+wrongAnswer2);\n break;\n }\n }", "public void displayCorrect(){\n textPane1.setText(\"\");\r\n generatePlayerName();\r\n textPane1.setText(\"GOOD JOB! That was the correct answer.\\n\"\r\n + atBatPlayer + \" got a hit!\\n\" +\r\n \"Press Next Question, or hit ENTER, to continue.\");\r\n SWINGButton.setText(\"Next Question\");\r\n formattedTextField1.setText(\"\");\r\n formattedTextField1.setText(\"Score: \" + score);\r\n }", "void setText (String text);", "public Question(String aQText, String anA1Text, String anA2Text, String anA3Text, String anA4Text, int aCorrect, int aValue){\n qText = aQText;\n a1Text = anA1Text;\n a2Text = anA2Text;\n a3Text = anA3Text;\n a4Text = anA4Text;\n correct = aCorrect;\n value = aValue;\n }", "public void reset() {\n\t\tTextView SetQuestionText = (TextView) findViewById(R.id.textView5);\n\t\tSetQuestionText.setText(\"\" + Question);\n\t\tEditText editText22 = (EditText) findViewById(R.id.editText1);\n\t\teditText22.setText(\" ?\");\n\t\tExpresstion_generator_based_on_difficulty();\n\t\tEndTimer();\n\t\tStartTimer();\n\t}", "public void setAnswer(String answer) {\r\n this.answer = answer;\r\n }", "private void setQuestionView() {\n textView.setText(currentQuestion.getQuestion());\n buttonA.setText(currentQuestion.getOptA());\n buttonB.setText(currentQuestion.getOptB());\n buttonC.setText(currentQuestion.getOptC());\n numberText.setText(\"Question \" + (questionID + 1) + \" of \" + questionList.size());\n questionID++;\n }", "public void setQuestion(){\n\n\n triggerReport(); //Check if max questions are displayed, if yes then show report\n\n MyDatabase db = new MyDatabase(QuizCorner.this);\n Cursor words = db.getQuizQuestion();\n TextView question_text = (TextView) findViewById(R.id.question_text);\n RadioButton rb;\n resetOptions();\n disableCheck();\n enableRadioButtons();\n hideAnswer();\n words.moveToFirst();\n word = words.getString(words.getColumnIndex(\"word\"));\n correct_answer = words.getString(words.getColumnIndex(\"meaning\"));\n question_text.setText(word + \" means:\");\n for (int i = 0; i < 4; i++){\n answers[i] = words.getString(words.getColumnIndex(\"meaning\"));\n words.moveToNext();\n }\n answers = randomizeArray(answers);\n for (int i = 0; i < 4; i++){\n rb = (RadioButton) findViewById(options[i]);\n rb.setText(answers[i]);\n }\n question_displayed_count++;\n }", "public void setarText() {\n txdata2 = (TextView) findViewById(R.id.txdata2);\n txdata1 = (TextView) findViewById(R.id.txdata3);\n txCpf = (TextView) findViewById(R.id.cpf1);\n txRenda = (TextView) findViewById(R.id.renda1);\n txCpf.setText(cpf3);\n txRenda.setText(renda.toString());\n txdata1.setText(data);\n txdata2.setText(data2);\n\n\n }", "void setText(String text);", "public void updateP1(String stats)\r\n\t{\r\n\t\tp1.setText(stats);\r\n\t}", "public void resetQuestion() \n\t{\n\t\tthis.game = masterPanel.getGame();\n\t\t\n\t\tArrayList<String> tempQuestion = new ArrayList<String>();\n\t\ttempQuestion = getRandQuestion();\n\t\t\n\t\tquestion.setText(tempQuestion.get(0));\n\t\tanswerOne.setText(tempQuestion.get(1));\n\t\tanswerTwo.setText(tempQuestion.get(2));\n\t\tanswerThree.setText(tempQuestion.get(3));\n\t\tanswerFour.setText(tempQuestion.get(4));\n\t\tcorrectAnswer = tempQuestion.get(5);\n\t\t\n\t\tlayoutConstraints.gridy = 1;\n\t\tthis.add(answerOne, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 2;\n\t\tthis.add(answerTwo, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 3;\n\t\tthis.add(answerThree, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 4;\n\t\tthis.add(answerFour, layoutConstraints);\n\t\t\n\t\tthis.repaint();\n\t}", "@Override\n public void actionPerformed(ActionEvent e)\n {\n area2.setText(area1.getText());\n }", "public void enterAnswer(String text) {\n\t\ttextBox.clear();\n\t\ttextBox.sendKeys(text);\n\t}", "private void populateQuestion(String tempQuestionText) {\n\n\t\t// set them to radio options\n\t\tquestionTextView.setText(tempQuestionText);\n\n\t}", "public void setForgottenPasswordQuestion1(String forgottenPasswordQuestion1) {\n\t\tthis.forgottenPasswordQuestion1 = forgottenPasswordQuestion1;\n\t}", "public void changeText()\n {\n Double base = 1.0;\n Double exponent = 0.0;\n\n try\n {\n /*get the values of the text inputs and set them to their respective variable, converting them to\n a double*/\n base = Double.parseDouble(txtBase.getText());\n exponent = Double.parseDouble(txtExponent.getText());\n }\n catch (NumberFormatException e) {\n /*On NumberFormatException, do nothing. Suppresses errors in the console which we do not need to\n know about, this is an expected and solved issue.*/\n }\n\n //calculate the new result, based on the current values of exponent and base, then set it to the output.\n Double result = Math.pow(base, exponent);\n lblResult.setText(result.toString());\n }", "public void changeQuestionText(Question question, String text) throws Exception {\n DataBaseBroker dbb = new DataBaseBroker();\n dbb.loadDriver();\n dbb.establishConnection();\n question.setText(text);\n dbb.overwriteQuestion(question);\n dbb.commit();\n dbb.closeConnection();\n }", "private void updateQuestion()//update the question each time\n\t{\n\t\tInteger num = random.nextInt(20);\n\t\tcurrentAminoAcid = FULL_NAMES[num];\n\t\tcurrentShortAA= SHORT_NAMES[num];\n\t\tquestionField.setText(\"What is the ONE letter name for:\");\n\t\taminoacid.setText(currentAminoAcid);\n\t\tanswerField.setText(\"\");\n\t\tvalidate();\n\t}", "public void setText(String text) {\r\n\t\tthis.text= text;\r\n\t}", "public void saveQuestion(){\n\n\t\tint numAnswers = testGenerator.getNumAnswers(questionNo);\n\t\tString setAnswerBox = Integer.toString(numAnswers);\n\n\t\ttestGenerator.setQuestionText(questionNo, ques.getText());\n\t\ttestGenerator.setAnswerText(questionNo, 1, ans1.getText());\n\t\ttestGenerator.setAnswerText(questionNo, 2, ans2.getText());\n\n\t\ttestGenerator.setIsAnswerCorrect(questionNo, 1, answer1.isSelected());\n\t\ttestGenerator.setIsAnswerCorrect(questionNo, 2, answer2.isSelected());\n\n\t\tif((setAnswerBox.equals(\"3\")) || setAnswerBox.equals(\"4\")) {\n\t\t\ttestGenerator.setAnswerText(questionNo, 3, ans3.getText()); \t\n\t\t\ttestGenerator.setIsAnswerCorrect(questionNo, 3, answer3.isSelected());\n\t\t}\n\n\t\tif(setAnswerBox.equals(\"4\")) {\n\t\t\ttestGenerator.setAnswerText(questionNo, 4, ans4.getText()); \t\n\t\t\ttestGenerator.setIsAnswerCorrect(questionNo, 4, answer4.isSelected());\n\t\t}\n\t}", "private void ConvertTextToSpeech(String voice1) {\n text=voice1;\n //text = et.getText().toString();\n if (text == null || \"\".equals(text)) {\n tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);\n } else\n tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);\n }", "@Override\n\tpublic void setText(String arg0) {\n\t\t\n\t}", "private void secQuestionInput()\n {\n if(textBox1.getText().equals(user.getSecretQAns()))\n {\n secQuestion = false;\n password = true;\n\n textBox1.setText(\"\");\n textBox1.promptTextProperty().set(\"New Password\");\n labelHeader.setText(\"Input new password\");\n\n textBox2Label.setVisible(true);\n textBox2Label.setText(\"Confirm New Password\");\n textBox2.setVisible(true);\n textBox1Label.setText(\"New Password\");\n }\n else\n {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setContentText(\"Security answer does not match!\");\n alert.show();\n }\n }", "public void correctAnswer(){\n AlertDialog.Builder dialogBoxAns = new AlertDialog.Builder(this);\n //set title to dialog box\n dialogBoxAns.setTitle(\"Results\");\n //set correct message to dialog box\n dialogBoxAns.setMessage((Html.fromHtml(\"<font color='#39FF14'> CORRECT! </font> \")));\n //set button to dialog box\n dialogBoxAns.setPositiveButton(\"OK\", null);\n //create new dialog box\n AlertDialog dialog = dialogBoxAns.create();\n dialog.show();\n }", "public String getPollAnswer1() {\n return pollAnswer1;\n }", "public void button1(View v) {\n expression += \"1\";\n\n /* Update the screen. */\n TextView expressionText = (TextView) findViewById(R.id.expressionText);\n expressionText.setText(expression);\n }", "public void setText(String text)\n {\n this.text = text;\n }", "private void setQuestionView()\n\t{\n txtQNumber.setText(qid + 1 + \"/\" + numberOfQuestions);\n\t\ttxtQuestion.setText(currentQ.getQUESTION());\n\t\ttxtReference.setText(currentQ.getREFERENCE());\n\t\trda.setText(currentQ.getOPTA());\n\t\trdb.setText(currentQ.getOPTB());\n\t\trdc.setText(currentQ.getOPTC());\n\t\trdd.setText(currentQ.getOPTD());\n\t\tqid++;\n\t}", "public void home_score(int score1){\n homeSore.setText(String.valueOf(score1));\n }", "private void updateQuestion(){\n mchoice1.setChecked(false);\n mchoice2.setChecked(false);\n mchoice3.setChecked(false);\n mchoice4.setChecked(false);\n\n if (mQuestonNumber < mQuizLibrary.getLength()){\n //menset setiap textview dan radiobutton untuk diubah jadi pertanyaan\n sQuestion.setText(mQuizLibrary.getQuestion(mQuestonNumber));\n //mengatur opsi sesuai pada optional A\n mchoice1.setText(mQuizLibrary.getChoice(mQuestonNumber, 1)); //Pilihan Ganda ke 1\n //mengatur opsi sesuai pada optional B\n mchoice2.setText(mQuizLibrary.getChoice(mQuestonNumber, 2)); //Pilihan Ganda ke 2\n //mengatur opsi sesuai pada optional C\n mchoice3.setText(mQuizLibrary.getChoice(mQuestonNumber, 3)); //Pilihan Ganda ke 3\n //mengatur opsi sesuai pada optional D\n mchoice4.setText(mQuizLibrary.getChoice(mQuestonNumber, 4)); //Pilihan Ganda ke 4\n\n manswer = mQuizLibrary.getCorrect(mQuestonNumber);\n //untuk mengkoreksi jawaban yang ada di class QuizBank sesuai nomor urut\n mQuestonNumber++; //update pertanyaan\n }else{\n Toast.makeText(Quiz.this, \"ini pertanyaan terakhir\", Toast.LENGTH_LONG).show();\n Intent i = new Intent (Quiz.this, HighestScore.class);\n i.putExtra(\"score\", mScore); //UNTUK MENGIRIM NILAI KE activity melalui intent\n startActivity(i);\n }\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif(e.getSource() == e1) {\r\n\t\t\t\t\ttext.setText(\"4\");\r\n\t\t\t\t}\r\n\t\t\t}", "public void onClick(View arg0) {\n // change the text to state that radio button one was clicked\n tv_display.setText(R.string.tv_display_rb1);\n }", "private void setQuestion(int resID){\n questionView.setText(resID);\n ecaFragment.sendToECAToSpeak(getResources().getString(resID));\n }", "public void setQuestion(Question q)\n {\n currentQuestion=q;\n questionLabel.setText(q.getQuestion());\n feedbackLabel.setVisible(false);\n }", "public void answer1Clicked(View view) {\n\n answer1Clicked = true;\n\n answer2Clicked = false;\n answer3Clicked = false;\n answer4Clicked = false;\n\n changeButtonColor();\n }", "public void setText(String text) {\r\n this.text = text;\r\n }", "private void setQuestion(int number){\n tv_question.setText(questionsList.get(number).getQuestion());\n\n }", "@Override\n\tpublic void setText(String text) {\n \tif (_assocModel == null) return;\n\t\tString mult;\n\t\tPattern p = Pattern.compile(\"([\\\\d]|\\\\Q*\\\\E)([.]{2}+([\\\\d]|\\\\Q*\\\\E))?\");\t// regex for multiplicities: (digit | *) + optional(.. (digit | *))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// can use a Collection to handle multiplicities of *; we really only care about\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the upper bound also\n\t\tMatcher m = p.matcher(text);\n\t\t// regex didn't find anything, so we'll assign a default multiplicity\n\t\tif (!m.find() || m.group().length() < 0) {\n\t\t\tmult=\"1\";\n\t\t}\n\t\telse mult = m.group();\n\t\t_assocModel.setMultiplicity(mult);\n\t\tsuper.setText(mult);\n\t}", "@Override\n public void setText(String englishText) {\n\n }", "public void setText(String text) {\n this.text = text;\n }", "public void setText(String text) {\n this.text = text;\n }", "public void setText(String text) {\n this.text = text;\n }", "public void setText(String text) {\n this.text = text;\n }", "public void setText(String text) {\n this.text = text;\n }", "public void setText(String text) {\n this.text = text;\n }", "public void setText(String text) {\n this.text = text;\n }", "public void setInstructions(String text){\n instructions.setText(text);\n }", "public void setText(String text) {\r\n\t\tthis.text = text;\r\n\t}", "public boolean setQuiz1(double quiz1)\n\t{\n\t\tboolean isValid;\n\t\t\n\t\tisValid = isValidQuiz1(quiz1);\n\t\t\n\t\tif(isValid)\n\t\t{\n\t\t\tthis.quiz1 = quiz1;\n\t\t}\n\t\t\n\t\treturn isValid;\n\t}", "public void onClick(View arg0) {\n // change the text to state that radio button one was clicked\n tv_display.setText(R.string.tv_display_rb2);\n }", "public void setText(String text)\n\t{\n\t\tthis.text = text;\n\t}", "public void setText(String text)\n\t{\n\t\tthis.text = text;\n\t}", "@Override\n\tpublic void SuccessText(String text) {\n\t\tLog.i(TAG, \"==-->text:=\"+text);\n\t\tmain_one.setText(text);\n\t}", "@Override\n\tpublic int getAnswerNum() {\n\t\treturn 1;\n\t}", "public void setQuestion()\n\t{\n\t\tthis.game = masterPanel.getGame();\n\t\t\n\t\tthis.setLayout(new GridBagLayout());\n\t\t\n\t\tArrayList<String> tempQuestion = new ArrayList<String>();\n\t\ttempQuestion = getRandQuestion();\n\t\t\t\t\n\t\tquestion = new JLabel();\n\t\tquestion.setText(tempQuestion.get(0));\n\t\tquestion.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tquestion.setPreferredSize(new Dimension(BUTTON_WIDTH + 200, BUTTON_HEIGHT));\n\t\t\n\t\tlayoutConstraints.gridy = 0;\n\t\tlayoutConstraints.insets = new Insets(10, 10, 10, 10);\n\t\tthis.add(question, layoutConstraints);\n\t\t\n\t\tanswerOne = new JButton();\n\t\tanswerOne.setText(tempQuestion.get(1));\n\t\tanswerOne.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));\n\t\tanswerOne.addActionListener(new AnswerButtonListener());\n\t\t\n\t\tlayoutConstraints.gridy = 1;\n\t\tthis.add(answerOne, layoutConstraints);\n\t\t\n\t\tanswerTwo = new JButton();\n\t\tanswerTwo.setText(tempQuestion.get(2));\n\t\tanswerTwo.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));\n\t\tanswerTwo.addActionListener(new AnswerButtonListener());\n\t\t\n\t\tlayoutConstraints.gridy = 2;\n\t\tthis.add(answerTwo, layoutConstraints);\n\t\t\n\t\tanswerThree = new JButton();\n\t\tanswerThree.setText(tempQuestion.get(3));\n\t\tanswerThree.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));\n\t\tanswerThree.addActionListener(new AnswerButtonListener());\n\t\t\n\t\tlayoutConstraints.gridy = 3;\n\t\tthis.add(answerThree, layoutConstraints);\n\t\t\n\t\tanswerFour = new JButton();\n\t\tanswerFour.setText(tempQuestion.get(4));\n\t\tanswerFour.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));\n\t\tanswerFour.addActionListener(new AnswerButtonListener());\n\t\t\n\t\tlayoutConstraints.gridy = 4;\n\t\tthis.add(answerFour, layoutConstraints);\n\t\t\n\t\tcorrectAnswer = tempQuestion.get(5);\t\n\t}" ]
[ "0.7967956", "0.7703133", "0.72550064", "0.6759519", "0.6659617", "0.6617382", "0.6564866", "0.63782567", "0.6347384", "0.6345873", "0.6300181", "0.62822044", "0.6273388", "0.6260493", "0.61775225", "0.61766005", "0.6172356", "0.6151933", "0.61472195", "0.6130555", "0.6110651", "0.6092552", "0.60788083", "0.6061097", "0.6040753", "0.60258806", "0.6013873", "0.5963465", "0.5960043", "0.59474736", "0.59364855", "0.59302914", "0.5922547", "0.5913026", "0.59064984", "0.59055233", "0.58895", "0.5888474", "0.5869285", "0.5868028", "0.58639437", "0.58591825", "0.5853443", "0.58379817", "0.58326346", "0.58316696", "0.58280814", "0.58175445", "0.5814418", "0.5811539", "0.5805726", "0.5802438", "0.5791636", "0.5781437", "0.5775824", "0.5773535", "0.57615644", "0.57532614", "0.57497525", "0.57490224", "0.57416326", "0.57367015", "0.573578", "0.57348156", "0.5730227", "0.57300663", "0.57291824", "0.57243556", "0.5710653", "0.5696168", "0.56819504", "0.56707156", "0.56697345", "0.5667086", "0.56670713", "0.56626827", "0.56624645", "0.5653962", "0.5645928", "0.56441325", "0.5643498", "0.56257004", "0.56122696", "0.5610903", "0.5609397", "0.5609397", "0.5609397", "0.5609397", "0.5609397", "0.5609397", "0.5609397", "0.5606816", "0.5602112", "0.5600961", "0.5598533", "0.55967814", "0.55967814", "0.5592624", "0.559134", "0.5590167" ]
0.8842797
0
Gets the answer text2.
public String getAnswerText2() { return answerText2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getAnswerText1() {\r\n\t\treturn answerText1;\r\n\t}", "public String getText2() {\n return text2;\n }", "public void setAnswerText2(String answerText2) {\r\n\t\tthis.answerText2 = answerText2;\r\n\t}", "public String getAnswerText3() {\r\n\t\treturn answerText3;\r\n\t}", "public String getPollAnswer2() {\n return pollAnswer2;\n }", "public String getHint2() {\n return this.hint2;\n }", "java.lang.String getCorrectAnswer();", "public String getTextTF2() {\n\t\treturn tf2.getText();\n\t}", "@Click(R.id.bt_answer2)\n void clickAnswer2() {\n selectedAnswer = questionList.get(questionProgress - 1).getAnswers().get(1);\n showResult();\n }", "public String getText3() {\n return text3;\n }", "public String getAnswer(){\n\t\tString result = new String(answer);\n\t\tanswer = \"\"; //reset answer after every read\n\t\treturn result;\n\t}", "public String getCrrAnswerString() {\n if (type.equals(\"txt\")) {\n return getTextCrrAnswer();\n }\n else {\n return answers[mcCrrAnswer - 1];\n }\n }", "public double getQuiz2()\n\t{\n\t\treturn this.quiz2;\n\t}", "public String getInput2() {\n return input2;\n }", "public java.lang.String getQ2Label() {\n return q2Label;\n }", "@Nullable\n public final CharSequence getLabel2() {\n return mLabel2;\n }", "public void setAnswerText1(String answerText1) {\r\n\t\tthis.answerText1 = answerText1;\r\n\t}", "public String getForgottenPasswordAnswer2() {\n\t\treturn forgottenPasswordAnswer2;\n\t}", "public String getPollAnswer1() {\n return pollAnswer1;\n }", "public String getPra2() {\n return pra2;\n }", "public String getApellido2() {\r\n\t\treturn apellido2;\r\n\t}", "String getAnswerResponse();", "public BigDecimal getSMART_OPTION_TEXT2() {\r\n return SMART_OPTION_TEXT2;\r\n }", "public BigDecimal getSMART_OPTION_TEXT2() {\r\n return SMART_OPTION_TEXT2;\r\n }", "public String getAnswerByNumber(int n) {\n return this.answers.get(n);\n }", "public String getTextTF1() {\n\t\treturn tf1.getText();\n\t}", "public String getHint1() {\n return this.hint1;\n }", "public java.lang.String getRemark2()\r\n {\r\n return _remark2;\r\n }", "public String getRemarks2() {\n return remarks2;\n }", "public java.lang.String getCurr2() {\n\treturn curr2;\n}", "public String getAnswerText()\r\n\t {\r\n\t return spinner.getValue().toString();\r\n\t }", "public java.lang.String getValue2() {\n return this.value2;\n }", "public String getPollAnswer3() {\n return pollAnswer3;\n }", "public String getAnswer() {\n return answer;\n }", "public String getAnAnswer() {\n\t\t\n\t\tString answer = \"\";\n\t\t\n\t\t\n\t\tRandom randomGenerator = new Random(); //Construct a new random number generator\n\t\tint randomNumber = randomGenerator.nextInt(mAnswers.length);\n\t\t\n\t\tanswer = mAnswers[randomNumber];\n\t\t\n\t\treturn answer;\n\t}", "public String getAnAnswer() {\n\n\t\tString answer = \" \";\n\n\t\t// Randomly select one of the answers\n\t\t// Construct a random number using the Random class and the\n\t\t// nextInt method\n\t\tRandom randomGenerator = new Random();\n\t\tint randomNumber = randomGenerator.nextInt(mAnswers.length);\n\n\t\t// Assign a randomly generated number to an answer\n\t\tanswer = mAnswers[randomNumber];\n\n\t\t// Return the result\n\t\treturn answer;\n\t}", "public String getChoice2(int a){\n String choice1 = choices[a][1];\n return choice1;\n }", "public String getSupBytxt2() {\n return supBytxt2;\n }", "public String getForgottenPasswordQuestion2() {\n\t\treturn forgottenPasswordQuestion2;\n\t}", "public int getInput2() {\n return input2;\n }", "public String getCorrect() {\n\t\treturn new String(correctAnswer);\n\t}", "public String getSelectedAnswer() {\n\t\tList<Integer> selected = getSelectedIndexes();\n\t\treturn this.value.get(selected.get(0));\n\t}", "public String getDescription2() {\r\n return description2;\r\n }", "public String getAnswer(int index){\n return answerList.get(index);\n }", "public String getTest2() {\r\n return test2;\r\n }", "public String getRadius2()\n\t{\n\t\treturn radius2.getText();\n\t}", "public String getCorrectedText() {\n return this.computeCorrectedText();\n }", "public String getUser2()\n {\n return userInput2;\n }", "public String retA()\n\t{\n\t\treturn answers[correctAns]; \t\n\t}", "public double getOperand2()\r\n\t{\r\n\t\tSystem.out.println(\"enter the operand 2:\");\r\n\t\tdouble op2=sc.nextDouble();\r\n\t\treturn op2;\r\n\t}", "public java.lang.String getLine2() {\r\n return line2;\r\n }", "public String getAnswer(){\n return this.answer;\n }", "public void setAnswerText3(String answerText3) {\r\n\t\tthis.answerText3 = answerText3;\r\n\t}", "public String getEventTime2()\n {\n EventTime2 = timeField2.getText();\n return EventTime2;\n }", "public String getTxt_potencia() {\r\n\t\treturn txt_potencia.getText();\r\n\t}", "private int getAnswer() throws IOException {\n String w = next();\n while (w.equals(\"\")) {\n w = next();\n }\n // System.out.println(w + \" is the answer key\");\n c = r.read();\n if (w.equals(\"b\")) {\n return 1;\n } else {\n return 0;\n }\n }", "private String extractSecurityAnswer() {\n return SwingUtil.extract(securityAnswerJTextField, Boolean.TRUE);\n }", "public double getQuiz1()\n\t{\n\t\treturn this.quiz1;\n\t}", "@Override\n\tpublic String getString(String prompt, String value1, String value2) {\n\t\tString s;\n\t\tdo {\n\t\t\tSystem.out.print(prompt);\n\t\t\ts = sc.nextLine(); // read user entry\n\n\t\t\t// Provides error message if response is empty or not 'y' or 'n'\n\t\t\tif (s.trim().isEmpty()) {\n\t\t\t\tSystem.out.println(\"Error! This entry is required. Try again.\");\n\t\t\t} else if (!s.equalsIgnoreCase(value1) && !s.equalsIgnoreCase(value2)) {\n\t\t\t\tSystem.out.println(\"Error! Entry must be 'y' or 'n'. Try agian.\");\n\t\t\t}\n\t\t} while (!s.equalsIgnoreCase(value1) && !s.equalsIgnoreCase(value2));\n\t\treturn s;\n\t}", "public void setAnswer1(String answer1) {\r\n this.answer1 = answer1;\r\n }", "public java.lang.String getCorrectAnswer() {\n java.lang.Object ref = correctAnswer_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n correctAnswer_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getSecondWord()\r\n {\r\n return this.aSecondWord; \r\n }", "public java.lang.String getTestAnswer() {\r\n return testAnswer;\r\n }", "public OctetString getMsg1012()\n {\n\treturn this.msg1012;\n }", "public Alternatives getAlternatives_2() { return cAlternatives_2; }", "public Alternatives getAlternatives_2() { return cAlternatives_2; }", "public String getINSTRUCTIONS2() {\r\n return INSTRUCTIONS2;\r\n }", "String getTextB(){\n\t\treturn textB;\n\t}", "public abstract String getLastAnswer();", "public String ordaindu() {\r\n\t\treturn textField_1.getText();\r\n\t}", "private int getTextAns() {\n EditText tempAns = findViewById(R.id.answer0);\n if (tempAns.getText().toString().toLowerCase().equals(\"addition\")) {\n return 1;\n } else {\n return 0;\n }\n }", "Integer getTxtOrent();", "public String getInput1() {\n return input1;\n }", "@Override\n\t public String solve() {\n\t if (count == 0) {\n\t answer1 = getVariable2()*getVariable3();\n\t setAnswer(answer1 + \"\");\n\t } else if (count == 1) {\n\t answer1 = getVariable1()/getVariable2();\n\t setAnswer(answer1 + \"\");\n\t }else if (count == 2) {\n\t answer1 = getVariable1()/getVariable3();\n\t setAnswer(answer1 + \"\");\n\t }\n\t return getAnswer();\n\t }", "String answerStatement(boolean answer) {\n String answerStatement = getResources().getString(R.string.wrong);\n if (answer) {\n answerStatement = getResources().getString(R.string.correct);\n }\n return answerStatement;\n }", "@DSComment(\"ToggleButton, check callbacks modeled\")\n @DSSafe(DSCat.GUI)\n @DSSource({DSSourceKind.SENSITIVE_UNCATEGORIZED})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:31:45.973 -0500\", hash_original_method = \"3E15133DBF34E1DA0E6FF67809AEAC81\", hash_generated_method = \"68589246CEB40B35E20815867173DA1D\")\n \npublic TextView getText2() {\n return mText2;\n }", "public String getExtra2() {\n return extra2;\n }", "public String getForgottenPasswordAnswer1() {\n\t\treturn forgottenPasswordAnswer1;\n\t}", "public String getLine2() {\n return line2;\n }", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "java.lang.String getText();", "@Override\n\tpublic String getAnswer() {\n\t\treturn \"\" + IntStream.iterate(1, i->i+1)\n\t\t\t\t.mapToObj(i -> Tuple.of(i, sort(DigitsUtils.getDigits(i))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(2*tuple.getKey()))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(3*tuple.getKey()))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(4*tuple.getKey()))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(5*tuple.getKey()))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(6*tuple.getKey()))))\n\t\t\t\t.findFirst()\n\t\t\t\t.orElseThrow(SolutionNotFoundException::new)\n\t\t\t\t.getKey();\n\t}", "public String getOther2() {\n return other2;\n }", "public String getChoice3(int a){\n String choice2 = choices[a][2];\n return choice2;\n }", "public String getAnswercontent() {\n return answercontent;\n }", "public double getAmount2() // getAmount2 method start\n\t\t{\n\t\t\treturn Double.parseDouble(amountField2.getText());\n\t\t}", "public double getAmount2() // getAmount2 method start\n\t\t{\n\t\t\treturn Double.parseDouble(amountField2.getText());\n\t\t}", "@java.lang.Override\n public java.lang.String getCorrectAnswer() {\n java.lang.Object ref = correctAnswer_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n correctAnswer_ = s;\n return s;\n }\n }", "public void choicesText() {\n\t\tmcqChoicesText1 = answerChoice.get(0).getText().trim();\n\t\tmcqChoicesText2 = answerChoice.get(1).getText().trim();\n\t\tmcqChoicesText3 = answerChoice.get(2).getText().trim();\n\t\tmcqChoicesText4 = answerChoice.get(3).getText().trim();\n\t\tmcqChoicesText5 = answerChoice.get(4).getText().trim();\n\t\tmcqChoicesText6 = answerChoice.get(5).getText().trim();\n\t}", "public String getInput3() {\n return input3;\n }", "String getText();", "String getText();", "String getText();", "String getText();" ]
[ "0.7736356", "0.7620959", "0.74323153", "0.70216304", "0.69632673", "0.67714286", "0.6768307", "0.6625698", "0.66237557", "0.6578214", "0.64918756", "0.64862883", "0.642297", "0.6384071", "0.6331899", "0.6309724", "0.628264", "0.6280028", "0.6187289", "0.6176747", "0.6158116", "0.6076713", "0.6068072", "0.6068072", "0.60546905", "0.603333", "0.5989016", "0.5983484", "0.5966081", "0.59585327", "0.5955706", "0.5953132", "0.5951216", "0.5936168", "0.5933625", "0.5932136", "0.591674", "0.58859736", "0.58760065", "0.58621424", "0.58418745", "0.580768", "0.5797819", "0.5788732", "0.57787985", "0.5757255", "0.57419086", "0.5722541", "0.5711392", "0.5694556", "0.56814486", "0.5673025", "0.567042", "0.5653092", "0.56407565", "0.56374407", "0.562485", "0.56246513", "0.5619953", "0.5619769", "0.5613588", "0.55951375", "0.5592758", "0.5590134", "0.5589754", "0.5589754", "0.55897456", "0.5587755", "0.55853087", "0.5568574", "0.55598885", "0.55587655", "0.5551076", "0.5539038", "0.5533021", "0.55319345", "0.5530194", "0.5526326", "0.5526123", "0.5526016", "0.5526016", "0.5526016", "0.5526016", "0.5526016", "0.5526016", "0.5526016", "0.5526016", "0.5522829", "0.5520663", "0.55077904", "0.54969656", "0.5494482", "0.5494482", "0.5475143", "0.5465135", "0.54615855", "0.54609853", "0.54609853", "0.54609853", "0.54609853" ]
0.86739266
0
Sets the answer text2.
public void setAnswerText2(String answerText2) { this.answerText2 = answerText2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setAnswerText1(String answerText1) {\r\n\t\tthis.answerText1 = answerText1;\r\n\t}", "public String getAnswerText2() {\r\n\t\treturn answerText2;\r\n\t}", "public String getAnswerText1() {\r\n\t\treturn answerText1;\r\n\t}", "public void setAnswer1(String answer1) {\r\n this.answer1 = answer1;\r\n }", "public void setAnswerText3(String answerText3) {\r\n\t\tthis.answerText3 = answerText3;\r\n\t}", "@Click(R.id.bt_answer2)\n void clickAnswer2() {\n selectedAnswer = questionList.get(questionProgress - 1).getAnswers().get(1);\n showResult();\n }", "public void setText2(String text2) {\n this.text2 = text2 == null ? null : text2.trim();\n }", "private void setOperand2() {\n\t\ttext_Result.setText(\"\");\n\t\tlabel_Result.setText(\"Result\");\n\t\tlabel_errResult.setText(\"\");\n\t\tif (perform.setOperand2(text_Operand2.getText())) {\n\t\t\tlabel_errOperand2.setText(\"\");\n\t\t\toperand2ErrPart1.setText(\"\"); // Clear the first term of error part\n\t\t\toperand2ErrPart2.setText(\"\"); // Clear the second term of error part\n\t\t\tif (text_Operand1.getText().length() == 0)\n\t\t\t\tlabel_errOperand1.setText(\"\");\n\t\t} else\n\t\t\terr2();\n\t}", "public void updateAnswer(String text) {\n\t\tclearAnswer();\n\t\t\n\t\t// Add new label with the string\n\t\tlbl.setText(text);\n\t\tvPanel.add(lbl);\n\n\t\treturn;\n\t}", "public String getText2() {\n return text2;\n }", "public String getAnswerText3() {\r\n\t\treturn answerText3;\r\n\t}", "private void secQuestionInput()\n {\n if(textBox1.getText().equals(user.getSecretQAns()))\n {\n secQuestion = false;\n password = true;\n\n textBox1.setText(\"\");\n textBox1.promptTextProperty().set(\"New Password\");\n labelHeader.setText(\"Input new password\");\n\n textBox2Label.setVisible(true);\n textBox2Label.setText(\"Confirm New Password\");\n textBox2.setVisible(true);\n textBox1Label.setText(\"New Password\");\n }\n else\n {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setContentText(\"Security answer does not match!\");\n alert.show();\n }\n }", "public void setQ2Label(java.lang.String q2Label) {\n this.q2Label = q2Label;\n }", "public void setAnswer(String newAnswer){\n this.answer = newAnswer; \n }", "@Override\n public void actionPerformed(ActionEvent e)\n {\n area2.setText(area1.getText());\n }", "public void setOptionText(String newText) {\n this.option = newText;\n\n this.database.update(\"AnswerOptions\", \"option = '\" + option + \"'\", \"optionId = \" + this.optionId);\n }", "public void setForgottenPasswordAnswer2(String forgottenPasswordAnswer2) {\n\t\tthis.forgottenPasswordAnswer2 = forgottenPasswordAnswer2;\n\t}", "public void modifyQuestion(String text) {\n // TODO implement here\n }", "public void setQuestions() {\n\t\tString question1 = str1 + _QwdQuestionFst;\n\t\tSpannableString sb1 = new SpannableString(question1);\n\t\tsb1.setSpan(new ForegroundColorSpan(Color.BLACK), str1.length() ,\n\t\t\t\tsb1.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);\n\t\t_FPTV_Question_1.setText(sb1);\n\n\t\tString question2 = str2 + _QwdQuestionSec;\n\t\tSpannableString sb2 = new SpannableString(question2);\n\t\tsb2.setSpan(new ForegroundColorSpan(Color.BLACK), str2.length() ,\n\t\t\t\tsb2.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);\n\t\t_FPTV_Question_2.setText(sb2);\n\t}", "public void button2(View v) {\n expression += \"2\";\n\n /* Update the screen. */\n TextView expressionText = (TextView) findViewById(R.id.expressionText);\n expressionText.setText(expression);\n }", "private void setAnswers()\n {\n StringBuilder answers = new StringBuilder(256);\n String[] correctAnswers = getResources().getStringArray(R.array.correct_answers);\n TextView answer_view = (TextView) findViewById(R.id.answers);\n for(int i = 0 ; i < correctAnswers.length; i++)\n {\n answers.append(correctAnswers[i]);\n }\n answer_view.setText(answers.toString());\n }", "public void actionPerformed(ActionEvent e){\n\t\t\t\t\tif (q2.isAnswerCorrect(getattempt.getText())){ //if you get the 2nd question correct\n\t\t\t\t\t\tforq2 = 1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tint score = forq1 + forq2; //score is the sum of the individual questions\n\t\t\t\t\tattempt2 = getattempt.getText(); //removes all the own components to make way for the new ones\n\t\t\t\t\tquestionarea.setVisible(false);\n\t\t\t\t\tenter.setVisible(false);\n\t\t\t\t\tgetattempt.setVisible(false);\n\t\t\t\t\tJLabel result = new JLabel(\"RESULT: \" + score + \"/2\"); //the result of your quizz\n\t\t\t\t\tresult.setFont(new Font(\"Serif\", Font.BOLD, 50));\n\t\t\t\t\tresult.setBounds(110,15, 400,50);\n\t\t\t\t\tJTextArea question1 = new JTextArea(q1.question);\n\t\t\t\t\tJTextArea question2 = new JTextArea(q2.question);\n\t\t\t\t\n\t\t\t\t\t//displays the correct answer your answer, and the question\n\t\t\t\t\tJLabel header = new JLabel(\"Question Your Answer Correct Ans.\");\n\t\t\t\t\theader.setFont(new Font(\"Serif\", Font.BOLD, 15));\n\t\t\t\t\theader.setBounds(10, 65,500,50);\n\t\t\t\t\t\n\t\t\t\t\tquestion1.setBounds(10,110, 280,50);\n\t\t\t\t\tquestion1.setLineWrap(true);\n\t\t\t\t\tJTextArea youranswer = new JTextArea (attempt);\n\t\t\t\t\tyouranswer.setBounds(300, 110, 50,30);\n\t\t\t\t\tJTextArea theanswer = new JTextArea(q1.answer);\n\t\t\t\t\ttheanswer.setBounds(410, 110,50,30);\n\t\t\t\t\t\n\t\t\t\t\tquestion2.setBounds(10,160, 280,50);\n\t\t\t\t\tquestion2.setLineWrap(true);\n\t\t\t\t\tJTextArea youranswer2 = new JTextArea (attempt2);\n\t\t\t\t\tyouranswer2.setBounds(300, 160 ,50,30);\n\t\t\t\t\tJTextArea theanswer2 = new JTextArea(q2.answer);\n\t\t\t\t\ttheanswer2.setBounds(410, 160,50,30);\n\t\t\t\t\t//adds everything to the JPanel\n\t\t\t\t\tadd(result);\n\t\t\t\t\tadd(question1);\n\t\t\t\t\tadd(question2);\n\t\t\t\t\tadd(header);\n\t\t\t\t\tadd(youranswer);\n\t\t\t\t\tadd(theanswer);\n\t\t\t\t\tadd(youranswer2);\n\t\t\t\t\tadd(theanswer2);\n\t\t\t\t\t\n\t\t\t\t\tJButton quit = new JButton(\"Exit\"); //the button that allows you to quit\n\t\t\t\t\tquit.setBounds(50,230,65,20);\n\t\t\t\t\tquit.addActionListener(new Quitter());\n\t\t\t\t\tadd(quit);\n\t\t\t\t\tif(type == 0){ //the type - if after u win a level, then you only need 1 right to pass, but if you lost, then u need 2 questins to pass, type == 0 is for loss\n\t\t\t\t\t\tif (score == 2){\n\t\t\t\t\t\t\tJButton retrylevel = new JButton(\"Retry\");\n\t\t\t\t\t\t\tretrylevel.setBounds(350,230,65,20);\n\t\t\t\t\t\t\tretrylevel.addActionListener(new Retry());\n\t\t\t\t\t\t\tadd(retrylevel);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tJButton retrylevel = new JButton(\"New Game\");\n\t\t\t\t\t\t\tretrylevel.setBounds(350,210,100,20);\n\t\t\t\t\t\t\tretrylevel.addActionListener(new Retry());\n\t\t\t\t\t\t\tadd(retrylevel);\t\n\t\t\t\t\t\t\tnumplanes = 1;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\thealth = finalhealth;\n\t\t\t\t\t}\n\t\t\t\t\telse if (type == 1){ //if you just cleared a wave of planes, this pops up\n\t\t\t\t\t\tif (score == 2){\n\t\t\t\t\t\t\tJButton retrylevel = new JButton(\"Continue\");\n\t\t\t\t\t\t\tretrylevel.setBounds(330,230,100,20);\n\t\t\t\t\t\t\tretrylevel.addActionListener(new Retry());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfinalhealth++;\n\t\t\t\t\t\t\thealth = finalhealth;\n\t\t\t\t\t\t\tadd(retrylevel);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (score==1){ //lets you pass on but no health bonus\n\t\t\t\t\t\t\tJButton retrylevel = new JButton(\"Continue\");\n\t\t\t\t\t\t\tretrylevel.setBounds(330,230,100,20);\n\t\t\t\t\t\t\tretrylevel.addActionListener(new Retry());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\thealth = finalhealth;\n\t\t\t\t\t\t\tadd(retrylevel);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse { //forces you to restart\n\t\t\t\t\t\t\tJButton retrylevel = new JButton(\"Restart Level\");\n\t\t\t\t\t\t\tretrylevel.setBounds(350,210,120,20);\n\t\t\t\t\t\t\tretrylevel.addActionListener(new Retry());\n\t\t\t\t\t\t\tadd(retrylevel);\n\t\t\t\t\t\t\thealth=finalhealth;\n\t\t\t\t\t\t\tnumplanes--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}", "public void setTextWarning(String warning1, String warning2){\n jLabel2.setText(warning1);\n jLabel3.setText(warning2);\n }", "private void btnSpeaker2ActionPerformed(java.awt.event.ActionEvent evt) {\n txtSpeaker2.setText(Dialog());\n \n }", "public void choicesText() {\n\t\tmcqChoicesText1 = answerChoice.get(0).getText().trim();\n\t\tmcqChoicesText2 = answerChoice.get(1).getText().trim();\n\t\tmcqChoicesText3 = answerChoice.get(2).getText().trim();\n\t\tmcqChoicesText4 = answerChoice.get(3).getText().trim();\n\t\tmcqChoicesText5 = answerChoice.get(4).getText().trim();\n\t\tmcqChoicesText6 = answerChoice.get(5).getText().trim();\n\t}", "public void actionPerformed(ActionEvent e) {\n String text = textField1.getText();\n textField2.setText(text);\n\n }", "public String getPollAnswer2() {\n return pollAnswer2;\n }", "private void ans1Option() {\n RadioButton radioButtonA = (RadioButton) findViewById(R.id.radio_button_A);\n RadioButton radioButtonB = (RadioButton) findViewById(R.id.radio_button_B);\n RadioButton radioButtonC = (RadioButton) findViewById(R.id.radio_Button_C);\n RadioButton radioButtonD = (RadioButton) findViewById(R.id.radio_Button_D);\n radioButtonA.setText(R.string.que1Opt1);\n radioButtonB.setText(R.string.que1Opt2);\n radioButtonC.setText(R.string.que1Opt3);\n radioButtonD.setText(R.string.que1Opt4);\n }", "private void updateQuestion(){\n\t\tint question = mQuestionBank[mCurrentIndex].getQuestion();\n\t\tmQuestionTextView.setText(question);\n\t}", "public void actionPerformed(ActionEvent e){\n\t\t\t\t\tif (q1.isAnswerCorrect(getattempt.getText())){ //if its correct\n\t\t\t\t\t\tforq1 = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse forq1 = 0; //if it is incorrect\n\t\t\t\t\tattempt = getattempt.getText();\n\t\t\t\t\t\n\t\t\t\t\tquestionarea.setText(q2.question);//changes everything for the 2nd question after entering the first question\n\t\t\t\t\tgetattempt.setText(\"Enter your answer here\");\n\t\t\t\t\t//enter.remove(et);\n\t\t\t\t\tenter.addActionListener(ft);\n\t\t\t\t\t\n\t\t\t\t}", "public void changeText()\n {\n Double base = 1.0;\n Double exponent = 0.0;\n\n try\n {\n /*get the values of the text inputs and set them to their respective variable, converting them to\n a double*/\n base = Double.parseDouble(txtBase.getText());\n exponent = Double.parseDouble(txtExponent.getText());\n }\n catch (NumberFormatException e) {\n /*On NumberFormatException, do nothing. Suppresses errors in the console which we do not need to\n know about, this is an expected and solved issue.*/\n }\n\n //calculate the new result, based on the current values of exponent and base, then set it to the output.\n Double result = Math.pow(base, exponent);\n lblResult.setText(result.toString());\n }", "public void setQuestion(){\n txt_question.setText(arrayList.get(quesAttempted).getQuestion());\n txt_optionA.setText(arrayList.get(quesAttempted).getOptionA());\n txt_optionB.setText(arrayList.get(quesAttempted).getOptionB());\n txt_optionC.setText(arrayList.get(quesAttempted).getOptionC());\n txt_optionD.setText(arrayList.get(quesAttempted).getOptionD());\n txt_que_count.setText(\"Que: \"+(quesAttempted+1)+\"/\"+totalQues);\n txt_score.setText(\"Score: \"+setScore);\n }", "private void setQuestion() {\n Question.setText(gen.getQuestion() + \"\\t\\tProblem # \" + currentQuestion + \"/\" + numQuestions);\n }", "public void q1Submit(View view) {\n\n EditText editText = (EditText) findViewById(R.id.q1enterEditText);\n String q1answer = editText.getText().toString().trim();\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if ((q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck1))) || (q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck2)))) {\n if (isNotAnsweredQ1) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct1), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ1 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }", "private void updateQuestion(){\n int question = mQuestionBank[mCurrentIndex].getmQuestion();\n mQuestionTextView.setText(question);\n }", "public void setForgottenPasswordQuestion2(String forgottenPasswordQuestion2) {\n\t\tthis.forgottenPasswordQuestion2 = forgottenPasswordQuestion2;\n\t}", "private void settingQuestion() {\n\n int[] setWord = {0, 0, 0, 0, 0};\n int[] setPos = {0, 0, 0, 0};\n int[] setBtn = {0, 0, 0, 0};\n\n Random ans = new Random();\n int wordNum = ans.nextInt(vocabularyLesson.size());\n //answer = vocabularyLesson.get(wordNum).getMean();\n word = vocabularyLesson.get(wordNum).getWord();\n vocabularyID = vocabularyLesson.get(wordNum).getId();\n answer = word;\n\n Practice practice = pc.getPracticeById(vocabularyID);\n if (practice != null) {\n Log.d(\"idVocabulary\", practice.getSentence());\n question.setText(practice.getSentence());\n }\n\n\n // Random position contain answer\n setWord[wordNum] = 1;\n Random p = new Random();\n int pos = p.nextInt(4);\n if (pos == 0) {\n word1.setText(word);\n setBtn[0] = 1;\n }\n if (pos == 1) {\n word2.setText(word);\n setBtn[1] = 1;\n }\n if (pos == 2) {\n word3.setText(word);\n setBtn[2] = 1;\n }\n if (pos == 3) {\n word4.setText(word);\n setBtn[3] = 1;\n }\n setPos[pos] = 1;\n\n // Random 3 position contain 3 answer\n for (int i = 0; i < 3; i++) {\n Random ques = new Random();\n int num = ques.nextInt(5);\n int p1 = ques.nextInt(4);\n while (setWord[num] == 1 || setPos[p1] == 1) {\n num = ques.nextInt(5);\n p1 = ques.nextInt(4);\n }\n String wordIncorrect = vocabularyLesson.get(num).getWord();\n setWord[num] = 1;\n setPos[p1] = 1;\n if (setBtn[p1] == 0 && p1 == 0) {\n word1.setText(wordIncorrect);\n setBtn[0] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 1) {\n word2.setText(wordIncorrect);\n setBtn[1] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 2) {\n word3.setText(wordIncorrect);\n setBtn[2] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 3) {\n word4.setText(wordIncorrect);\n setBtn[3] = 1;\n }\n }\n\n }", "@Click(R.id.bt_answer1)\n void clickAnswer1() {\n selectedAnswer = questionList.get(questionProgress - 1).getAnswers().get(0);\n showResult();\n }", "public void setarText() {\n txdata2 = (TextView) findViewById(R.id.txdata2);\n txdata1 = (TextView) findViewById(R.id.txdata3);\n txCpf = (TextView) findViewById(R.id.cpf1);\n txRenda = (TextView) findViewById(R.id.renda1);\n txCpf.setText(cpf3);\n txRenda.setText(renda.toString());\n txdata1.setText(data);\n txdata2.setText(data2);\n\n\n }", "private void setOperand1() {\n\t\ttext_Result.setText(\"\"); // Any change of an operand probably invalidates\n\t\tlabel_Result.setText(\"Result\"); // the result, so we clear the old result.\n\t\tlabel_errResult.setText(\"\");\n\t\tif (perform.setOperand1(text_Operand1.getText())) { // Set the operand and see if there was an error\n\t\t\tlabel_errOperand1.setText(\"\"); // If no error, clear this operands error\n\t\t\toperand1ErrPart1.setText(\"\"); // Clear the first term of error part\n\t\t\toperand1ErrPart2.setText(\"\"); // Clear the second term of error part\n\t\t\tif (text_Operand2.getText().length() == 0) // If the other operand is empty, clear its error\n\t\t\t\tlabel_errOperand2.setText(\"\"); // as well.\n\t\t} else // If there's a problem with the operand, display\n\t\t\terr1();\n\t}", "public final void setLabel2(@Nullable CharSequence label) {\n mLabel2 = label;\n }", "public void updateP2(String stats)\r\n\t{\r\n\t\tp2.setText(stats);\r\n\t}", "public void setAnswer(String answer) {\r\n this.answer = answer;\r\n }", "public void correctAnswer(){\n AlertDialog.Builder dialogBoxAns = new AlertDialog.Builder(this);\n //set title to dialog box\n dialogBoxAns.setTitle(\"Results\");\n //set correct message to dialog box\n dialogBoxAns.setMessage((Html.fromHtml(\"<font color='#39FF14'> CORRECT! </font> \")));\n //set button to dialog box\n dialogBoxAns.setPositiveButton(\"OK\", null);\n //create new dialog box\n AlertDialog dialog = dialogBoxAns.create();\n dialog.show();\n }", "public String getHint2() {\n return this.hint2;\n }", "public void updateQ4scoreAndGoToNext(View view){\r\n EditText q1Correct;\r\n q1Correct = (EditText) findViewById(R.id.q1Answer);\r\n String inputText = q1Correct.getText().toString();\r\n String rightAnswer = \"TextView\";\r\n\r\n if (inputText.equals(rightAnswer)) {\r\n q1Score = q1Score + 1;\r\n Toast toast = Toast.makeText(this, \"Great Job! 1 point added.\", Toast.LENGTH_SHORT);\r\n toast.show();\r\n } else {\r\n q1Score = 0;\r\n Toast toast = Toast.makeText(this, \"Better luck next time, 0 points added.\", Toast.LENGTH_SHORT);\r\n toast.show();\r\n }\r\n\r\n Intent i = new Intent(this, Question2Activity.class);\r\n startActivity(i);\r\n }", "@Step(\"Choose answer number {ans} for the 2nd question\")\r\n public ResendPageSteps sendSecondAnswer(int ans) {\r\n switch (ans) {\r\n case 1:\r\n getVisibleWebElement(resendPage.ANS2_1).click();\r\n break;\r\n case 2:\r\n getVisibleWebElement(resendPage.ANS2_2).click();\r\n break;\r\n case 3:\r\n getVisibleWebElement(resendPage.ANS2_3).click();\r\n break;\r\n case 4:\r\n getVisibleWebElement(resendPage.ANS2_4).click();\r\n break;\r\n case 5:\r\n getVisibleWebElement(resendPage.ANS2_5).click();\r\n break;\r\n }\r\n return this;\r\n }", "private void setquestion() {\n qinit();\n question_count++;\n\n if (modeflag == 3) {\n modetag = (int) (Math.random() * 3);\n } else {\n modetag = modeflag;\n }\n\n WordingIO trueword = new WordingIO(vocabulary);\n\n if (modetag == 0) {\n\n MCmode(trueword);\n }\n\n if (modetag == 1) {\n BFmode(trueword);\n }\n\n if (modetag == 2) {\n TLmode(trueword);\n }\n\n if (time_limit != 0) {\n timingtoanswer(time_limit, jLabel2, answer_temp, jLabel5, jLabel6, jButton1);\n }\n }", "public void saveQuestion(){\n\n\t\tint numAnswers = testGenerator.getNumAnswers(questionNo);\n\t\tString setAnswerBox = Integer.toString(numAnswers);\n\n\t\ttestGenerator.setQuestionText(questionNo, ques.getText());\n\t\ttestGenerator.setAnswerText(questionNo, 1, ans1.getText());\n\t\ttestGenerator.setAnswerText(questionNo, 2, ans2.getText());\n\n\t\ttestGenerator.setIsAnswerCorrect(questionNo, 1, answer1.isSelected());\n\t\ttestGenerator.setIsAnswerCorrect(questionNo, 2, answer2.isSelected());\n\n\t\tif((setAnswerBox.equals(\"3\")) || setAnswerBox.equals(\"4\")) {\n\t\t\ttestGenerator.setAnswerText(questionNo, 3, ans3.getText()); \t\n\t\t\ttestGenerator.setIsAnswerCorrect(questionNo, 3, answer3.isSelected());\n\t\t}\n\n\t\tif(setAnswerBox.equals(\"4\")) {\n\t\t\ttestGenerator.setAnswerText(questionNo, 4, ans4.getText()); \t\n\t\t\ttestGenerator.setIsAnswerCorrect(questionNo, 4, answer4.isSelected());\n\t\t}\n\t}", "private void populateQuestion(String tempQuestionText) {\n\n\t\t// set them to radio options\n\t\tquestionTextView.setText(tempQuestionText);\n\n\t}", "public void onClick(View arg0) {\n // change the text to state that radio button one was clicked\n tv_display.setText(R.string.tv_display_rb2);\n }", "public void q2Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q2option3);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ2) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ2 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }", "public void updateProgressLabel2 (String label2)\n\t{\n\t\t\n\t\tmProgressLabel2.setText(label2);\n\t\n\t}", "public void setQuestion(){\n String welcomeTextString = \"Welcome \" + getIntent().getStringExtra(\"name\") + \"!\";\n welcomeText.setText(welcomeTextString);\n\n //Setting Question title, description, and answers\n questionTitle.setText(questions[currentQuestion-1][0]);\n questionDescription.setText(questions[currentQuestion-1][1]);\n ans1.setText(questions[currentQuestion-1][2]);\n ans2.setText(questions[currentQuestion-1][3]);\n ans3.setText(questions[currentQuestion-1][4]);\n\n //Save correct answer\n correctAnswer = questions[currentQuestion-1][5];\n\n //Set progress bar and progress text\n progressBar.setProgress(currentQuestion);\n progressText.setText(currentQuestion.toString() + \"/5\");\n\n //Clear selection of buttons if any are already selected\n ans1.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n ans2.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n ans3.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n }", "public void modify() {\n io.writeLine(\"Enter the new correct answer\");\n String newAnswer = io.readLine();\n while (!newAnswer.equals(\"T\") && !newAnswer.equals(\"F\")) {\n io.writeLine(\"Please put in T or F\");\n newAnswer = io.readLine();\n }\n rightAnswers.set(0, newAnswer);\n }", "@Override\n public void setText(String promptText) {\n super.setText(promptText); \n if (promptText != null) {\n ResizeUtils.updateSize(this, actions);\n }\n }", "@Override\n public void setText(String text) {\n myProgressManager.setText2(this, text);\n }", "private void convertion(){\n txtBox2.setText(workin.convertText(txtBox1.getText())) ; \n }", "private void setText(Text text) {\n \t\tthis.text = text;\n \t}", "public void changeQuestionText(Question question, String text) throws Exception {\n DataBaseBroker dbb = new DataBaseBroker();\n dbb.loadDriver();\n dbb.establishConnection();\n question.setText(text);\n dbb.overwriteQuestion(question);\n dbb.commit();\n dbb.closeConnection();\n }", "public void changeText(String s) {\n textArea1.setText(s);\n\n }", "@FXML\n\tprivate void answerQuestion() {\n\t\tint correctAnsID = 0;\n\t\ttry {\n\t\t\tswitch (((RadioButton) answerGroup.getSelectedToggle()).getId()) {\n\t\t\tcase \"ans1Check\":\n\t\t\t\tcorrectAnsID = 1;\n\t\t\t\tbreak;\n\t\t\tcase \"ans2Check\":\n\t\t\t\tcorrectAnsID = 2;\n\t\t\t\tbreak;\n\t\t\tcase \"ans3Check\":\n\t\t\t\tcorrectAnsID = 3;\n\t\t\t\tbreak;\n\t\t\tcase \"ans4Check\":\n\t\t\t\tcorrectAnsID = 4;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\terrorLabel.setVisible(true);\n\t\t}\n\n\t\t// nothing is selected\n\t\tif (correctAnsID == 0) { \n\t\t\terrorLabel.setVisible(true);\n\t\t\t// correct answer\n\t\t} else if (question.getCorrect_ans() == correctAnsID) {\n\t\t\tcontrol.setScore(control.getScore() + question.getScore());\n\t\t\thandleAlertAndWindow(AlertType.INFORMATION, \"Congrats! :D\",\n\t\t\t\t\t\"You received \" + question.getScore() + \" points\");\n\t\t\t// wrong answer\n\t\t} else {\n\t\t\tcontrol.setScore(control.getScore() + question.getPenalty());\n\n\t\t\thandleAlertAndWindow(AlertType.ERROR, \"Uh oh! :(\",\n\t\t\t\t\t\"You lost \" + question.getPenalty() + \" points\");\n\t\t}\n\n\t\t// reset the eaten question\n\t\tViewLogic.playGameController.getControl().setQuestionEaten(null);\n\t}", "public boolean setQuiz2(double quiz2)\n\t{\n\t\tboolean isValid;\n\t\t\n\t\tisValid = isValidQuiz2(quiz2);\n\t\t\n\t\tif(isValid)\n\t\t{\n\t\t\tthis.quiz2 = quiz2;\n\t\t}\n\t\t\n\t\treturn isValid;\n\t}", "public void setText( String text );", "public void setText3(String text3) {\n this.text3 = text3 == null ? null : text3.trim();\n }", "public void err2() {\n\t\tString errMessage = CalculatorValue.checkMeasureValue(text_Operand2.getText());\n\t\tif (errMessage != \"\") {\n\t\t\tlabel_errOperand2.setText(CalculatorValue.measuredValueErrorMessage);\n\t\t\tif (CalculatorValue.measuredValueIndexofError <= -1)\n\t\t\t\treturn;\n\t\t\tString input = CalculatorValue.measuredValueInput;\n\t\t\toperand2ErrPart1.setText(input.substring(0, CalculatorValue.measuredValueIndexofError));\n\t\t\toperand2ErrPart2.setText(\"\\u21EB\");\n\t\t}\n\t}", "public void setQuestionText(String questionText) {\n this.questionText = questionText;\n }", "public void setText(String text) {\n\t\t\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif (e.getSource() == btn2) {\n\t\t\t\t\tchucnang(txt1.getText(), btn1);\n\t\t\t\t}\n\t\t\t}", "public String getForgottenPasswordAnswer2() {\n\t\treturn forgottenPasswordAnswer2;\n\t}", "public void displayCorrect(){\n textPane1.setText(\"\");\r\n generatePlayerName();\r\n textPane1.setText(\"GOOD JOB! That was the correct answer.\\n\"\r\n + atBatPlayer + \" got a hit!\\n\" +\r\n \"Press Next Question, or hit ENTER, to continue.\");\r\n SWINGButton.setText(\"Next Question\");\r\n formattedTextField1.setText(\"\");\r\n formattedTextField1.setText(\"Score: \" + score);\r\n }", "public void setText(String text) {\r\n\r\n\t}", "public void setDifficultyString () {\n String difficultyString = \"EASY\";\n if(mAlarmDetails.getDifficulty() == 0){\n difficultyString = \"EASY\";\n }\n else if (mAlarmDetails.getDifficulty() == 1) {\n difficultyString = \"MEDIUM\";\n }\n else if (mAlarmDetails.getDifficulty() == 2) {\n difficultyString = \"HARD\";\n }\n\n TextView difficultySelection = (TextView) findViewById(R.id.difficulty_level);\n difficultySelection.setText(difficultyString);\n }", "private void updatescreen2(){\n screen2.setText(displayscreen2);}", "public void setText(String text);", "private void updateQuestion(){\n mchoice1.setChecked(false);\n mchoice2.setChecked(false);\n mchoice3.setChecked(false);\n mchoice4.setChecked(false);\n\n if (mQuestonNumber < mQuizLibrary.getLength()){\n //menset setiap textview dan radiobutton untuk diubah jadi pertanyaan\n sQuestion.setText(mQuizLibrary.getQuestion(mQuestonNumber));\n //mengatur opsi sesuai pada optional A\n mchoice1.setText(mQuizLibrary.getChoice(mQuestonNumber, 1)); //Pilihan Ganda ke 1\n //mengatur opsi sesuai pada optional B\n mchoice2.setText(mQuizLibrary.getChoice(mQuestonNumber, 2)); //Pilihan Ganda ke 2\n //mengatur opsi sesuai pada optional C\n mchoice3.setText(mQuizLibrary.getChoice(mQuestonNumber, 3)); //Pilihan Ganda ke 3\n //mengatur opsi sesuai pada optional D\n mchoice4.setText(mQuizLibrary.getChoice(mQuestonNumber, 4)); //Pilihan Ganda ke 4\n\n manswer = mQuizLibrary.getCorrect(mQuestonNumber);\n //untuk mengkoreksi jawaban yang ada di class QuizBank sesuai nomor urut\n mQuestonNumber++; //update pertanyaan\n }else{\n Toast.makeText(Quiz.this, \"ini pertanyaan terakhir\", Toast.LENGTH_LONG).show();\n Intent i = new Intent (Quiz.this, HighestScore.class);\n i.putExtra(\"score\", mScore); //UNTUK MENGIRIM NILAI KE activity melalui intent\n startActivity(i);\n }\n }", "public void clearAnswer(){\r\n textField1.setText(\"\");\r\n }", "@Click(R.id.bt_answer3)\n void clickAnswer3() {\n selectedAnswer = questionList.get(questionProgress - 1).getAnswers().get(2);\n showResult();\n }", "private void step2() {\n\t\tthis.demonstrationStep++;\n\t\tthis.editableFields = 1;\n\t\tthis.getView().getProceed().setVisible(false);\n\t\tthis.getView().getUserInput()[0].setBorder(null);\n\t\tthis.getView().getUserOutput()[0].setBorder(null);\n\t\tthis.getView()\n\t\t\t\t.getExplanations()\n\t\t\t\t.setText(\n\t\t\t\t\t\tthis.wrapHtml(CryptoDemonstrationController.i18n\n\t\t\t\t\t\t\t\t.tr(\"Now try to encrypt the next letter yourself.\"\n\t\t\t\t\t\t\t\t\t\t+ \" If you need help, you can always use the help button.\")));\n\n\t\tthis.getView().getUserInput()[1].setBorder(BorderFactory\n\t\t\t\t.createLineBorder(Color.green));\n\t\tthis.getView().getUserOutput()[1].setEditable(true);\n\t\tthis.getView().getUserOutput()[1].requestFocus();\n\t\tthis.getView().validate();\n\t}", "private void updateTextBox(){\n\t\tString tmpWord = game.getTempAnswer().toString();\n\t\tString toTextBox = \"\";\n\t\tStringBuilder sb = new StringBuilder(tmpWord);\n\n\t\t//if a letter is blank in the temp answer make it an underscore. Goes for as long as the word length\n\t\tfor (int i = 0; i<tmpWord.length();i++){\n\t\t\tif(sb.charAt(i) == ' ')\n\t\t\t\tsb.setCharAt(i, '_');\n\t\t}\n\t\ttoTextBox = sb.toString();\n\t\ttextField.setText(toTextBox);\n\t\tlblWord.setText(toTextBox);\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif(e.getSource() == e1) {\r\n\t\t\t\t\ttext.setText(\"4\");\r\n\t\t\t\t}\r\n\t\t\t}", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\t\tif( txt_showresult.getText().equals( \"0\" )){ \n\t\t\t\t\t\t\t\ttxt_showresult.setText(\"2\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// if textfield show other value , add number after the value\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttxt_showresult.setText( txt_showresult.getText() + \"2\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tdouble n1 = Integer.parseInt(num1.getText());\n\t\tdouble n2 = Integer.parseInt(num2.getText());\n\t\tdouble ans = 0;\n\t\tif(e.getSource()==subtraction) {\n\t\t\tans = n1-n2;\n\t\t}\n\t\telse if(e.getSource()==addition) {\n\t\t\t\tans = n1+n2;\n\t\t}\n\t\telse if(e.getSource()==division) {\n\t\t\t\t\tans = n1/n2;\n\t\t}\n\t\telse if(e.getSource()==multiplacation) {\n\t\t\tans = n1*n2;\n\t\t}\n\t\telse if(e.getSource()==modulo) {\n\t\t\tans = n1%n2;\n\t\t}\n\t\tanswer.setText(String.valueOf(ans));\n\t\tframe.pack();\n\t}", "String answerStatement(boolean answer) {\n String answerStatement = getResources().getString(R.string.wrong);\n if (answer) {\n answerStatement = getResources().getString(R.string.correct);\n }\n return answerStatement;\n }", "public void onClickButton2(View view) {\n\n if (turn%2 == 0 && button2.getText()==\"·\"){\n button2.setText(\"O\");\n turn++;\n }\n else if (button2.getText()==\"·\"){\n button2.setText(\"X\");\n turn++;\n }\n\n }", "public String getText3() {\n return text3;\n }", "public void setAnswer(MCQChoice answer)\n\t{\n\t\tmcqAnswer = answer;\n\t}", "java.lang.String getCorrectAnswer();", "public void setLocationText(String textToShow) {\n this.location_line2 = textToShow;\n }", "void setQuestion(){\n int numberRange = currentLevel * 3;\n Random randInt = new Random();\n\n int partA = randInt.nextInt(numberRange);\n partA++;//not zero\n\n int partB = randInt.nextInt(numberRange);\n partB++;//not zero\n\n correctAnswer = partA * partB;\n int wrongAnswer1 = correctAnswer-2;\n int wrongAnswer2 = correctAnswer+2;\n\n textObjectPartA.setText(\"\"+partA);\n textObjectPartB.setText(\"\"+partB);\n\n //set the multi choice buttons\n //A number between 0 and 2\n int buttonLayout = randInt.nextInt(3);\n switch (buttonLayout){\n case 0:\n buttonObjectChoice1.setText(\"\"+correctAnswer);\n buttonObjectChoice2.setText(\"\"+wrongAnswer1);\n buttonObjectChoice3.setText(\"\"+wrongAnswer2);\n break;\n\n case 1:\n buttonObjectChoice2.setText(\"\"+correctAnswer);\n buttonObjectChoice3.setText(\"\"+wrongAnswer1);\n buttonObjectChoice1.setText(\"\"+wrongAnswer2);\n break;\n\n case 2:\n buttonObjectChoice3.setText(\"\"+correctAnswer);\n buttonObjectChoice1.setText(\"\"+wrongAnswer1);\n buttonObjectChoice2.setText(\"\"+wrongAnswer2);\n break;\n }\n }", "private void checkAnswer(int i) {\n\tswitch(i){\r\n\tcase 1:\r\n\t\t Button answer=(Button)findViewById(R.id.radio0);\r\n\t\t Log.d(\"yourans\", currentQ.getANSWER()+\" \"+answer.getText());\r\n\t\t if(currentQ.getANSWER().contentEquals(answer.getText()))\r\n\t\t \t {\r\n\t\t \t scoreSci++;\r\n\t\t \t String d=String.valueOf(scoreSci);\r\n\t\t\t \tEditor editor=mGameSettings.edit();\r\n\t\t\t \teditor.putString(GAME_PREFERENCES_SCORE_SCI,d);\r\n\t\t\t \teditor.commit();\r\n\t\t\t\t\tLog.d(DEBUG_TAG, \"Score is : \"\r\n\t\t\t + mGameSettings.getString(GAME_PREFERENCES_SCORE_SCI, \"Not set\"));\r\n\t\t \t Toast.makeText(getApplicationContext(),\"correct\",Toast.LENGTH_SHORT).show();\r\n\t\t\t }\r\n\t\t \t else{\r\n\t\t \t\tString d=\"The correct answer is\\n\"+currentQ.getANSWER();\r\n\t\t \t\tEditor editor2=mGameSettings.edit();\r\n\t\t\t \teditor2.putString(GAME_CURRENT_ANS_SCI,d);\r\n\t\t\t \teditor2.commit();\r\n\t\t\t \tQuizActivitySci.this.showDialog(GET_WRONG);\r\n\t\t \t }\r\n\t Log.d(\"score\", \"Your score\"+scoreSci);\r\n\t\tbreak;\r\n\tcase 2:\r\n\t\t Button answer1=(Button)findViewById(R.id.radio1);\r\n\t \t Log.d(\"yourans\", currentQ.getANSWER()+\" \"+answer1.getText()); \t\r\n\t if(currentQ.getANSWER().contentEquals(answer1.getText()))\r\n\t \t {\r\n\t \t scoreSci++;\r\n\t \t String d=String.valueOf(scoreSci);\r\n\t \tEditor editor=mGameSettings.edit();\r\n\t \teditor.putString(GAME_PREFERENCES_SCORE_SCI,d);\r\n\t \teditor.commit();\r\n\t\t\t Log.d(\"score\", \"Your score\"+scoreSci);\r\n\t\t\t Log.d(DEBUG_TAG, \"Score is : \"\r\n\t + mGameSettings.getString(GAME_PREFERENCES_SCORE_SCI, \"Not set\"));\r\n\t\t\t Toast.makeText(getApplicationContext(),\"correct\",Toast.LENGTH_SHORT).show();\r\n\t\t }else{\r\n\t\t\t String d=\"The correct answer is\\n\"+currentQ.getANSWER();\r\n\t\t \t\tEditor editor2=mGameSettings.edit();\r\n\t\t\t \teditor2.putString(GAME_CURRENT_ANS_SCI,d);\r\n\t\t\t \teditor2.commit();\r\n\t\t\t \tQuizActivitySci.this.showDialog(GET_WRONG);\r\n\t \t }\r\n\t Log.d(\"score\", \"Your score\"+scoreSci);\r\n\t\tbreak;\r\n\tcase 3:\r\n\t\tButton answer11=(Button)findViewById(R.id.radio2);\r\n\t \t Log.d(\"yourans\", currentQ.getANSWER()+\" \"+answer11.getText()); \r\n\t \t if(currentQ.getANSWER().contentEquals(answer11.getText()))\r\n\t \t {\r\n\t \t scoreSci++;\r\n\t \tString d=String.valueOf(scoreSci);\r\n\t \tEditor editor=mGameSettings.edit();\r\n\t \teditor.putString(GAME_PREFERENCES_SCORE_SCI,d);\r\n\t \teditor.commit();\r\n\t\t\t Log.d(\"score\", \"Your score\"+scoreSci);\r\n\t\t\t Log.d(DEBUG_TAG, \"Score is : \"\r\n\t + mGameSettings.getString(GAME_PREFERENCES_SCORE_SCI, \"Not set\"));\r\n\t\t\t Toast.makeText(getApplicationContext(),\"correct\",Toast.LENGTH_SHORT).show();\r\n\t\t }else{\r\n\t\t\t String d=\"The correct answer is\\n\"+currentQ.getANSWER();\r\n\t\t \t\tEditor editor2=mGameSettings.edit();\r\n\t\t\t \teditor2.putString(GAME_CURRENT_ANS_SCI,d);\r\n\t\t\t \teditor2.commit();\r\n\t\t\t \tQuizActivitySci.this.showDialog(GET_WRONG);\r\n\t \t\t}\r\n\t \tLog.d(\"score\", \"Your score\"+scoreSci);\r\n\t\tbreak;\r\n\tcase 4:\r\n\t\tButton answer111=(Button)findViewById(R.id.radio3);\r\n\t \t Log.d(\"yourans\", currentQ.getANSWER()+\" \"+answer111.getText()); \t\r\n\t \t if(currentQ.getANSWER().contentEquals(answer111.getText()))\r\n\t \t {\r\n\t \t scoreSci++;\r\n\t \tString d=String.valueOf(scoreSci);\r\n\t \tEditor editor=mGameSettings.edit();\r\n\t \teditor.putString(GAME_PREFERENCES_SCORE_SCI,d);\r\n\t \teditor.commit();\r\n\t\t\t Log.d(\"score\", \"Your score\"+scoreSci);\r\n\t\t\t Log.d(DEBUG_TAG, \"Score is : \"\r\n\t + mGameSettings.getString(GAME_PREFERENCES_SCORE_SCI, \"Not set\"));\r\n\t\t\t Toast.makeText(getApplicationContext(),\"correct\",Toast.LENGTH_SHORT).show();\r\n\t\t }else{\r\n\t\t\t String d=\"The correct answer is\\n\"+currentQ.getANSWER();\r\n\t\t \t\tEditor editor2=mGameSettings.edit();\r\n\t\t\t \teditor2.putString(GAME_CURRENT_ANS_SCI,d);\r\n\t\t\t \teditor2.commit();\r\n\t\t\t \tQuizActivitySci.this.showDialog(GET_WRONG);\r\n\t \t\t }\r\n\t \tLog.d(\"score\", \"Your score\"+scoreSci);\r\n\t\tbreak;\r\n\t\t\r\n}\r\n\t\r\n}", "public void reset() {\n\t\tTextView SetQuestionText = (TextView) findViewById(R.id.textView5);\n\t\tSetQuestionText.setText(\"\" + Question);\n\t\tEditText editText22 = (EditText) findViewById(R.id.editText1);\n\t\teditText22.setText(\" ?\");\n\t\tExpresstion_generator_based_on_difficulty();\n\t\tEndTimer();\n\t\tStartTimer();\n\t}", "@Override\n public void setText(String text) {\n label.setText(text);\n textArea.setText(text);\n }", "public void onClick(View arg0) {\n // change the text to state that radio button one was clicked\n tv_display.setText(R.string.tv_display_rb1);\n }", "public static <T, A, B> Answer<T> answer(Answer2<T, A, B> answer) {\n return toAnswer(answer);\n }", "public void setPlayer2Txt(String user) {\n\t\tclientName = user;\n\t\tplayer2Txt.setText(clientName);\n\t}", "@Override\n\tpublic void SuccessText(String text) {\n\t\tLog.i(TAG, \"==-->text:=\"+text);\n\t\tmain_one.setText(text);\n\t}", "void setText (String text);", "private boolean checkAnswerTwo() {\n CheckBox correctAnswer1Q2 = findViewById(R.id.qs2Ans3);\n correctAnswer1Q2.setTextColor(Color.parseColor(\"green\"));\n return correctAnswer1Q2.isChecked();\n }", "public void setP1Van() {\n p1Points.setText(\"Ad\");\n }" ]
[ "0.78692704", "0.7713367", "0.6963037", "0.69279015", "0.6906847", "0.68434805", "0.6832265", "0.6496084", "0.6416064", "0.6410967", "0.6274333", "0.6209412", "0.6178317", "0.6160178", "0.61099696", "0.60577023", "0.6048443", "0.59910965", "0.59891367", "0.59847635", "0.5982197", "0.5982155", "0.59506875", "0.59492105", "0.5916199", "0.5895518", "0.5876443", "0.5853595", "0.58473206", "0.5837828", "0.58369416", "0.58256304", "0.5810003", "0.57935536", "0.57907283", "0.5779541", "0.57534355", "0.57358944", "0.57103854", "0.570421", "0.5702077", "0.5693858", "0.56830627", "0.5678031", "0.56683856", "0.5642978", "0.56395006", "0.5633515", "0.56255305", "0.56188005", "0.56130904", "0.56125134", "0.56085867", "0.5600539", "0.55777377", "0.557534", "0.55691373", "0.5566056", "0.55581707", "0.55564207", "0.55463827", "0.55413646", "0.55408883", "0.5534403", "0.5534208", "0.5532593", "0.5518183", "0.55078363", "0.5504743", "0.54881877", "0.54878026", "0.5468532", "0.54684246", "0.5467607", "0.5467429", "0.54603785", "0.54588205", "0.54555094", "0.54515266", "0.5447853", "0.5438048", "0.5429754", "0.5420755", "0.5415976", "0.54130566", "0.5410947", "0.5409858", "0.5408458", "0.54063267", "0.54027134", "0.5396967", "0.53897274", "0.5383514", "0.5383338", "0.53781354", "0.537173", "0.53704745", "0.5366794", "0.536466", "0.53645384" ]
0.86311
0
Gets the answer text3.
public String getAnswerText3() { return answerText3; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getText3() {\n return text3;\n }", "public void setAnswerText3(String answerText3) {\r\n\t\tthis.answerText3 = answerText3;\r\n\t}", "public String getPollAnswer3() {\n return pollAnswer3;\n }", "public String getAnswerText1() {\r\n\t\treturn answerText1;\r\n\t}", "public String getInput3() {\n return input3;\n }", "public double getQuiz3()\n\t{\n\t\treturn this.quiz3;\n\t}", "@Click(R.id.bt_answer3)\n void clickAnswer3() {\n selectedAnswer = questionList.get(questionProgress - 1).getAnswers().get(2);\n showResult();\n }", "public String getChoice3(int a){\n String choice2 = choices[a][2];\n return choice2;\n }", "public String getForgottenPasswordAnswer3() {\n\t\treturn forgottenPasswordAnswer3;\n\t}", "public java.lang.String getQ3Label() {\n return q3Label;\n }", "public String getAnswerText2() {\r\n\t\treturn answerText2;\r\n\t}", "java.lang.String getCorrectAnswer();", "public String getCrrAnswerString() {\n if (type.equals(\"txt\")) {\n return getTextCrrAnswer();\n }\n else {\n return answers[mcCrrAnswer - 1];\n }\n }", "public String getPra3() {\n return pra3;\n }", "public java.lang.String getRemark3()\r\n {\r\n return _remark3;\r\n }", "public BigDecimal getSMART_OPTION_TEXT3() {\r\n return SMART_OPTION_TEXT3;\r\n }", "public BigDecimal getSMART_OPTION_TEXT3() {\r\n return SMART_OPTION_TEXT3;\r\n }", "public String getForgottenPasswordQuestion3() {\n\t\treturn forgottenPasswordQuestion3;\n\t}", "public String getValue3() { return this.value3; }", "public String getAnswerByNumber(int n) {\n return this.answers.get(n);\n }", "public Alternatives getAlternatives_3() { return cAlternatives_3; }", "private String getCampo3() {\r\n String campo = this.campoLivre.substring(15);\r\n return boleto.getDigitoCampo(campo);\r\n }", "private boolean checkAnswerThree() {\n CheckBox correctAnswer1Q3 = findViewById(R.id.qs3Ans1);\n correctAnswer1Q3.setTextColor(Color.parseColor(\"green\"));\n return correctAnswer1Q3.isChecked();\n }", "private String getCampo3() {\n String campo = this.campoLivre.substring(15);\n System.out.println(\"campo3 \" + campo);\n return boleto.getDigitoCampo(campo);\n }", "public String getAnswer(){\n\t\tString result = new String(answer);\n\t\tanswer = \"\"; //reset answer after every read\n\t\treturn result;\n\t}", "public String getLine3() {\n return line3;\n }", "public java.lang.String getDirection3() {\r\n return direction3;\r\n }", "private String signalThreeLetters(){\r\n\t\tSystem.out.print(\"Enter a three letter currency code (e.g., AUD, JPY, USD, EUR): \");\r\n\t\tString userInputCode = keyboardInput.getLine();\r\n\t\tif (userInputCode.length() != 3) {\r\n\t\t\tSystem.out.println(\"\\\"\" + userInputCode + \"\\\" is not a THREE letter code. Returning to menu.\");\t\t\t\t\r\n\t\t\tSystem.out.println();\r\n\t\t return null;}\r\n\t\tSystem.out.println();\r\n\t\treturn userInputCode;\r\n\t\t}", "@Override\n\t public String solve() {\n\t if (count == 0) {\n\t answer1 = getVariable2()*getVariable3();\n\t setAnswer(answer1 + \"\");\n\t } else if (count == 1) {\n\t answer1 = getVariable1()/getVariable2();\n\t setAnswer(answer1 + \"\");\n\t }else if (count == 2) {\n\t answer1 = getVariable1()/getVariable3();\n\t setAnswer(answer1 + \"\");\n\t }\n\t return getAnswer();\n\t }", "@Step(\"Choose answer number {ans} for the 3rd question\")\r\n public ResendPageSteps sendThirdAnswer(int ans) {\r\n switch (ans) {\r\n case 1:\r\n getVisibleWebElement(resendPage.ANS3_1).click();\r\n break;\r\n case 2:\r\n getVisibleWebElement(resendPage.ANS3_2).click();\r\n break;\r\n case 3:\r\n getVisibleWebElement(resendPage.ANS3_3).click();\r\n WebElement commentField = getVisibleWebElement(resendPage.ANS3_3_COMMENT);\r\n commentField.clear();\r\n commentField.sendKeys(RandomStringUtils.randomAlphabetic(10));\r\n break;\r\n }\r\n return this;\r\n }", "public String getLine3() {\n return line3;\n }", "public String getQuestion(int a) {\n String question = textQuestions[a];\n return question;\n }", "public String getOther3() {\n return other3;\n }", "public String getAnswer(int index){\n return answerList.get(index);\n }", "public double getSolutionX3() {\n this.polySolve();\n if (this.degree < 3) {\n return 0010;\n } else {\n if (this.real) {\n return this.x3;\n } else {\n return 0010;\n }\n }\n }", "public static <T, A, B, C> Answer<T> answer(Answer3<T, A, B, C> answer) {\n return toAnswer(answer);\n }", "public String getSupBytxt3() {\n return supBytxt3;\n }", "public String getExtra3() {\n return extra3;\n }", "public String getAnswerText()\r\n\t {\r\n\t return spinner.getValue().toString();\r\n\t }", "public void setText3(String text3) {\n this.text3 = text3 == null ? null : text3.trim();\n }", "public java.lang.String getSecondary3() {\n return secondary3;\n }", "private void err3() {\n\t\tString errMessage = CalculatorValue.checkMeasureValue(text_Operand3.getText());\n\t\tif (errMessage != \"\") {\n\t\t\t// System.out.println(errMessage);\n\t\t\tlabel_errOperand3.setText(CalculatorValue.measuredValueErrorMessage);\n\t\t\tif (CalculatorValue.measuredValueIndexofError <= -1)\n\t\t\t\treturn;\n\t\t\tString input = CalculatorValue.measuredValueInput;\n\t\t\toperand3ErrPart1.setText(input.substring(0, CalculatorValue.measuredValueIndexofError));\n\t\t\toperand3ErrPart2.setText(\"\\u21EB\");\n\t\t} else {\n\t\t\terrMessage = CalculatorValue.checkErrorTerm(text_Operand3.getText());\n\t\t\tif (errMessage != \"\") {\n\t\t\t\t// System.out.println(errMessage);\n\t\t\t\tlabel_errOperand3.setText(CalculatorValue.errorTermErrorMessage);\n\t\t\t\tString input = CalculatorValue.errorTermInput;\n\t\t\t\tif (CalculatorValue.errorTermIndexofError <= -1)\n\t\t\t\t\treturn;\n\t\t\t\toperand3ErrPart1.setText(input.substring(0, CalculatorValue.errorTermIndexofError));\n\t\t\t\toperand3ErrPart2.setText(\"\\u21EB\");\n\t\t\t}\n\t\t}\n\t}", "public int getPlayerAnswer()\r\n\t{\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\tSystem.out.print(\"Enter your answer (0-3): \");\r\n\t\treturn in.nextInt();\r\n\t}", "public OctetString getMsg1013()\n {\n\treturn this.msg1013;\n }", "public void button3(View v) {\n expression += \"3\";\n\n /* Update the screen. */\n TextView expressionText = (TextView) findViewById(R.id.expressionText);\n expressionText.setText(expression);\n }", "public void choicesText() {\n\t\tmcqChoicesText1 = answerChoice.get(0).getText().trim();\n\t\tmcqChoicesText2 = answerChoice.get(1).getText().trim();\n\t\tmcqChoicesText3 = answerChoice.get(2).getText().trim();\n\t\tmcqChoicesText4 = answerChoice.get(3).getText().trim();\n\t\tmcqChoicesText5 = answerChoice.get(4).getText().trim();\n\t\tmcqChoicesText6 = answerChoice.get(5).getText().trim();\n\t}", "public JTextField getjTextField3() {\n return jTextField3;\n }", "public String getAnswer() {\n return answer;\n }", "public String getCorrectAnswer(int a){\n String answer = correctAnswers[a];\n return answer;\n }", "public String selectedRadioButton3o(JRadioButton button1, JRadioButton button2, JRadioButton button3, String option1, String option2, String option3)\r\n {\r\n \r\n if (button1.isSelected()) \r\n {\r\n return option1;\r\n }\r\n \r\n else if (button2.isSelected())\r\n {\r\n return option2;\r\n }\r\n \r\n else if (button3.isSelected())\r\n {\r\n return option3;\r\n }\r\n return null;\r\n }", "public String getSelectedAnswer() {\n\t\tList<Integer> selected = getSelectedIndexes();\n\t\treturn this.value.get(selected.get(0));\n\t}", "public void setQ3Label(java.lang.String q3Label) {\n this.q3Label = q3Label;\n }", "public String getVchar3() {\n return vchar3;\n }", "public static String getQuestion() {\n\t\treturn \"3) A line in the xy-plane passes through the origin and has a slope of 1/7. Which of \\\\n\"+\"the following points lies on the line?\";\n\t}", "public String getCorrectedText() {\n return this.computeCorrectedText();\n }", "public void setAnswerText1(String answerText1) {\r\n\t\tthis.answerText1 = answerText1;\r\n\t}", "private int getAnswer() throws IOException {\n String w = next();\n while (w.equals(\"\")) {\n w = next();\n }\n // System.out.println(w + \" is the answer key\");\n c = r.read();\n if (w.equals(\"b\")) {\n return 1;\n } else {\n return 0;\n }\n }", "public ResultPoint getRp3() {\n return rp3;\n }", "public String getAttribute3() {\n return (String)getAttributeInternal(ATTRIBUTE3);\n }", "public String getAttribute3() {\n return (String)getAttributeInternal(ATTRIBUTE3);\n }", "public String getAttribute3() {\n return (String)getAttributeInternal(ATTRIBUTE3);\n }", "public String getAttribute3() {\n return (String)getAttributeInternal(ATTRIBUTE3);\n }", "public String getAttribute3() {\n return (String)getAttributeInternal(ATTRIBUTE3);\n }", "public String getCorrect() {\n\t\treturn new String(correctAnswer);\n\t}", "public String getAttribute3()\n {\n return (String)getAttributeInternal(ATTRIBUTE3);\n }", "public void setForgottenPasswordAnswer3(String forgottenPasswordAnswer3) {\n\t\tthis.forgottenPasswordAnswer3 = forgottenPasswordAnswer3;\n\t}", "public String getFreeuse3() {\n return freeuse3;\n }", "java.lang.String getC3();", "public java.lang.Double getVar3() {\n return var3;\n }", "private int getTextAns() {\n EditText tempAns = findViewById(R.id.answer0);\n if (tempAns.getText().toString().toLowerCase().equals(\"addition\")) {\n return 1;\n } else {\n return 0;\n }\n }", "public String getAttribute3() {\n return (String) getAttributeInternal(ATTRIBUTE3);\n }", "public Problem getProblem3(MathConfiguration mathConfig) {\r\n\t\t\r\n\t\tCreateProblem cProblem = new CreateProblem();\r\n\t\tAnswer answ = new Answer();\r\n\t\tMessageSource mSource = mathConfig.getmSource();\r\n\t\t\r\n\t\tList<QuestionLine> questionList = new LinkedList<QuestionLine>();\r\n\r\n\t\tint base = MathUtilities.getRandomNumber(2, 8);\r\n\t\tint pow = MathUtilities.getRandomNumber(2,4);\r\n\t\t\r\n\t\tint base1 = MathUtilities.getRandomNumber(2, 8);\r\n\t\tint pow1 = MathUtilities.getRandomNumber(2,4);\r\n\t\t\t\r\n\t\tint ans = (int)Math.pow(base1, pow1) + (int)Math.pow(base, pow);\r\n\t\tString question = \"$\" + Integer.toString(base1) + \"^{\" + Integer.toString(pow1)+ \"}\" + \" + \" + Integer.toString(base) + \"^{\" + Integer.toString(pow)+ \"}\" + \"$\";\r\n\t\t\r\n\t\tQuestionLine qLine1 = new QuestionLine(mSource.getMessage(Constants.FIND_EXPRESSION, null, Locale.ENGLISH));\r\n\t\tQuestionLine qLine2 = new QuestionLine(question);\r\n\r\n\t\tquestionList.add(qLine1);\r\n\t\tquestionList.add(qLine2);\r\n\r\n\t\tString heading = mSource.getMessage(Constants.GRADE_7_INTEGER_EXPONENTIATION, null, Locale.ENGLISH);\r\n\t\tansw.setAnswer(Integer.toString(ans));\r\n\r\n\t\tProblem problem = cProblem.constructProblem(questionList, heading, Constants.RANK_ONE, Constants.PROBLEM_TYPE_FRACTION);\r\n\t\tproblem.setAnswer(answ);\r\n\r\n\t\treturn problem;\r\n\t}", "String getAnswerResponse();", "public java.lang.Double getVar3() {\n return var3;\n }", "public String getAnAnswer() {\n\t\t\n\t\tString answer = \"\";\n\t\t\n\t\t\n\t\tRandom randomGenerator = new Random(); //Construct a new random number generator\n\t\tint randomNumber = randomGenerator.nextInt(mAnswers.length);\n\t\t\n\t\tanswer = mAnswers[randomNumber];\n\t\t\n\t\treturn answer;\n\t}", "public String getThirdNumber() {\n return thirdNumber;\n }", "public String retA()\n\t{\n\t\treturn answers[correctAns]; \t\n\t}", "public void setAnswerText2(String answerText2) {\r\n\t\tthis.answerText2 = answerText2;\r\n\t}", "public abstract String getLastAnswer();", "public String getFreeuse3() {\n\t\treturn freeuse3;\n\t}", "public java.lang.String getLevel3Eligible() {\r\n return level3Eligible;\r\n }", "public String getAnAnswer() {\n\n\t\tString answer = \" \";\n\n\t\t// Randomly select one of the answers\n\t\t// Construct a random number using the Random class and the\n\t\t// nextInt method\n\t\tRandom randomGenerator = new Random();\n\t\tint randomNumber = randomGenerator.nextInt(mAnswers.length);\n\n\t\t// Assign a randomly generated number to an answer\n\t\tanswer = mAnswers[randomNumber];\n\n\t\t// Return the result\n\t\treturn answer;\n\t}", "public String getCorrectAnswer(int a) {\n String answer = mCorrectAnswers[a];\n return answer;\n }", "Integer getTxtOrent();", "public String getRpfBak3() {\r\n return rpfBak3;\r\n }", "public String getTxt_potencia() {\r\n\t\treturn txt_potencia.getText();\r\n\t}", "public String getQuestion(int index){\n return questionList.get(index);\n }", "public String getX3RealStr() {\n this.polySolve();\n return this.x3real;\n }", "@Override\n\tpublic String getAnswer() {\n\t\treturn \"\" + IntStream.iterate(1, i->i+1)\n\t\t\t\t.mapToObj(i -> Tuple.of(i, sort(DigitsUtils.getDigits(i))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(2*tuple.getKey()))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(3*tuple.getKey()))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(4*tuple.getKey()))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(5*tuple.getKey()))))\n\t\t\t\t.filter(tuple -> Arrays.equals(tuple.getValue(), sort(DigitsUtils.getDigits(6*tuple.getKey()))))\n\t\t\t\t.findFirst()\n\t\t\t\t.orElseThrow(SolutionNotFoundException::new)\n\t\t\t\t.getKey();\n\t}", "private String getUserAnswer() {\n CheckBox checkBox1 = (CheckBox) findViewById(R.id.checkbox_1);\n CheckBox checkBox2 = (CheckBox) findViewById(R.id.checkbox_2);\n CheckBox checkBox3 = (CheckBox) findViewById(R.id.checkbox_3);\n CheckBox checkBox4 = (CheckBox) findViewById(R.id.checkbox_4);\n EditText inputText = (EditText) findViewById(R.id.input_text);\n RadioButton radioButtonA = (RadioButton) findViewById(R.id.radio_button_A);\n RadioButton radioButtonB = (RadioButton) findViewById(R.id.radio_button_B);\n RadioButton radioButtonC = (RadioButton) findViewById(R.id.radio_Button_C);\n RadioButton radioButtonD = (RadioButton) findViewById(R.id.radio_Button_D);\n\n if (radioButtonA.isChecked())\n userAnswer[currentQueNum - 1] = radioButtonA.getText().toString();\n else if (radioButtonB.isChecked())\n userAnswer[currentQueNum - 1] = radioButtonB.getText().toString();\n else if (radioButtonC.isChecked())\n userAnswer[currentQueNum - 1] = radioButtonC.getText().toString();\n else if (radioButtonD.isChecked())\n userAnswer[currentQueNum - 1] = radioButtonD.getText().toString();\n\n //the below block of code can be modify if needed that, to record the state of checkbox\n //and compare with set down cases\n //but in this situation this is the only condition that a correct answer is chosen\n else if (checkBox1.isChecked() && checkBox2.isChecked() && checkBox3.isChecked() && !checkBox4.isChecked()) {\n userAnswer[currentQueNum - 1] = checkBox1.getText().toString() + \",\" + checkBox2.getText().toString() + \",\" + checkBox3.getText().toString();\n\n } else if (inputText.getText().toString().trim().length() != 0) {\n userAnswer[currentQueNum - 1] = inputText.getText().toString();\n inputText.setText(\"\");// this will set the text field back to empty for subsequent use\n } else\n userAnswer[currentQueNum - 1] = \"skipped\";//the string when user skipped question\n return userAnswer[currentQueNum - 1];\n }", "public T3 _3() {\n return _3;\n }", "public static void incorrect3() {\r\n\r\n System.out.println(\" *---*\");\r\n System.out.println(\" | |\");\r\n System.out.println(\" 0 |\");\r\n System.out.println(\" /| | Incorrect - 3\");\r\n System.out.println(\" |\");\r\n System.out.println(\" |\");\r\n System.out.println(\"==========\");\r\n }", "public String getAttribute3() {\n return attribute3;\n }", "public String getAttr3() {\n return attr3;\n }", "public String getAttr3() {\n return attr3;\n }", "public void thirdAction () {\r\n // Declare and initialize the fact array\r\n String fact[] = new String[4];\r\n fact[0] = \"Hi\";\r\n fact[1] = \"Stephen Colbert is a satire reporter. He does do interviews\";\r\n fact[2] = \"Colbert ran many shows: Daily Show, Colbert Report, and Late Show. You are probably on one of these shows.\";\r\n fact[3] = \"Colbert is funny and good.\";\r\n \r\n // Generate random facts\r\n int randomFactNumber = (int) (Math.random() * 4);\r\n \r\n // Print out the fact and write it to the transcript file\r\n System.out.println(fact[randomFactNumber]);\r\n fileOut.println(fact[randomFactNumber]);\r\n }", "public String getText2() {\n return text2;\n }", "public java.lang.String getC3() {\n java.lang.Object ref = c3_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n c3_ = s;\n }\n return s;\n }\n }", "public java.lang.String getC3() {\n java.lang.Object ref = c3_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n c3_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getAnswer(){\n return this.answer;\n }" ]
[ "0.7891389", "0.7671387", "0.72941095", "0.6883469", "0.6859458", "0.6840314", "0.6826864", "0.67059934", "0.667235", "0.6597789", "0.6596534", "0.64981383", "0.64683867", "0.64569205", "0.63455546", "0.632635", "0.632635", "0.6240168", "0.6233222", "0.6130383", "0.6082349", "0.6070353", "0.6069162", "0.6059968", "0.60131335", "0.59957004", "0.59650284", "0.59396404", "0.59318334", "0.5904975", "0.58994764", "0.5874546", "0.586313", "0.582175", "0.5820642", "0.58172804", "0.5815571", "0.57912123", "0.5744872", "0.5736308", "0.5733318", "0.57202053", "0.5717369", "0.56852806", "0.56728613", "0.5669367", "0.56548095", "0.56415254", "0.56408685", "0.56370497", "0.56303406", "0.56241226", "0.5618162", "0.5612142", "0.5601146", "0.5584918", "0.5583884", "0.5581714", "0.5581217", "0.5581217", "0.5581217", "0.5581217", "0.5581217", "0.5572542", "0.5572387", "0.5557676", "0.5557035", "0.55562127", "0.5548516", "0.5538203", "0.5535309", "0.552853", "0.5503027", "0.5502045", "0.5499232", "0.5498012", "0.54977727", "0.5485409", "0.54850686", "0.5481751", "0.5474963", "0.5474338", "0.5472227", "0.546695", "0.54440695", "0.5443213", "0.54429215", "0.5441602", "0.54369676", "0.5433292", "0.5429992", "0.5417866", "0.5417496", "0.54136986", "0.54136986", "0.5398434", "0.53762794", "0.53728396", "0.5365901", "0.5363061" ]
0.88283765
0
Sets the answer text3.
public void setAnswerText3(String answerText3) { this.answerText3 = answerText3; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getAnswerText3() {\r\n\t\treturn answerText3;\r\n\t}", "public void setText3(String text3) {\n this.text3 = text3 == null ? null : text3.trim();\n }", "@Click(R.id.bt_answer3)\n void clickAnswer3() {\n selectedAnswer = questionList.get(questionProgress - 1).getAnswers().get(2);\n showResult();\n }", "public void setAnswerText1(String answerText1) {\r\n\t\tthis.answerText1 = answerText1;\r\n\t}", "public void setTextTF3(String data) {\n\t\ttf3.setText(data);\n\t}", "public String getText3() {\n return text3;\n }", "public void setQ3Label(java.lang.String q3Label) {\n this.q3Label = q3Label;\n }", "public void setForgottenPasswordAnswer3(String forgottenPasswordAnswer3) {\n\t\tthis.forgottenPasswordAnswer3 = forgottenPasswordAnswer3;\n\t}", "public void setAnswerText2(String answerText2) {\r\n\t\tthis.answerText2 = answerText2;\r\n\t}", "public void setQuestion(){\n txt_question.setText(arrayList.get(quesAttempted).getQuestion());\n txt_optionA.setText(arrayList.get(quesAttempted).getOptionA());\n txt_optionB.setText(arrayList.get(quesAttempted).getOptionB());\n txt_optionC.setText(arrayList.get(quesAttempted).getOptionC());\n txt_optionD.setText(arrayList.get(quesAttempted).getOptionD());\n txt_que_count.setText(\"Que: \"+(quesAttempted+1)+\"/\"+totalQues);\n txt_score.setText(\"Score: \"+setScore);\n }", "private void settingQuestion() {\n\n int[] setWord = {0, 0, 0, 0, 0};\n int[] setPos = {0, 0, 0, 0};\n int[] setBtn = {0, 0, 0, 0};\n\n Random ans = new Random();\n int wordNum = ans.nextInt(vocabularyLesson.size());\n //answer = vocabularyLesson.get(wordNum).getMean();\n word = vocabularyLesson.get(wordNum).getWord();\n vocabularyID = vocabularyLesson.get(wordNum).getId();\n answer = word;\n\n Practice practice = pc.getPracticeById(vocabularyID);\n if (practice != null) {\n Log.d(\"idVocabulary\", practice.getSentence());\n question.setText(practice.getSentence());\n }\n\n\n // Random position contain answer\n setWord[wordNum] = 1;\n Random p = new Random();\n int pos = p.nextInt(4);\n if (pos == 0) {\n word1.setText(word);\n setBtn[0] = 1;\n }\n if (pos == 1) {\n word2.setText(word);\n setBtn[1] = 1;\n }\n if (pos == 2) {\n word3.setText(word);\n setBtn[2] = 1;\n }\n if (pos == 3) {\n word4.setText(word);\n setBtn[3] = 1;\n }\n setPos[pos] = 1;\n\n // Random 3 position contain 3 answer\n for (int i = 0; i < 3; i++) {\n Random ques = new Random();\n int num = ques.nextInt(5);\n int p1 = ques.nextInt(4);\n while (setWord[num] == 1 || setPos[p1] == 1) {\n num = ques.nextInt(5);\n p1 = ques.nextInt(4);\n }\n String wordIncorrect = vocabularyLesson.get(num).getWord();\n setWord[num] = 1;\n setPos[p1] = 1;\n if (setBtn[p1] == 0 && p1 == 0) {\n word1.setText(wordIncorrect);\n setBtn[0] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 1) {\n word2.setText(wordIncorrect);\n setBtn[1] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 2) {\n word3.setText(wordIncorrect);\n setBtn[2] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 3) {\n word4.setText(wordIncorrect);\n setBtn[3] = 1;\n }\n }\n\n }", "public void button3(View v) {\n expression += \"3\";\n\n /* Update the screen. */\n TextView expressionText = (TextView) findViewById(R.id.expressionText);\n expressionText.setText(expression);\n }", "public void modifyQuestion(String text) {\n // TODO implement here\n }", "public String getPollAnswer3() {\n return pollAnswer3;\n }", "@Step(\"Choose answer number {ans} for the 3rd question\")\r\n public ResendPageSteps sendThirdAnswer(int ans) {\r\n switch (ans) {\r\n case 1:\r\n getVisibleWebElement(resendPage.ANS3_1).click();\r\n break;\r\n case 2:\r\n getVisibleWebElement(resendPage.ANS3_2).click();\r\n break;\r\n case 3:\r\n getVisibleWebElement(resendPage.ANS3_3).click();\r\n WebElement commentField = getVisibleWebElement(resendPage.ANS3_3_COMMENT);\r\n commentField.clear();\r\n commentField.sendKeys(RandomStringUtils.randomAlphabetic(10));\r\n break;\r\n }\r\n return this;\r\n }", "public void setForgottenPasswordQuestion3(String forgottenPasswordQuestion3) {\n\t\tthis.forgottenPasswordQuestion3 = forgottenPasswordQuestion3;\n\t}", "public void setInput3(final String input3) {\n this.input3 = input3;\n }", "public void updateAnswer(String text) {\n\t\tclearAnswer();\n\t\t\n\t\t// Add new label with the string\n\t\tlbl.setText(text);\n\t\tvPanel.add(lbl);\n\n\t\treturn;\n\t}", "private void setQuestion() {\n Question.setText(gen.getQuestion() + \"\\t\\tProblem # \" + currentQuestion + \"/\" + numQuestions);\n }", "private void updateQuestion(){\n\t\tint question = mQuestionBank[mCurrentIndex].getQuestion();\n\t\tmQuestionTextView.setText(question);\n\t}", "public boolean setQuiz3(double quiz3)\n\t{\n\t\tboolean isValid;\n\t\t\n\t\tisValid = isValidQuiz3(quiz3);\n\t\t\n\t\tif(isValid)\n\t\t{\n\t\t\tthis.quiz3 = quiz3;\n\t\t}\n\t\t\n\t\treturn isValid;\n\t}", "private void setquestion() {\n qinit();\n question_count++;\n\n if (modeflag == 3) {\n modetag = (int) (Math.random() * 3);\n } else {\n modetag = modeflag;\n }\n\n WordingIO trueword = new WordingIO(vocabulary);\n\n if (modetag == 0) {\n\n MCmode(trueword);\n }\n\n if (modetag == 1) {\n BFmode(trueword);\n }\n\n if (modetag == 2) {\n TLmode(trueword);\n }\n\n if (time_limit != 0) {\n timingtoanswer(time_limit, jLabel2, answer_temp, jLabel5, jLabel6, jButton1);\n }\n }", "public String getAnswerText1() {\r\n\t\treturn answerText1;\r\n\t}", "public void saveQuestion(){\n\n\t\tint numAnswers = testGenerator.getNumAnswers(questionNo);\n\t\tString setAnswerBox = Integer.toString(numAnswers);\n\n\t\ttestGenerator.setQuestionText(questionNo, ques.getText());\n\t\ttestGenerator.setAnswerText(questionNo, 1, ans1.getText());\n\t\ttestGenerator.setAnswerText(questionNo, 2, ans2.getText());\n\n\t\ttestGenerator.setIsAnswerCorrect(questionNo, 1, answer1.isSelected());\n\t\ttestGenerator.setIsAnswerCorrect(questionNo, 2, answer2.isSelected());\n\n\t\tif((setAnswerBox.equals(\"3\")) || setAnswerBox.equals(\"4\")) {\n\t\t\ttestGenerator.setAnswerText(questionNo, 3, ans3.getText()); \t\n\t\t\ttestGenerator.setIsAnswerCorrect(questionNo, 3, answer3.isSelected());\n\t\t}\n\n\t\tif(setAnswerBox.equals(\"4\")) {\n\t\t\ttestGenerator.setAnswerText(questionNo, 4, ans4.getText()); \t\n\t\t\ttestGenerator.setIsAnswerCorrect(questionNo, 4, answer4.isSelected());\n\t\t}\n\t}", "private void updateQuestion(){\n int question = mQuestionBank[mCurrentIndex].getmQuestion();\n mQuestionTextView.setText(question);\n }", "public void choicesText() {\n\t\tmcqChoicesText1 = answerChoice.get(0).getText().trim();\n\t\tmcqChoicesText2 = answerChoice.get(1).getText().trim();\n\t\tmcqChoicesText3 = answerChoice.get(2).getText().trim();\n\t\tmcqChoicesText4 = answerChoice.get(3).getText().trim();\n\t\tmcqChoicesText5 = answerChoice.get(4).getText().trim();\n\t\tmcqChoicesText6 = answerChoice.get(5).getText().trim();\n\t}", "private boolean checkAnswerThree() {\n CheckBox correctAnswer1Q3 = findViewById(R.id.qs3Ans1);\n correctAnswer1Q3.setTextColor(Color.parseColor(\"green\"));\n return correctAnswer1Q3.isChecked();\n }", "public static <T, A, B, C> Answer<T> answer(Answer3<T, A, B, C> answer) {\n return toAnswer(answer);\n }", "void setQuestion(){\n int numberRange = currentLevel * 3;\n Random randInt = new Random();\n\n int partA = randInt.nextInt(numberRange);\n partA++;//not zero\n\n int partB = randInt.nextInt(numberRange);\n partB++;//not zero\n\n correctAnswer = partA * partB;\n int wrongAnswer1 = correctAnswer-2;\n int wrongAnswer2 = correctAnswer+2;\n\n textObjectPartA.setText(\"\"+partA);\n textObjectPartB.setText(\"\"+partB);\n\n //set the multi choice buttons\n //A number between 0 and 2\n int buttonLayout = randInt.nextInt(3);\n switch (buttonLayout){\n case 0:\n buttonObjectChoice1.setText(\"\"+correctAnswer);\n buttonObjectChoice2.setText(\"\"+wrongAnswer1);\n buttonObjectChoice3.setText(\"\"+wrongAnswer2);\n break;\n\n case 1:\n buttonObjectChoice2.setText(\"\"+correctAnswer);\n buttonObjectChoice3.setText(\"\"+wrongAnswer1);\n buttonObjectChoice1.setText(\"\"+wrongAnswer2);\n break;\n\n case 2:\n buttonObjectChoice3.setText(\"\"+correctAnswer);\n buttonObjectChoice1.setText(\"\"+wrongAnswer1);\n buttonObjectChoice2.setText(\"\"+wrongAnswer2);\n break;\n }\n }", "public void setQuestion(){\n String welcomeTextString = \"Welcome \" + getIntent().getStringExtra(\"name\") + \"!\";\n welcomeText.setText(welcomeTextString);\n\n //Setting Question title, description, and answers\n questionTitle.setText(questions[currentQuestion-1][0]);\n questionDescription.setText(questions[currentQuestion-1][1]);\n ans1.setText(questions[currentQuestion-1][2]);\n ans2.setText(questions[currentQuestion-1][3]);\n ans3.setText(questions[currentQuestion-1][4]);\n\n //Save correct answer\n correctAnswer = questions[currentQuestion-1][5];\n\n //Set progress bar and progress text\n progressBar.setProgress(currentQuestion);\n progressText.setText(currentQuestion.toString() + \"/5\");\n\n //Clear selection of buttons if any are already selected\n ans1.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n ans2.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n ans3.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n }", "public void setAnswer1(String answer1) {\r\n this.answer1 = answer1;\r\n }", "public void setQuestions() {\n\t\tString question1 = str1 + _QwdQuestionFst;\n\t\tSpannableString sb1 = new SpannableString(question1);\n\t\tsb1.setSpan(new ForegroundColorSpan(Color.BLACK), str1.length() ,\n\t\t\t\tsb1.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);\n\t\t_FPTV_Question_1.setText(sb1);\n\n\t\tString question2 = str2 + _QwdQuestionSec;\n\t\tSpannableString sb2 = new SpannableString(question2);\n\t\tsb2.setSpan(new ForegroundColorSpan(Color.BLACK), str2.length() ,\n\t\t\t\tsb2.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);\n\t\t_FPTV_Question_2.setText(sb2);\n\t}", "private void updateQuestion(){\n mchoice1.setChecked(false);\n mchoice2.setChecked(false);\n mchoice3.setChecked(false);\n mchoice4.setChecked(false);\n\n if (mQuestonNumber < mQuizLibrary.getLength()){\n //menset setiap textview dan radiobutton untuk diubah jadi pertanyaan\n sQuestion.setText(mQuizLibrary.getQuestion(mQuestonNumber));\n //mengatur opsi sesuai pada optional A\n mchoice1.setText(mQuizLibrary.getChoice(mQuestonNumber, 1)); //Pilihan Ganda ke 1\n //mengatur opsi sesuai pada optional B\n mchoice2.setText(mQuizLibrary.getChoice(mQuestonNumber, 2)); //Pilihan Ganda ke 2\n //mengatur opsi sesuai pada optional C\n mchoice3.setText(mQuizLibrary.getChoice(mQuestonNumber, 3)); //Pilihan Ganda ke 3\n //mengatur opsi sesuai pada optional D\n mchoice4.setText(mQuizLibrary.getChoice(mQuestonNumber, 4)); //Pilihan Ganda ke 4\n\n manswer = mQuizLibrary.getCorrect(mQuestonNumber);\n //untuk mengkoreksi jawaban yang ada di class QuizBank sesuai nomor urut\n mQuestonNumber++; //update pertanyaan\n }else{\n Toast.makeText(Quiz.this, \"ini pertanyaan terakhir\", Toast.LENGTH_LONG).show();\n Intent i = new Intent (Quiz.this, HighestScore.class);\n i.putExtra(\"score\", mScore); //UNTUK MENGIRIM NILAI KE activity melalui intent\n startActivity(i);\n }\n }", "private void err3() {\n\t\tString errMessage = CalculatorValue.checkMeasureValue(text_Operand3.getText());\n\t\tif (errMessage != \"\") {\n\t\t\t// System.out.println(errMessage);\n\t\t\tlabel_errOperand3.setText(CalculatorValue.measuredValueErrorMessage);\n\t\t\tif (CalculatorValue.measuredValueIndexofError <= -1)\n\t\t\t\treturn;\n\t\t\tString input = CalculatorValue.measuredValueInput;\n\t\t\toperand3ErrPart1.setText(input.substring(0, CalculatorValue.measuredValueIndexofError));\n\t\t\toperand3ErrPart2.setText(\"\\u21EB\");\n\t\t} else {\n\t\t\terrMessage = CalculatorValue.checkErrorTerm(text_Operand3.getText());\n\t\t\tif (errMessage != \"\") {\n\t\t\t\t// System.out.println(errMessage);\n\t\t\t\tlabel_errOperand3.setText(CalculatorValue.errorTermErrorMessage);\n\t\t\t\tString input = CalculatorValue.errorTermInput;\n\t\t\t\tif (CalculatorValue.errorTermIndexofError <= -1)\n\t\t\t\t\treturn;\n\t\t\t\toperand3ErrPart1.setText(input.substring(0, CalculatorValue.errorTermIndexofError));\n\t\t\t\toperand3ErrPart2.setText(\"\\u21EB\");\n\t\t\t}\n\t\t}\n\t}", "public void setOptionText(String newText) {\n this.option = newText;\n\n this.database.update(\"AnswerOptions\", \"option = '\" + option + \"'\", \"optionId = \" + this.optionId);\n }", "public void q3Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q3option1);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ3) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ3 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }", "public void setQuestion(){\n\n\n triggerReport(); //Check if max questions are displayed, if yes then show report\n\n MyDatabase db = new MyDatabase(QuizCorner.this);\n Cursor words = db.getQuizQuestion();\n TextView question_text = (TextView) findViewById(R.id.question_text);\n RadioButton rb;\n resetOptions();\n disableCheck();\n enableRadioButtons();\n hideAnswer();\n words.moveToFirst();\n word = words.getString(words.getColumnIndex(\"word\"));\n correct_answer = words.getString(words.getColumnIndex(\"meaning\"));\n question_text.setText(word + \" means:\");\n for (int i = 0; i < 4; i++){\n answers[i] = words.getString(words.getColumnIndex(\"meaning\"));\n words.moveToNext();\n }\n answers = randomizeArray(answers);\n for (int i = 0; i < 4; i++){\n rb = (RadioButton) findViewById(options[i]);\n rb.setText(answers[i]);\n }\n question_displayed_count++;\n }", "public void setValue3(String value3) { this.value3 = value3; }", "public void changeQuestionText(Question question, String text) throws Exception {\n DataBaseBroker dbb = new DataBaseBroker();\n dbb.loadDriver();\n dbb.establishConnection();\n question.setText(text);\n dbb.overwriteQuestion(question);\n dbb.commit();\n dbb.closeConnection();\n }", "public void setAnswer(String newAnswer){\n this.answer = newAnswer; \n }", "public String getForgottenPasswordAnswer3() {\n\t\treturn forgottenPasswordAnswer3;\n\t}", "private void setAnswers()\n {\n StringBuilder answers = new StringBuilder(256);\n String[] correctAnswers = getResources().getStringArray(R.array.correct_answers);\n TextView answer_view = (TextView) findViewById(R.id.answers);\n for(int i = 0 ; i < correctAnswers.length; i++)\n {\n answers.append(correctAnswers[i]);\n }\n answer_view.setText(answers.toString());\n }", "@FXML\n\tprivate void answerQuestion() {\n\t\tint correctAnsID = 0;\n\t\ttry {\n\t\t\tswitch (((RadioButton) answerGroup.getSelectedToggle()).getId()) {\n\t\t\tcase \"ans1Check\":\n\t\t\t\tcorrectAnsID = 1;\n\t\t\t\tbreak;\n\t\t\tcase \"ans2Check\":\n\t\t\t\tcorrectAnsID = 2;\n\t\t\t\tbreak;\n\t\t\tcase \"ans3Check\":\n\t\t\t\tcorrectAnsID = 3;\n\t\t\t\tbreak;\n\t\t\tcase \"ans4Check\":\n\t\t\t\tcorrectAnsID = 4;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\terrorLabel.setVisible(true);\n\t\t}\n\n\t\t// nothing is selected\n\t\tif (correctAnsID == 0) { \n\t\t\terrorLabel.setVisible(true);\n\t\t\t// correct answer\n\t\t} else if (question.getCorrect_ans() == correctAnsID) {\n\t\t\tcontrol.setScore(control.getScore() + question.getScore());\n\t\t\thandleAlertAndWindow(AlertType.INFORMATION, \"Congrats! :D\",\n\t\t\t\t\t\"You received \" + question.getScore() + \" points\");\n\t\t\t// wrong answer\n\t\t} else {\n\t\t\tcontrol.setScore(control.getScore() + question.getPenalty());\n\n\t\t\thandleAlertAndWindow(AlertType.ERROR, \"Uh oh! :(\",\n\t\t\t\t\t\"You lost \" + question.getPenalty() + \" points\");\n\t\t}\n\n\t\t// reset the eaten question\n\t\tViewLogic.playGameController.getControl().setQuestionEaten(null);\n\t}", "public Question(String aQText, String anA1Text, String anA2Text, String anA3Text, String anA4Text, int aCorrect, int aValue){\n qText = aQText;\n a1Text = anA1Text;\n a2Text = anA2Text;\n a3Text = anA3Text;\n a4Text = anA4Text;\n correct = aCorrect;\n value = aValue;\n }", "public void setQuestionText(String questionText) {\n this.questionText = questionText;\n }", "public void program3Pressed() {\n // display\n TextLCD.print(PROGRAM3);\n }", "@FXML\n\tprivate void choiceThreeEventHandler(ActionEvent event) {\n\t\tchosenAnswer = choiceThreeButton;\n\t\ttestChoiceAnswer();\n\t}", "private void ans1Option() {\n RadioButton radioButtonA = (RadioButton) findViewById(R.id.radio_button_A);\n RadioButton radioButtonB = (RadioButton) findViewById(R.id.radio_button_B);\n RadioButton radioButtonC = (RadioButton) findViewById(R.id.radio_Button_C);\n RadioButton radioButtonD = (RadioButton) findViewById(R.id.radio_Button_D);\n radioButtonA.setText(R.string.que1Opt1);\n radioButtonB.setText(R.string.que1Opt2);\n radioButtonC.setText(R.string.que1Opt3);\n radioButtonD.setText(R.string.que1Opt4);\n }", "public void setLine3(String line3) {\n this.line3 = line3;\n }", "public double getQuiz3()\n\t{\n\t\treturn this.quiz3;\n\t}", "public void setSMART_OPTION_TEXT3(BigDecimal SMART_OPTION_TEXT3) {\r\n this.SMART_OPTION_TEXT3 = SMART_OPTION_TEXT3;\r\n }", "public void setSMART_OPTION_TEXT3(BigDecimal SMART_OPTION_TEXT3) {\r\n this.SMART_OPTION_TEXT3 = SMART_OPTION_TEXT3;\r\n }", "public static void incorrect3() {\r\n\r\n System.out.println(\" *---*\");\r\n System.out.println(\" | |\");\r\n System.out.println(\" 0 |\");\r\n System.out.println(\" /| | Incorrect - 3\");\r\n System.out.println(\" |\");\r\n System.out.println(\" |\");\r\n System.out.println(\"==========\");\r\n }", "public void displayCorrect(){\n textPane1.setText(\"\");\r\n generatePlayerName();\r\n textPane1.setText(\"GOOD JOB! That was the correct answer.\\n\"\r\n + atBatPlayer + \" got a hit!\\n\" +\r\n \"Press Next Question, or hit ENTER, to continue.\");\r\n SWINGButton.setText(\"Next Question\");\r\n formattedTextField1.setText(\"\");\r\n formattedTextField1.setText(\"Score: \" + score);\r\n }", "private void setQuestionView() {\n textView.setText(currentQuestion.getQuestion());\n buttonA.setText(currentQuestion.getOptA());\n buttonB.setText(currentQuestion.getOptB());\n buttonC.setText(currentQuestion.getOptC());\n numberText.setText(\"Question \" + (questionID + 1) + \" of \" + questionList.size());\n questionID++;\n }", "private void renewWordLevel3()\n {\n givenWord = availableWords.randomWordLevel3();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }", "private void setText(Text text) {\n \t\tthis.text = text;\n \t}", "private void setQuestionView()\n\t{\n txtQNumber.setText(qid + 1 + \"/\" + numberOfQuestions);\n\t\ttxtQuestion.setText(currentQ.getQUESTION());\n\t\ttxtReference.setText(currentQ.getREFERENCE());\n\t\trda.setText(currentQ.getOPTA());\n\t\trdb.setText(currentQ.getOPTB());\n\t\trdc.setText(currentQ.getOPTC());\n\t\trdd.setText(currentQ.getOPTD());\n\t\tqid++;\n\t}", "private void setQuestion(int number){\n tv_question.setText(questionsList.get(number).getQuestion());\n\n }", "public void chooseAnswer(View view)\n {\n\n if(view.getTag().toString().equals(Integer.toString(pos_of_correct)))\n {\n //Log.i(\"Result\",\"Correct Answer\");\n correct++;\n noOfQues++;\n correct();\n }\n else\n {\n //Log.i(\"Result\",\"Incorrect Answer\");\n //resluttextview.setText(\"Incorrect!\");\n incorrect();\n noOfQues++;\n }\n pointtextView.setText(Integer.toString(correct)+\"/\"+Integer.toString(noOfQues));\n if(tag==4)\n generateAdditionQuestion();\n if(tag==5)\n generateSubtractionQuestion();\n if(tag==6)\n generateMultiplicationQuestion();\n if(tag==7)\n generateDivisionQuestion();\n\n }", "public java.lang.String getQ3Label() {\n return q3Label;\n }", "public void enableThreeDisableFour() {\n\t\tans3.setEnabled(true);\n\t\tans4.setEnabled(false);\n\t\tans4.setText(\"\");\n\t\tanswer3.setEnabled(true);\n\t\tanswer4.setEnabled(false);\n\t}", "public void setarText() {\n txdata2 = (TextView) findViewById(R.id.txdata2);\n txdata1 = (TextView) findViewById(R.id.txdata3);\n txCpf = (TextView) findViewById(R.id.cpf1);\n txRenda = (TextView) findViewById(R.id.renda1);\n txCpf.setText(cpf3);\n txRenda.setText(renda.toString());\n txdata1.setText(data);\n txdata2.setText(data2);\n\n\n }", "public void setPra3(String pra3) {\n this.pra3 = pra3 == null ? null : pra3.trim();\n }", "public void setQuestion(){\n Random rand = new Random();\n a = rand.nextInt(maxRange)+1;\n b = rand.nextInt(maxRange)+1;\n int res = rand.nextInt(4);\n equation.setText(a +\"+\"+ b);\n for(int i=0; i<4; i++){\n if(i == res)\n arr[i] = a+b;\n else {\n int answer = rand.nextInt(2*maxRange)+1;\n while(answer == a+b)\n answer = rand.nextInt(2*maxRange)+1;\n arr[i] = answer;\n }\n }\n for(int i=0; i<4; i++)\n buttons[i].setText(String.valueOf(arr[i]));\n }", "public String getAnswerText2() {\r\n\t\treturn answerText2;\r\n\t}", "private void populateQuestion(String tempQuestionText) {\n\n\t\t// set them to radio options\n\t\tquestionTextView.setText(tempQuestionText);\n\n\t}", "public void q1Submit(View view) {\n\n EditText editText = (EditText) findViewById(R.id.q1enterEditText);\n String q1answer = editText.getText().toString().trim();\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if ((q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck1))) || (q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck2)))) {\n if (isNotAnsweredQ1) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct1), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ1 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }", "public String getInput3() {\n return input3;\n }", "public void actionPerformed(ActionEvent e){\n\t\t\t\t\tif (q1.isAnswerCorrect(getattempt.getText())){ //if its correct\n\t\t\t\t\t\tforq1 = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse forq1 = 0; //if it is incorrect\n\t\t\t\t\tattempt = getattempt.getText();\n\t\t\t\t\t\n\t\t\t\t\tquestionarea.setText(q2.question);//changes everything for the 2nd question after entering the first question\n\t\t\t\t\tgetattempt.setText(\"Enter your answer here\");\n\t\t\t\t\t//enter.remove(et);\n\t\t\t\t\tenter.addActionListener(ft);\n\t\t\t\t\t\n\t\t\t\t}", "public void setAnswer(MCQChoice answer)\n\t{\n\t\tmcqAnswer = answer;\n\t}", "public void setRemark3(java.lang.String _remark3)\r\n {\r\n this._remark3 = _remark3;\r\n }", "public void setTaxNumber3(\n @Nullable\n final String taxNumber3) {\n rememberChangedField(\"TaxNumber3\", this.taxNumber3);\n this.taxNumber3 = taxNumber3;\n }", "private static JPanel setAnswersText(Question question, copyRightGUI gui, ArrayList<Question> questionsList){\n JLabel label = new JLabel(); // Used for the final determination question\n JLabel optPermissionLaber = new JLabel(); // If asking for permission is preferred, display text\n\n // If the buttons array was previously filled, clear it\n if (buttons != null) {\n for (JButton btn : buttons\n ) {\n if (btn != null) {\n questionsPanel.remove(btn);\n }\n }\n }\n\n // create a new panel for the questions\n questionsPanel = new JPanel();\n\n // Create a new array with the specific amount of buttons needed\n buttons = new JButton[question.getNumAnswers()];\n\n // For the last question\n if (question.getQuestion().equals(\"Final Determination\")){\n\n if (totalScore > THRESHOLD) {\n label.setText(\"Fair use suggested\");\n label.setForeground(Color.GREEN);\n questionsPanel.add(label);\n if (askingPermsPref){\n optPermissionLaber.setText(\"...but asking for permission is preferred\");\n questionsPanel.add(optPermissionLaber);\n }\n } else {\n label.setText(\"Fair use not suggested\");\n label.setForeground(Color.red);\n questionsPanel.add(label);\n }\n return questionsPanel;\n }\n\n\n // For loop which adds buttons to the panel and creates their actions\n for (int i = 0; i < question.getNumAnswers(); i++){\n buttons[i] = new JButton(question.getAnswer(i));\n questionsPanel.updateUI();\n questionsPanel.add(buttons[i]);\n\n int selectedAnswer = i; // set the selected answer of the question\n\n // Add an actionListener for every question\n buttons[i].addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n question.setSelectedAnswer(selectedAnswer);\n // Create a temporary question which will hold the previous question data\n Question tempQuest;\n\n // Check if the quesiton has a special case and act correspondingly\n switch (question.getSpecialCase()){\n case 0:\n case 4:\n if (question.getScore() > 0){\n totalScore += question.getScore();\n scoreStack.push(question.getScore());\n }\n break;\n case 1:\n tempQuest = questionStack.peek();\n if ((tempQuest.getSelectedAnswer() == 0 && question.getSelectedAnswer() == 1)){\n scoreStack.push(20);\n totalScore+= 20;\n } else if (tempQuest.getSelectedAnswer() == 1 && question.getSelectedAnswer() == 0) {\n scoreStack.push(20);\n totalScore+=20;\n askingPermsPref = true;\n } else if (tempQuest.getSelectedAnswer() == 1 && question.getSelectedAnswer() == 1){\n scoreStack.push(40);\n totalScore+= 40;\n } else if (tempQuest.getSelectedAnswer() == 0 && question.getSelectedAnswer() == 0){\n scoreStack.push(0);\n }\n break;\n case 2:\n tempQuest = questionStack.peek();\n if (tempQuest.getSelectedAnswer() == 0 && question.getSelectedAnswer() == 0){\n scoreStack.push(10);\n totalScore+=10;\n } else if (tempQuest.getSelectedAnswer() == 0 && question.getSelectedAnswer() == 1){\n scoreStack.push(0);\n } else if (tempQuest.getSelectedAnswer() == 1 && question.getSelectedAnswer() == 0){\n scoreStack.push(40);\n totalScore+=40;\n } else if (tempQuest.getSelectedAnswer() == 1 && question.getSelectedAnswer() == 1){\n for (int k = 0; k < questionsList.size(); k++){\n if (questionsList.get(k).getQuestion().equals(\"Is gaining permission to use the film available?\")){\n gui.revalidate();\n loadQuestion(questionsList, gui, k);\n gui.revalidate();\n return;\n }\n\n }\n break;\n }\n break;\n case 3:\n try {\n Desktop.getDesktop().browse(new URL(\"https://creativecommons.org/licenses/\").toURI());\n } catch (Exception r) {\n System.out.println(\"Something went wrong with opening the link. Make sure the link\"\n + \"exists and is still valid\");\n r.printStackTrace();\n }\n break;\n case 5:\n if (question.getScore() > 0){\n totalScore += question.getScore();\n scoreStack.push(question.getScore());\n }\n if (question.getSelectedAnswer() == 0) {\n askingPermsPref = true;\n }\n default:\n break;\n\n }\n\n // testing purposes\n //System.out.println(question.getNextQuestion());\n\n // load the next question\n loadNextQuestion(question, questionsList, gui);\n\n\n }\n });\n }\n\n // return questionPanel which contains a panel with buttons\n return questionsPanel;\n }", "public void resetQuestion() \n\t{\n\t\tthis.game = masterPanel.getGame();\n\t\t\n\t\tArrayList<String> tempQuestion = new ArrayList<String>();\n\t\ttempQuestion = getRandQuestion();\n\t\t\n\t\tquestion.setText(tempQuestion.get(0));\n\t\tanswerOne.setText(tempQuestion.get(1));\n\t\tanswerTwo.setText(tempQuestion.get(2));\n\t\tanswerThree.setText(tempQuestion.get(3));\n\t\tanswerFour.setText(tempQuestion.get(4));\n\t\tcorrectAnswer = tempQuestion.get(5);\n\t\t\n\t\tlayoutConstraints.gridy = 1;\n\t\tthis.add(answerOne, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 2;\n\t\tthis.add(answerTwo, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 3;\n\t\tthis.add(answerThree, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 4;\n\t\tthis.add(answerFour, layoutConstraints);\n\t\t\n\t\tthis.repaint();\n\t}", "public void changeText()\n {\n Double base = 1.0;\n Double exponent = 0.0;\n\n try\n {\n /*get the values of the text inputs and set them to their respective variable, converting them to\n a double*/\n base = Double.parseDouble(txtBase.getText());\n exponent = Double.parseDouble(txtExponent.getText());\n }\n catch (NumberFormatException e) {\n /*On NumberFormatException, do nothing. Suppresses errors in the console which we do not need to\n know about, this is an expected and solved issue.*/\n }\n\n //calculate the new result, based on the current values of exponent and base, then set it to the output.\n Double result = Math.pow(base, exponent);\n lblResult.setText(result.toString());\n }", "public void actionPerformed(ActionEvent e){\n\t\t\t\t\tif (q2.isAnswerCorrect(getattempt.getText())){ //if you get the 2nd question correct\n\t\t\t\t\t\tforq2 = 1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tint score = forq1 + forq2; //score is the sum of the individual questions\n\t\t\t\t\tattempt2 = getattempt.getText(); //removes all the own components to make way for the new ones\n\t\t\t\t\tquestionarea.setVisible(false);\n\t\t\t\t\tenter.setVisible(false);\n\t\t\t\t\tgetattempt.setVisible(false);\n\t\t\t\t\tJLabel result = new JLabel(\"RESULT: \" + score + \"/2\"); //the result of your quizz\n\t\t\t\t\tresult.setFont(new Font(\"Serif\", Font.BOLD, 50));\n\t\t\t\t\tresult.setBounds(110,15, 400,50);\n\t\t\t\t\tJTextArea question1 = new JTextArea(q1.question);\n\t\t\t\t\tJTextArea question2 = new JTextArea(q2.question);\n\t\t\t\t\n\t\t\t\t\t//displays the correct answer your answer, and the question\n\t\t\t\t\tJLabel header = new JLabel(\"Question Your Answer Correct Ans.\");\n\t\t\t\t\theader.setFont(new Font(\"Serif\", Font.BOLD, 15));\n\t\t\t\t\theader.setBounds(10, 65,500,50);\n\t\t\t\t\t\n\t\t\t\t\tquestion1.setBounds(10,110, 280,50);\n\t\t\t\t\tquestion1.setLineWrap(true);\n\t\t\t\t\tJTextArea youranswer = new JTextArea (attempt);\n\t\t\t\t\tyouranswer.setBounds(300, 110, 50,30);\n\t\t\t\t\tJTextArea theanswer = new JTextArea(q1.answer);\n\t\t\t\t\ttheanswer.setBounds(410, 110,50,30);\n\t\t\t\t\t\n\t\t\t\t\tquestion2.setBounds(10,160, 280,50);\n\t\t\t\t\tquestion2.setLineWrap(true);\n\t\t\t\t\tJTextArea youranswer2 = new JTextArea (attempt2);\n\t\t\t\t\tyouranswer2.setBounds(300, 160 ,50,30);\n\t\t\t\t\tJTextArea theanswer2 = new JTextArea(q2.answer);\n\t\t\t\t\ttheanswer2.setBounds(410, 160,50,30);\n\t\t\t\t\t//adds everything to the JPanel\n\t\t\t\t\tadd(result);\n\t\t\t\t\tadd(question1);\n\t\t\t\t\tadd(question2);\n\t\t\t\t\tadd(header);\n\t\t\t\t\tadd(youranswer);\n\t\t\t\t\tadd(theanswer);\n\t\t\t\t\tadd(youranswer2);\n\t\t\t\t\tadd(theanswer2);\n\t\t\t\t\t\n\t\t\t\t\tJButton quit = new JButton(\"Exit\"); //the button that allows you to quit\n\t\t\t\t\tquit.setBounds(50,230,65,20);\n\t\t\t\t\tquit.addActionListener(new Quitter());\n\t\t\t\t\tadd(quit);\n\t\t\t\t\tif(type == 0){ //the type - if after u win a level, then you only need 1 right to pass, but if you lost, then u need 2 questins to pass, type == 0 is for loss\n\t\t\t\t\t\tif (score == 2){\n\t\t\t\t\t\t\tJButton retrylevel = new JButton(\"Retry\");\n\t\t\t\t\t\t\tretrylevel.setBounds(350,230,65,20);\n\t\t\t\t\t\t\tretrylevel.addActionListener(new Retry());\n\t\t\t\t\t\t\tadd(retrylevel);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tJButton retrylevel = new JButton(\"New Game\");\n\t\t\t\t\t\t\tretrylevel.setBounds(350,210,100,20);\n\t\t\t\t\t\t\tretrylevel.addActionListener(new Retry());\n\t\t\t\t\t\t\tadd(retrylevel);\t\n\t\t\t\t\t\t\tnumplanes = 1;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\thealth = finalhealth;\n\t\t\t\t\t}\n\t\t\t\t\telse if (type == 1){ //if you just cleared a wave of planes, this pops up\n\t\t\t\t\t\tif (score == 2){\n\t\t\t\t\t\t\tJButton retrylevel = new JButton(\"Continue\");\n\t\t\t\t\t\t\tretrylevel.setBounds(330,230,100,20);\n\t\t\t\t\t\t\tretrylevel.addActionListener(new Retry());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfinalhealth++;\n\t\t\t\t\t\t\thealth = finalhealth;\n\t\t\t\t\t\t\tadd(retrylevel);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (score==1){ //lets you pass on but no health bonus\n\t\t\t\t\t\t\tJButton retrylevel = new JButton(\"Continue\");\n\t\t\t\t\t\t\tretrylevel.setBounds(330,230,100,20);\n\t\t\t\t\t\t\tretrylevel.addActionListener(new Retry());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\thealth = finalhealth;\n\t\t\t\t\t\t\tadd(retrylevel);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse { //forces you to restart\n\t\t\t\t\t\t\tJButton retrylevel = new JButton(\"Restart Level\");\n\t\t\t\t\t\t\tretrylevel.setBounds(350,210,120,20);\n\t\t\t\t\t\t\tretrylevel.addActionListener(new Retry());\n\t\t\t\t\t\t\tadd(retrylevel);\n\t\t\t\t\t\t\thealth=finalhealth;\n\t\t\t\t\t\t\tnumplanes--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}", "private void updateQuestion() {\r\n\r\n //The code below resets the option\r\n mOption1.setVisibility(View.VISIBLE);\r\n mOption2.setVisibility(View.VISIBLE);\r\n mOption3.setVisibility(View.VISIBLE);\r\n mNext.setVisibility(View.INVISIBLE);\r\n\r\n int questionSize = 12;\r\n\r\n if (mQuestionNumber < questionSize) {\r\n\r\n mQuestionView.setText((questionsDB.getQuestion(mQuestionNumber)));\r\n mOption1.setText(questionsDB.getChoice1(mQuestionNumber));\r\n mOption2.setText(questionsDB.getChoice2(mQuestionNumber));\r\n mOption3.setText(questionsDB.getChoice3(mQuestionNumber));\r\n\r\n mAnswer = questionsDB.getCorrectAnswer(mQuestionNumber);\r\n mQuestionNumber++;\r\n timeLeftInMillis = COUNTDOWN_IN_MILLIS;\r\n startCountDown();\r\n\r\n\r\n } else {\r\n displayScore();\r\n }\r\n\r\n }", "private void setQuestion(int number) {\n questionPlaceholder.setText(questionsList.get(number).getQuestion());\n }", "public void setAnswer(String answer) {\r\n this.answer = answer;\r\n }", "public void correctAnswer(){\n AlertDialog.Builder dialogBoxAns = new AlertDialog.Builder(this);\n //set title to dialog box\n dialogBoxAns.setTitle(\"Results\");\n //set correct message to dialog box\n dialogBoxAns.setMessage((Html.fromHtml(\"<font color='#39FF14'> CORRECT! </font> \")));\n //set button to dialog box\n dialogBoxAns.setPositiveButton(\"OK\", null);\n //create new dialog box\n AlertDialog dialog = dialogBoxAns.create();\n dialog.show();\n }", "@Click(R.id.bt_answer4)\n void clickAnswer4() {\n selectedAnswer = questionList.get(questionProgress - 1).getAnswers().get(3);\n showResult();\n }", "public void thirdAction () {\r\n // Declare and initialize the fact array\r\n String fact[] = new String[4];\r\n fact[0] = \"Hi\";\r\n fact[1] = \"Stephen Colbert is a satire reporter. He does do interviews\";\r\n fact[2] = \"Colbert ran many shows: Daily Show, Colbert Report, and Late Show. You are probably on one of these shows.\";\r\n fact[3] = \"Colbert is funny and good.\";\r\n \r\n // Generate random facts\r\n int randomFactNumber = (int) (Math.random() * 4);\r\n \r\n // Print out the fact and write it to the transcript file\r\n System.out.println(fact[randomFactNumber]);\r\n fileOut.println(fact[randomFactNumber]);\r\n }", "public void setQuestion(Question q)\n {\n currentQuestion=q;\n questionLabel.setText(q.getQuestion());\n feedbackLabel.setVisible(false);\n }", "public void setQuestion()\n\t{\n\t\tthis.game = masterPanel.getGame();\n\t\t\n\t\tthis.setLayout(new GridBagLayout());\n\t\t\n\t\tArrayList<String> tempQuestion = new ArrayList<String>();\n\t\ttempQuestion = getRandQuestion();\n\t\t\t\t\n\t\tquestion = new JLabel();\n\t\tquestion.setText(tempQuestion.get(0));\n\t\tquestion.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tquestion.setPreferredSize(new Dimension(BUTTON_WIDTH + 200, BUTTON_HEIGHT));\n\t\t\n\t\tlayoutConstraints.gridy = 0;\n\t\tlayoutConstraints.insets = new Insets(10, 10, 10, 10);\n\t\tthis.add(question, layoutConstraints);\n\t\t\n\t\tanswerOne = new JButton();\n\t\tanswerOne.setText(tempQuestion.get(1));\n\t\tanswerOne.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));\n\t\tanswerOne.addActionListener(new AnswerButtonListener());\n\t\t\n\t\tlayoutConstraints.gridy = 1;\n\t\tthis.add(answerOne, layoutConstraints);\n\t\t\n\t\tanswerTwo = new JButton();\n\t\tanswerTwo.setText(tempQuestion.get(2));\n\t\tanswerTwo.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));\n\t\tanswerTwo.addActionListener(new AnswerButtonListener());\n\t\t\n\t\tlayoutConstraints.gridy = 2;\n\t\tthis.add(answerTwo, layoutConstraints);\n\t\t\n\t\tanswerThree = new JButton();\n\t\tanswerThree.setText(tempQuestion.get(3));\n\t\tanswerThree.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));\n\t\tanswerThree.addActionListener(new AnswerButtonListener());\n\t\t\n\t\tlayoutConstraints.gridy = 3;\n\t\tthis.add(answerThree, layoutConstraints);\n\t\t\n\t\tanswerFour = new JButton();\n\t\tanswerFour.setText(tempQuestion.get(4));\n\t\tanswerFour.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));\n\t\tanswerFour.addActionListener(new AnswerButtonListener());\n\t\t\n\t\tlayoutConstraints.gridy = 4;\n\t\tthis.add(answerFour, layoutConstraints);\n\t\t\n\t\tcorrectAnswer = tempQuestion.get(5);\t\n\t}", "@Override\n\t\t\tpublic void onCheckedChanged(CompoundButton buttonView,\n\t\t\t\t\tboolean isChecked) {\n\t\t\t\tif (isChecked) {\n\t\t\t\t\ttxtDevice3.setText(\"อุปกรณ์ที่ 3 เปิด\");\n\t\t\t\t} else\n\t\t\t\t\ttxtDevice3.setText(\"อุปกรณ์ที่ 3 ปิด\");\n\t\t\t}", "public Alternatives getAlternatives_3() { return cAlternatives_3; }", "public void disableThreeAndFour() {\n\t\tans3.setEnabled(false);\n\t\tans4.setEnabled(false);\n\t\tans3.setText(\"\");\n\t\tans4.setText(\"\");\n\t\tanswer3.setEnabled(false);\n\t\tanswer4.setEnabled(false);\n\t}", "public void checkAnswer(View view) {\n TextView tv=findViewById(R.id.question);\n String question=tv.getText().toString();\n\n //split the question into numbers\n String [] numbers=question.split(\"X\");\n\n\n //convert the numbers into integer\n Integer num1, num2;\n num1=Integer.valueOf(numbers[0]);\n num2=Integer.valueOf(numbers[1]);\n\n\n user=findViewById(R.id.printAns);\n ans=findViewById(R.id.answer);\n Integer uer=Integer.parseInt(ans.getText().toString());\n\n\n\n int total=uer;\n\n\n if (num1*num2==total){\n user.setText(\"Your answer is correct\");\n\n }else{\n user.setText(\"Try Again\");\n }\n\n\n\n }", "private void checkAnswer(int i) {\n\tswitch(i){\r\n\tcase 1:\r\n\t\t Button answer=(Button)findViewById(R.id.radio0);\r\n\t\t Log.d(\"yourans\", currentQ.getANSWER()+\" \"+answer.getText());\r\n\t\t if(currentQ.getANSWER().contentEquals(answer.getText()))\r\n\t\t \t {\r\n\t\t \t scoreSci++;\r\n\t\t \t String d=String.valueOf(scoreSci);\r\n\t\t\t \tEditor editor=mGameSettings.edit();\r\n\t\t\t \teditor.putString(GAME_PREFERENCES_SCORE_SCI,d);\r\n\t\t\t \teditor.commit();\r\n\t\t\t\t\tLog.d(DEBUG_TAG, \"Score is : \"\r\n\t\t\t + mGameSettings.getString(GAME_PREFERENCES_SCORE_SCI, \"Not set\"));\r\n\t\t \t Toast.makeText(getApplicationContext(),\"correct\",Toast.LENGTH_SHORT).show();\r\n\t\t\t }\r\n\t\t \t else{\r\n\t\t \t\tString d=\"The correct answer is\\n\"+currentQ.getANSWER();\r\n\t\t \t\tEditor editor2=mGameSettings.edit();\r\n\t\t\t \teditor2.putString(GAME_CURRENT_ANS_SCI,d);\r\n\t\t\t \teditor2.commit();\r\n\t\t\t \tQuizActivitySci.this.showDialog(GET_WRONG);\r\n\t\t \t }\r\n\t Log.d(\"score\", \"Your score\"+scoreSci);\r\n\t\tbreak;\r\n\tcase 2:\r\n\t\t Button answer1=(Button)findViewById(R.id.radio1);\r\n\t \t Log.d(\"yourans\", currentQ.getANSWER()+\" \"+answer1.getText()); \t\r\n\t if(currentQ.getANSWER().contentEquals(answer1.getText()))\r\n\t \t {\r\n\t \t scoreSci++;\r\n\t \t String d=String.valueOf(scoreSci);\r\n\t \tEditor editor=mGameSettings.edit();\r\n\t \teditor.putString(GAME_PREFERENCES_SCORE_SCI,d);\r\n\t \teditor.commit();\r\n\t\t\t Log.d(\"score\", \"Your score\"+scoreSci);\r\n\t\t\t Log.d(DEBUG_TAG, \"Score is : \"\r\n\t + mGameSettings.getString(GAME_PREFERENCES_SCORE_SCI, \"Not set\"));\r\n\t\t\t Toast.makeText(getApplicationContext(),\"correct\",Toast.LENGTH_SHORT).show();\r\n\t\t }else{\r\n\t\t\t String d=\"The correct answer is\\n\"+currentQ.getANSWER();\r\n\t\t \t\tEditor editor2=mGameSettings.edit();\r\n\t\t\t \teditor2.putString(GAME_CURRENT_ANS_SCI,d);\r\n\t\t\t \teditor2.commit();\r\n\t\t\t \tQuizActivitySci.this.showDialog(GET_WRONG);\r\n\t \t }\r\n\t Log.d(\"score\", \"Your score\"+scoreSci);\r\n\t\tbreak;\r\n\tcase 3:\r\n\t\tButton answer11=(Button)findViewById(R.id.radio2);\r\n\t \t Log.d(\"yourans\", currentQ.getANSWER()+\" \"+answer11.getText()); \r\n\t \t if(currentQ.getANSWER().contentEquals(answer11.getText()))\r\n\t \t {\r\n\t \t scoreSci++;\r\n\t \tString d=String.valueOf(scoreSci);\r\n\t \tEditor editor=mGameSettings.edit();\r\n\t \teditor.putString(GAME_PREFERENCES_SCORE_SCI,d);\r\n\t \teditor.commit();\r\n\t\t\t Log.d(\"score\", \"Your score\"+scoreSci);\r\n\t\t\t Log.d(DEBUG_TAG, \"Score is : \"\r\n\t + mGameSettings.getString(GAME_PREFERENCES_SCORE_SCI, \"Not set\"));\r\n\t\t\t Toast.makeText(getApplicationContext(),\"correct\",Toast.LENGTH_SHORT).show();\r\n\t\t }else{\r\n\t\t\t String d=\"The correct answer is\\n\"+currentQ.getANSWER();\r\n\t\t \t\tEditor editor2=mGameSettings.edit();\r\n\t\t\t \teditor2.putString(GAME_CURRENT_ANS_SCI,d);\r\n\t\t\t \teditor2.commit();\r\n\t\t\t \tQuizActivitySci.this.showDialog(GET_WRONG);\r\n\t \t\t}\r\n\t \tLog.d(\"score\", \"Your score\"+scoreSci);\r\n\t\tbreak;\r\n\tcase 4:\r\n\t\tButton answer111=(Button)findViewById(R.id.radio3);\r\n\t \t Log.d(\"yourans\", currentQ.getANSWER()+\" \"+answer111.getText()); \t\r\n\t \t if(currentQ.getANSWER().contentEquals(answer111.getText()))\r\n\t \t {\r\n\t \t scoreSci++;\r\n\t \tString d=String.valueOf(scoreSci);\r\n\t \tEditor editor=mGameSettings.edit();\r\n\t \teditor.putString(GAME_PREFERENCES_SCORE_SCI,d);\r\n\t \teditor.commit();\r\n\t\t\t Log.d(\"score\", \"Your score\"+scoreSci);\r\n\t\t\t Log.d(DEBUG_TAG, \"Score is : \"\r\n\t + mGameSettings.getString(GAME_PREFERENCES_SCORE_SCI, \"Not set\"));\r\n\t\t\t Toast.makeText(getApplicationContext(),\"correct\",Toast.LENGTH_SHORT).show();\r\n\t\t }else{\r\n\t\t\t String d=\"The correct answer is\\n\"+currentQ.getANSWER();\r\n\t\t \t\tEditor editor2=mGameSettings.edit();\r\n\t\t\t \teditor2.putString(GAME_CURRENT_ANS_SCI,d);\r\n\t\t\t \teditor2.commit();\r\n\t\t\t \tQuizActivitySci.this.showDialog(GET_WRONG);\r\n\t \t\t }\r\n\t \tLog.d(\"score\", \"Your score\"+scoreSci);\r\n\t\tbreak;\r\n\t\t\r\n}\r\n\t\r\n}", "public void setText(String text) {\n\t\t\n\t}", "public void modify() {\n io.writeLine(\"Enter the new correct answer\");\n String newAnswer = io.readLine();\n while (!newAnswer.equals(\"T\") && !newAnswer.equals(\"F\")) {\n io.writeLine(\"Please put in T or F\");\n newAnswer = io.readLine();\n }\n rightAnswers.set(0, newAnswer);\n }", "@Override\n\tpublic void setText(String text) {\n \tif (_assocModel == null) return;\n\t\tString mult;\n\t\tPattern p = Pattern.compile(\"([\\\\d]|\\\\Q*\\\\E)([.]{2}+([\\\\d]|\\\\Q*\\\\E))?\");\t// regex for multiplicities: (digit | *) + optional(.. (digit | *))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// can use a Collection to handle multiplicities of *; we really only care about\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the upper bound also\n\t\tMatcher m = p.matcher(text);\n\t\t// regex didn't find anything, so we'll assign a default multiplicity\n\t\tif (!m.find() || m.group().length() < 0) {\n\t\t\tmult=\"1\";\n\t\t}\n\t\telse mult = m.group();\n\t\t_assocModel.setMultiplicity(mult);\n\t\tsuper.setText(mult);\n\t}", "private void step3() {\n\t\tthis.demonstrationStep++;\n\t\tthis.editableFields = (this.getView().getUserInput().length - 2);\n\t\tthis.getView().getForwardingViewContainer().remove(this.getView().getProceed());\n\t\tthis.getView().setProceed(null);\n\t\tthis.getView().getUserInput()[1].setBorder(null);\n\t\tthis.getView().getUserOutput()[1].setBorder(null);\n\t\tfor (int i = 2; i < this.getView().getUserInput().length; i++) {\n\t\t\tthis.getView().getUserOutput()[i].setEditable(true);\n\t\t}\n\t\tthis.getView()\n\t\t\t\t.getExplanations()\n\t\t\t\t.setText(\n\t\t\t\t\t\tthis.wrapHtml(CryptoDemonstrationController.i18n\n\t\t\t\t\t\t\t\t.tr(\"Oh mighty Caesar. No one will ever be able to destroy you! Because of that fact lets end\"\n\t\t\t\t\t\t\t\t\t\t+ \" this childish games and finish the rest of the fields fast. Then we can send the courier again\"\n\t\t\t\t\t\t\t\t\t\t+ \" but this time your enemies will have no idea who wrote it and you will conquer the world.\")));\n\t\tthis.getView().getUserOutput()[2].requestFocus();\n\t\tthis.getView().validate();\n\n\t}", "private void previousQuestion() {\n if (mCurrentIndex > 0) {\n mCurrentIndex = (mCurrentIndex - 1) % questions.length;\n }\n else\n mCurrentIndex = questions.length - 1;\n int question = questions[mCurrentIndex].getTextResId();\n mText.setText(question);\n }", "@Click(R.id.bt_answer1)\n void clickAnswer1() {\n selectedAnswer = questionList.get(questionProgress - 1).getAnswers().get(0);\n showResult();\n }", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\t\tif( txt_showresult.getText().equals( \"0\" )){ \n\t\t\t\t\t\t\t\ttxt_showresult.setText(\"3\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// if textfield show other value , add number after the value\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttxt_showresult.setText( txt_showresult.getText() + \"3\");\n\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t}", "public void updateQ4scoreAndGoToNext(View view){\r\n EditText q1Correct;\r\n q1Correct = (EditText) findViewById(R.id.q1Answer);\r\n String inputText = q1Correct.getText().toString();\r\n String rightAnswer = \"TextView\";\r\n\r\n if (inputText.equals(rightAnswer)) {\r\n q1Score = q1Score + 1;\r\n Toast toast = Toast.makeText(this, \"Great Job! 1 point added.\", Toast.LENGTH_SHORT);\r\n toast.show();\r\n } else {\r\n q1Score = 0;\r\n Toast toast = Toast.makeText(this, \"Better luck next time, 0 points added.\", Toast.LENGTH_SHORT);\r\n toast.show();\r\n }\r\n\r\n Intent i = new Intent(this, Question2Activity.class);\r\n startActivity(i);\r\n }", "private void checkAnswer()\r\n\t{\r\n\t\t//Submission to the model and getting 'true' if correct and 'false' otherwise\r\n\t\tboolean response = quizModel.isCorrect(group.getSelection().getActionCommand());\r\n\t\t\r\n\t\t//Updating score label based on result\r\n\t\tif (response == true)\r\n\t\t{\r\n\t\t\tscoreLabel.setText(\"<html><div style='text-align: center;'>\" + \"Score = \" + quizModel.getScore() + \"<br>Correct answer!\" + \"</div></html>\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tscoreLabel.setText(\"<html><div style='text-align: center;'>\" + \"Score = \" + quizModel.getScore() + \"<br>Incorrect answer!\" + \"</div></html>\");\r\n\t\t}\r\n\t}", "public void setText(String text) {\r\n\r\n\t}" ]
[ "0.80302846", "0.75034076", "0.7102324", "0.69921947", "0.67021394", "0.6701131", "0.6579523", "0.65733373", "0.64908946", "0.63922644", "0.6285126", "0.6273893", "0.6238461", "0.6236281", "0.6223801", "0.6217664", "0.6203637", "0.61527395", "0.61415035", "0.6110146", "0.60907185", "0.6074799", "0.60520035", "0.6050621", "0.60463333", "0.60302883", "0.6022242", "0.60156107", "0.5974483", "0.5966394", "0.5959362", "0.59574264", "0.59567404", "0.5915192", "0.59098244", "0.5875544", "0.5866385", "0.5865411", "0.58598673", "0.5839891", "0.58204263", "0.58094347", "0.5776883", "0.57766986", "0.57703567", "0.57635325", "0.5762906", "0.5687407", "0.565246", "0.56444675", "0.56434", "0.56434", "0.56327", "0.5632559", "0.56304735", "0.56294197", "0.56269675", "0.5623834", "0.56192976", "0.56131715", "0.56128", "0.5612779", "0.5598143", "0.55861485", "0.558466", "0.5571305", "0.5569063", "0.55648154", "0.55513746", "0.5545216", "0.55448323", "0.554201", "0.55393314", "0.55387664", "0.5532562", "0.5531245", "0.55239546", "0.5519876", "0.5518128", "0.5511245", "0.54963213", "0.54920447", "0.5481629", "0.54803795", "0.5468548", "0.54578227", "0.5451009", "0.5445277", "0.5444329", "0.5442093", "0.5432666", "0.54295474", "0.54273987", "0.5421478", "0.5420223", "0.5414104", "0.541017", "0.5405889", "0.53912866", "0.5391184" ]
0.8830244
0
Creates new form calculate salary
public calsal() { initComponents(); //connect to DB con =DBconnect.connect(); //load table tableload(); tableloadfnl(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void calculateSalary() ;", "public Salary_Calculator() {\n initComponents();\n }", "public Salary() {\n initComponents();\n }", "@Override\n public double calculateSalary(){\n return this.horas_trabajadas*EmployeeByHours.VALOR_HORA;\n }", "public abstract double salary();", "public void setSalary(double salary){\r\n this.salary = salary;\r\n }", "public void getSalary() {\n this.payDay(this.monthlyIncome);\n }", "private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {\n fetchSalaryDetailsFromDB(1,1);\r\n calculate();\r\n \r\n }", "@Override\r\n\tpublic void calculateSalary() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t salary = hoursWorked * hourlyWages;\r\n\t\t this.setSalary(salary);\r\n\t}", "public void setSalary(double salary) {\r\n this.salary = salary;\r\n }", "public void salary() {\n System.out.print(\"Wage: \");\n double wage = in.nextDouble();\n System.out.print(\"Hours: \");\n double hours = in.nextDouble();\n final double REG_HOURS = 40;\n final double OVERTIME_MULTIPLIER = 0.5;\n\n double salary = wage * hours;\n if (hours > REG_HOURS) {\n salary += (hours - REG_HOURS) * wage * OVERTIME_MULTIPLIER;\n }\n\n System.out.printf(\"\\nYou'll make $%,.2f this week.\\n\\n\", salary);\n }", "public void setSalary(double salary) {\n this.salary = salary;\n }", "public void setSalary(double salary) {\n this.salary = salary;\n }", "public String getSalary() {\n return salaryField.getText();\n }", "@Override\n\tpublic void computeSalary(int empid) {\n\t\t\n\t}", "@Override\n\tpublic float CalculateSalary() {\n\t\treturn salary;\n\t}", "public static void showSalary(CreateUser user){ // passing an argument\n\n double salary = user.userSalary;\n\n System.out.println(\"Salary is: \"+salary);\n }", "public void calculateSalary() {\n if (hours < 0 || hourlyRate < 0) {\r\n salary = -1;\r\n }\r\n else if (hours > 40) {\r\n salary = 40 * hourlyRate;\r\n }\r\n else {\r\n salary = hours * hourlyRate;\r\n }\r\n }", "public abstract void raiseSalary();", "float getMonthlySalary();", "public void setSalary(int salary) {\n salaryField.setText(\"\" + salary);\n }", "public void salary(int sal)\n {\n IT it = new IT();\n it.salary(sal);\n System.out.println(\"ECE Faculty: \"+(sal+4500));\n }", "public void setSalary(double salary) {\r\n\t\tthis.salary = salary;\r\n\t}", "public double getSalary(){\r\n return salary;\r\n }", "int getSalary();", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n salary = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n jSeparator1 = new javax.swing.JSeparator();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n jLabel10 = new javax.swing.JLabel();\n totalDeductions = new javax.swing.JTextField();\n totalSalary = new javax.swing.JTextField();\n jSeparator2 = new javax.swing.JSeparator();\n actualSalary = new javax.swing.JTextField();\n terminationPayment = new javax.swing.JTextField();\n health = new javax.swing.JTextField();\n bonuses = new javax.swing.JTextField();\n pension = new javax.swing.JTextField();\n addRegistry = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n jLabel13 = new javax.swing.JLabel();\n date = new com.toedter.calendar.JDateChooser();\n jLabel14 = new javax.swing.JLabel();\n panelVariable = new javax.swing.JPanel();\n labelTotalIncomes = new javax.swing.JLabel();\n totalIncomes = new javax.swing.JTextField();\n labelTransportAssistance = new javax.swing.JLabel();\n transportAssistance = new javax.swing.JTextField();\n jLabel11 = new javax.swing.JLabel();\n jSeparator3 = new javax.swing.JSeparator();\n jSeparator4 = new javax.swing.JSeparator();\n jSeparator5 = new javax.swing.JSeparator();\n\n setBackground(new java.awt.Color(255, 255, 255));\n setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel1.setText(\"Salario básico\");\n add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 360, 100, 30));\n\n salary.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n salaryActionPerformed(evt);\n }\n });\n add(salary, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 360, 144, 40));\n\n jLabel2.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel2.setText(\"Cesantias\");\n add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(690, 110, 99, 30));\n add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 30, 800, 15));\n\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel3.setText(\"Total Ingresos y Deducciones del mes de marzo\");\n add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 60, 490, -1));\n\n jLabel4.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel4.setText(\"Bonos \");\n add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 190, 99, 30));\n\n jLabel5.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel5.setText(\"Pension\");\n add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 190, 99, 30));\n\n jLabel6.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel6.setText(\"Salud\");\n add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 150, 99, 30));\n\n jLabel7.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel7.setText(\"Deducciones\");\n add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(520, 110, 99, 30));\n\n jLabel8.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel8.setText(\"Ingresos\");\n add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 120, -1, -1));\n\n jLabel9.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel9.setText(\"Total Deducciones\");\n add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 240, 110, 30));\n\n jLabel10.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n jLabel10.setText(\"Devengado Actual\");\n add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 150, 120, 30));\n\n totalDeductions.setEditable(false);\n totalDeductions.setBackground(new java.awt.Color(0, 204, 51));\n totalDeductions.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n totalDeductions.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n add(totalDeductions, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 240, 130, 30));\n\n totalSalary.setEditable(false);\n totalSalary.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n totalSalary.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n add(totalSalary, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 360, 240, 40));\n add(jSeparator2, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 330, 800, 10));\n\n actualSalary.setEditable(false);\n actualSalary.setBackground(new java.awt.Color(0, 204, 51));\n actualSalary.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n actualSalary.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n add(actualSalary, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 150, 130, 30));\n\n terminationPayment.setEditable(false);\n terminationPayment.setBackground(new java.awt.Color(0, 204, 51));\n terminationPayment.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n terminationPayment.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n add(terminationPayment, new org.netbeans.lib.awtextra.AbsoluteConstraints(680, 150, 130, 30));\n\n health.setEditable(false);\n health.setBackground(new java.awt.Color(0, 204, 51));\n health.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n health.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n add(health, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 150, 130, 30));\n\n bonuses.setEditable(false);\n bonuses.setBackground(new java.awt.Color(0, 204, 51));\n bonuses.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n bonuses.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n add(bonuses, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 190, 130, 30));\n\n pension.setEditable(false);\n pension.setBackground(new java.awt.Color(0, 204, 51));\n pension.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n pension.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n pension.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n pensionActionPerformed(evt);\n }\n });\n add(pension, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 190, 130, 30));\n\n addRegistry.setBackground(new java.awt.Color(0, 204, 51));\n addRegistry.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/images/icons8_Clock_64px_1.png\"))); // NOI18N\n addRegistry.setText(\"Agregar Jornada\");\n addRegistry.setBorderPainted(false);\n addRegistry.setFocusPainted(false);\n addRegistry.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n addRegistryActionPerformed(evt);\n }\n });\n add(addRegistry, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 440, 220, 60));\n\n jButton2.setBackground(new java.awt.Color(0, 204, 51));\n jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/images/icons8_Money_Bag_48px.png\"))); // NOI18N\n jButton2.setText(\" Ingresos Adicionales\");\n jButton2.setBorderPainted(false);\n jButton2.setFocusPainted(false);\n jButton2.setMargin(new java.awt.Insets(2, 10, 2, 10));\n add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 440, 230, 60));\n\n jLabel13.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n jLabel13.setText(\"$\");\n add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 360, 20, 30));\n\n date.addPropertyChangeListener(new java.beans.PropertyChangeListener() {\n public void propertyChange(java.beans.PropertyChangeEvent evt) {\n datePropertyChange(evt);\n }\n });\n date.addVetoableChangeListener(new java.beans.VetoableChangeListener() {\n public void vetoableChange(java.beans.PropertyChangeEvent evt)throws java.beans.PropertyVetoException {\n dateVetoableChange(evt);\n }\n });\n add(date, new org.netbeans.lib.awtextra.AbsoluteConstraints(580, 50, 110, 30));\n\n jLabel14.setText(\"Fecha de pago\");\n add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 80, -1, -1));\n\n panelVariable.setBackground(new java.awt.Color(255, 255, 255));\n panelVariable.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n labelTotalIncomes.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n labelTotalIncomes.setText(\"Total Ingresos\");\n panelVariable.add(labelTotalIncomes, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 60, 99, 30));\n\n totalIncomes.setEditable(false);\n totalIncomes.setBackground(new java.awt.Color(0, 204, 51));\n totalIncomes.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n totalIncomes.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n panelVariable.add(totalIncomes, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 60, 130, 30));\n\n labelTransportAssistance.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n labelTransportAssistance.setText(\"Auxilio de transporte\");\n panelVariable.add(labelTransportAssistance, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 20, 120, 30));\n\n transportAssistance.setEditable(false);\n transportAssistance.setBackground(new java.awt.Color(0, 204, 51));\n transportAssistance.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n transportAssistance.setHorizontalAlignment(javax.swing.JTextField.CENTER);\n panelVariable.add(transportAssistance, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 20, 130, 30));\n\n add(panelVariable, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 220, 300, 100));\n\n jLabel11.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel11.setText(\"Neto a recibir: \");\n add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 360, 110, 30));\n\n jSeparator3.setOrientation(javax.swing.SwingConstants.VERTICAL);\n add(jSeparator3, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 30, 20, 300));\n\n jSeparator4.setOrientation(javax.swing.SwingConstants.VERTICAL);\n add(jSeparator4, new org.netbeans.lib.awtextra.AbsoluteConstraints(830, 30, 20, 300));\n add(jSeparator5, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 100, 800, 240));\n }", "public double getSalary() {\r\n return salary;\r\n }", "public double showSalary() {\n return super.showSalary() * 1.2;\n }", "public void salary(int sal)\n {\n Faculty fac = new Faculty();\n fac.salary(sal);\n System.out.println(\"CSE Faculty: \"+(sal+3000));\n }", "@Override\r\n public int calculateSalary()\r\n {\r\n return weeklySalary*4;\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel8 = new javax.swing.JLabel();\n jLabel1 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel10 = new javax.swing.JLabel();\n jButton2 = new javax.swing.JButton();\n jLabel11 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n txtId = new javax.swing.JTextField();\n jLabel7 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jButton1 = new javax.swing.JButton();\n jLabel4 = new javax.swing.JLabel();\n lblLeave = new javax.swing.JLabel();\n jLabel13 = new javax.swing.JLabel();\n lblAmount = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel8.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel8.setText(\"Epf Amount\");\n\n jLabel1.setFont(new java.awt.Font(\"Times New Roman\", 1, 24)); // NOI18N\n jLabel1.setText(\"Salary Slip\");\n\n jLabel9.setText(\"etf\");\n\n jLabel2.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel2.setText(\"Employee ID\");\n\n jLabel10.setText(\"epf\");\n\n jButton2.setFont(new java.awt.Font(\"Times New Roman\", 0, 18)); // NOI18N\n jButton2.setText(\"Ok\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n jLabel11.setText(\"name\");\n\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel3.setText(\"Employee Name\");\n\n jLabel6.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel6.setText(\"Salary\");\n\n jLabel7.setText(\"Final Salary\");\n\n jLabel5.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel5.setText(\"Etf Amount\");\n\n jButton1.setFont(new java.awt.Font(\"Times New Roman\", 0, 18)); // NOI18N\n jButton1.setText(\"Back\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jLabel4.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel4.setText(\"Leave \");\n\n lblLeave.setText(\"lleave\");\n\n jLabel13.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel13.setText(\"Leave Amount\");\n\n lblAmount.setText(\"amount\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(30, 30, 30)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jButton1)\n .addGap(61, 61, 61)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(40, 40, 40)\n .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(60, 60, 60)\n .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(layout.createSequentialGroup()\n .addGap(40, 40, 40)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel8)\n .addComponent(jLabel13)\n .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4))\n .addGap(157, 157, 157)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel7)\n .addComponent(lblLeave)\n .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lblAmount)\n .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel11)))\n .addGroup(layout.createSequentialGroup()\n .addGap(40, 40, 40)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addComponent(jLabel3)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel5)\n .addGap(198, 198, 198))))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(20, 20, 20)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(jButton1))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jButton2)\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGap(49, 49, 49)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(jLabel11))\n .addGap(13, 13, 13)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5)\n .addComponent(jLabel9))\n .addGap(13, 13, 13)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel8)\n .addComponent(jLabel10))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(lblLeave)\n .addComponent(jLabel4))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel13)\n .addComponent(lblAmount))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel6)\n .addComponent(jLabel7))\n .addGap(31, 31, 31))\n );\n\n pack();\n setLocationRelativeTo(null);\n }", "public double getSalary() {\n return salary;\n }", "public double getSalary() {\n return salary;\n }", "public double getSalary() {\n return salary;\n }", "public void setSalary(double fromage)\r\n {\r\n mySalary = fromage;\r\n }", "void newSale(double totalWithTaxes);", "@FXML\r\n\tpublic void btnCalculate(ActionEvent event) {\n\t\ttry {\r\n\t\t\tint iYearsToWork = Integer.parseInt(txtYearsToWork.getText());\r\n\t\t\tdouble dAnnualReturnWorking = Double.parseDouble(txtAnnualReturn.getText());\r\n\t\t\tint iYearsRetired = Integer.parseInt(txtYearsRetired.getText());\r\n\t\t\tdouble dAnnualReturnRetired = Double.parseDouble(txtAnnualReturnRetired.getText());\r\n\t\t\tdouble dRequiredIncome = Double.parseDouble(txtRequiredIncome.getText());\r\n\t\t\tdouble dMonthlySSI = Double.parseDouble(txtMonthlySSI.getText());\r\n\t\t\t\r\n\t\t\tif (dAnnualReturnWorking > 1 || dAnnualReturnRetired > 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}\r\n\t\tcatch (NumberFormatException e) {\r\n\t\t\ttxtYearsToWork.setText(\"Please clear and enter an integer\");\r\n\t\t\ttxtAnnualReturn.setText(\"Please clear and enter a decimal\");\r\n\t\t\ttxtYearsRetired.setText(\"Please clear and enter an integer\");\r\n\t\t\ttxtAnnualReturnRetired.setText(\"Please clear and enter a decimal\");\r\n\t\t\ttxtRequiredIncome.setText(\"Please clear and enter a double\");\r\n\t\t\ttxtMonthlySSI.setText(\"Please clear and enter a double\");\r\n\t\t}\r\n\t\t\r\n\t\tfinally {\r\n\t\t\tint iYearsToWork = Integer.parseInt(txtYearsToWork.getText());\r\n\t\t\tdouble dAnnualReturnWorking = Double.parseDouble(txtAnnualReturn.getText());\r\n\t\t\tint iYearsRetired = Integer.parseInt(txtYearsRetired.getText());\r\n\t\t\tdouble dAnnualReturnRetired = Double.parseDouble(txtAnnualReturnRetired.getText());\r\n\t\t\tdouble dRequiredIncome = Double.parseDouble(txtRequiredIncome.getText());\r\n\t\t\tdouble dMonthlySSI = Double.parseDouble(txtMonthlySSI.getText());\r\n\t\t\t\r\n\t\t\tRetirement r = new Retirement(iYearsToWork, dAnnualReturnWorking, iYearsRetired, dAnnualReturnRetired, dRequiredIncome, dMonthlySSI);\r\n\t\t\r\n\t\t\tTotalSaved.setDisable(false);\r\n\t\t\tSaveEachMonth.setDisable(false);\r\n\t\t\tString month = String.format(\"$%.2f\", r.AmountToSave());\r\n\t\t\tString total = String.format(\"$%.2f\", r.TotalAmountSaved());\r\n\t\t\tSaveEachMonth.setText(month);\r\n\t\t\tTotalSaved.setText(total);\r\n\t\t\tTotalSaved.setDisable(true);\r\n\t\t\tSaveEachMonth.setDisable(true);\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n\tpublic int calculateSalary() {\n\t\treturn this.getPaymentPerHour() * this.workingHours;\n\t}", "@Override\r\n public double getSalary() {\r\n return salary;\r\n }", "public void salary(int sal)\n {\n CSE cse = new CSE();\n cse.salary(sal);\n System.out.println(\"IT Faculty: \"+(sal+5000));\n }", "public static void main(String[] args) {\n int n = Integer.parseInt(JOptionPane.showInputDialog(\"Enter Number of Staff on Payroll\"));\n for (int i =0; i<n;i++){\n int salary = Integer.parseInt(JOptionPane.showInputDialog(\"Enter Basic Salary of Staff\"));\n double ta = (10/100)*salary;\n double ha = (15.5/100)*salary;\n int m = 500;\n int y = Integer.parseInt(JOptionPane.showInputDialog(\"Enter Numbers of year of Staff with the organisation\"));\n double lsa;\n if (y>10){\n lsa = (2/100)*salary;\n }\n else{\n lsa = 0;}\n double netpay = salary + ta + ha + m+ lsa;\n JOptionPane.showMessageDialog(null,\"Staff salary is \"+ salary + \"with netpay of \"+ netpay, \"Netpay\",JOptionPane.INFORMATION_MESSAGE);\n }\n }", "public Employee(String firstName, String lastName, int salary, int bonus) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.salary = salary;\n this.bonus = bonus;\n this.taxableSalary=this.salary+this.bonus-this.taxAllowance;\n }", "public float calculate_salary() {\r\n\t\tfloat calculate = 1000 + this.calculate_benefits();\r\n\t\treturn calculate;\r\n\t}", "private double calculeSalaires() {\n return salaireHoraire * heures;\n }", "@Override\n public void calculatePayment()\n {\n this.paymentAmount = annualSalary / SALARY_PERIOD;\n }", "public SearchEmpSalary() {\n initComponents();\n con = DatabaseHelper.getConnection();\n Toolkit toolkit = getToolkit();\n Dimension size = toolkit.getScreenSize();\n setLocation(size.width/2 - getWidth()/2, size.height/2 - getHeight()/2);\n lbl_emp.setText(String.valueOf(Emp.empName).toString());\n }", "public TBasicSalary() {\n\t\tthis(\"t_basic_salary\", null);\n\t}", "private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {\n loadInTable();\r\n calculate();\r\n \r\n fetchSalaryDetailsFromDB(1, 202);\r\n }", "public String getSalary() {\n return salary;\n }", "public String getSalary() {\n return salary;\n }", "public int getSalary() {\n return salary;\n }", "public int getSalary () {\n return salary;\n }", "private void createSalaryBox() {\n salaryField = new TextField();\n salaryField.setId(\"Salary\");\n HBox salaryFieldBox = new HBox(new Label(\"Salary: \"), salaryField);\n salaryFieldBox.setAlignment(Pos.CENTER);\n mainBox.getChildren().add(salaryFieldBox);\n\n }", "public void initSalarys() {\n\t\tList ls = departmentServiceImpl.findAll(Employees.class);\n\t\temployeesList = ls;\n\t\temployeesList = employeesList.stream().filter(fdet -> \"0\".equalsIgnoreCase(fdet.getActive()))\n\t\t\t\t.collect(Collectors.toList());\n\t\ttotalSalary = new BigDecimal(0);\n\t\ttotalSalaryAfter = new BigDecimal(0);\n\n\t\tif (conId != null) {\n\t\t\temployeesList = new ArrayList<Employees>();\n\t\t\tcon = new Contracts();\n\t\t\tcon = (Contracts) departmentServiceImpl.findEntityById(Contracts.class, conId);\n\t\t\tList<ContractsEmployees> empIds = departmentServiceImpl.loadEmpByContractId(conId);\n\t\t\tfor (ContractsEmployees id : empIds) {\n\t\t\t\tEmployees emp = (Employees) departmentServiceImpl.findEntityById(Employees.class, id.getEmpId());\n\t\t\t\temployeesList.add(emp);\n\t\t\t\temployeesList = employeesList.stream().filter(fdet -> \"0\".equalsIgnoreCase(fdet.getActive()))\n\t\t\t\t\t\t.collect(Collectors.toList());\n\t\t\t}\n\n\t\t}\n\n\t\tif (enterpriseAdd != null && enterpriseAdd.size() > 0) {\n\t\t\tList<Employees> empAllList = new ArrayList<>();\n\t\t\tfor (String entId : enterpriseAdd) {\n\t\t\t\t// enterpriseId = Integer.parseInt(entId);\n\t\t\t\tList<Employees> empList = employeesList.stream()\n\t\t\t\t\t\t.filter(fdet -> fdet.getEnterpriseId().equals(Integer.parseInt(entId)))\n\t\t\t\t\t\t.collect(Collectors.toList());\n\t\t\t\tif (empList != null && empList.size() > 0) {\n\t\t\t\t\tempAllList.addAll(empList);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\temployeesList = empAllList;\n\t\t}\n\n//\t\tif (employeesList != null && employeesList.size() > 0) {\n//\t\t\tlistTotalSum = employeesList.stream().filter(fdet -> fdet.getSalary() != 0.0d)\n//\t\t\t\t\t.mapToDouble(fdet -> fdet.getSalary()).sum();\n//\t\t\ttotalSalary = new BigDecimal(listTotalSum).setScale(3, RoundingMode.HALF_UP);\n\t\t// totalSalaryAfter = totalSalary;\n//\t\t\tSystem.out.println(\"\" + totalSalary);\n//\n//\t\t}\n\t\tif (con != null) {\n\t\t\tloadSalaries();\n\t\t}\n\n//\t\tls = departmentServiceImpl.findAll(Enterprise.class);\n//\t\tenterpriseList = ls;\n\t}", "public SalesEmployee(String firstName, String lastName, String number, double salary, double commission){\r\n this.firstname = firstName;\r\n this.lastname = lastName;\r\n this.number = number;\r\n this.salary = salary;\r\n this.commission = commission;\r\n }", "private void calculateEarnings()\n {\n // get user input\n int items = Integer.parseInt( itemsSoldJTextField.getText() );\n double price = Double.parseDouble( priceJTextField.getText() );\n Integer integerObject = \n ( Integer ) commissionJSpinner.getValue();\n int commissionRate = integerObject.intValue();\n \n // calculate total sales and earnings\n double sales = items * price;\n double earnings = ( sales * commissionRate ) / 100;\n \n // display the results\n DecimalFormat dollars = new DecimalFormat( \"$0.00\" );\n grossSalesJTextField.setText( dollars.format( sales ) );\n earningsJTextField.setText( dollars.format( earnings ) );\n\n }", "public double getSalary() {\n\t\treturn salary;\n\t}", "public void salary(int sal)\n {\n System.out.println(\"Base Salary: \"+ sal);\n }", "public void setSalary (int newSalary) {\n if (joined == false) {\n this.salary = newSalary;\n }else{\n System.out.println(\"It is not possible to change the salary.\");\n }\n }", "public double getSalary() {\r\n\t\treturn this.salary;\r\n\t}", "public final void setSalary(float salary){\n if(salary>=0){\n this.salary=salary;\n }\n else{\n JOptionPane.showMessageDialog(null,\"Incorrect amount of salary \");\n }\n }", "public void setSalary(double sal) { //salary variable to assign a value\n\t\tsalary = sal;\n\t}", "public void calculatePayment() {\n\t\tdouble pay = this.annualSalary / NUM_PAY_PERIODS;\n\t\tsuper.setPayment(pay);\n\t}", "public int annualSalary(){\r\n int aSalary = monthlySalary * MONTHS;\r\n return aSalary;\r\n }", "public float getAnnualSalary()\n {\n return annualSalary;\n }", "Calcul createCalcul();", "public int getSalary()\n\n\t{\n\t\treturn salary;\n\t}", "@Override\n public double getAnnualSalary() {\n return super.getAnnualSalary() + 10000;\n }", "public EmployeePay() {\n initComponents();\n setDefaultDateRange();\n updateTable();\n }", "public Salaries() {\n\t\tallSalaries= new ArrayList<double[]>();\n\t}", "public JTextField addFocusSalaryTxtField() {\n JTextField salaryTxtField = new JTextField(\"Annual Salary\", 10);\n salaryTxtField.addFocusListener(new FocusListener() {\n public void focusGained(FocusEvent e) {\n salaryTxtField.setText(\"\");\n }\n\n public void focusLost(FocusEvent e) {\n if (salaryTxtField.getText().equals(\"\")) {\n salaryTxtField.setText(\"Annual Salary\");\n }\n }\n });\n return salaryTxtField;\n }", "public void salir() {\n if (bandera == 1) {\n altoTabla = \"310\";\n formulaProceso = (Column) FacesContext.getCurrentInstance().getViewRoot().findComponent(\"form:datosFormulaProceso:formulaProceso\");\n formulaProceso.setFilterStyle(\"display: none; visibility: hidden;\");\n\n formulaPeriodicidad = (Column) FacesContext.getCurrentInstance().getViewRoot().findComponent(\"form:datosFormulaProceso:formulaPeriodicidad\");\n formulaPeriodicidad.setFilterStyle(\"display: none; visibility: hidden;\");\n\n RequestContext.getCurrentInstance().update(\"form:datosFormulaProceso\");\n bandera = 0;\n filtrarListFormulasProcesos = null;\n tipoLista = 0;\n }\n listFormulasProcesosBorrar.clear();\n listFormulasProcesosCrear.clear();\n listFormulasProcesosModificar.clear();\n index = -1;\n secRegistro = null;\n k = 0;\n listFormulasProcesos = null;\n guardado = true;\n RequestContext.getCurrentInstance().update(\"form:ACEPTAR\");\n formulaActual = null;\n lovProcesos = null;\n }", "@Override \n public double getPaymentAmount() \n { \n return getWeeklySalary(); \n }", "@Override\n\tprotected double getSalary() {\n\t\treturn 0;\n\t}", "public void setSalary(int salary) {\n this.salary = salary; // assigning a local variable value to a global variable\r\n }", "public void companyPayRoll(){\n calcTotalSal();\n updateBalance();\n resetHoursWorked();\n topBudget();\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tdouble investment = Double.parseDouble(Inv_amount.getText());\r\n\t\t\t\tdouble years = Double.parseDouble(YEARS.getText());\r\n\t\t\t\tdouble annual_interest_rate = Double.parseDouble(RATE.getText());\r\n\t\t\t\tCalculate total = new Calculate();\r\n\t\t\t\tcalc_total = total.get_future(investment, years, annual_interest_rate);\r\n\t\t\t\tFUTURE.setText(\"$\" +calc_total);\t\r\n\t\t\t}", "public static void EmployeePay() {\r\n\t\t\r\n\t\tJLabel e6 = new JLabel(\"Employee's Pay:\");\r\n\t\te6.setFont(f);\r\n\t\tGUI1Panel.add(e6);\r\n\t\tGUI1Panel.add(employeePay);\r\n\t\te6.setHorizontalAlignment(JLabel.LEFT);\r\n\t\tGUI1Panel.add(Box.createHorizontalStrut(5));\r\n\t}", "public CalculatorSalariuNet2018() {\n initComponents();\n }", "public Executive(int salary, String name, String department, int yearlyBonus){\n super(salary,name,department); \n this.yearlyBonus = yearlyBonus;\n }", "public AddExpensesForm() {\n initComponents();\n }", "public static void calculateLoanPayment() {\n\t\t//get values from text fields\n\t\tdouble interest = \n\t\t\t\tDouble.parseDouble(tfAnnualInterestRate.getText());\n\t\tint year = Integer.parseInt(tfNumberOfYears.getText());\n\t\tdouble loanAmount =\n\t\t\t\tDouble.parseDouble(tfLoanAmount.getText());\n\t\t\n\t\t//crate a loan object\n\t\t Loan loan = new Loan(interest, year, loanAmount);\n\t\t \n\t\t //Display monthly payment and total payment\n\t\t tfMonthlyPayment.setText(String.format(\"$%.2f\", loan.getMonthlyPayment()));\n\t\t tfTotalPayment.setText(String.format(\"$%.2f\", loan.getTotalPayment()));\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n txtsearch = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n txtid = new javax.swing.JTextField();\n jLabel3 = new javax.swing.JLabel();\n txtfn = new javax.swing.JTextField();\n txtln = new javax.swing.JTextField();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n txtdob = new javax.swing.JTextField();\n txtdep = new javax.swing.JTextField();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n txtdes = new javax.swing.JTextField();\n jLabel8 = new javax.swing.JLabel();\n txtsta = new javax.swing.JTextField();\n jLabel9 = new javax.swing.JLabel();\n txthire = new javax.swing.JTextField();\n jLabel10 = new javax.swing.JLabel();\n txtjob = new javax.swing.JTextField();\n jLabel11 = new javax.swing.JLabel();\n txtsal = new javax.swing.JTextField();\n btnGenSleap = new javax.swing.JButton();\n btnBack = new javax.swing.JButton();\n jLabel12 = new javax.swing.JLabel();\n lbl_emp = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Search_Employee_Salary\");\n\n jPanel1.setBackground(new java.awt.Color(255, 204, 204));\n\n jLabel1.setText(\"Search Employee\");\n\n txtsearch.setText(\"Enter Employee ID\");\n txtsearch.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyReleased(java.awt.event.KeyEvent evt) {\n txtsearchKeyReleased(evt);\n }\n });\n\n jLabel2.setText(\"Employee ID\");\n\n txtid.setEditable(false);\n\n jLabel3.setText(\"First Name\");\n\n txtfn.setEditable(false);\n\n txtln.setEditable(false);\n\n jLabel4.setText(\"Last Name\");\n\n jLabel5.setText(\"Date of Birth\");\n\n txtdob.setEditable(false);\n\n txtdep.setEditable(false);\n\n jLabel6.setText(\"Department\");\n\n jLabel7.setText(\"Designation\");\n\n txtdes.setEditable(false);\n\n jLabel8.setText(\"Status\");\n\n txtsta.setEditable(false);\n\n jLabel9.setText(\"Date Hired\");\n\n txthire.setEditable(false);\n\n jLabel10.setText(\"Job Title\");\n\n txtjob.setEditable(false);\n\n jLabel11.setText(\"Basic Salary\");\n\n txtsal.setEditable(false);\n\n btnGenSleap.setText(\"Generate Sleap\");\n btnGenSleap.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnGenSleapActionPerformed(evt);\n }\n });\n\n btnBack.setText(\"Back\");\n btnBack.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnBackActionPerformed(evt);\n }\n });\n\n jLabel12.setText(\"Logged is as: \");\n\n lbl_emp.setText(\"emp\");\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel2)\n .addComponent(jLabel3)\n .addComponent(jLabel4)\n .addComponent(jLabel5)\n .addComponent(jLabel6))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(txtsearch)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtid, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtfn, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtln, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtdob, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtdep, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(56, 56, 56)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel7)\n .addComponent(jLabel8)\n .addComponent(jLabel9)\n .addComponent(jLabel10)\n .addComponent(jLabel11))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtdes, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtsta, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txthire, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtjob, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtsal, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(22, 22, 22)\n .addComponent(btnGenSleap, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(36, 36, 36)\n .addComponent(btnBack, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel12)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(lbl_emp, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(33, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel7)\n .addComponent(txtdes, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel8)\n .addComponent(txtsta, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel9)\n .addComponent(txthire, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel10)\n .addComponent(txtjob, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel11)\n .addComponent(txtsal, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(txtsearch, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(txtid, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(txtfn, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(txtln, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5)\n .addComponent(txtdob, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel6)\n .addComponent(txtdep, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnGenSleap, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnBack, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel12)\n .addComponent(lbl_emp))\n .addGap(4, 4, 4))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jTabbedPane2 = new javax.swing.JTabbedPane();\n tab1 = new javax.swing.JPanel();\n dividend = new javax.swing.JSpinner();\n bonus = new javax.swing.JSpinner();\n jLabel11 = new javax.swing.JLabel();\n jLabel14 = new javax.swing.JLabel();\n jLabel15 = new javax.swing.JLabel();\n jLabel16 = new javax.swing.JLabel();\n jLabel17 = new javax.swing.JLabel();\n jLabel18 = new javax.swing.JLabel();\n jLabel19 = new javax.swing.JLabel();\n jLabel20 = new javax.swing.JLabel();\n sumIncome = new javax.swing.JTextField();\n jLabel21 = new javax.swing.JLabel();\n jLabel22 = new javax.swing.JLabel();\n salary = new javax.swing.JSpinner();\n salaryYear = new javax.swing.JCheckBox();\n anotherIncome = new javax.swing.JSpinner();\n sumReduce = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n jLabel10 = new javax.swing.JLabel();\n jLabel12 = new javax.swing.JLabel();\n jLabel13 = new javax.swing.JLabel();\n jLabel23 = new javax.swing.JLabel();\n jLabel24 = new javax.swing.JLabel();\n jLabel25 = new javax.swing.JLabel();\n jLabel26 = new javax.swing.JLabel();\n jLabel27 = new javax.swing.JLabel();\n jLabel28 = new javax.swing.JLabel();\n jLabel29 = new javax.swing.JLabel();\n childIn = new javax.swing.JSpinner();\n parent = new javax.swing.JSpinner();\n joint = new javax.swing.JCheckBox();\n out = new javax.swing.JSpinner();\n self = new javax.swing.JSpinner();\n parentMoney = new javax.swing.JSpinner();\n childInMoney = new javax.swing.JSpinner();\n life = new javax.swing.JSpinner();\n health = new javax.swing.JSpinner();\n social = new javax.swing.JSpinner();\n RMF = new javax.swing.JSpinner();\n LTF = new javax.swing.JSpinner();\n travelIn = new javax.swing.JSpinner();\n buyHouse = new javax.swing.JSpinner();\n buyIn = new javax.swing.JSpinner();\n donateEdu = new javax.swing.JSpinner();\n donate = new javax.swing.JSpinner();\n marry = new javax.swing.JSpinner();\n jLabel30 = new javax.swing.JLabel();\n jLabel31 = new javax.swing.JLabel();\n jLabel32 = new javax.swing.JLabel();\n jLabel33 = new javax.swing.JLabel();\n jLabel34 = new javax.swing.JLabel();\n jLabel35 = new javax.swing.JLabel();\n jLabel36 = new javax.swing.JLabel();\n jLabel37 = new javax.swing.JLabel();\n jLabel38 = new javax.swing.JLabel();\n jLabel39 = new javax.swing.JLabel();\n jLabel40 = new javax.swing.JLabel();\n jLabel41 = new javax.swing.JLabel();\n jLabel43 = new javax.swing.JLabel();\n jLabel44 = new javax.swing.JLabel();\n jLabel45 = new javax.swing.JLabel();\n jLabel46 = new javax.swing.JLabel();\n jLabel42 = new javax.swing.JLabel();\n donateJing = new javax.swing.JSpinner();\n jLabel47 = new javax.swing.JLabel();\n sumDe = new javax.swing.JSpinner();\n net = new javax.swing.JPanel();\n jLabel4 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n jLabel48 = new javax.swing.JLabel();\n netSum = new javax.swing.JTextField();\n taxRe = new javax.swing.JTextField();\n taxPlus = new javax.swing.JTextField();\n taxbefore = new javax.swing.JSpinner();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jTabbedPane2.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jTabbedPane2MouseClicked(evt);\n }\n });\n\n tab1.setBackground(new java.awt.Color(255, 204, 204));\n\n dividend.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n dividendStateChanged(evt);\n }\n });\n\n bonus.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n bonusStateChanged(evt);\n }\n });\n\n jLabel11.setText(\"บาท\");\n\n jLabel14.setText(\"เงินเดือน\");\n\n jLabel15.setText(\"บาท\");\n\n jLabel16.setText(\"โบนัส \");\n\n jLabel17.setText(\"บาท\");\n\n jLabel18.setText(\"เงินปันผล\");\n\n jLabel19.setText(\"บาท\");\n\n jLabel20.setText(\"รายได้อื่นๆ\");\n\n sumIncome.setText(\" 0\");\n sumIncome.addInputMethodListener(new java.awt.event.InputMethodListener() {\n public void caretPositionChanged(java.awt.event.InputMethodEvent evt) {\n }\n public void inputMethodTextChanged(java.awt.event.InputMethodEvent evt) {\n sumIncomeInputMethodTextChanged(evt);\n }\n });\n sumIncome.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n sumIncomeActionPerformed(evt);\n }\n });\n\n jLabel21.setText(\"รวมรายได้\");\n\n jLabel22.setText(\"บาท\");\n\n salary.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n salaryStateChanged(evt);\n }\n });\n\n salaryYear.setBackground(new java.awt.Color(255, 204, 204));\n salaryYear.setText(\"รวมยอดทั้งปี\");\n salaryYear.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n salaryYearStateChanged(evt);\n }\n });\n salaryYear.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n salaryYearActionPerformed(evt);\n }\n });\n\n anotherIncome.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n anotherIncomeStateChanged(evt);\n }\n });\n\n javax.swing.GroupLayout tab1Layout = new javax.swing.GroupLayout(tab1);\n tab1.setLayout(tab1Layout);\n tab1Layout.setHorizontalGroup(\n tab1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 424, Short.MAX_VALUE)\n .addGroup(tab1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(tab1Layout.createSequentialGroup()\n .addGap(62, 62, 62)\n .addGroup(tab1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(tab1Layout.createSequentialGroup()\n .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(2, 2, 2)\n .addComponent(salaryYear))\n .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel21))\n .addGap(34, 34, 34)\n .addGroup(tab1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(tab1Layout.createSequentialGroup()\n .addComponent(bonus, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jLabel15))\n .addGroup(tab1Layout.createSequentialGroup()\n .addComponent(dividend, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jLabel17))\n .addGroup(tab1Layout.createSequentialGroup()\n .addComponent(salary, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jLabel11))\n .addGroup(tab1Layout.createSequentialGroup()\n .addGroup(tab1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(anotherIncome)\n .addComponent(sumIncome))\n .addGap(18, 18, 18)\n .addGroup(tab1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel19)\n .addComponent(jLabel22))))\n .addContainerGap(53, Short.MAX_VALUE)))\n );\n tab1Layout.setVerticalGroup(\n tab1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 543, Short.MAX_VALUE)\n .addGroup(tab1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(tab1Layout.createSequentialGroup()\n .addGap(104, 104, 104)\n .addGroup(tab1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel14)\n .addComponent(salary, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(salaryYear)\n .addComponent(jLabel11))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(tab1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel16)\n .addComponent(bonus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel15))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(tab1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel18)\n .addComponent(dividend, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel17))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(tab1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel20)\n .addComponent(anotherIncome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel19))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(tab1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel21)\n .addComponent(sumIncome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel22))\n .addContainerGap(314, Short.MAX_VALUE)))\n );\n\n jTabbedPane2.addTab(\"เงินได้พึงประเมิน\", tab1);\n\n sumReduce.setBackground(new java.awt.Color(204, 255, 204));\n\n jLabel1.setText(\"ค่าใช้จ่าย\");\n\n jLabel2.setText(\"ค่าลดหย่อนส่วนตัว\");\n\n jLabel3.setText(\"ค่าลดหย่อนคู่สมรส\");\n\n jLabel5.setText(\"บุตร\");\n\n jLabel7.setText(\"ลดหย่อนบิดา-มารดา\");\n\n jLabel8.setText(\"เบี้ยประกันชีวิต\");\n\n jLabel10.setText(\"เบี้ยประกันสุขภาพบิดา-มารดา\");\n\n jLabel12.setText(\"เงินสมทบกองทุนประกันสังคม\");\n\n jLabel13.setText(\"ค่าซื้อหน่วยลงทุนในกองทุนรวมเพื่อการเลี้ยงชีพ\");\n\n jLabel23.setText(\"ค่าซื้อหน่วยลงทุนในกองทุนรวมหุ้นระยะยาว\");\n\n jLabel24.setText(\"ดอกเบี้ยเงินกู้ยืมเพื่อซื้อ เช่าซื้อ สร้างที่อยู่อาศัย\");\n\n jLabel25.setText(\"ค่าเดินทางท่องเที่ยวภายในประเทศ\");\n\n jLabel26.setText(\"ค่าซื้อสินค้าหรือบริการภายในประเทศ\");\n\n jLabel27.setText(\"เงินบริจาคสนับสนุนการศึกษา / กีฬา จ่ายจริง\");\n\n jLabel28.setText(\"เงินบริจาคอื่นๆ\");\n\n jLabel29.setText(\"รวมค่าใช้จ่าย รายการลดหย่อนและเงินได้ที่ได้รับการยกเว้นภาษี \");\n\n childIn.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n childInStateChanged(evt);\n }\n });\n\n parent.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n parentStateChanged(evt);\n }\n });\n\n joint.setText(\"ยื่นร่วมกัน\");\n joint.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jointActionPerformed(evt);\n }\n });\n\n out.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n outStateChanged(evt);\n }\n });\n\n self.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n selfStateChanged(evt);\n }\n });\n\n life.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n lifeStateChanged(evt);\n }\n });\n\n health.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n healthStateChanged(evt);\n }\n });\n\n social.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n socialStateChanged(evt);\n }\n });\n\n RMF.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n RMFStateChanged(evt);\n }\n });\n\n LTF.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n LTFStateChanged(evt);\n }\n });\n\n travelIn.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n travelInStateChanged(evt);\n }\n });\n\n buyHouse.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n buyHouseStateChanged(evt);\n }\n });\n\n buyIn.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n buyInStateChanged(evt);\n }\n });\n\n donateEdu.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n donateEduStateChanged(evt);\n }\n });\n\n donate.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n donateStateChanged(evt);\n }\n });\n\n jLabel30.setText(\"บาท\");\n\n jLabel31.setText(\"บาท\");\n\n jLabel32.setText(\"บาท\");\n\n jLabel33.setText(\"บาท\");\n\n jLabel34.setText(\"บาท\");\n\n jLabel35.setText(\"บาท\");\n\n jLabel36.setText(\"บาท\");\n\n jLabel37.setText(\"บาท\");\n\n jLabel38.setText(\"บาท\");\n\n jLabel39.setText(\"บาท\");\n\n jLabel40.setText(\"บาท\");\n\n jLabel41.setText(\"บาท\");\n\n jLabel43.setText(\"บาท\");\n\n jLabel44.setText(\"บาท\");\n\n jLabel45.setText(\"บาท\");\n\n jLabel46.setText(\"บาท\");\n\n jLabel42.setText(\"ที่ลดหย่อนได้(2เท่าแต่ไม่เกิน 10%หลังหักค่าใช้จ่าย)\");\n\n donateJing.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n donateJingStateChanged(evt);\n }\n });\n\n jLabel47.setText(\"บาท\");\n\n sumDe.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n sumDeStateChanged(evt);\n }\n });\n\n javax.swing.GroupLayout sumReduceLayout = new javax.swing.GroupLayout(sumReduce);\n sumReduce.setLayout(sumReduceLayout);\n sumReduceLayout.setHorizontalGroup(\n sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(sumReduceLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(sumReduceLayout.createSequentialGroup()\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jLabel12)\n .addComponent(jLabel10)\n .addGroup(sumReduceLayout.createSequentialGroup()\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel26)\n .addComponent(jLabel24)\n .addComponent(jLabel25)\n .addComponent(jLabel23)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, sumReduceLayout.createSequentialGroup()\n .addComponent(jLabel3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(joint))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, sumReduceLayout.createSequentialGroup()\n .addComponent(jLabel7)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(parent, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(sumReduceLayout.createSequentialGroup()\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(childIn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(jLabel13, javax.swing.GroupLayout.Alignment.LEADING))\n .addComponent(jLabel8)\n .addComponent(jLabel2)\n .addComponent(jLabel1)\n .addComponent(jLabel27))\n .addGap(95, 95, 95)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(life)\n .addComponent(RMF)\n .addComponent(LTF)\n .addComponent(travelIn)\n .addComponent(buyHouse)\n .addComponent(buyIn)\n .addComponent(social)\n .addComponent(health)\n .addComponent(childInMoney)\n .addComponent(parentMoney)\n .addComponent(out)\n .addComponent(self)\n .addComponent(marry)\n .addComponent(donateEdu, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(sumReduceLayout.createSequentialGroup()\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel28)\n .addComponent(jLabel29))\n .addGap(23, 23, 23)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(donate)\n .addComponent(sumDe))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel30)\n .addComponent(jLabel41)\n .addComponent(jLabel38)\n .addComponent(jLabel37)\n .addComponent(jLabel36)\n .addComponent(jLabel34)\n .addComponent(jLabel35)\n .addComponent(jLabel32)\n .addComponent(jLabel33)\n .addComponent(jLabel31)\n .addComponent(jLabel43)\n .addComponent(jLabel44)\n .addComponent(jLabel46)\n .addComponent(jLabel45)\n .addComponent(jLabel39)\n .addComponent(jLabel40)))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, sumReduceLayout.createSequentialGroup()\n .addComponent(jLabel42)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(donateJing, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel47)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n sumReduceLayout.setVerticalGroup(\n sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(sumReduceLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(out, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel46)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(self, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel45))\n .addGap(18, 18, 18)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(joint))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(marry, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel43)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5)\n .addComponent(childIn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(childInMoney, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel44)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(parent, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(parentMoney, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel30))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(life, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel31)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel10)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(health, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel33)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(social, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel32)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(RMF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel35)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(LTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel34)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(travelIn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel36)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(buyHouse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel37)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(buyIn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel38)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel27)\n .addComponent(donateEdu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel40))\n .addGap(18, 18, 18)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel42)\n .addComponent(donateJing, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel47))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel28)\n .addComponent(donate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel39))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(sumReduceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel29)\n .addComponent(jLabel41)\n .addComponent(sumDe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(54, Short.MAX_VALUE))\n );\n\n jTabbedPane2.addTab(\"ค่าใช้จ่าย ค่าลดหย่อน\", sumReduce);\n\n net.setBackground(new java.awt.Color(0, 204, 204));\n\n jLabel4.setText(\"ภาษีหัก ณ ที่จ่าย\");\n\n jLabel6.setText(\"รายได้พึงประเมิน สำหรับคำนวนภาษี\");\n\n jLabel9.setText(\"ภาษีที่ท่านสามารถขอคืน\");\n\n jLabel48.setText(\"ภาษีที่ท่านต้องจ่ายเพิ่ม\");\n\n netSum.setText(\" 0\");\n netSum.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n netSumActionPerformed(evt);\n }\n });\n\n taxRe.setText(\" 0\");\n\n taxPlus.setText(\" 0\");\n\n javax.swing.GroupLayout netLayout = new javax.swing.GroupLayout(net);\n net.setLayout(netLayout);\n netLayout.setHorizontalGroup(\n netLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(netLayout.createSequentialGroup()\n .addGap(83, 83, 83)\n .addGroup(netLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(netLayout.createSequentialGroup()\n .addComponent(jLabel9)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(taxRe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(netLayout.createSequentialGroup()\n .addComponent(jLabel48)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(taxPlus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, netLayout.createSequentialGroup()\n .addGroup(netLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, netLayout.createSequentialGroup()\n .addComponent(jLabel6)\n .addGap(18, 18, 18))\n .addGroup(netLayout.createSequentialGroup()\n .addComponent(jLabel4)\n .addGap(105, 105, 105)))\n .addGroup(netLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(taxbefore)\n .addComponent(netSum))))\n .addContainerGap(105, Short.MAX_VALUE))\n );\n netLayout.setVerticalGroup(\n netLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(netLayout.createSequentialGroup()\n .addGap(81, 81, 81)\n .addGroup(netLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel6)\n .addComponent(netSum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(netLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(taxbefore, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(netLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel9)\n .addComponent(taxRe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(netLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel48)\n .addComponent(taxPlus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(365, Short.MAX_VALUE))\n );\n\n jTabbedPane2.addTab(\"ภาษีที่ต้องชำระ\", net);\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(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jTabbedPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 429, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jTabbedPane2)\n .addContainerGap())\n );\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n buttonGroup1 = new javax.swing.ButtonGroup();\n buttonGroup2 = new javax.swing.ButtonGroup();\n jLabel1 = new javax.swing.JLabel();\n tfbs = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n cbpost = new javax.swing.JComboBox<>();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n rbrural = new javax.swing.JRadioButton();\n rburban = new javax.swing.JRadioButton();\n cbtransport = new javax.swing.JCheckBox();\n cbuniform = new javax.swing.JCheckBox();\n cbfitness = new javax.swing.JCheckBox();\n cbcomm = new javax.swing.JCheckBox();\n cbentert = new javax.swing.JCheckBox();\n jbCalculateearn = new javax.swing.JButton();\n jbcalculatededuct = new javax.swing.JButton();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n tfDA = new javax.swing.JTextField();\n tfHRA = new javax.swing.JTextField();\n tfOthers = new javax.swing.JTextField();\n tfEarnings = new javax.swing.JTextField();\n jLabel10 = new javax.swing.JLabel();\n jLabel11 = new javax.swing.JLabel();\n jLabel12 = new javax.swing.JLabel();\n jLabel13 = new javax.swing.JLabel();\n tfIT = new javax.swing.JTextField();\n tfPF = new javax.swing.JTextField();\n tfSC = new javax.swing.JTextField();\n tfTD = new javax.swing.JTextField();\n jbCalculateSal = new javax.swing.JButton();\n jButton4 = new javax.swing.JButton();\n jButton5 = new javax.swing.JButton();\n jLabel14 = new javax.swing.JLabel();\n tfSalarynHand = new javax.swing.JTextField();\n rbp = new javax.swing.JRadioButton();\n rbt = new javax.swing.JRadioButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setText(\"Basic Salary\");\n\n jLabel2.setText(\"Status\");\n\n jLabel3.setText(\"Designation\");\n\n cbpost.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Chairman\", \"Manager\", \"Team Leader\", \"Worker\" }));\n\n jLabel4.setText(\"Allowance\");\n\n jLabel5.setText(\"Area\");\n\n buttonGroup2.add(rbrural);\n rbrural.setText(\"Rural\");\n\n buttonGroup2.add(rburban);\n rburban.setText(\"Urban\");\n\n cbtransport.setText(\"Transport\");\n\n cbuniform.setText(\"Uniform\");\n\n cbfitness.setText(\"Fitness\");\n\n cbcomm.setText(\"Communication\");\n\n cbentert.setText(\"Entertainment\");\n\n jbCalculateearn.setText(\"Calculate Earnings\");\n jbCalculateearn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbCalculateearnActionPerformed(evt);\n }\n });\n\n jbcalculatededuct.setText(\"Calculate Deductions\");\n jbcalculatededuct.setEnabled(false);\n jbcalculatededuct.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbcalculatedeductActionPerformed(evt);\n }\n });\n\n jLabel6.setText(\"D A\");\n\n jLabel7.setText(\"H R A\");\n\n jLabel8.setText(\"Other\");\n\n jLabel9.setText(\"Total Earnings\");\n\n tfDA.setEditable(false);\n tfDA.setEnabled(false);\n tfDA.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n tfDAActionPerformed(evt);\n }\n });\n\n tfHRA.setEditable(false);\n tfHRA.setEnabled(false);\n\n tfOthers.setEditable(false);\n tfOthers.setEnabled(false);\n\n tfEarnings.setEditable(false);\n tfEarnings.setEnabled(false);\n\n jLabel10.setText(\"Income Tax\");\n\n jLabel11.setText(\"P F\");\n\n jLabel12.setText(\"Social Contribution\");\n\n jLabel13.setText(\"Total Deductions\");\n\n tfIT.setEditable(false);\n tfIT.setEnabled(false);\n tfIT.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n tfITActionPerformed(evt);\n }\n });\n\n tfPF.setEditable(false);\n tfPF.setEnabled(false);\n\n tfSC.setEditable(false);\n tfSC.setEnabled(false);\n\n tfTD.setEditable(false);\n tfTD.setEnabled(false);\n\n jbCalculateSal.setText(\"Calculate Salary in Hand\");\n jbCalculateSal.setEnabled(false);\n jbCalculateSal.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jbCalculateSalActionPerformed(evt);\n }\n });\n\n jButton4.setText(\"RESET\");\n jButton4.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton4ActionPerformed(evt);\n }\n });\n\n jButton5.setText(\"STOP\");\n jButton5.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton5ActionPerformed(evt);\n }\n });\n\n jLabel14.setText(\"Salary in Hand\");\n\n tfSalarynHand.setEditable(false);\n tfSalarynHand.setEnabled(false);\n tfSalarynHand.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n tfSalarynHandActionPerformed(evt);\n }\n });\n\n buttonGroup1.add(rbp);\n rbp.setText(\"Permanent\");\n\n buttonGroup1.add(rbt);\n rbt.setText(\"Temporary\");\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(24, 24, 24)\n .addComponent(jLabel1)\n .addGap(63, 63, 63)\n .addComponent(tfbs, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(113, 113, 113)\n .addComponent(jLabel3)\n .addGap(67, 67, 67)\n .addComponent(cbpost, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(20, 20, 20)\n .addComponent(jLabel2)\n .addGap(106, 106, 106)\n .addComponent(rbp)\n .addGap(146, 146, 146)\n .addComponent(jLabel5)\n .addGap(118, 118, 118)\n .addComponent(rbrural))\n .addGroup(layout.createSequentialGroup()\n .addGap(170, 170, 170)\n .addComponent(rbt)\n .addGap(298, 298, 298)\n .addComponent(rburban))\n .addGroup(layout.createSequentialGroup()\n .addGap(20, 20, 20)\n .addComponent(jLabel4)\n .addGap(47, 47, 47)\n .addComponent(cbtransport)\n .addGap(25, 25, 25)\n .addComponent(cbuniform)\n .addGap(38, 38, 38)\n .addComponent(cbfitness)\n .addGap(55, 55, 55)\n .addComponent(cbcomm)\n .addGap(45, 45, 45)\n .addComponent(cbentert))\n .addGroup(layout.createSequentialGroup()\n .addGap(60, 60, 60)\n .addComponent(jbCalculateearn)\n .addGap(301, 301, 301)\n .addComponent(jbcalculatededuct))\n .addGroup(layout.createSequentialGroup()\n .addGap(70, 70, 70)\n .addComponent(jbCalculateSal)\n .addGap(105, 105, 105)\n .addComponent(jButton4)\n .addGap(217, 217, 217)\n .addComponent(jButton5))\n .addGroup(layout.createSequentialGroup()\n .addGap(350, 350, 350)\n .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(320, 320, 320)\n .addComponent(tfSalarynHand, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(40, 40, 40)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel7)\n .addGap(106, 106, 106)\n .addComponent(tfHRA, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(220, 220, 220)\n .addComponent(jLabel11))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel6)\n .addGap(117, 117, 117)\n .addComponent(tfDA, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(220, 220, 220)\n .addComponent(jLabel10))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel8)\n .addGap(98, 98, 98)\n .addComponent(tfOthers, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(220, 220, 220)\n .addComponent(jLabel12))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel9)\n .addGap(41, 41, 41)\n .addComponent(tfEarnings, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(220, 220, 220)\n .addComponent(jLabel13)))\n .addGap(47, 47, 47)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(tfTD, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(tfSC, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(tfIT, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(tfPF, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addContainerGap(61, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(8, 8, 8)\n .addComponent(jLabel1))\n .addComponent(tfbs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addGap(12, 12, 12)\n .addComponent(jLabel3))\n .addGroup(layout.createSequentialGroup()\n .addGap(2, 2, 2)\n .addComponent(cbpost, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(15, 15, 15)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(rbp)\n .addComponent(rbrural)\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(jLabel5))))\n .addGap(12, 12, 12)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(rbt)\n .addComponent(rburban))\n .addGap(27, 27, 27)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4)\n .addComponent(cbtransport)\n .addComponent(cbuniform)\n .addComponent(cbfitness)\n .addComponent(cbcomm)\n .addComponent(cbentert))\n .addGap(47, 47, 47)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jbCalculateearn)\n .addComponent(jbcalculatededuct))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(32, 32, 32)\n .addComponent(jLabel6))\n .addGroup(layout.createSequentialGroup()\n .addGap(22, 22, 22)\n .addComponent(tfDA, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(14, 14, 14)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel10)\n .addComponent(tfIT, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGap(15, 15, 15)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addComponent(jLabel7))\n .addComponent(tfHRA, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel11)\n .addComponent(tfPF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(15, 15, 15)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(20, 20, 20)\n .addComponent(jLabel8))\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addComponent(tfOthers, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(tfSC)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addComponent(jLabel9))\n .addComponent(tfEarnings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel13)\n .addComponent(tfTD, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(35, 35, 35)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jbCalculateSal)\n .addComponent(jButton4)\n .addComponent(jButton5))\n .addGap(22, 22, 22)\n .addComponent(jLabel14)\n .addGap(12, 12, 12)\n .addComponent(tfSalarynHand, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n );\n\n pack();\n }", "PriceCalculationModel createLease(Long customerId, DateTime leaseDate, List<MovieRentDetailsModel> movieRentDetailsModel, Long employeId);", "public double salaryPay() {\n\t\treturn overtimePay() + getSalary();\n\t}", "@Override\r\n\tpublic void salaryAllocated() {\n\t\tSystem.out.println(\"Salary for manager 40000\");\r\n\t}", "@Override\n public void newSale(double payment) {\n calculateTotalRevenue(payment);\n showTotalRevenue();\n }", "public double getSalary() {\n\t\treturn super.getSalary() + (super.getSalary() * .20);\n\t}", "public Integer addEmployee(String fname, String lname, int salary) {\n\t\tSession session = factory.openSession();\n\t\tTransaction transaction = null;\n\t\tInteger employeeID = null;\n\t\ttry {\n\t\t\ttransaction = session.beginTransaction();\n\t\t\tEmployee employee = new Employee(fname, lname, salary);\n\t\t\temployeeID = (Integer) session.save(employee);\n\t\t\ttransaction.commit();\n\t\t} catch (HibernateException e) {\n\t\t\tif (transaction != null)\n\t\t\t\ttransaction.rollback();\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tsession.close();\n\t\t}\n\t\treturn employeeID;\n\t}", "public Builder setMonthlySalary(float value) {\n \n monthlySalary_ = value;\n onChanged();\n return this;\n }", "@Override\n\tpublic int addNewEmployee(String firstName, String lastName, String email, String designation, String location,\n\t\t\tint salary) {\n\t\treturn template.update(\n\t\t\t\t\"insert into employee(fname, lname, email, desig, location, salary) values(?, ?, ?, ?, ?, ?)\",\n\t\t\t\tfirstName, lastName, email, designation, location, salary);\n\t}", "@Override\n public double annualSalary(){\n double bonus = 0.00;\n\n if(currentStockPrice > 50){\n bonus = 30000;\n }\n\n return (super.annualSalary() + bonus);\n }", "Salesman() {\n super();\n super.setType(EMPLOYEE_TYPE);\n this.setAnnualSales(-1);\n }", "private void studentSubTotalActionPerformed(java.awt.event.ActionEvent evt) {\n }", "public salary() {\n initComponents();\n conn = DBconnect.connect();\n \n tableLoad();\n \n \n v = \"v\";\n \n BasicInternalFrameUI basicInternalFrameUI = ((javax.swing.plaf.basic.BasicInternalFrameUI)this.getUI());\n for(MouseListener listner : basicInternalFrameUI.getNorthPane().getMouseListeners()){\n basicInternalFrameUI.getNorthPane().removeMouseListener(listner);\n }\n }", "private void CalculateJButtonActionPerformed(java.awt.event.ActionEvent evt) { \n // read the inputs and calculate payment of loan\n //constants for max values, and number of comoundings per year\n final double MAX_AMOUNT = 100000000;\n final double MAX_INTEREST_RATE = 100;\n final int COUMPOUNDINGS = 12;\n final double MAX_YEARS = 50;\n final double PERIOD_INTEREST = COUMPOUNDINGS * 100;\n String errorMessage = \"Please enter a positive number for all required fields\"\n + \"\\nLoan amount must be in reange (0, \" + MAX_AMOUNT + \"]\"\n + \"\\nInterest rate must be in range [0, \" + MAX_INTEREST_RATE + \"]\"\n + \"\\nYears must be in range [0, \" + MAX_INTEREST_RATE + \"]\";\n \n counter++;\n CounterJTextField.setText(String.valueOf(counter));\n \n //get inputs\n double amount = Double.parseDouble(PrincipalJTextField.getText());\n double rate = Double.parseDouble(RateJTextField.getText());\n double years = Double.parseDouble(YearsJTextField.getText());\n \n //calculate paymets using formula\n double payment = (amount * rate/PERIOD_INTEREST)/\n (1 - Math.pow((1 + rate/PERIOD_INTEREST),\n years * (-COUMPOUNDINGS)));\n double interest = years * COUMPOUNDINGS * payment - amount;\n \n //displays results\n DecimalFormat dollars = new DecimalFormat(\"$#,##0.00\");\n\n PaymentJTextField.setText(dollars.format(payment));\n InterestJTextField.setText(dollars.format(interest));\n \n }", "public Employee(String name, double salary){\r\n\t\tthis.employeeName = name;\r\n\t\tthis.salary = salary;\r\n\t}", "public Employee(String name,String pos,int sal, int Vbal, int AnBon){\n Random rnd = new Random();\n this.idnum = 100000 + rnd.nextInt(900000);\n this.name = name;\n this.position = pos;\n this.salary = sal;\n this.vacationBal = Vbal;\n this.annualBonus = AnBon;\n this.password = \"AJDLIAFYI\";\n salaryHist[0] = salary;\n }", "public Employee(String fName, String lName, String gender, double salary) {\n this.fName = fName;\n this.lName = lName;\n this.gender = gender;\n this.salary = salary; \n }" ]
[ "0.7048114", "0.68142146", "0.63574755", "0.62598026", "0.6241968", "0.61850476", "0.6161105", "0.60871243", "0.60553956", "0.6044097", "0.6032841", "0.60319287", "0.60319287", "0.6023127", "0.5984877", "0.5943494", "0.58477557", "0.58382535", "0.58164513", "0.5759452", "0.5733064", "0.5699037", "0.5697908", "0.5689904", "0.5674747", "0.56607807", "0.5655581", "0.5649986", "0.56496996", "0.5638446", "0.56153595", "0.56089807", "0.56089807", "0.56089807", "0.56060934", "0.56010044", "0.55719566", "0.55109066", "0.54897183", "0.5488385", "0.54499316", "0.54485506", "0.5431406", "0.5422361", "0.5410503", "0.5404057", "0.5392611", "0.5389928", "0.5371538", "0.5371538", "0.53561425", "0.53550977", "0.5338713", "0.5335527", "0.53334916", "0.5332264", "0.53019905", "0.5294451", "0.52818274", "0.52757615", "0.52680737", "0.5264724", "0.5264216", "0.5241258", "0.5217374", "0.52135396", "0.5212446", "0.5206767", "0.5202017", "0.5179494", "0.51606613", "0.51467514", "0.5137985", "0.5136642", "0.5120192", "0.511252", "0.51109564", "0.5088443", "0.508364", "0.5073539", "0.50706416", "0.50540197", "0.5036443", "0.5023271", "0.50147444", "0.50088656", "0.5007504", "0.5005505", "0.4998139", "0.49902844", "0.49898952", "0.49896532", "0.49877548", "0.49833152", "0.4981405", "0.49809036", "0.4971911", "0.49709427", "0.49704462", "0.49666628", "0.49643615" ]
0.0
-1
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); jButton3 = new javax.swing.JButton(); a = new javax.swing.JTextField(); c = new javax.swing.JTextField(); d = new javax.swing.JTextField(); g = new javax.swing.JTextField(); jLabel13 = new javax.swing.JLabel(); h = new javax.swing.JTextField(); jScrollPane2 = new javax.swing.JScrollPane(); y = new javax.swing.JTable(); jLabel11 = new javax.swing.JLabel(); jLabel12 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jScrollPane3 = new javax.swing.JScrollPane(); j = new javax.swing.JTextArea(); datebox = new com.toedter.calendar.JDateChooser(); jLabel5 = new javax.swing.JLabel(); i = new javax.swing.JTextField(); jLabel14 = new javax.swing.JLabel(); b = new javax.swing.JTextField(); jLabel16 = new javax.swing.JLabel(); jButton4 = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); x = new javax.swing.JTable(); jLabel17 = new javax.swing.JLabel(); f = new javax.swing.JTextField(); jLabel15 = new javax.swing.JLabel(); reduced = new javax.swing.JTextField(); jButton2 = new javax.swing.JButton(); jLabel18 = new javax.swing.JLabel(); jLabel19 = new javax.swing.JLabel(); setMaximumSize(new java.awt.Dimension(1329, 649)); setMinimumSize(new java.awt.Dimension(1329, 649)); setPreferredSize(new java.awt.Dimension(1329, 649)); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel7.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel7.setText("ID"); getContentPane().add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(56, 41, -1, -1)); jLabel8.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel8.setText("Salary "); getContentPane().add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(56, 101, -1, -1)); jLabel9.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel9.setText("No Of Absent Days"); getContentPane().add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(56, 130, -1, -1)); jLabel10.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel10.setText("Loan Amount"); getContentPane().add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 250, -1, -1)); jButton3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jButton3.setText("Calculate to be Paid"); jButton3.setMaximumSize(new java.awt.Dimension(130, 36)); jButton3.setMinimumSize(new java.awt.Dimension(130, 36)); jButton3.setPreferredSize(new java.awt.Dimension(130, 36)); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); getContentPane().add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 290, 175, -1)); getContentPane().add(a, new org.netbeans.lib.awtextra.AbsoluteConstraints(227, 41, 104, -1)); getContentPane().add(c, new org.netbeans.lib.awtextra.AbsoluteConstraints(227, 99, 104, -1)); getContentPane().add(d, new org.netbeans.lib.awtextra.AbsoluteConstraints(227, 128, 104, -1)); getContentPane().add(g, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 242, 104, 30)); jLabel13.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel13.setText("To be Paid Amount"); getContentPane().add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(59, 349, -1, -1)); getContentPane().add(h, new org.netbeans.lib.awtextra.AbsoluteConstraints(229, 347, 104, -1)); y.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null}, {null, null, null, null, null, null, null} }, new String [] { "ID", "Name", "Salary Level", "To be Paid Amount", "Finalized Salary", "Reason", "Assigned Date" } )); y.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { yMouseClicked(evt); } }); jScrollPane2.setViewportView(y); getContentPane().add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 380, 743, 180)); jLabel11.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel11.setText("Reason for Reduction"); getContentPane().add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 470, -1, -1)); jLabel12.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel12.setText("Finalized Amount"); getContentPane().add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(59, 380, -1, -1)); jButton1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jButton1.setText("Assign"); jButton1.setMaximumSize(new java.awt.Dimension(130, 36)); jButton1.setMinimumSize(new java.awt.Dimension(130, 36)); jButton1.setPreferredSize(new java.awt.Dimension(130, 36)); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 510, 175, -1)); j.setColumns(20); j.setRows(5); jScrollPane3.setViewportView(j); getContentPane().add(jScrollPane3, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 470, 162, 73)); datebox.setDateFormatString("yyyy-MM-dd"); getContentPane().add(datebox, new org.netbeans.lib.awtextra.AbsoluteConstraints(229, 415, 125, -1)); jLabel5.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel5.setText("Date"); getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(59, 415, -1, -1)); getContentPane().add(i, new org.netbeans.lib.awtextra.AbsoluteConstraints(229, 380, 103, -1)); jLabel14.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel14.setText("Name"); getContentPane().add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(56, 72, -1, -1)); getContentPane().add(b, new org.netbeans.lib.awtextra.AbsoluteConstraints(227, 70, 104, -1)); jLabel16.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N getContentPane().add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(49, 377, -1, -1)); jButton4.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jButton4.setText("Cal_Salary"); jButton4.setMaximumSize(new java.awt.Dimension(130, 36)); jButton4.setMinimumSize(new java.awt.Dimension(130, 36)); jButton4.setPreferredSize(new java.awt.Dimension(130, 36)); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); getContentPane().add(jButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 190, 177, -1)); x.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null} }, new String [] { "ID", "Name", "Salary", "no of days", "non approved" } )); x.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { xMouseClicked(evt); } }); jScrollPane1.setViewportView(x); getContentPane().add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 120, 743, 163)); jLabel17.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel17.setText("Rs"); getContentPane().add(jLabel17, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 200, -1, -1)); getContentPane().add(f, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 192, 104, 30)); jLabel15.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel15.setText("Amount Reduced"); getContentPane().add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 570, -1, -1)); getContentPane().add(reduced, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 570, 104, -1)); jButton2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jButton2.setText("Clear Fields"); jButton2.setMaximumSize(new java.awt.Dimension(130, 36)); jButton2.setMinimumSize(new java.awt.Dimension(130, 36)); jButton2.setPreferredSize(new java.awt.Dimension(130, 36)); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); getContentPane().add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(660, 320, 175, -1)); jLabel18.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel18.setForeground(new java.awt.Color(255, 255, 255)); jLabel18.setText("Employee Final Salary"); getContentPane().add(jLabel18, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 30, 220, 40)); jLabel19.setIcon(new javax.swing.ImageIcon(getClass().getResource("/bill/backgrnd1.png"))); // NOI18N getContentPane().add(jLabel19, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1350, 700)); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public Oddeven() {\n initComponents();\n }", "public intrebarea() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "public kunde() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public frmVenda() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public FrmMenu() {\n initComponents();\n }", "public Botonera() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }" ]
[ "0.7319975", "0.7291426", "0.7291426", "0.7291426", "0.7286372", "0.7249133", "0.72134817", "0.7208172", "0.7196412", "0.7190365", "0.7184679", "0.71593916", "0.7147999", "0.7093026", "0.7080469", "0.7056178", "0.69875216", "0.69774026", "0.69545585", "0.69538534", "0.69452554", "0.69424194", "0.69357204", "0.6931598", "0.6928378", "0.6924548", "0.6924153", "0.6911372", "0.6911153", "0.6893088", "0.68923634", "0.6891", "0.68903977", "0.6889337", "0.68828684", "0.6881574", "0.6881235", "0.6878528", "0.6875488", "0.6874173", "0.6871147", "0.68604684", "0.6856229", "0.6855731", "0.6854888", "0.6854778", "0.68532974", "0.68529445", "0.68529445", "0.6843208", "0.6836825", "0.68361586", "0.68285096", "0.68282986", "0.6826397", "0.68238246", "0.6822819", "0.681734", "0.6816736", "0.68100905", "0.6809092", "0.6808217", "0.68082136", "0.68076205", "0.68026686", "0.67949307", "0.6793832", "0.6792444", "0.67903346", "0.67889607", "0.67888707", "0.67885673", "0.6782288", "0.6766402", "0.67653865", "0.6764692", "0.67566204", "0.67552745", "0.6752128", "0.6751242", "0.6743578", "0.6738973", "0.67371684", "0.6735791", "0.67334443", "0.6727505", "0.67269194", "0.6720125", "0.67154783", "0.6715316", "0.6713893", "0.67090744", "0.67064255", "0.670392", "0.67012566", "0.67005646", "0.669898", "0.66985846", "0.66949356", "0.66912866", "0.6689551" ]
0.0
-1
Converts pitches in Hertz to the requested unit.
public static List<Double> convertHertzTo(PitchUnit unit, List<Double> pitchValuesInHertz) { List<Double> convertedValues = new ArrayList<Double>(pitchValuesInHertz); switch (unit) { case ABSOLUTE_CENTS: convertHertzToAbsoluteCent(convertedValues); break; case RELATIVE_CENTS: convertHertzToRelativeCent(convertedValues); break; case MIDI_KEY: convertHertzToMidiKey(convertedValues); break; case MIDI_CENT: convertHertzToMidiCent(convertedValues); break; case HERTZ: break; default: throw new Error("Unsupported unit: " + unit.name()); } return convertedValues; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static float toHertz(int unit, float value) {\n \t\tswitch (unit) {\n \t\tcase CSSPrimitiveValue.CSS_HZ:\n \t\t\treturn value;\n \t\tcase CSSPrimitiveValue.CSS_KHZ:\n \t\t\treturn (value / 1000);\n \t\tdefault:\n \t\t\tthrow new DOMException(DOMException.INVALID_ACCESS_ERR, \"\");\n \t\t}\n \t}", "protected static float tokHertz(int unit, float value) {\n \t\tswitch (unit) {\n \t\tcase CSSPrimitiveValue.CSS_HZ:\n \t\t\treturn (value * 1000);\n \t\tcase CSSPrimitiveValue.CSS_KHZ:\n \t\t\treturn value;\n \t\tdefault:\n \t\t\tthrow new DOMException(DOMException.INVALID_ACCESS_ERR, \"\");\n \t\t}\n \t}", "public static double convert(\n final double input, final FrequencyUnit inputUnit,\n final FrequencyUnit outputUnit) {\n double hertz;\n\n // convert to hertz's\n switch (inputUnit) {\n case KILOHERTZ:\n hertz = kiloHertzToHertz(input);\n break;\n case MEGAHERTZ:\n hertz = megaHertzToHertz(input);\n break;\n case GIGAHERTZ:\n hertz = gigaHertzToHertz(input);\n break;\n case TERAHERTZ:\n hertz = teraHertzToHertz(input);\n break;\n\n case HERTZ:\n default:\n hertz = input;\n break;\n }\n\n // convert from Hertz to required output unit\n switch (outputUnit) {\n case KILOHERTZ:\n return hertzToKiloHertz(hertz);\n case MEGAHERTZ:\n return hertzToMegaHertz(hertz);\n case GIGAHERTZ:\n return hertzToGigaHertz(hertz);\n case TERAHERTZ:\n return hertzToTeraHertz(hertz);\n\n case HERTZ:\n default:\n return hertz;\n }\n }", "String getUnits();", "String getUnits();", "String getUnits();", "public void setPitch(float hertz) {\n\tthis.pitch = hertz;\n }", "private String getUnits(Unit units, int value) {\n if (units == Unit.FEET) {\n if (value == 1) return \" foot\";\n return \" feet\";\n }\n if (value == 1) return \" inch\";\n return \" inches\";\n }", "private String HumidityConversion() {\n int reading = ((raw[21] & 0xFC) >> 2) + ((raw[22] & 0x0F) << 6);\n\n // double fixed = (161.29 * (0.000967742 * reading - 0.16)) / (1.0546 - 0.00216 * Double.parseDouble(TemperatureConversion()));\n\n double fixed = (0.204036 * reading - 25.8065) / (1.0546 - 0.00216 * Double.parseDouble(TemperatureConversion())) + 6;\n\n return Double.valueOf(threeDForm.format(fixed)) + \"\";\n }", "public static double teraHertzToHertz(final double teraHertz) {\n return teraHertz * HERTZ_PER_TERAHERTZ;\n }", "public abstract double toBasicUnit(double unit);", "public static double kiloHertzToHertz(final double kiloHertz) {\n return kiloHertz * HERTZS_PER_KILOHERTZ;\n }", "private void changeUnitWithDirection() {\n MainActivity app = MainActivity.app;\n if (app == null) return;\n int unit = SharedPreferencesManager.getCurrencyUnit(app);\n switch (unit) {\n case BRConstants.CURRENT_UNIT_BITS:\n SharedPreferencesManager.putCurrencyUnit(app, BRConstants.CURRENT_UNIT_MBITS);\n break;\n case BRConstants.CURRENT_UNIT_MBITS:\n SharedPreferencesManager.putCurrencyUnit(app, BRConstants.CURRENT_UNIT_BITCOINS);\n break;\n case BRConstants.CURRENT_UNIT_BITCOINS:\n SharedPreferencesManager.putCurrencyUnit(app, BRConstants.CURRENT_UNIT_BITS);\n break;\n }\n\n }", "public static double hertzToKiloHertz(final double hertz) {\n return hertz / HERTZS_PER_KILOHERTZ;\n }", "void switchToDeterminate(int pUnits);", "public Unit<Pressure> hectopascal() {return hectopascal;}", "public byte getUnits() { return units; }", "@Override\r\n public void convert(int wa) {\n hasil1 = wa / menit;\r\n String wat = Integer.toString(hasil1);\r\n hasil = wat + \" Menit \";\r\n }", "String getUnitsString();", "public String getUnit() {\n String unit = (String) comboUnits.getSelectedItem();\n if (\"inch\".equals(unit)) {\n return \"in\";\n } else if (\"cm\".equals(unit)) {\n return \"cm\";\n } else if (\"mm\".equals(unit)) {\n return \"mm\";\n } else if (\"pixel\".equals(unit)) {\n return \"px\";\n }\n return \"\";\n }", "public static double hertzToMegaHertz(final double hertz) {\n return hertz / HERTZ_PER_MEGAHERTZ;\n }", "String getUnit();", "public static double megaHertzToHertz(final double megaHertz) {\n return megaHertz * HERTZ_PER_MEGAHERTZ;\n }", "public void setUnits(byte units) { this.units = units; }", "public String getUnit();", "public static double hertzToTeraHertz(final double hertz) {\n return hertz / HERTZ_PER_TERAHERTZ;\n }", "private static void convertHertzToRelativeCent(List<Double> convertedValues) {\r\n for (int i = 0; i < convertedValues.size(); i++) {\r\n Double hertzValue = convertedValues.get(i);\r\n Double pitchValueInCentFoldedToOneOctave = PitchConverter.hertzToRelativeCent(hertzValue);\r\n convertedValues.set(i, pitchValueInCentFoldedToOneOctave);\r\n }\r\n }", "public void setUnit(String unit);", "Units getUnits();", "private KilometersPerHour() {}", "public float convertUnitToEm(float ptSize, int units) {\n return (units * ptSize) / upem;\n }", "public void setUnit(Length units) {\n unit = units;\n }", "protected String getUnits()\n {\n return units;\n }", "public String getUnits() {\n return units;\n }", "public String getUnits() {\n return units;\n }", "@Override\n protected double convertToDefaultUnit(AngularSpeed value) {\n return AngularSpeedConverter.convert(value.getValue().doubleValue(),\n value.getUnit(), getDefaultUnit());\n }", "public static double letterToMultiplier(final char value) {\n\t\tfinal double multiplier;\n\t\tswitch (value) {\n\t\tcase 'Z':\n\t\t\tmultiplier = 0.001;\n\t\t\tbreak;\n\t\tcase 'Y':\n\t\tcase 'R':\n\t\t\tmultiplier = 0.01;\n\t\t\tbreak;\n\t\tcase 'X':\n\t\tcase 'S':\n\t\t\tmultiplier = 0.1;\n\t\t\tbreak;\n\t\tcase 'A':\n\t\t\tmultiplier = 1.0;\n\t\t\tbreak;\n\t\tcase 'B':\n\t\tcase 'H':\n\t\t\tmultiplier = 10.;\n\t\t\tbreak;\n\t\tcase 'C':\n\t\t\tmultiplier = 100.;\n\t\t\tbreak;\n\t\tcase 'D':\n\t\t\tmultiplier = 1000.;\n\t\t\tbreak;\n\t\tcase 'E':\n\t\t\tmultiplier = 10000.;\n\t\t\tbreak;\n\t\tcase 'F':\n\t\t\tmultiplier = 100000.;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// Unknown\n\t\t\tmultiplier = 0.0;\n\t\t\tbreak;\n\t\t}\n\t\treturn multiplier;\n\t}", "public String getUnits() {\n return this.units;\n }", "public String getUnits() {\r\n\t\treturn units;\r\n\t}", "public String getToUnit() {\r\n return this.toUnit;\r\n }", "private static void convertHertzToAbsoluteCent(List<Double> convertedValues) {\r\n for (int i = 0; i < convertedValues.size(); i++) {\r\n Double valueInHertz = convertedValues.get(i);\r\n convertedValues.set(i, PitchConverter.hertzToAbsoluteCent(valueInHertz));\r\n }\r\n }", "public java.lang.String getUnits() {\r\n return localUnits;\r\n }", "public Builder setSampleRateHertz(int value) {\n\n sampleRateHertz_ = value;\n bitField0_ |= 0x00000002;\n onChanged();\n return this;\n }", "public int getUnits() {\r\n return units;\r\n }", "public void setUnits(int value) {\r\n this.units = value;\r\n }", "public static double inchToMeter(final double inch) {\n return inch * METERS_PER_INCH;\n }", "public static String printConversion(double kilometersPerHour) {\n\t\t\t// TODO Write an implementation for this method declaration\n\t\t\tString result;\n\t\t\tdouble milesPerHour;\n\t\t\tlong iPart;\n\t\t\tdouble fPart;\n\t\t\tlong output = 0;\n\t\t\tif(kilometersPerHour < 0) {\n\t\t\t\tresult = \"Invalid Value\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmilesPerHour = 0.62137 * kilometersPerHour;\n\t\t\t\tiPart = (long) milesPerHour;\n\t\t\t\tfPart = milesPerHour - iPart;\n\t\t\t\tif(fPart > 0 && fPart < 0.5) {\n\t\t\t\t\toutput = iPart;\n\t\t\t\t}\n\t\t\t\telse if(fPart > 0.5 && fPart <=0.99d) {\n\t\t\t\t\toutput = iPart+1;\n\t\t\t\t}\n\t\t\t\tresult = Double.toString(kilometersPerHour) + \" km/h\" + \" = \" + Long.toString(output) + \" mi/h\";\t\t\t\t\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}", "public void setUnitTable(Units value);", "public void setUnits(String units) {\n this.units = units;\n }", "public void setUnits(String units) {\n this.units = units;\n }", "public String getUnits() {\n\t\treturn units;\n\t}", "private void convertInput(double input) {\n\n if (input != 0) {\n // Set standard value in meters based on selected unit\n switch (selectedUnit) {\n case \"km\":\n standard = input / 0.001;\n break;\n case \"m\":\n standard = input;\n break;\n case \"cm\":\n standard = input / 100;\n break;\n case \"mm\":\n standard = input / 1000;\n break;\n case \"μm\":\n standard = input / 1000000;\n break;\n case \"nm\":\n standard = input / 1000000000;\n break;\n case \"mi\":\n standard = input / 0.000621371;\n break;\n case \"yd\":\n standard = input / 1.09361;\n break;\n case \"ft\":\n standard = input / 3.28084;\n break;\n case \"in\":\n standard = input / 39.3701;\n break;\n default:\n standard = input;\n break;\n }\n //km\n kmTextView.setText(numberFormatter(standard * 0.001));\n //m\n mTextView.setText(numberFormatter(standard * 1));\n //cm\n cmTextView.setText(numberFormatter(standard * 100));\n //mm\n mmTextView.setText(numberFormatter(standard * 1000));\n //um\n umTextView.setText(numberFormatter(standard * 1000000));\n //nm\n nmTextView.setText(numberFormatter(standard * 1000000000));\n //mi\n miTextView.setText(numberFormatter(standard * 0.000621371));\n //yd\n ydTextView.setText(numberFormatter(standard * 1.09361));\n //ft\n ftTextView.setText(numberFormatter(standard * 3.28084));\n //in\n inTextView.setText(numberFormatter(standard * 39.3701));\n } else {\n //km\n kmTextView.setText(\"\");\n //m\n mTextView.setText(\"\");\n //cm\n cmTextView.setText(\"\");\n //mm\n mmTextView.setText(\"\");\n //um\n umTextView.setText(\"\");\n //nm\n nmTextView.setText(\"\");\n //mi\n miTextView.setText(\"\");\n //yd\n ydTextView.setText(\"\");\n //ft\n ftTextView.setText(\"\");\n //in\n inTextView.setText(\"\");\n }\n }", "@Override\r\n\tpublic int unitsToWagger() {\n\t\treturn 0;\r\n\t}", "private String getResultUnit() {\n switch (mCalculationType) {\n case CONSUMPTION_L_100_KM:\n return \"l/100 km\";\n case CONSUMPTION_KM_L:\n return \"km/l\";\n case CONSUMPTION_MPG:\n return \"mpg\";\n default:\n return \"\";\n }\n }", "int getStrength(Unit unit);", "private String getVerticalLevelUnits(String gVCord) {\n\n String tmp = gVCord.toUpperCase();\n if (tmp.compareTo(\"PRES\") == 0) {\n return \"MB\";\n }\n if (tmp.compareTo(\"THTA\") == 0) {\n return \"K \";\n }\n if (tmp.compareTo(\"HGHT\") == 0) {\n return \"M \";\n }\n if (tmp.compareTo(\"SGMA\") == 0) {\n return \"SG\";\n }\n if (tmp.compareTo(\"DPTH\") == 0) {\n return \"M \";\n }\n return \"\";\n }", "@java.lang.Override\n public int getSampleRateHertz() {\n return sampleRateHertz_;\n }", "public String getUnit() {\n return unit;\n }", "public String getUnit() {\n return unit;\n }", "public String getUnit() {\n return unit;\n }", "@java.lang.Override\n public int getSampleRateHertz() {\n return sampleRateHertz_;\n }", "public static double millimetersToInches(double millimeters) {\n return millimeters / 25.4;\n }", "private String altitudeConversion() {\n int reading = ((record[9] & 255) << 8) + (record[8] & 255);\n if (reading == 60000) {\n return \" \";\n } else {\n return reading + \"\";\n }\n }", "public double convert(double amount, Unit u);", "private void setupConvertDialog() {\n\t\tfinal int displayUnit = preferences.getInt(\"displayUnit\", UnitType.FOOTINCH\n\t\t\t\t.getId());\n\t\tfinal CharSequence[] unitCharSequence = UnitType\n\t\t\t\t.getCharSequenceItemsForDisplay();\n\t\tAlertDialog.Builder unitDialog = new AlertDialog.Builder(context);\n\t\tunitDialog.setTitle(context.getString(R.string.menuDisplayConvertToUnit) + \"...\");\n\t\tunitDialog.setItems(unitCharSequence,\n\t\t\t\tnew DialogInterface.OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int item) {\n\t\t\t\t\t\tString s = (String) unitCharSequence[item];\n\t\t\t\t\t\tUnitType ut = UnitType.getUnitTypeFromDisplayFormat(s);\n\n\t\t\t\t\t\tString abbreviation = ut.getAbbreviation();\n\t\t\t\t\t\tLog.i(\"convert\", \"convert to unit: \" + abbreviation);\n\t\t\t\t\t\t// convert to specified format\n\t\t\t\t\t\t\n\t\t\t\t\t\t//expression in this case should be the entire formula in memory\n\t\t\t\t\t\t//String expression = display.get()\n\t\t\t\t\t\t//\t\t+ context.getString(R.string.equal);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//String expressionToConvert = expression + context.getString(R.string.equal);\n\t\t\t\t\t\t\n\t\t\t\t\t\texpression = \"\";\t\t\t\t\t\t\n\t\t\t\t\t\tString expressionToConvert = display.get() + context.getString(R.string.equal);\n\t\t\t\t\t\tdisplay.clear();\n\t\t\t\t\t\t\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t//Measurement result = parser.convert(expression, ut);\n\t\t\t\t\t\t\tMeasurement result = parser.convert(parser.solve(expressionToConvert), ut);\n\t\t\t\t\t\t\tif (result == null) {\n\t\t\t\t\t\t\t\tdisplay.add(context.getString(R.string.error));\n\t\t\t\t\t\t\t\tLog.e(\"convert\", \"result null for: \"\n\t\t\t\t\t\t\t\t\t\t+ expressionToConvert);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//HACK -- set display unit to correct unit\n\t\t\t\t\t\t\t\tsaveCurrentPreferences();\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tSharedPreferences.Editor editor = preferences.edit();\n\t\t\t\t\t\t\t\teditor = preferences.edit();\n\t\t\t\t\t\t\t\teditor.putInt(\"displayUnit\", ut.getId());\n\t\t\t\t\t\t\t\teditor.commit();\n\t\t\t\t\t\t\t\t//HACK -- set display unit to correct unit\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tString printable = parser\n\t\t\t\t\t\t\t\t\t\t.getPrintableResult(result);\n\t\t\t\t\t\t\t\tdisplay.add(printable);\n\t\t\t\t\t\t\t\tLog.i(\"convert\", \"printable result: \"\n\t\t\t\t\t\t\t\t\t\t+ printable);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//HACK -- set display unit to correct unit\n\t\t\t\t\t\t\t\trestoreCurrentPreferences();\n\t\t\t\t\t\t\t\t//HACK -- set display unit to correct unit\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (ExpressionParserException epe) {\n\t\t\t\t\t\t\tshowErrorAndResetDisplay(epe.getMessage(), false);\n\t\t\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t\t\tdisplay.add(context.getString(R.string.error));\n\t\t\t\t\t\t\tLog.e(\"convert\", \"expression: \" + expressionToConvert\n\t\t\t\t\t\t\t\t\t+ ex.toString());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tAlertDialog alert = unitDialog.create();\n\t\talert.show();\n\t}", "double normalizeHeading(double h) {\n double nh = h;\n if( h>-180 && h<180 ) {\n } else if( h <= -180 ) {\n nh = h+360;\n } else if( h > 180 ) {\n nh = h-360;\n }\n return nh;\n }", "public void setUnit (String value) {\n\tthis.unit = value;\n }", "public static String formatSpeed(float value, String unit)\n\t{\n\n\t\tif (value < 0.224)\n\t\t{\n\t\t\treturn \"0\";\n\t\t}\n\n\t\tif (unit.equals(\"km/h\"))\n\t\t{\n\t\t\treturn Utils.formatNumber(value * 3.6, 1, 1);\n\t\t}\n\n\t\tif (unit.equals(\"mi/h\"))\n\t\t{\n\t\t\treturn Utils.formatNumber(value * 3.6 * KM_TO_MI, 1, 1);\n\t\t}\n\n\t\tif (unit.equals(\"kn\"))\n\t\t{\n\t\t\treturn Utils.formatNumber(value * 3.6 * KMH_TO_KNOTS, 1);\n\t\t}\n\n\t\treturn \"\";\n\n\t}", "private String tempConversion() {\n int reading = ((record[17] & 255) + ((record[21] & 0x30) << 4));\n\n double voltage = (reading * 3.3) / 1024;\n return formatter.format((voltage - .6) / .01);\n\n }", "public void setUnit () {\n\t\tdouble f = factor;\n\t\t/* Transform the value as a part of Unit */\n\t\tif (Double.isNaN(value)) return;\n\t\tif ((mksa&_log) != 0) {\n\t\t\tif ((mksa&_mag) != 0) value *= -2.5;\n\t\t\tfactor *= AstroMath.dexp(value);\n\t\t\tvalue = 0;\n\t\t}\n\t\telse {\n\t\t\tfactor *= value;\n\t\t\tvalue = 1.;\n\t\t}\n\t\t// Transform also the symbol\n\t\tif (f != factor) {\n\t\t\tif (symbol == null) symbol = edf(factor);\n\t\t\telse symbol = edf(factor) + toExpr(symbol);\n\t\t}\n\t}", "public String getUnit()\n {\n return (this.unit);\n }", "@Test\n\tpublic void testchangeUnits1(){\t\t//Celcius to Kelvin\n\t\tTemperature data = new Temperature (0, Temperature.Units.CELCIUS);\n\t\tdata.changeUnits(Temperature.Units.KELVIN);\n\t\tassertEquals(data.getUnits() , Temperature.Units.KELVIN);\n\t\tassertTrue(data.getValue() == 273.15);\n\t}", "public static String units(String unit) {\n\t\tswitch (unit) {\n\t\t\tcase \"feet\":\n\t\t\t\treturn \"ft\";\n\t\t\tcase \"miles\":\n\t\t\t\treturn \"mi\";\n\t\t\tcase \"meters\":\n\t\t\t\treturn \"m\";\n\t\t\tcase \"kilometers\":\n\t\t\t\treturn \"km\";\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\t}", "public String getUnitsString() {\n return units;\n }", "static void transfer_hl_to_sp(String passed){\n\t\tSP = hexa_to_deci(registers.get('H')+registers.get('L'));\n\t}", "public double toMetersPerSecond(){\n\t\tdouble mps = mph * 1609.34/3600;\n\t\treturn mps;\n\t}", "public UnitConverter() {\r\n getParameters();\r\n }", "public static double convertKeltoFah(double temp){\r\n return ((temp - 273) * 9/5) + 32;\r\n }", "private static String lettre2Chiffre1(String n) {\n\t\tString c= new String() ;\n\t\tswitch(n) {\n\t\tcase \"A\": case \"J\":\n\t\t\tc=\"1\";\n\t\t\treturn c;\n\t\tcase \"B\": case \"K\": case \"S\":\n\t\t\tc=\"2\";\n\t\t\treturn c;\n\t\tcase \"C\": case\"L\": case \"T\":\n\t\t\tc=\"3\";\n\t\t\treturn c;\n\t\tcase \"D\": case \"M\": case \"U\":\n\t\t\tc=\"4\";\n\t\t\treturn c;\n\t\tcase \"E\": case \"N\": case \"V\":\n\t\t\tc=\"5\";\n\t\t\treturn c;\n\t\tcase \"F\": case \"O\": case \"W\":\n\t\t\tc=\"6\";\n\t\t\treturn c;\n\t\tcase \"G\": case \"P\": case \"X\":\n\t\t\tc=\"7\";\n\t\t\treturn c;\n\t\tcase \"H\": case \"Q\": case \"Y\":\n\t\t\tc=\"8\";\n\t\t\treturn c;\n\t\tcase \"I\": case \"R\": case \"Z\":\n\t\t\tc=\"4\";\n\t\t\treturn c;\n\t\t\t\n\t\t}\n\t\treturn c;\n\t\t\n\t\n\t\t}", "public static double meterToFoot(final double meter) {\n return meter / METERS_PER_FOOT;\n }", "private static double hpToEz(double hp) {\n return 1.015 + Math.cos(Math.toRadians(89.038 + hp));\n }", "private String convertFeetToInches(String description) {\n String regex = \"(\\\\d+) to (\\\\d+) feet|up to (\\\\d+) (feet|foot)\";\n Pattern pattern = Pattern.compile(regex);\n Matcher matcher = pattern.matcher(description);\n if (matcher.find()) {\n if (matcher.group(1) != null) {\n int lower = Integer.parseInt(matcher.group(1)) * 12;\n int upper = Integer.parseInt(matcher.group(2)) * 12;\n return description.replace(matcher.group(0), lower + \" to \" + upper + \" inches\");\n }\n int upper = Integer.parseInt(matcher.group(3)) * 12;\n return description.replace(matcher.group(0), \"up to \" + upper + \" inches\");\n }\n return description;\n }", "public TempUnit getHighUnit() {\n return highUnit;\n }", "public String unit() {\n return this.unit;\n }", "public static double meterToInch(final double meter) {\n return meter / METERS_PER_INCH;\n }", "public Units getUnitTable();", "public String getResult() {\n\t\tDecimalFormat df = new DecimalFormat(\"##.00\");\n\t\tswitch(currentUnit) {\n\t\t\tcase 0:\n\t\t\t\tresult = \"<html>\"+df.format(celsius)+\"\\u00B0C = \"+df.format(fahrenheit)+\"\\u00B0F<br />\"\n\t\t\t\t\t+df.format(celsius)+\"\\u00B0C = \"+df.format(kelvin)+\"\\u00B0K</html\";\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tresult = \"<html>\"+df.format(fahrenheit)+\"\\u00B0F = \"+df.format(celsius)+\"\\u00B0C<br />\"\n\t\t\t\t\t\t+df.format(fahrenheit)+\"\\u00B0F = \"+df.format(kelvin)+\"\\u00B0K</html\";\n\t\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tresult = \"<html>\"+df.format(kelvin)+\"\\u00B0K = \"+df.format(celsius)+\"\\u00B0C<br />\"\n\t\t\t\t\t\t+df.format(kelvin)+\"\\u00B0K = \"+df.format(fahrenheit)+\"\\u00B0F</html\";\n\t\t\t\t\tbreak;\t\n\t\t}\n\t\treturn result;\n\t}", "public String getPitchAsString(){ return Integer.toString(this.pitch);}", "public static double feetToMeters(double foot){\r\n\t\t\r\n\t\tdouble meter = 0.305 * foot;\r\n\t\t\r\n\t\treturn meter;\r\n\t}", "public void setHopUnits(int i, String u) {\n \t\t((Hop) hops.get(i)).setUnits(u);\n \t}", "public void toiGianPhanSo(){\n int x = timUSCLN(tuSo,mauSo);\n\n tuSo/=x;\n mauSo/=x;\n }", "public int getUnits() {\n\t\treturn units;\n\t}", "void FahtoCel() {\n\t\tSystem.out.println(\"Your converted celcius degrees is: \" + fahrenheit + \" degrees celcius.\");\t// prints out converted degrees, with fahrenheit = conversion.fahrenheit\r\n\t}", "public Temperature toFahrenheit() { \n\t\tif (scale==\"C\"){\n\t\t\tdegrees=degrees*1.8+32;\n\t\t\tscale=\"F\";}\n\t\t\treturn this;\n\t}", "public static double inchesToMillimeters(double inches) {\n return inches * 25.4;\n }", "public String getUnit() {\n\t\treturn unit;\n\t}", "public static String dtrmn(int number) {\n\t\t\n\t\tString letter = \"\";\n\t\t\n\t\tint cl = number / 100;\n\t\tif (cl != 9 && cl != 4) {\n\t\t\t\n\t\t\tif (cl < 4) {\n\t\t\t\t\n\t\t\t\tfor(int i = 1; i <= cl; i++) {\n\t\t\t\t\tletter = letter + \"C\";\n\t\t\t\t}\n\t\t\t} else if (cl < 9 && cl > 4) {\n\t\t\t\t\n\t\t\t\tletter = letter + \"D\";\n\t\t\t\tfor (int i = 1; i <= cl - 5; i++) {\n\t\t\t\t\tletter = letter + \"C\";\n\t\t\t\t}\n\t\t\t} else if(cl == 10) { \n\t\t\t\t\n\t\t\t\tletter = letter + \"M\";\n\t\t\t}\n\t\t} else if (cl == 4) {\n\t\t\t\n\t\t\tletter = letter + \"CD\";\n\t\t\t\n\t\t} else if (cl == 9) {\n\t\t\t\n\t\t\tletter = letter + \"CM\";\n\t\t}\n\t\t\n\t\tint cl1 = (number % 100)/10;\n\t\tif (cl1 != 9 && cl1 != 4) {\n\t\t\t\n\t\t\tif (cl1 < 4) {\n\t\t\t\t\n\t\t\t\tfor (int i = 1; i <= cl1; i++) {\n\t\t\t\t\tletter = letter + \"X\";\n\t\t\t\t}\n\t\t\t} else if (cl1 < 9 && cl1 > 4) {\n\t\t\t\tletter = letter + \"L\";\n\t\t\t\t\n\t\t\t\tfor (int i = 1; i <= cl1 -5; i++) {\n\t\t\t\t\tletter = letter + \"X\";\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else if (cl1 == 4) {\n\t\t\tletter = letter + \"XL\";\n\t\t} else if (cl1 == 9) {\n\t\t\tletter = letter + \"XC\";\n\t\t}\n\t\t\n\t\tint cl2 = (number % 100)%10;\n\t\t\n\t\tif (cl2 != 9 && cl2 != 4) {\n\t\t\t\n\t\t\tif (cl2 < 4) {\n\t\t\t\tfor (int i = 1; i <= cl2; i++) {\n\t\t\t\t\tletter = letter + \"I\";\n\t\t\t\t}\n\t\t\t} else if (cl2 < 9 && cl2 > 4) {\n\t\t\t\t\n\t\t\t\tletter = letter + \"V\";\n\t\t\t\tfor (int i = 1; i <= cl2-5; i++) {\n\t\t\t\t\tletter = letter + \"I\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} else if (cl2 == 4) {\n\t\t\tletter = letter +\"IV\";\n\t\t} else if (cl2 == 9) {\n\t\t\tletter = letter + \"IX\";\n\t\t}\n\t\treturn letter;\n\t}", "public int getUnits() {\r\n\r\n\t\treturn this.units;\r\n\t}", "private String LightConversion() {\n\n int exponent = ((raw[19] & 0xC0) >> 6) + ((raw[20] & 0x03) << 2);\n int mantissa = ((raw[20] & 0xFC) >> 2) + ((raw[21] & 0x03) << 6);\n double value = (Math.pow(2.0, exponent)) * mantissa * 0.025;\n\n return Double.valueOf(threeDForm.format(value)) + \"\";\n\n }", "private void convertSetWindDir() {\n if (windDegTmp != null) {\n double windDbl = new Double(windDegTmp);\n setWindDir(headingToString(windDbl)); // convert wind degree to cardinal direction\n }\n }" ]
[ "0.6663947", "0.6158668", "0.58528066", "0.5632254", "0.5632254", "0.5632254", "0.55581933", "0.55581784", "0.5519959", "0.5455512", "0.54342306", "0.5400662", "0.53841525", "0.53720266", "0.53558284", "0.5331955", "0.5315639", "0.5279866", "0.52753234", "0.52679694", "0.52528435", "0.5240138", "0.5205967", "0.5200333", "0.5161666", "0.51496553", "0.51379937", "0.5131098", "0.5102205", "0.50945", "0.5089866", "0.50805825", "0.508052", "0.50587755", "0.50521576", "0.5046009", "0.5043203", "0.49908984", "0.4989825", "0.49788347", "0.4949879", "0.49303538", "0.492964", "0.49223962", "0.4921094", "0.49069878", "0.49059963", "0.48997176", "0.48902836", "0.48902836", "0.48780596", "0.48774856", "0.4863088", "0.4852448", "0.48512995", "0.48512968", "0.48498744", "0.48474276", "0.48474276", "0.48474276", "0.484052", "0.48403758", "0.4832908", "0.48318174", "0.4820844", "0.48140225", "0.48134348", "0.48075497", "0.48066983", "0.4803733", "0.48036233", "0.48002616", "0.47980687", "0.47973782", "0.47850513", "0.4785005", "0.47819084", "0.47811288", "0.47805077", "0.47802553", "0.477722", "0.4766721", "0.4766104", "0.47605374", "0.47494003", "0.47333857", "0.47263694", "0.47147948", "0.47113967", "0.47104028", "0.47087052", "0.47060043", "0.47027144", "0.46968797", "0.4695183", "0.46879187", "0.46837732", "0.4674443", "0.46695733", "0.46606147" ]
0.5681717
3
Converts a list of pitches in Hertz to absolute cents.
private static void convertHertzToAbsoluteCent(List<Double> convertedValues) { for (int i = 0; i < convertedValues.size(); i++) { Double valueInHertz = convertedValues.get(i); convertedValues.set(i, PitchConverter.hertzToAbsoluteCent(valueInHertz)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void convertHertzToRelativeCent(List<Double> convertedValues) {\r\n for (int i = 0; i < convertedValues.size(); i++) {\r\n Double hertzValue = convertedValues.get(i);\r\n Double pitchValueInCentFoldedToOneOctave = PitchConverter.hertzToRelativeCent(hertzValue);\r\n convertedValues.set(i, pitchValueInCentFoldedToOneOctave);\r\n }\r\n }", "public int getAsCents(){\n return (dollars*100 + cents);\n }", "private int toFeet(int inches) {\n return (int) Math.round(inches / 12.0);\n }", "public static List<Double> convertHertzTo(PitchUnit unit, List<Double> pitchValuesInHertz) {\r\n List<Double> convertedValues = new ArrayList<Double>(pitchValuesInHertz);\r\n switch (unit) {\r\n case ABSOLUTE_CENTS:\r\n convertHertzToAbsoluteCent(convertedValues);\r\n break;\r\n case RELATIVE_CENTS:\r\n convertHertzToRelativeCent(convertedValues);\r\n break;\r\n case MIDI_KEY:\r\n convertHertzToMidiKey(convertedValues);\r\n break;\r\n case MIDI_CENT:\r\n convertHertzToMidiCent(convertedValues);\r\n break;\r\n case HERTZ:\r\n break;\r\n default:\r\n throw new Error(\"Unsupported unit: \" + unit.name());\r\n }\r\n return convertedValues;\r\n }", "private Integer toAmountCents(final BigDecimal input) {\n return input.multiply(ONE_HUNDRED).intValue();\n }", "public int getHandValue() {\n\t\tint value = 0;\n\t\tint aces = 0;\n\t\tfor (Card card : cardHand) {\n\t\t\t// convert suits to 10\n\t\t\tif (card.getValue() > 10) {\n\t\t\t\tvalue += 10;\n\t\t\t} else if (card.getValue() == 1) {\n\t\t\t\taces++;\n\t\t\t} else {\n\t\t\t\tvalue += card.getValue();\n\t\t\t}\n\t\t}\n\t\tvalue += calculateAce(value, aces);\n\n\t\treturn value;\n\t}", "public static String toDollarsAndCents(int cents){\n \n NumberFormat currencyFormatter = \n NumberFormat.getCurrencyInstance();\n return currencyFormatter.format(cents/100.0);\n }", "private int calculateCents(int cents)\n\t{\n\t\tint dollars= getDollars() + cents/100;\n\t\tsetDollars(dollars);\n\t\t\n\t\treturn cents%100;\n\t}", "public static String sumCreditList(List<String> list) {\r\n if (list == null || list.isEmpty()) return \"0\";\r\n float minCredits = 0;\r\n float maxCredits = 0;\r\n for (String item : list) {\r\n String[] split = item.split(\"[ ,/-]\");\r\n\r\n String first = split[0];\r\n float min = Float.parseFloat(first);\r\n minCredits += min;\r\n\r\n String last = split[split.length - 1];\r\n float max = Float.parseFloat(last);\r\n maxCredits += max;\r\n }\r\n\r\n String credits = Float.toString(minCredits);\r\n\r\n if (minCredits != maxCredits) {\r\n credits = credits + \"-\" + Float.toString(maxCredits);\r\n }\r\n\r\n credits = credits.replace(\".0\", \"\");\r\n return credits;\r\n }", "public static void main(String[] args) {\n int cents = new Scanner(System.in).nextInt();\n double convertedCents = cents*131;\n int wholeDollars = (int) (convertedCents/100);\n int wholeCents = (int) (convertedCents%100);\n\n System.out.printf(\"%03d.%03d\",wholeDollars, wholeCents);\n\n }", "public int getCents() {\n return cents;\n }", "public int getCents() {\n return cents;\n }", "public int getCents()\r\n {\r\n return cents;\r\n }", "public static double teraHertzToHertz(final double teraHertz) {\n return teraHertz * HERTZ_PER_TERAHERTZ;\n }", "private int condense(int[] inputs) {\n\t\tint total = 0;\n\t\tflag = false;\n\t\tfor(int i = 0; i < inputs.length; i++) {\n\t\t\tinputs[i] -= 48;\n\t\t\tif(inputs[i] < 0 || inputs[i] > 9) {\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ttotal *= 10;\n\t\t\ttotal += inputs[i];\n\t\t}\n\t\treturn total;\n\t}", "protected double toPounds(double weightOunces){\n\t\treturn 0.0625 * weightOunces;\n\t}", "public static int calculateHand(ArrayList<Card> hand)\n\t{\n\t\tint value=0,aces=0;\n\t\tfor(int i =0;i<hand.size();i++)\n\t\t{\n\t\t\tvalue+=calculateCard(hand.get(i));\n\t\t\tif(hand.get(i).getValue()==1)\n\t\t\t\taces++;\n\t\t}\n\t\twhile(value>21&&aces>0)\n\t\t{\n\t\t\tvalue-=10;\n\t\t}\n\t\tif(value>21)\n\t\t\treturn 0;\n\t\treturn value;\n\t}", "private static double hpToEz(double hp) {\n return 1.015 + Math.cos(Math.toRadians(89.038 + hp));\n }", "public static int totalCreditHours(){\n int total = 0; //stores total credit hours\n for (int credit: courseCredithourList){\n total += credit;\n }\n return total;\n }", "protected int convertToPence(PriceModel number) {\n return (number.getPounds() * ConstantUtil.PENCE_IN_POUND) + (number.getShillings() * ConstantUtil.PENCE_IN_SHILLING) + number.getPence();\n }", "private int getUnitsToConvert() throws IOException {\n int sum = 0;\n for (Converter converter : converters) {\n sum += converter.getUnitsToConvert();\n }\n return sum;\n }", "@Override\n public double getCost(int hours) {\n\n if (hours < 2) {\n\n return 30;\n } else if (hours < 4) {\n\n return 70;\n } else if (hours < 24) {\n\n return 100;\n } else {\n\n int days = hours / 24;\n return days * 100;\n }\n }", "public static double hertzToTeraHertz(final double hertz) {\n return hertz / HERTZ_PER_TERAHERTZ;\n }", "public int rubleToEuro(int value) {\n return value / EURO;\n }", "private static int convertToCents(String amount) {\n\n /* First check if the format of the amount is correct */\n if(!validAmount(amount)) {\n return -1;\n }\n\n /* Look for the dot (if there is one), to separate cents from dollars */\n int dotIdx = amount.indexOf('.');\n\n /* Calculate the number of cents */\n int numCents = 0;\n if(dotIdx != -1){\n for(int i = dotIdx+1; i < Math.min(dotIdx+3, amount.length()); i++){\n numCents = numCents*10 + amount.charAt(i) - '0';\n }\n if(numCents < 10){\n numCents *= 10;\n }\n }\n\n /* Calculate the number of dollars */\n if(dotIdx == -1){\n dotIdx = amount.length();\n }\n int numDollars = 0;\n for(int i = 0; i < dotIdx; i++){\n if(Character.isDigit(amount.charAt(i))){\n numDollars = numDollars*10 + amount.charAt(i) - '0';\n }\n }\n\n if (numDollars >= 100000) { return -2; }\n\n return numDollars*100 + numCents;\n }", "public String centsToDollar() {\n return partieEntier + \".\" +\n String.format(\"%02d\", partieFractionnaire) + \"$\";\n }", "private static List<Double> getNormalizedAndRoundedSpeeds( List<Stat> statList ) {\n \tList<Double> speeds = new LinkedList<Double>();\n \tdouble normalization = 15;\n \t\n \tfor (Stat stat: statList) {\n \t\tDouble speed = stat.stepSpeed;\n \t\tDouble roundedspeed = new Double((double) Math.round((speed/normalization) * 10) / 10);\n \t\tspeeds.add( roundedspeed );\n \t}\n \t\n \treturn speeds;\n }", "protected static float toHertz(int unit, float value) {\n \t\tswitch (unit) {\n \t\tcase CSSPrimitiveValue.CSS_HZ:\n \t\t\treturn value;\n \t\tcase CSSPrimitiveValue.CSS_KHZ:\n \t\t\treturn (value / 1000);\n \t\tdefault:\n \t\t\tthrow new DOMException(DOMException.INVALID_ACCESS_ERR, \"\");\n \t\t}\n \t}", "private static int hex2dec(int hex) {\n if (hex > 0x255 || hex < 0) {\n throw new IllegalArgumentException(\"Value must be between 0 and 0x255 (597)\");\n }\n return (hex / 256) * 100 + ((hex % 256) / 16) * 10 + hex % 256 % 16;\n }", "private static int intFeetToTicks(double feet) {\n return (int) (feetToTicks(feet));\n }", "public static double hertzToKiloHertz(final double hertz) {\n return hertz / HERTZS_PER_KILOHERTZ;\n }", "private String convertFeetToInches(String description) {\n String regex = \"(\\\\d+) to (\\\\d+) feet|up to (\\\\d+) (feet|foot)\";\n Pattern pattern = Pattern.compile(regex);\n Matcher matcher = pattern.matcher(description);\n if (matcher.find()) {\n if (matcher.group(1) != null) {\n int lower = Integer.parseInt(matcher.group(1)) * 12;\n int upper = Integer.parseInt(matcher.group(2)) * 12;\n return description.replace(matcher.group(0), lower + \" to \" + upper + \" inches\");\n }\n int upper = Integer.parseInt(matcher.group(3)) * 12;\n return description.replace(matcher.group(0), \"up to \" + upper + \" inches\");\n }\n return description;\n }", "public static double convertToFt(int in)\r\n {\n\r\n final int INCHES_PER_FOOT = 12;\r\n\r\n double feet = in / (double)INCHES_PER_FOOT;\r\n\r\n return feet;\r\n }", "public static double kiloHertzToHertz(final double kiloHertz) {\n return kiloHertz * HERTZS_PER_KILOHERTZ;\n }", "private int CalcHandSum(Player player, List<Card> hand) {\n int sum = 0;\n int aceCounter = 0;\n\n for (Card card : hand) {\n if (card.cardRank == CardRank.ACE) {\n aceCounter++;\n }\n sum += card.cardValue;\n if (sum > 21 && card.cardRank == CardRank.ACE) {\n sum -= 10;\n aceCounter--;\n }\n }\n return sum;\n }", "public static double valueForAddingToDeck(List<? extends Card> instances, int refs) {\n // some bullshit\n return instances.stream()\n .map(c -> valueInHand(c, refs - 1))\n .reduce(0., Double::sum) / 10;\n }", "public static final float pointsToInches(float value) {\n\t return value / 72f;\n\t}", "public static String unionCreditList(List<String> list) {\r\n if (list == null || list.isEmpty()) return \"\";\r\n float minCredits = Integer.MAX_VALUE;\r\n float maxCredits = Integer.MIN_VALUE;\r\n for (String item : list) {\r\n String[] split = item.split(\"[ ,/-]\");\r\n\r\n String first = split[0];\r\n float min = Float.parseFloat(first);\r\n minCredits = Math.min(min, minCredits);\r\n\r\n String last = split[split.length - 1];\r\n float max = Float.parseFloat(last);\r\n maxCredits = Math.max(max, maxCredits);\r\n }\r\n\r\n String credits = Float.toString(minCredits);\r\n\r\n if (minCredits != maxCredits) {\r\n credits = credits + \"-\" + Float.toString(maxCredits);\r\n }\r\n\r\n credits = credits.replace(\".0\", \"\");\r\n return credits;\r\n }", "public int handValue() {\n\t\tint val = 0;\n\t\tfor(Card card: hand) {\n\t\t\tval += card.getValue();\n\t\t}\n\t\tif(val > 21) {\n\t\t\tif(checkOverflow()) {\n\t\t\t\treturn val - 10;\n\t\t\t}\n\t\t\treturn val;\n\t\t\t\n\t\t}\n\t\telse\n\t\t\treturn val;\n\t}", "private static String convertToFormat(int number) {\n int cents = number%100;\n number /= 100;\n return \"$\" + String.valueOf(number) + \".\" + String.valueOf(cents);\n }", "public int calculatePayDollarsPerHour() {\n int dollarsPerHour = BASE_RATE_DOLLARS_PER_HOUR;\n\n if (getHeight() >= TALL_INCHES && getWeight() < THIN_POUNDS)\n dollarsPerHour += TALL_THIN_BONUS_DOLLARS_PER_HOUR;\n if (isCanTravel())\n dollarsPerHour += TRAVEL_BONUS_DOLLARS_PER_HOUR;\n if (isSmokes())\n dollarsPerHour -= SMOKER_DEDUCTION_DOLLARS_PER_HOUR;\n\n return dollarsPerHour;\n }", "public static double fahrenheitToCelsius(double f) {\n\t\tif (f < 0)\n\t\t\treturn f;\n\n\t\treturn ((f - 32) * 5 / 9);\n\t}", "public static final float inchesToPoints(float value) {\n\t return value * 72f;\n\t}", "private String HumidityConversion() {\n int reading = ((raw[21] & 0xFC) >> 2) + ((raw[22] & 0x0F) << 6);\n\n // double fixed = (161.29 * (0.000967742 * reading - 0.16)) / (1.0546 - 0.00216 * Double.parseDouble(TemperatureConversion()));\n\n double fixed = (0.204036 * reading - 25.8065) / (1.0546 - 0.00216 * Double.parseDouble(TemperatureConversion())) + 6;\n\n return Double.valueOf(threeDForm.format(fixed)) + \"\";\n }", "public float getAsFloat(){\n return (new Float(getAsCents()) / 100);\n }", "public double getHeardPercentCS() {\n return heardPercentCS;\n }", "public static void calcSpeedPoints(Champion ch) {\n\t\tch.setSpeedPoints(310 - ch.getEffectiveSpeed());\n\t}", "public int value(List<Integer> hand) {\n\t\tint val; // The value computed for the hand.\n\t\tboolean ace; // This will be set to true if the\n\t\t// hand contains an ace.\n\t\tint cards; // Number of cards in the hand.\n\n\t\tval = 0;\n\t\tace = false;\n\t\tcards = hand.size();\n\n\t\tfor (int i = 0; i < cards; i++) {\n\t\t\t// Add the value of the i-th card in the hand.\n\t\t\tint card; // The i-th card;\n\t\t\tint cardVal; // The blackjack value of the i-th card.\n\t\t\tcard = getCard(hand, i);\n\t\t\tcardVal = getCardValue(card); // The normal value, 1 to 13.\n\t\t\tif (cardVal > 10) {\n\t\t\t\tcardVal = 10; // For a Jack, Queen, or King.\n\t\t\t}\n\t\t\tif (cardVal == 1) {\n\t\t\t\tace = true; // There is at least one ace.\n\t\t\t}\n\t\t\tval = val + cardVal;\n\t\t}\n\n\t\t// Now, val is the value of the hand, counting any ace as 1.\n\t\t// If there is an ace, and if changing its value from 1 to\n\t\t// 11 would leave the score less than or equal to 21,\n\t\t// then do so by adding the extra 10 points to val.\n\n\t\tif (ace == true && val + 10 <= 21) {\n\t\t\tval = val + 10;\n\t\t}\n\n\t\treturn val;\n\n\t}", "private String convertToCelsius(String string) {\n\t\tDecimalFormat df2 = new DecimalFormat(\".##\");\n\t\treturn df2.format((Double.parseDouble(string)-273.15));\n\t}", "private String calculateDistancePerAmount() {\n double distance = parser(getTextFromEditText(R.id.distanceEdit));\n double fuel = parser(getTextFromEditText(R.id.fuelEdit));\n double value = distance / fuel;\n return rounder(value);\n }", "public static void convertIntegerToAbsolute(){\n\t\tSystem.out.println(\"please enter an integer number: \");\n\t\tScanner scann=new Scanner(System.in);\n\t\tint x=scann.nextInt();\n\t\tSystem.out.println(Math.abs(x));\n\t}", "public int value(){\r\n\t\t\r\n\t\tthis.sort();\r\n\t\t\r\n\t\tint result = 0;\r\n\t\t\r\n\t\tfor(int i = this.cardCount()-1; i >= 0; i--){\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.ACE) == 0){\r\n\t\t\t\tif(result <= 10 - i)\r\n\t\t\t\t\tresult += 11;\r\n\t\t\t\telse\r\n\t\t\t\t\tresult += 1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.TEN) == 0 ||\r\n\t\t\t\tthis.getCard(i).getValue().compareTo(CardValue.JACK) == 0 ||\r\n\t\t\t\tthis.getCard(i).getValue().compareTo(CardValue.QUEEN) == 0 ||\r\n\t\t\t\tthis.getCard(i).getValue().compareTo(CardValue.KING) == 0 ){\r\n\t\t\t\tresult += 10;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.TWO) == 0){\r\n\t\t\t\tresult += 2;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.THREE) == 0){\r\n\t\t\t\tresult += 3;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.FOUR) == 0){\r\n\t\t\t\tresult += 4;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.FIVE) == 0){\r\n\t\t\t\tresult += 5;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.SIX) == 0){\r\n\t\t\t\tresult += 6;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.SEVEN) == 0){\r\n\t\t\t\tresult += 7;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.EIGHT) == 0){\r\n\t\t\t\tresult += 8;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.NINE) == 0){\r\n\t\t\t\tresult += 9;\r\n\t\t\t}\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}", "public static HandEnum calculateHandValue(ArrayList<Card> c)\n {\n //Assume that all hands from now on are sorted beforehand, which makes our job easier.\n ArrayList<Card> sortedHand = sortCardArray(new ArrayList<Card>(c));\n \n for (int x = 0 ; x < sortedHand.size() ; x++)\n {\n System.out.println(sortedHand.get(x));\n }\n \n HandEnum val = HandEnum.HIGH;\n \n if(isFive(sortedHand))\n {\n return HandEnum.FIVE;\n }\n \n if(isStraightFlush(sortedHand))\n {\n return HandEnum.STRAIGHT_FLUSH;\n }\n \n if(isFour(sortedHand))\n {\n return HandEnum.FOUR;\n }\n \n if(isFullHouse(sortedHand))\n {\n return HandEnum.FULL_HOUSE;\n }\n \n if(isFlush(sortedHand))\n {\n return HandEnum.FLUSH;\n }\n \n if(isStraight(sortedHand))\n {\n return HandEnum.STRAIGHT;\n }\n \n if(isThree(sortedHand))\n {\n return HandEnum.THREE;\n }\n \n if(isTwoPair(sortedHand))\n {\n return HandEnum.TWO_PAIR;\n }\n \n if(isPair(sortedHand))\n {\n return HandEnum.PAIR;\n }\n \n return val;\n }", "static long convertMahToDeciCoulombs(double powerMah) {\n return (long) (powerMah * (10 * 3600 / 1000) + 0.5);\n }", "@Override\n public double getAlcoholPercent() {\n return (getAlcoholVolume() / getVolume()) * 100.0;\n }", "@Override\n public double calcularValorCompra(ArrayList<Mueble> muebles){\n double total = 0d;\n for (Mueble m : muebles) {\n total+= m.getCantidad()*m.getPrecio();\n }\n return total; \n }", "static public double convertTachoCountToDistance(double TachoCount) {\n\t\treturn TachoCount = (TachoCount * 0.5 * wheeldiameter * Math.PI / 180);\n\t}", "public static double letterToMultiplier(final char value) {\n\t\tfinal double multiplier;\n\t\tswitch (value) {\n\t\tcase 'Z':\n\t\t\tmultiplier = 0.001;\n\t\t\tbreak;\n\t\tcase 'Y':\n\t\tcase 'R':\n\t\t\tmultiplier = 0.01;\n\t\t\tbreak;\n\t\tcase 'X':\n\t\tcase 'S':\n\t\t\tmultiplier = 0.1;\n\t\t\tbreak;\n\t\tcase 'A':\n\t\t\tmultiplier = 1.0;\n\t\t\tbreak;\n\t\tcase 'B':\n\t\tcase 'H':\n\t\t\tmultiplier = 10.;\n\t\t\tbreak;\n\t\tcase 'C':\n\t\t\tmultiplier = 100.;\n\t\t\tbreak;\n\t\tcase 'D':\n\t\t\tmultiplier = 1000.;\n\t\t\tbreak;\n\t\tcase 'E':\n\t\t\tmultiplier = 10000.;\n\t\t\tbreak;\n\t\tcase 'F':\n\t\t\tmultiplier = 100000.;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// Unknown\n\t\t\tmultiplier = 0.0;\n\t\t\tbreak;\n\t\t}\n\t\treturn multiplier;\n\t}", "private void calculateAngle(){\n for (Point point : points) {\n double d = Math.abs(point.x)+Math.abs(point.z);\n double angle = 0;\n\n if (point.x >= 0 && point.z >= 0){\n angle = point.z/d;\n } else if (point.x < 0 && point.z >= 0){\n angle = 2 - point.z/d;\n } else if (point.x < 0 && point.z <0){\n angle = 2 + Math.abs(point.z)/d;\n } else if (point.x >=0 && point.z < 0){\n angle = 4 - Math.abs(point.z)/d;\n }\n point.setAngle(angle);\n }\n Collections.sort(points);\n }", "public int points(Card.Color trump) {\n return PackedCard.points(trump, packedCard);\n }", "float getBonusPercentHP();", "public static int[] exchange(double amount){\n\t\tint dollar10 = (int)(amount / 10);\n\t\tamount %= 10;\n\t\tint dollar5 = (int)(amount / 5);\n\t\tamount %= 5;\n\t\tint dollar1 = (int)(amount / 1);\n\t\tamount %= 1;\n\t\tint cents50 = (int)(amount/.50);\n\t\tamount %= .50;\n\t\tint quarters = (int)(amount/.25);\n\t\tamount %= .25;\n\t\tint dime = (int)(amount/.10);\n\t\tamount %= .10;\n\t\tint penny = Math.round((float)(amount/0.01));\n\t\tint[] change = new int[]{dollar10, dollar5, dollar1, cents50, quarters, dime, penny};\n\t\treturn change;\n\n\t}", "private String convertCelsiusToFahrenheit(double c) {\n double f = (c * (9.0 / 5.0)) + 32.0;\n DecimalFormat numberFormat = new DecimalFormat(\"#.0\");\n return numberFormat.format(f);\n }", "private static double calculDistanceTourneeAlea(List<Point> points, Random rand) {\n double distance = 0;\n Collections.shuffle(points, rand);\n Point courant = points.get(0);\n Point suivant;\n for(int i=1; i<points.size(); i++) {\n suivant = points.get(i);\n distance += courant.getDistance(suivant);\n courant = suivant;\n }\n suivant = points.get(0);\n distance += courant.getDistance(suivant);\n return distance;\n }", "public static double convertKeltoCel(double temp){\r\n return temp - 273;\r\n }", "public static double hertzToMegaHertz(final double hertz) {\n return hertz / HERTZ_PER_MEGAHERTZ;\n }", "public double getCredits() {\n\n return Math.round(this.credits * 100.0) / 100.0;\n }", "public int swapCardsForArmyUnits(ArrayList<CardModel> playerCardsList) {\n int totalNumberOfArmyUnits = getNumberOfSimilarCards(playerCardsList) + getNumberOfDifferentCards(playerCardsList);\n if (totalNumberOfArmyUnits > 0) {\n this.playerModel.setSuccessfulCardSwapCounter(this.playerModel.getSuccessfulCardSwapCounter() + 1);\n if(isUpdatePlayerDeck() && !isTournamentModeFlag()) {\n gameModel.cardSwap();\n gameModel.reinforce();\n }\n return (totalNumberOfArmyUnits * 5) *(this.playerModel.getSuccessfulCardSwapCounter());\n }\n\n return 0;\n }", "public int getTotal()\r\n\t{\r\n\t\t// the running total of points in the hand\r\n\t\tint sum = 0;\r\n\r\n\t\t// count of the number of aces in the hand, to be processed later\r\n\t\tint aces = 0;\r\n\t\t\r\n\t\t// evaluates each card in the hand\r\n\t\tfor (int i = 0; i < handCount; i++)\r\n\t\t{\r\n\t\t\tint value = 0;\r\n\t\r\n\t\t\t/* while each card stores a value for both its suite and rank, this method is only\r\n\t\t\tconcerned with rank, and thus only examines the first character */\r\n\t\t\tchar thisCard = pCards[i].charAt(0);\r\n\t\t\t\r\n\t\t\tswitch(thisCard)\r\n\t\t\t{\r\n\t\t\t\tcase '2':\tvalue = 2;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase '3':\tvalue = 3;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase '4':\tvalue = 4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase '5':\tvalue = 5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase '6':\tvalue = 6;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase '7':\tvalue = 7;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase '8':\tvalue = 8;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase '9':\tvalue = 9;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase '1':\tvalue = 10;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'J':\tvalue = 10;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'Q':\tvalue = 10;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'K':\tvalue = 10;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'A':\taces++;\r\n\t\t\t\t\t\t\t\tvalue = 0;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t} // end switch\r\n\t\r\n\t\t\tsum += value;\r\n\t\t} // end for\r\n\t\t\r\n\t\t// checks if any aces exist\r\n\t\tif (aces > 0)\r\n\t\t{\r\n\t\t\t// The value of all aces in the hand, the first valued at 11 and all subsequent aces valued at 1\r\n\t\t\tint aceTotal = 11 + (aces - 1);\r\n\t\t\r\n\t\t\t/* if this total would cause the player to bust, the aces are all added at value 1.\r\n\t\t\tOtherwise, the first is added at value of 11, and the others at value of 1. */\r\n\t\t\tif ( sum <= (BlackJackGame.BUST_SCORE - aceTotal ) )\r\n\t\t\t{\r\n\t\t\t\tsum = sum + aceTotal;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tsum = sum + aces;\r\n\t\t\t}\r\n\t\t} // end if\r\n\t\r\n\t\treturn sum;\r\n\t}", "public void calculatePoints() {\n /*\n for (int i = 0; i < getRacers().size(); i++) {\n String username = getRacers().get(i).getUsername();\n int total = 0;\n for (int j = 0; j < getRounds().size(); j++) {\n Slot slot = getRounds().get(j).findRacerInRound(username);\n if (slot != null) {\n total = total + slot.getPoints();\n }\n }\n getRacers().get(i).setPoints(total);\n }*/\n }", "public int getHandTotal()\n\t{\n\t\tint total = 0;\n\t\tfor (Card c : hand)\n\t\t{\n\t\t\ttotal += c.getValue();\n\t\t}\n\t\treturn total;\n\t}", "public double getRangeInches()\n {\n if (isRangeValid())\n {\n\n double currentInches = ((AnalogInput)m_echoChannel).getVoltage() * m_conversionToInches;\n\n m_oldDistance = currentInches;\n }\n\n return m_oldDistance;\n }", "public static double sum(List<Double> doubleList) {\n\t\tdouble sum = 0;\n\t\tint size = doubleList.size();\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tsum += doubleList.get(i);\n\t\t}\n\t\t\n\t\treturn (double) Math.round(sum * 100) / 100;//保留两位小数\n\t}", "@Override\r\n\tpublic float convertValue(String[] elementDesc) throws MerchantGuideException {\r\n\t\tlog.debug(\"convertValue starts here\");\r\n\t\t//holds final value\r\n\t\tfloat total = 0;\r\n\t\t//for checking previous value for subtraction logic\r\n\t\tfloat prevVal = 0;\r\n\t\tfor (int i = 0; i < elementDesc.length; i++) {\r\n\t\t\tString currentValue = elementDesc[i];\r\n\t\t\tlog.debug(\"input value is :\" + currentValue);\r\n\t\t\tlog.debug(\"previous value is :\" + prevVal);\r\n\t\t\t//validate first all repeating and non-repeating numerals\r\n\t\t\tif(Validator.validateRomanOccurences(currentValue)){\r\n\t\t\t\tfloat currVal = RomanNumbers.getRomanNumbers().get(currentValue);\r\n\t\t\t\t//\"I\" can be subtracted from \"V\" and \"X\" only. 1 be can subtracted from 5 or 10\r\n\t\t\t\t// \"X\" can be subtracted from \"L\" and \"C\" only. 10 be can subtracted from 50 or 100\r\n\t\t\t\t// \"C\" can be subtracted from \"D\" and \"M\" only. 100 be can subtracted from 500 or 100\r\n\t\t\t\tif(currVal > prevVal && (currVal == 5*prevVal || currVal == 10*prevVal)){\r\n\t\t\t\t\ttotal = total + (currVal - prevVal) - prevVal;\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// \"V\", \"L\", and \"D\" can never be subtracted. hence getting added\r\n\t\t\t\t\ttotal = total + currVal;\r\n\t\t\t\t}\r\n\t\t\t\t//assigning current value to keep copy\r\n\t\t\t\tprevVal = currVal;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//clears all the counter for checking repetitions\r\n\t\tValidator.clearRepeatationCountMap();\r\n\t\tlog.debug(\"convertValue ends here : final total value is \" + total);\r\n\t\treturn total;\r\n\t}", "private static double feetToTicks(double feet) {\n return feet / Config.DRIVE_ENCODER_DPP;\n }", "private static List<Integer> getMinMaxAltitude(\n List<ACARSRecord> soundingList) {\n Integer minAlt = Integer.MAX_VALUE;\n Integer maxAlt = Integer.MIN_VALUE;\n\n for (ACARSRecord rec : soundingList) {\n if ((rec != null) && (rec.getFlightLevel() != null)) {\n maxAlt = Math.max(rec.getFlightLevel(), maxAlt);\n minAlt = Math.min(rec.getFlightLevel(), minAlt);\n }\n }\n\n List<Integer> retValue = null;\n if (!maxAlt.equals(Integer.MIN_VALUE)\n && !minAlt.equals(Integer.MAX_VALUE)) {\n retValue = new ArrayList<Integer>();\n retValue.add(minAlt);\n retValue.add(maxAlt);\n }\n return retValue;\n }", "public static double convertFahtoCel(double temp){\r\n return ((temp - 32) * 5) / 9;\r\n }", "public int getPayAmtInCents() {\n BigDecimal bd = super.getPayAmt().multiply(Env.ONEHUNDRED);\n return bd.intValue();\n }", "private void setAltitudeValues(){\n minAlt = trackingList.get(0).getAltitude();\n maxAlt = trackingList.get(0).getAltitude();\n averageAlt = trackingList.get(0).getAltitude();\n\n double sumAlt =0.0;\n\n for (TrackingEntry entry:trackingList) {\n\n sumAlt += entry.getAltitude();\n\n //sets min Speed\n if (minAlt > entry.getAltitude()){\n minAlt = entry.getAltitude();\n }\n //sets max Speed\n if (maxAlt < entry.getAltitude()) {\n maxAlt = entry.getAltitude();\n }\n\n }\n averageAlt = sumAlt/trackingList.size();\n }", "public static Double calculatePerCapita(List<Person> personsList)\n\t{\n\t\tDouble perCapitaIncome = personsList.stream().collect(Collectors.averagingDouble(Person::getAnualIncome));\n\t\treturn perCapitaIncome;\t\n\t}", "public int getHourFraction()\n {\n return (int)Math.floor(hours);\n }", "private String convertFahrenheitToCelsius(double f) {\n double c = (f - 32.0) * (5.0 / 9.0);\n DecimalFormat numberFormat = new DecimalFormat(\"#.0\");\n return numberFormat.format(c);\n }", "private static double celsiusToFahrenheit(double c){\n\n return ((c*9)/5)+52;\n\n }", "public static double fahrenheitToCelsius(double fahrenheit){\n \n //declare variable for converted temperature\n double convertedTemperature = ((5.0 / 9) * (fahrenheit - 32));\n \n //return value of converted temperature\n return convertedTemperature; \n }", "public int getHours(){\n return (int) totalSeconds/3600;\n }", "public static int convertDistance(double distance) {\n // Using arc length formula to calculate the distance + scaling\n return (int) ((180 * distance) / (Math.PI * WHEEL_RAD) * 100) / 100;\n }", "public static double valueInHand(Card c, int refs) {\n double rushStormBonus = 0;\n if (c instanceof Minion) {\n if (c.finalStats.get(Stat.RUSH) > 0) {\n rushStormBonus = valueOfRush(c.finalStats.get(Stat.ATTACK));\n }\n if (c.finalStats.get(Stat.STORM) > 0) {\n rushStormBonus = valueOfStorm(c.finalStats.get(Stat.ATTACK));\n }\n }\n return (c.getValue(refs) + rushStormBonus) / (c.finalStats.get(Stat.COST) + 1.1);\n }", "public float PercentPL() {\n\t\tif (!isClosed()) {\r\n\t\t\tSystem.err.println(\"Cannot compute PL if trade is on\");\r\n\t\t\treturn -1f;\r\n\t\t}\r\n\t\tif(dir == Direction.LONG) {//If long\r\n\t\t\t//(Sell price - Buy price) / Buy price * 100\r\n\t\t\treturn ((exitPrice - entryPrice)/entryPrice)*100;\r\n\t\t}\r\n\t\t//If short\r\n\t\t//(Sell price - Buy price) / Sell price * 100\r\n\t\treturn ((entryPrice - exitPrice)/entryPrice)*100;\r\n\t}", "void calcComplement()\r\n { \r\n // check if this is a negative number\r\n if ( this.value > 0.5*Math.pow(16, this.digits) )\r\n {\r\n this.complement = this.value - (int)Math.pow(16, this.digits);\r\n }\r\n else\r\n {\r\n this.complement = this.value;\r\n }\r\n return;\r\n }", "private String AccelZConversion() {\n short reading = (short) (((raw[18] & 0xF0) >> 4) + ((raw[19] & 0x3f) << 4));\n\n\n int z[] = fixBinaryString(Integer.toBinaryString(reading));\n return myUnsignedToSigned(z) + \"\";\n }", "public static void main(String[] args) {\n\r\n int cent = 200;\r\n\r\n // you have purchase candle for 74 cent, what would be your remainder\r\n\r\n cent -= 74 ; // 126 cent\r\n\r\n int quarter = cent / 25 ; // 126/25---->\r\n int penny = cent % 25; //126%25 ---> 1 is remaining\r\n\r\n System.out.println(quarter);\r\n System.out.println(penny);\r\n\r\n int dime= cent / 10 ; // 126 / 10 --->12\r\n // how much penny I have after getting dime 126 %10---->6\r\n int penny2 = cent % 10 ; //---->6\r\n System.out.println(dime);\r\n System.out.println(penny2);\r\n\r\n\r\n\r\n }", "public static double convertKeltoFah(double temp){\r\n return ((temp - 273) * 9/5) + 32;\r\n }", "public static double convertCeltoFah(double temp){\r\n return (temp * 9/5) + 32;\r\n }", "public static double feetPerSecondToCentiMetresPerSecond(double num) { return (num*30.48); }", "public int totalMoney() {\r\n\t\tint money = 0;\r\n\t\tfor (int i = 0; i < this.hand.size(); i++) {\r\n\t\t\tif (this.hand.get(i).cardColor.contains(CardColor.GREEN)) {\r\n\t\t\t\tmoney += this.hand.get(i).value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.money + money;\r\n\t}", "public double calcularPortes() {\n\t\tif (this.pulgadas <= 40) {\n\t\t\tif (this.getPrecioBase() > 500)\n\t\t\t\treturn 0;\n\t\t\telse\n\t\t\t\treturn 35;\n\t\t} else\n\t\t\treturn 35 + (this.pulgadas - 40);\n\t}", "public int toDecimal() {\n\t\tint length = data.length;\n\t\tint decimal = 0;\n\t\tfor(int i = 0;i < length;i++) {\n\t\t\tint index = length - 1 - i;\n\t\t\tint power = (int)Math.pow(2, index);\n\t\t\tdecimal = decimal + data[i] * power;\n\t\t}\n\t\treturn decimal;\n\t}", "private static double convertBearingTo360(double dBearing){\n\t\t\n\t\t//dOut = output\n\t\t\n\t\tdouble dOut;\n\t\t\n\t\tdOut = dBearing;\n\t\t\n\t\twhile(dOut>360){\n\t\t\tdOut=dOut-360.;\n\t\t}\n\t\twhile(dOut<0){\n\t\t\tdOut=dOut+360.;\n\t\t}\n\t\t\n\t\treturn dOut;\n\t}", "public int calcTraderPrice() {\r\n Random r = new Random();\r\n return rtl + r.nextInt(rth - rtl);\r\n }", "public AmmoAmountUncapped subtract(AmmoAmountUncapped c){\n if (!canBuy(c)){ // c is\n throw new IllegalArgumentException(\"Cost is greater than available amounts\");\n } else {\n Map<AmmoColor,Integer> newMap = new EnumMap<>(getAmounts());\n for (Map.Entry<AmmoColor, Integer> i: c.getAmounts().entrySet()){\n newMap.put(i.getKey(), getAmounts().get(i.getKey())-i.getValue());\n }\n return new AmmoAmountUncapped(newMap);\n }\n }" ]
[ "0.65277046", "0.53424346", "0.5295586", "0.52722967", "0.5263988", "0.5115555", "0.50785255", "0.5054489", "0.5036893", "0.502775", "0.4864748", "0.4864748", "0.48059604", "0.47790754", "0.47645697", "0.47169602", "0.46847087", "0.46774295", "0.46469918", "0.4628708", "0.46269223", "0.46055114", "0.46054536", "0.45851284", "0.453469", "0.4514977", "0.45055765", "0.45052755", "0.45032036", "0.44984293", "0.44730636", "0.44718105", "0.44628555", "0.44227153", "0.43994498", "0.4399129", "0.43959582", "0.43855608", "0.43713263", "0.4362366", "0.4352695", "0.4336476", "0.43324715", "0.43181846", "0.43143493", "0.42997476", "0.42986366", "0.4296486", "0.42947185", "0.4287758", "0.42824423", "0.4257525", "0.42574447", "0.425473", "0.42538568", "0.4250046", "0.42492914", "0.42416987", "0.42385152", "0.42340687", "0.42296293", "0.42261913", "0.42259148", "0.4213751", "0.4204803", "0.4200776", "0.41936472", "0.41864634", "0.4183956", "0.41789138", "0.4178837", "0.41725567", "0.4166581", "0.41659206", "0.41654885", "0.4160715", "0.41576868", "0.41525176", "0.41515306", "0.41488057", "0.41467738", "0.4146075", "0.4146029", "0.41428918", "0.4142712", "0.41411418", "0.41295832", "0.41214862", "0.41199738", "0.41171706", "0.41165227", "0.41154316", "0.4114821", "0.41100463", "0.41095433", "0.4109531", "0.4097068", "0.40955818", "0.40937045", "0.40929478" ]
0.66527677
0
Folds the pitch values to one octave. E.g. 1203 becomes 3 and 956 remains 956
private static void convertHertzToRelativeCent(List<Double> convertedValues) { for (int i = 0; i < convertedValues.size(); i++) { Double hertzValue = convertedValues.get(i); Double pitchValueInCentFoldedToOneOctave = PitchConverter.hertzToRelativeCent(hertzValue); convertedValues.set(i, pitchValueInCentFoldedToOneOctave); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double getPitch();", "public final void addOctaves() {\n boolean cancelled = false;\n float max = 0;\n int octaves = Math.min((int) (\n Math.log(1 / (baseFreq * 2.0 * Math.PI / width))\n / Math.log(lacunarity)), octaveCap);\n noiseLoop:\n for (int j = 0; j < height; j++) {\n for (int i = 0; i < width; i++) {\n if (Thread.interrupted()) {\n cancelled = true;\n break noiseLoop;\n }\n double normU = i / (double) width;\n double normV = 1 - (2.0 * j / height);\n\n double x = Math.cos(2.0 * Math.PI * normU)\n * Math.sqrt(1.0 - normV * normV);\n double y = Math.sin(2.0 * Math.PI * normU)\n * Math.sqrt(1.0 - normV * normV);\n double z = normV;\n\n x *= baseFreq;\n y *= baseFreq;\n z *= baseFreq;\n\n float noiseSum = 0;\n double amplitude = baseAmp;\n for (int k = 1; k < octaves; k++) {\n noiseSum += noise(x, y, z) * amplitude;\n x *= lacunarity;\n y *= lacunarity;\n z *= lacunarity;\n amplitude *= gain;\n }\n noiseBuffer[j][i] += noiseSum;\n if (Math.abs(noiseBuffer[j][i]) > max) {\n max = Math.abs(noiseBuffer[j][i]);\n }\n }\n }\n\n if (!cancelled) {\n normalizeLoop:\n for (int j = 0; j < height; j++) {\n for (int i = 0; i < width; i++) {\n if (Thread.interrupted()) {\n break normalizeLoop;\n }\n noiseBuffer[j][i] /= max;\n switch (mode) {\n case NONE:\n noiseBuffer[j][i] =\n (1 + noiseBuffer[j][i]) / 2.0f;\n break;\n case SQUARE:\n noiseBuffer[j][i] =\n (float) Math.pow(noiseBuffer[j][i], 2);\n break;\n case CUBE:\n noiseBuffer[j][i] =\n (1 + (float) Math.pow(\n noiseBuffer[j][i], 3)) / 2.0f;\n break;\n default:\n noiseBuffer[j][i] =\n (float) Math.abs(noiseBuffer[j][i]);\n break;\n }\n }\n }\n }\n }", "public static int getNormalizedPitch(Note note) {\n try {\n String pitch = note.getPitch().toString();\n String octave = new Integer(note.getOctave()).toString();\n\n String target = null;\n\n if (note.getPitch().equals(Pitch.R)) {\n target = \"REST\";\n } else {\n if(note.getAlteration().equals(Alteration.N))\n target = pitch.concat(octave);\n else if(note.getAlteration().equals(Alteration.F))\n target = pitch.concat(\"F\").concat(octave);\n else\n target = pitch.concat(\"S\").concat(octave);\n }\n\n \n\n Class cClass = ConverterUtil.class;\n Field field = cClass.getField(target);\n Integer value = (Integer) field.get(null);\n\n return value.intValue()%12;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return 0;\n }", "private void analyzePitch(java.util.List<Double> samples) {\n \r\n if(samples.isEmpty()) return;\r\n if(samples.size()<=SAMPLE_RATE*MIN_SAMPLE_LENGTH_MS/1000) {\r\n //System.err.println(\"samples too short: \"+samples.size());\r\n return;\r\n }\r\n final Sound pitchSound=Sound.Sound_createSimple(\r\n 1, (double)samples.size() / SAMPLE_RATE, SAMPLE_RATE);\r\n for(int i=1; i < pitchSound.z[1].length; i++) {\r\n pitchSound.z[1][i]=samples.get(i - 1);\r\n }\r\n \r\n final SoundEditor editor=SoundEditor.SoundEditor_create(\"\", pitchSound);\r\n editor.pitch.floor=settings.floor;\r\n editor.pitch.ceiling=settings.ceiling;\r\n //editor.pitch.veryAccurate=1;\r\n \r\n if(DEBUG) System.err.print(\"analyzing \"+samples.size()+\" samples(\"\r\n +editor.pitch.floor+\"-\"+editor.pitch.ceiling+\")...\");\r\n final long start=System.nanoTime();\r\n try {\r\n editor.computePitch();\r\n } catch(Exception e) {\r\n e.printStackTrace();\r\n return;\r\n }\r\n if(DEBUG) System.err.println(\"complete in \"+(System.nanoTime()-start)/1000000.0+\"ms.\");\r\n \r\n \r\n //[ compute average pitch\r\n final java.util.List<Double> pitches=editor.getPitchesInFrequency();\r\n \r\n// diagram.clearData();\r\n// for(double s: pitches) {\r\n// diagram.addData((float)s); \r\n// }\r\n// diagram.setMaximum(500);\r\n// diagram.repaint();\r\n// \r\n double freqSum=0;\r\n int pitchCount=0;\r\n for(double p : pitches) {\r\n if(Double.isNaN(p) || p<=0) continue;\r\n freqSum+=p;\r\n pitchCount++;\r\n }\r\n final double averageFreq=freqSum/pitchCount; \r\n if(Double.isNaN(averageFreq)) {\r\n if(DEBUG) System.err.println(\"can't recognize.\");\r\n return;\r\n }\r\n//System.err.println(averageFreq); \r\n \r\n //[ compute length\r\n final double lengthMs=samples.size()*1000.0/SAMPLE_RATE;\r\n \r\n SwingUtilities.invokeLater(new Runnable() { //>>> not good\r\n public void run() {\r\n for(PitchListener lis: freqListener) {\r\n lis.gotPitch(averageFreq, lengthMs); //notify listeners\r\n }\r\n }\r\n });\r\n \r\n//System.err.println(\"add \"+ DumpReceiver.getKeyName((int) averagePitch));\r\n }", "float getPitch();", "float getPitch();", "public String getPitchAsString(){ return Integer.toString(this.pitch);}", "private int[] createScale(int octave, int rootNote, ArrayList<Integer> targetMode) {\n int[] scale = new int[targetMode.size()];\n for (int i = 0; i < targetMode.size(); i++) {\n scale[i] = (rootNote + 12 * octave) + targetMode.get(i);\n }\n return scale;\n }", "protected static void octaveUp() {\n\t\tOctaveShifter.shiftOctave(curMIDI, 1);\n\t}", "public static double frequencyToPitch(double frequency) {\n return CONCERT_A_PITCH + 12 * Math.log(frequency / mConcertAFrequency) / Math.log(2.0);\n }", "public void setPitch(int pitch);", "public static int getIntPitch(double pitch) {\n return (int) (((pitch % 360) / 360) * 256);\n }", "public double getShimmer() {\n\t\tint minAmp = 0; // figures the minium of the amplitude.\n\t\tint maxAmp; // figures the maxium of the amplitude.\n\t\tdouble amplitude = 0;\n\t\tList<Double> amplitudes = new ArrayList<Double>();\n\t\tdouble sum = 0;\n\t\tfor ( int i = 0; i < pitchPositions.size() - 1; i++ ) {\n\t\t\t// get each pitch\n\t\t\tmaxAmp = data.get( pitchPositions.get( i ) );\n\t\t\tfor ( int j = pitchPositions.get( i ); j < pitchPositions.get( i + 1 ); j++ ) {\n\t\t\t\tif ( minAmp > data.get( j ) ) {\n\t\t\t\t\tminAmp = data.get( j );\n\t\t\t\t}\n\t\t\t}\n\t\t\tamplitude = maxAmp - minAmp;\n\t\t\tamplitudes.add(amplitude);\n\t\t\tminAmp = 9999;\n\t\t}\n///Math.log(10)\n\t\tfor(int j = 0; j < amplitudes.size() - 1; j++){\n\t\t\tdouble element = Math.abs(20*(Math.log(amplitudes.get(j+1)/amplitudes.get(j))));\n\t\t\tsum = sum + element;\n\t\t}\n\t\tdouble result1 = sum/(amplitudes.size() - 1);\n\t\treturn result1;\n\n\t}", "public static double pitchToFrequency(double pitch) {\n return mConcertAFrequency * Math.pow(2.0, ((pitch - CONCERT_A_PITCH) * (1.0 / 12.0)));\n }", "protected static void octaveDown() {\n\t\tOctaveShifter.shiftOctave(curMIDI, -1);\n\t}", "@Override\n default void appendPitchRotation(double pitch)\n {\n AxisAngleTools.appendPitchRotation(this, pitch, this);\n }", "public int getOctave() {\n return this.octave;\n }", "public float getPitchAngle() { return PitchAngle; }", "public final flipsParser.pitch_return pitch() throws RecognitionException {\n flipsParser.pitch_return retval = new flipsParser.pitch_return();\n retval.start = input.LT(1);\n\n CommonTree root_0 = null;\n\n Token string_literal150=null;\n Token string_literal151=null;\n Token To152=null;\n Token string_literal154=null;\n Token string_literal155=null;\n Token With157=null;\n Token string_literal158=null;\n Token string_literal159=null;\n Token string_literal160=null;\n Token string_literal161=null;\n flipsParser.angularValueWithRate_return angularValueWithRate153 = null;\n\n flipsParser.angularValueWithRate_return angularValueWithRate156 = null;\n\n flipsParser.angularValueWithRate_return angularValueWithRate162 = null;\n\n\n CommonTree string_literal150_tree=null;\n CommonTree string_literal151_tree=null;\n CommonTree To152_tree=null;\n CommonTree string_literal154_tree=null;\n CommonTree string_literal155_tree=null;\n CommonTree With157_tree=null;\n CommonTree string_literal158_tree=null;\n CommonTree string_literal159_tree=null;\n CommonTree string_literal160_tree=null;\n CommonTree string_literal161_tree=null;\n RewriteRuleTokenStream stream_152=new RewriteRuleTokenStream(adaptor,\"token 152\");\n RewriteRuleTokenStream stream_153=new RewriteRuleTokenStream(adaptor,\"token 153\");\n RewriteRuleTokenStream stream_150=new RewriteRuleTokenStream(adaptor,\"token 150\");\n RewriteRuleTokenStream stream_151=new RewriteRuleTokenStream(adaptor,\"token 151\");\n RewriteRuleTokenStream stream_149=new RewriteRuleTokenStream(adaptor,\"token 149\");\n RewriteRuleTokenStream stream_To=new RewriteRuleTokenStream(adaptor,\"token To\");\n RewriteRuleTokenStream stream_With=new RewriteRuleTokenStream(adaptor,\"token With\");\n RewriteRuleTokenStream stream_154=new RewriteRuleTokenStream(adaptor,\"token 154\");\n RewriteRuleSubtreeStream stream_angularValueWithRate=new RewriteRuleSubtreeStream(adaptor,\"rule angularValueWithRate\");\n try {\n // flips.g:314:2: ( ( 'pit' | 'pitch' ) To angularValueWithRate -> ^( PITCH FIXED angularValueWithRate ) | ( 'pit' | 'pitch' ) angularValueWithRate -> ^( PITCH RELATIVE angularValueWithRate ) | ( With 'an' )? ( 'aoa' | 'angle of attack' ) ( 'of' )? angularValueWithRate -> ^( PITCH FIXED angularValueWithRate ) )\n int alt62=3;\n switch ( input.LA(1) ) {\n case 149:\n {\n int LA62_1 = input.LA(2);\n\n if ( (LA62_1==At||(LA62_1>=FloatingPointLiteral && LA62_1<=HexLiteral)||(LA62_1>=340 && LA62_1<=341)) ) {\n alt62=2;\n }\n else if ( (LA62_1==To) ) {\n alt62=1;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 62, 1, input);\n\n throw nvae;\n }\n }\n break;\n case 150:\n {\n int LA62_2 = input.LA(2);\n\n if ( (LA62_2==At||(LA62_2>=FloatingPointLiteral && LA62_2<=HexLiteral)||(LA62_2>=340 && LA62_2<=341)) ) {\n alt62=2;\n }\n else if ( (LA62_2==To) ) {\n alt62=1;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 62, 2, input);\n\n throw nvae;\n }\n }\n break;\n case With:\n case 152:\n case 153:\n {\n alt62=3;\n }\n break;\n default:\n NoViableAltException nvae =\n new NoViableAltException(\"\", 62, 0, input);\n\n throw nvae;\n }\n\n switch (alt62) {\n case 1 :\n // flips.g:314:4: ( 'pit' | 'pitch' ) To angularValueWithRate\n {\n // flips.g:314:4: ( 'pit' | 'pitch' )\n int alt57=2;\n int LA57_0 = input.LA(1);\n\n if ( (LA57_0==149) ) {\n alt57=1;\n }\n else if ( (LA57_0==150) ) {\n alt57=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 57, 0, input);\n\n throw nvae;\n }\n switch (alt57) {\n case 1 :\n // flips.g:314:5: 'pit'\n {\n string_literal150=(Token)match(input,149,FOLLOW_149_in_pitch1517); \n stream_149.add(string_literal150);\n\n\n }\n break;\n case 2 :\n // flips.g:314:11: 'pitch'\n {\n string_literal151=(Token)match(input,150,FOLLOW_150_in_pitch1519); \n stream_150.add(string_literal151);\n\n\n }\n break;\n\n }\n\n To152=(Token)match(input,To,FOLLOW_To_in_pitch1522); \n stream_To.add(To152);\n\n pushFollow(FOLLOW_angularValueWithRate_in_pitch1524);\n angularValueWithRate153=angularValueWithRate();\n\n state._fsp--;\n\n stream_angularValueWithRate.add(angularValueWithRate153.getTree());\n\n\n // AST REWRITE\n // elements: angularValueWithRate\n // token labels: \n // rule labels: retval\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\n root_0 = (CommonTree)adaptor.nil();\n // 315:2: -> ^( PITCH FIXED angularValueWithRate )\n {\n // flips.g:315:5: ^( PITCH FIXED angularValueWithRate )\n {\n CommonTree root_1 = (CommonTree)adaptor.nil();\n root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(PITCH, \"PITCH\"), root_1);\n\n adaptor.addChild(root_1, (CommonTree)adaptor.create(FIXED, \"FIXED\"));\n adaptor.addChild(root_1, stream_angularValueWithRate.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:316:4: ( 'pit' | 'pitch' ) angularValueWithRate\n {\n // flips.g:316:4: ( 'pit' | 'pitch' )\n int alt58=2;\n int LA58_0 = input.LA(1);\n\n if ( (LA58_0==149) ) {\n alt58=1;\n }\n else if ( (LA58_0==150) ) {\n alt58=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 58, 0, input);\n\n throw nvae;\n }\n switch (alt58) {\n case 1 :\n // flips.g:316:5: 'pit'\n {\n string_literal154=(Token)match(input,149,FOLLOW_149_in_pitch1541); \n stream_149.add(string_literal154);\n\n\n }\n break;\n case 2 :\n // flips.g:316:11: 'pitch'\n {\n string_literal155=(Token)match(input,150,FOLLOW_150_in_pitch1543); \n stream_150.add(string_literal155);\n\n\n }\n break;\n\n }\n\n pushFollow(FOLLOW_angularValueWithRate_in_pitch1546);\n angularValueWithRate156=angularValueWithRate();\n\n state._fsp--;\n\n stream_angularValueWithRate.add(angularValueWithRate156.getTree());\n\n\n // AST REWRITE\n // elements: angularValueWithRate\n // token labels: \n // rule labels: retval\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\n root_0 = (CommonTree)adaptor.nil();\n // 317:2: -> ^( PITCH RELATIVE angularValueWithRate )\n {\n // flips.g:317:5: ^( PITCH RELATIVE angularValueWithRate )\n {\n CommonTree root_1 = (CommonTree)adaptor.nil();\n root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(PITCH, \"PITCH\"), root_1);\n\n adaptor.addChild(root_1, (CommonTree)adaptor.create(RELATIVE, \"RELATIVE\"));\n adaptor.addChild(root_1, stream_angularValueWithRate.nextTree());\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:318:4: ( With 'an' )? ( 'aoa' | 'angle of attack' ) ( 'of' )? angularValueWithRate\n {\n // flips.g:318:4: ( With 'an' )?\n int alt59=2;\n int LA59_0 = input.LA(1);\n\n if ( (LA59_0==With) ) {\n alt59=1;\n }\n switch (alt59) {\n case 1 :\n // flips.g:318:5: With 'an'\n {\n With157=(Token)match(input,With,FOLLOW_With_in_pitch1563); \n stream_With.add(With157);\n\n string_literal158=(Token)match(input,151,FOLLOW_151_in_pitch1565); \n stream_151.add(string_literal158);\n\n\n }\n break;\n\n }\n\n // flips.g:318:17: ( 'aoa' | 'angle of attack' )\n int alt60=2;\n int LA60_0 = input.LA(1);\n\n if ( (LA60_0==152) ) {\n alt60=1;\n }\n else if ( (LA60_0==153) ) {\n alt60=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 60, 0, input);\n\n throw nvae;\n }\n switch (alt60) {\n case 1 :\n // flips.g:318:18: 'aoa'\n {\n string_literal159=(Token)match(input,152,FOLLOW_152_in_pitch1570); \n stream_152.add(string_literal159);\n\n\n }\n break;\n case 2 :\n // flips.g:318:24: 'angle of attack'\n {\n string_literal160=(Token)match(input,153,FOLLOW_153_in_pitch1572); \n stream_153.add(string_literal160);\n\n\n }\n break;\n\n }\n\n // flips.g:318:43: ( 'of' )?\n int alt61=2;\n int LA61_0 = input.LA(1);\n\n if ( (LA61_0==154) ) {\n alt61=1;\n }\n switch (alt61) {\n case 1 :\n // flips.g:318:43: 'of'\n {\n string_literal161=(Token)match(input,154,FOLLOW_154_in_pitch1575); \n stream_154.add(string_literal161);\n\n\n }\n break;\n\n }\n\n pushFollow(FOLLOW_angularValueWithRate_in_pitch1578);\n angularValueWithRate162=angularValueWithRate();\n\n state._fsp--;\n\n stream_angularValueWithRate.add(angularValueWithRate162.getTree());\n\n\n // AST REWRITE\n // elements: angularValueWithRate\n // token labels: \n // rule labels: retval\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\n root_0 = (CommonTree)adaptor.nil();\n // 319:2: -> ^( PITCH FIXED angularValueWithRate )\n {\n // flips.g:319:5: ^( PITCH FIXED angularValueWithRate )\n {\n CommonTree root_1 = (CommonTree)adaptor.nil();\n root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(PITCH, \"PITCH\"), root_1);\n\n adaptor.addChild(root_1, (CommonTree)adaptor.create(FIXED, \"FIXED\"));\n adaptor.addChild(root_1, stream_angularValueWithRate.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 }", "@Override\r\n\tpublic double getPitchRightHand() {\n\t\treturn rechtPitch;\r\n\t}", "int getOctave() {\n return this.octave;\n }", "@Override\n public void runEffect(double[] fft) {\n\n\n for(int i = fft.length - 1; i - pitchMove >= 0; i--)\n {\n fft[i] = fft[i - pitchMove];\n }\n for(int i = 0; i < pitchMove; i++)\n fft[i] = fft[i]*0.5;\n// for(int i = 0, k = 0; i < fft.length; i+=2)\n// {\n// if(i < fft.length/2) {\n// fft2[fft.length / 2 + k - 1] = (fft[fft.length / 2 + i] + fft[fft.length / 2 + i]) / 2;\n// fft2[fft.length / 2 - k - 1] = (fft[fft.length / 2 - i] + fft[fft.length / 2 - i]) / 2;\n// }\n// //fft2[k] = 0;\n// //fft2[fft2.length - k -1] = 0;\n// k++;\n// }\n /*for(int i = 0; i < fft.length; i++)\n {\n fft[i] = Math.abs(fft[i]);\n if(fft[i] < 2){\n fft[i] = 0;\n }\n //Log.d(\"Log\", fft[i] + \" \");\n }*/\n }", "private Pitch getPitch(int i) {\n return Pitch.values()[i];\n }", "private static final void silk_decode_pitch(final short lagIndex, final byte contourIndex, final int pitch_lags[], final int Fs_kHz, final int nb_subfr)\r\n\t{\r\n\t\t//final byte[] Lag_CB_ptr;\r\n\t\tfinal byte[][] Lag_CB_ptr;\r\n\r\n\t\tif( Fs_kHz == 8 ) {\r\n\t\t\tif( nb_subfr == Jpitch_est_defines.PE_MAX_NB_SUBFR ) {\r\n\t\t\t\t// Lag_CB_ptr = Jpitch_est_tables.silk_CB_lags_stage2[ 0 ];//[ 0 ];\r\n\t\t\t\tLag_CB_ptr = Jpitch_est_tables.silk_CB_lags_stage2;\r\n\t\t\t\t// cbk_size = Jpitch_est_defines.PE_NB_CBKS_STAGE2_EXT;\r\n\t\t\t} else {\r\n\t\t\t\t// celt_assert( nb_subfr == Jpitch_est_defines.PE_MAX_NB_SUBFR >> 1 );\r\n\t\t\t\t// Lag_CB_ptr = Jpitch_est_tables.silk_CB_lags_stage2_10_ms[ 0 ];//[ 0 ];\r\n\t\t\t\tLag_CB_ptr = Jpitch_est_tables.silk_CB_lags_stage2_10_ms;\r\n\t\t\t\t// cbk_size = Jpitch_est_defines.PE_NB_CBKS_STAGE2_10MS;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif( nb_subfr == Jpitch_est_defines.PE_MAX_NB_SUBFR ) {\r\n\t\t\t\t// Lag_CB_ptr = Jpitch_est_tables.silk_CB_lags_stage3[ 0 ];//[ 0 ];\r\n\t\t\t\tLag_CB_ptr = Jpitch_est_tables.silk_CB_lags_stage3;\r\n\t\t\t\t// cbk_size = Jpitch_est_defines.PE_NB_CBKS_STAGE3_MAX;\r\n\t\t\t} else {\r\n\t\t\t\t// celt_assert( nb_subfr == Jpitch_est_defines.PE_MAX_NB_SUBFR >> 1 );\r\n\t\t\t\t// Lag_CB_ptr = Jpitch_est_tables.silk_CB_lags_stage3_10_ms[ 0 ];//[ 0 ];\r\n\t\t\t\tLag_CB_ptr = Jpitch_est_tables.silk_CB_lags_stage3_10_ms;\r\n\t\t\t\t// cbk_size = Jpitch_est_defines.PE_NB_CBKS_STAGE3_10MS;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfinal int min_lag = Jpitch_est_defines.PE_MIN_LAG_MS * Fs_kHz;\r\n\t\tfinal int max_lag = Jpitch_est_defines.PE_MAX_LAG_MS * Fs_kHz;\r\n\t\tfinal int lag = min_lag + lagIndex;\r\n\r\n\t\tfor( int k = 0; k < nb_subfr; k++ ) {\r\n\t\t\t// pitch_lags[ k ] = lag + (int)Lag_CB_ptr[k * cbk_size + contourIndex];// FIXME dirty way using 2-dimensional array\r\n\t\t\tint v = lag + (int)Lag_CB_ptr[ k ][ contourIndex ];\r\n\t\t\tv = (v > max_lag ? max_lag : (v < min_lag ? min_lag : v));\r\n\t\t\tpitch_lags[ k ] = v;\r\n\t\t}\r\n\t}", "public float getPitch() {\n return pitch;\n }", "public void pitch(float amount)\r\n {\r\n //increment the pitch by the amount param\r\n pitch -= amount;\r\n }", "public float getPitch() {\n\treturn pitch;\n }", "public float getPitch() {\n return pitch_;\n }", "public float getPitch() {\n return pitch_;\n }", "public int getTestNotePitch()\n {\n return super.getTestNotePitch();\n }", "@Override\n default void prependPitchRotation(double pitch)\n {\n AxisAngleTools.prependPitchRotation(pitch, this, this);\n }", "private StringBuilder listAllPitches(int length) {\n StringBuilder builder = new StringBuilder();\n\n int padding = Integer.toString(length).length();\n String spaces = \"\";\n spaces = String.format(\"%\" + (padding) + \"s\", spaces);\n builder.append(spaces);\n\n Note highest = this.getHighestNote();\n Note lowest = this.getLowestNote();\n int ordinalHighestOctave = highest.getOctave().ordinal();\n int ordinalHighestPitch = highest.getPitch().ordinal();\n int ordinalLowOctave = lowest.getOctave().ordinal();\n int ordinalLowPitch = lowest.getPitch().ordinal();\n int from = ordinalLowOctave * 12 + ordinalLowPitch;\n int to = ordinalHighestOctave * 12 + ordinalHighestPitch;\n List<String> allNotes = this.allnotes.subList(from, to + 1);\n\n for (int i = 0; i < allNotes.size(); i++) {\n String current = allNotes.get(i);\n\n if (current.length() == 2) {\n builder.append(\" \" + current + \" \");\n } else if (current.length() == 3) {\n builder.append(\" \" + current + \" \");\n } else if (current.length() == 4) {\n builder.append(\" \" + current);\n } else {\n builder.append(current);\n }\n }\n return builder;\n }", "@Override\n\tpublic void handlePitch(PitchDetectionResult pitchDetectionResult, AudioEvent audioEvent) {\n\t\tif(pitchDetectionResult.getPitch() != -1){\n\t\t\tdouble timeStamp = audioEvent.getTimeStamp();\n\t\t\tfloat pitch = pitchDetectionResult.getPitch();\n\t\t\tpitch *= 2; // Because of bit of file\n\t\t\tfloat probability = pitchDetectionResult.getProbability();\n\t\t\tdouble rms = audioEvent.getRMS() * 100;\n\t\t\tint pMinute = (int) (timeStamp/60);\n\t\t\tint pSecond = (int) (timeStamp%60);\n\t\t\tint intvNum = -1;\n\t\t\tString tInterval = new String();\n \n\t\t\tif(pitch >= 127.142 && pitch < 134.702) {\n\t\t\t\ttInterval = \"C3\";\n\t\t\t\tintvNum = 1;\n\t\t\t}\n\t\t\telse if(pitch >= 134.702 && pitch < 142.712) {\n\t\t\t\ttInterval = \"C3#\";\n\t\t\t\tintvNum = 2;\n\t\t\t}\n\t\t\telse if(pitch >= 142.712 && pitch < 151.198) {\n\t\t\t\ttInterval = \"D3\";\n\t\t\t\tintvNum=3;\n\t\t\t}\n\t\t\telse if(pitch >= 151.198 && pitch < 160.189) {\n\t\t\t\ttInterval = \"D3#\";\n\t\t\t\tintvNum=4;\n\t\t\t}\n\t\t\telse if(pitch >= 160.189 && pitch < 169.714) {\n\t\t\t\ttInterval = \"E3\";\n\t\t\t\tintvNum=5;\n\t\t\t}\n\t\t\telse if(pitch >= 169.714 && pitch < 179.806) {\n\t\t\t\ttInterval = \"F3\";\n\t\t\t\tintvNum=6;\n\t\t\t}\n\t\t\telse if(pitch >= 179.806 && pitch < 190.497) {\n\t\t\t\ttInterval = \"F3#\";\n\t\t\t\tintvNum=7;\n\t\t\t}\n\t\t\telse if(pitch >= 190.497 && pitch < 201.825) {\n\t\t\t\ttInterval = \"G3\";\n\t\t\t\tintvNum=8;\n\t\t\t}\n\t\t\telse if(pitch >= 201.825 && pitch < 213.826) {\n\t\t\t\ttInterval = \"G3#\";\n\t\t\t\tintvNum=9;\n\t\t\t}\n\t\t\telse if(pitch >= 213.826 && pitch < 226.541) {\n\t\t\t\ttInterval = \"A3\";\n\t\t\t\tintvNum=10;\n\t\t\t}\n\t\t\telse if(pitch >= 226.541 && pitch < 240.012) {\n\t\t\t\ttInterval = \"A3#\";\n\t\t\t\tintvNum=11;\n\t\t\t}\n\t\t\telse if(pitch >= 240.012 && pitch < 254.284) {\n\t\t\t\ttInterval = \"B3\";\n\t\t\t\tintvNum=12;\n\t\t\t}\n\t\t\telse if(pitch >= 254.284 && pitch < 269.404) {\n\t\t\t\ttInterval = \"C4\";\n\t\t\t\tintvNum=13;\n\t\t\t}\n\t\t\telse if(pitch >= 269.404 && pitch < 287.924) {\n\t\t\t\ttInterval = \"C4#\";\n\t\t\t\tintvNum=14;\n\t\t\t}\n\t\t\telse if(pitch >= 287.294 && pitch < 302.396) {\n\t\t\t\ttInterval = \"D4\";\n\t\t\t\tintvNum=15;\n\t\t\t}\n\t\t\telse if(pitch >= 302.396 && pitch < 320.377) {\n\t\t\t\ttInterval = \"D4#\";\n\t\t\t\tintvNum=16;\n\t\t\t}\n\t\t\telse if(pitch >= 320.377 && pitch < 339.428) {\n\t\t\t\ttInterval = \"E4\";\n\t\t\t\tintvNum=17;\n\t\t\t}\n\t\t\telse if(pitch >= 339.428 && pitch < 359.611) {\n\t\t\t\ttInterval = \"F4\";\n\t\t\t\tintvNum=18;\n\t\t\t}\n\t\t\telse if(pitch >= 359.611 && pitch < 380.995) {\n\t\t\t\ttInterval = \"F4#\";\n\t\t\t\tintvNum=19;\n\t\t\t}\n\t\t\telse if(pitch >= 380.995 && pitch < 403.65) {\n\t\t\t\ttInterval = \"G4\";\n\t\t\t\tintvNum=20;\n\t\t\t}\n\t\t\telse if(pitch >= 403.65 && pitch < 427.652) {\n\t\t\t\ttInterval = \"G4#\";\n\t\t\t\tintvNum=21;\n\t\t\t}\n\t\t\telse if(pitch >= 427.652 && pitch < 453.082) {\n\t\t\t\ttInterval = \"A4\";\n\t\t\t\tintvNum=22;\n\t\t\t}\n\t\t\telse if(pitch >= 453.082 && pitch < 480.234) {\n\t\t\t\ttInterval = \"A4#\";\n\t\t\t\tintvNum=23;\n\t\t\t}\n\t\t\telse if(pitch >= 480.234 && pitch < 508.567) {\n\t\t\t\ttInterval = \"B4\";\n\t\t\t\tintvNum=24;\n\t\t\t}\n\t\t\telse if(pitch >= 508.567 && pitch < 538.808) {\n\t\t\t\ttInterval = \"C5\";\n\t\t\t\tintvNum=25;\n\t\t\t}\n\t\t\telse if(pitch >= 538.808 && pitch < 570.847) {\n\t\t\t\ttInterval = \"C5#\";\n\t\t\t\tintvNum=26;\n\t\t\t}\n\t\t\telse if(pitch >= 570.847 && pitch < 604.792) {\n\t\t\t\ttInterval = \"D5\";\n\t\t\t\tintvNum=27;\n\t\t\t}\n\t\t\telse if(pitch >= 604.792 && pitch < 640.755) {\n\t\t\t\ttInterval = \"D5#\";\n\t\t\t\tintvNum=28;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttInterval = \"null\";\n\t\t\t\tintvNum=-1;\n\t\t\t}\n \t\n\t\t\t\n\t\t\t//Converting Ended\n\t\t\tif(pitch < 8000 && probability > 0.85) {\n\t\t\t\tString message = String.format(\"Pitch detected at %d 분 %d초, %.2f: %.2fHz ( %.2f probability, RMS: %.5f ) %s\", \n\t\t\t\t\t\tpMinute, pSecond, timeStamp, pitch,probability,rms,tInterval);\n\t\t\t\t// System.out.println(message);\n\t\t\t\tif(tried == 0) {\n\t\t\t\t\tCalculateScore.startTime.add(timeStamp);\n\t\t\t\t\tCalculateScore.endTime.add(timeStamp);\n\t\t\t\t\tCalculateScore.subInterval1.add(intvNum);\n\t\t\t\t\tCalculateScore.subInterval2.add(intvNum);\n\t\t\t\t\tCalculateScore.realInterval.add(null);\n\t\t\t\t\ttried++;\n\t\t\t\t}\n\t\t\t\telse if(((CalculateScore.subInterval1.get(idx)) - intvNum) == 0 || Math.abs(((CalculateScore.subInterval1.get(idx)) - intvNum)) == 1) {\n\t\t\t\t\tCalculateScore.endTime.set(idx, timeStamp);\n\t\t\t\t\tCalculateScore.subInterval2.set(idx, intvNum);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tCalculateScore.endTime.set(idx, timeStamp);\n\t\t\t\t\tCalculateScore.startTime.add(timeStamp);\n\t\t\t\t\tCalculateScore.endTime.add(timeStamp);\n\t\t\t\t\tCalculateScore.subInterval1.add(intvNum);\n\t\t\t\t\tCalculateScore.subInterval2.add(intvNum);\n\t\t\t\t\tCalculateScore.realInterval.add(null);\n\t\t\t\t\tidx++;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void gyroPitch(int value, int timestamp) {\n }", "public void copiedMeasureDecoder(Integer chordNote,Integer[]previousChord, Integer[] playedChord){\n /* int c=0;\n int a=0;\n int b=0;\n int x0=0;\n int x1=0;*/\n int d1=0;\n int d2=0;\n\n\n\n for (int i=0;i<melodyNotes.length;i++){\n if(melodyNotes[i]==chordNote)\n d1=i;\n }\n for (int i=0;i<melodyNotes.length;i++){\n if(melodyNotes[i]==melody.get(melodyCounter))\n d2=i;\n /* if(melodyNotes[i]==playedChord[1])\n a=i;\n if(melodyNotes[i]==previousChord[1])\n b=i;*/\n }\n /*if(a<b){\n x0=a-b;\n x1=7+x1;\n }else{\n x0=a-b;\n x1=x0-7;\n }*/\n if(d1>d2) {\n binaryOutput += \"0\";\n }else {\n binaryOutput += \"1\";\n }\n for(int i = 0;i<4;i++){\n for(int j =0; j < rhytm.get(beatCounter).length;j++){\n if(rhytm.get(beatCounter)[j]!=null)\n if ((!rhytm.get(beatCounter)[j].equals(\"Ri\")) && (!rhytm.get(beatCounter)[j].equals(\"Rs\"))) {\n melodyCounter++;\n }\n }\n beatCounter++;\n }\n\n\n}", "public double volume () {return (4/3)*Math.PI*this.r*this.r*this.r;}", "public void setPitch(float pitch) {\n\t\talSourcef(musicSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(reverseSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(flangeSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(revFlangeSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(wahSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(revWahSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(wahFlangeSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(revWahFlangeSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(distortSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(revDistortSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(distortFlangeSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(revDistortFlangeSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(wahDistortSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(revWahDistortSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(wahDistortFlangeSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(revWahDistortFlangeSourceIndex, AL_PITCH, pitch);\n\t}", "public static Note makeNote(int pitch, int octave) {\n if (octave < 0) {\n throw new IllegalArgumentException(\"Invalid octave parameter!\");\n }\n return new Note(Pitch.makePitch(pitch),octave,0);\n }", "void calcWave() {\n yoff += 0.01f;\n \n //For every x value, calculate a y value based on sine or cosine\n float x = yoff; //**OPTION #1****/\n //float x = 0.0f; //**OPTION #2****/\n for (int i = 0; i < yvalues.length; i++) {\n float n = 2*noise(x)-1.0f; //**OPTION #1****/ //scale noise to be between 1 and -1\n //float n = 2*noise(x,yoff)-1.0f; //**OPTION #2****/ //scale noise to be between 1 and -1\n yvalues[i] = n*amplitude;\n x+=dx;\n }\n }", "public float getPitch() {\n return pitch_;\n }", "public float getPitch() {\n return pitch_;\n }", "public String getPitch()\n\t{\n\t\treturn pitch.getText();\n\t}", "public float getPitchShift() {\n\treturn pitchShift;\n }", "@Override\n public double getPitch()\n {\n Vector3d modelIntersect = getModelIntersection();\n if (modelIntersect == null)\n {\n return 0;\n }\n modelIntersect = modelIntersect.getNormalized();\n Vector3d projectedIntersect = Plane.unitProjection(myPosition.getDir().multiply(-1), modelIntersect).getNormalized();\n // Now calculate angle between vectors (and keep sign)\n Vector3d orthogonal = myPosition.getRight().multiply(-1);\n Vector3d cross = modelIntersect.cross(projectedIntersect);\n double dot = modelIntersect.dot(projectedIntersect);\n double resultAngle = Math.atan2(orthogonal.dot(cross), dot);\n double ninetyDegrees = Math.toRadians(90);\n return Math.signum(resultAngle) < 0 ? -1 * (ninetyDegrees - Math.abs(resultAngle)) : ninetyDegrees - resultAngle;\n }", "public int toMidi(Note n) {\n\n int normIndex = n.getNoteIndex() + numOffset + (7 * octaveOffset);\n int numOctaves = normIndex/7;\n\n int midiAddend = MIDI_OFFSETS[normIndex - (7*numOctaves)];\n\n return 38 + midiAddend + 12*numOctaves; // 37 is low D\n }", "INote removeNote(int beatNum, String pitch, int octave) throws IllegalArgumentException;", "public List<Float> calculatePitches(){\n\t\tList<Integer> res = new ArrayList<Integer>();\n\t\tint size = data.size();\n\t\tint maxAmp = 0;\n\t\tint startPos = 0;\n\t\t// get the first pitch in the basic period\n\t\tfor (int i = 0; i < BASE_FRAGMENT; i ++){\n\t\t\tif (maxAmp < data.get(i)){\n\t\t\t\tmaxAmp = data.get(i);\n\t\t\t\t// set this position as the start position\n\t\t\t\tstartPos = i;\n\t\t\t}\n\t\t}\n\t\tLog.v(\"startPos\", String.valueOf(startPos));\n\t\t// find every pitch in all the fragments\n\t\tint pos = startPos + OFFSET; // set current position\n\t\tint posAmpMax;\n\t\twhile(startPos < 1000){\n\t\t\tif(data.get(pos) > 0) { // only read the positive data\n\n\t\t\t\tposAmpMax = 0;\n\t\t\t\tmaxAmp = 0;\n\t\t\t\t// access to all the data in this fragment\n\t\t\t\twhile (pos < startPos + BASE_FRAGMENT) {\n\t\t\t\t\t// find the pitch and mark this position\n\t\t\t\t\tif (maxAmp < data.get(pos)) {\n\t\t\t\t\t\tmaxAmp = data.get(pos);\n\t\t\t\t\t\tposAmpMax = pos;\n\t\t\t\t\t}\n\t\t\t\t\tpos++;\n\t\t\t\t}\n\t\t\t\t// add pitch position into the list\n\t\t\t\tpitchPositions.add(posAmpMax);\n\t\t\t\tres.add(posAmpMax);\n\t\t\t\t// update the start position and the current position\n\t\t\t\tstartPos = posAmpMax;\n\t\t\t\tpos = startPos + OFFSET;\n\t\t\t}else{\n\t\t\t\tpos ++;\n\t\t\t}\n\t\t}\n\n\t\t// calculate all periods and add them into list\n\t\tfor(int i = 0; i < pitchPositions.size() - 1; i++){\n\t\t\tfloat period = (float)(pitchPositions.get(i+1) - pitchPositions.get(i));\n\t\t\tT.add(period);\n\t\t\tpitches.add(PeriodToPitch(period));\n\t\t}\n\t\tpitchPositions.clear();\n\t\treturn pitches;\n\t}", "private static void test3() {\n for (int noteNumber = 0; noteNumber < 128; noteNumber++) {\n double frequency = 440 * Math.pow(2, (noteNumber - 69) / 12.0);\n \n boolean clipMax = false;\n int block = 0;\n \n if (frequency <= 48.503) {\n block = 0;\n }\n else if (frequency <= 97.006) {\n block = 1;\n }\n else if (frequency <= 194.013) {\n block = 2;\n }\n else if (frequency <= 388.026) {\n block = 3;\n }\n else if (frequency <= 776.053) {\n block = 4;\n }\n else if (frequency <= 1552.107) {\n block = 5;\n }\n else if (frequency <= 3104.215) {\n block = 6;\n }\n else if (frequency <= 6208.431) {\n block = 7;\n \n }\n else {\n //throw new RuntimeException(\"invalid frequency !\");\n //System.out.println(\"unsupported frequency \" + frequency + \" !\");\n //System.exit(-1);\n block = 7;\n clipMax = true;\n }\n \n double f_num = frequency * Math.pow(2, (20 - block)) / 49716;\n if (clipMax) {\n f_num = 1023;\n }\n String f_num_hex = \"0000\" + Integer.toHexString((int) f_num);\n f_num_hex = f_num_hex.substring(f_num_hex.length() - 4, f_num_hex.length());\n //System.out.println(noteNumber + \" = \" + frequency + \" ---> block: \" + block + \" f_num_hex = \" + f_num_hex);\n //System.out.println(noteNumber + \" = \" + frequency);\n \n String block_hex = \"000\" + Integer.toHexString(block);\n block_hex = block_hex.substring(block_hex.length() - 3, block_hex.length());\n\n if (noteNumber % 4 == 0) {\n System.out.print(\"\\r\\n\\t\\t\\tdb \");\n }\n System.out.print(block_hex + \"h, 000h, 0\" + f_num_hex.subSequence(2, 4) + \"h, 0\" + f_num_hex.substring(0, 2) + \"h\" + ((noteNumber % 4 != 3) ? \", \" : \"\"));\n \n }\n System.out.println(\"\");\n }", "public Builder setPitch(float value) {\n bitField0_ |= 0x00000040;\n pitch_ = value;\n onChanged();\n return this;\n }", "public String scoreTo8BitsStringNotes(){\n\t\tString str = \"\", placeholder = \"00\",seperator = \" \";\n\t\tfor(StdNote tNote : musicTrack.get(0).noteTrack){\n\n\t\t\tstr += String.format(\"%03d\",tNote.absolutePosition)\n\t\t\t\t+ tNote.downFlatSharp\n\t\t\t\t+ tNote.octave\n\t\t\t\t+ tNote.dot\n\t\t\t\t+ placeholder\n\t\t\t\t+ seperator;\n\t\t\t//这里要这样写么??\n\t\t\tif(tNote.barPoint == 1) str += ',';\n\t\t}\n\t\treturn str.trim();//去掉前后空格\n\t}", "public static ArrayList<PitchCandidate> harmonicChecks(ArrayList<PitchCandidate> pitch_candidates, MelodicNote CF_note, Integer previous_cf_pitch,\n Integer previous_melody_pitch, MelodicNote fragment_note, int canon_transpose_interval ){\n Boolean large_dissonance_bad = InputParameters.large_dissonance_bad;\n Integer [] consonances = InputParameters.consonances;\n Integer [] perfect_consonances = InputParameters.perfect_consonances;\n Integer [] root_consonances = InputParameters.root_consonances;\n \n\n for (PitchCandidate myPC : pitch_candidates){\n\t\t\n Integer cand_pitch = myPC.getPitch() + canon_transpose_interval;\n Integer cf_pitch = CF_note.getPitch();\n boolean CF_accent = CF_note.getAccent();\n boolean use_CF_accent = false;\n if (CF_note.getRest()) cf_pitch = previous_cf_pitch;\n Integer cand_prev_pitch = previous_melody_pitch + canon_transpose_interval;\n //if(previous_melody_pitch == 9999) cand_prev_pitch = cand_pitch;// 9999 means the CP is held over to multiple cfs\n Integer melody_motion_to_cand = cand_pitch - cand_prev_pitch;\n int this_interval = abs(cand_pitch - cf_pitch)%12;\n int this_inv_interval = abs(cf_pitch - cand_pitch)%12;\n Integer melodic_motion_to_ = cf_pitch - previous_cf_pitch;\n Integer previous_interval = abs(cand_prev_pitch - previous_cf_pitch)%12;\n Integer previous_inv_interval = abs(previous_cf_pitch - cand_prev_pitch)%12;\n Double cp_start_time = fragment_note.getStartTime();\n Double cf_start_time = CF_note.getStartTime();\n Boolean directm = false;\n boolean this_interval_consonant = false;\n boolean this_inv_interval_consonant = false;\n boolean cand_prev_cf_diss = true;\n boolean inv_cand_prev_cf_diss = true;\n boolean previous_interval_consonant = false;\n boolean previous_inv_interval_consonant = false;\n \n //System.out.println(\"evaluating pitch candidate \" + cand_pitch + \" against \" + cf_pitch);\n //is this interval consonant\n for (Integer consonance : consonances) {\n if (this_interval == consonance){\n this_interval_consonant = true; \n break;\n }\n }\n for (Integer consonance : consonances) {\n if (this_inv_interval == consonance){\n this_inv_interval_consonant = true; \n break;\n }\n }\n\t \t\n \n if(this_interval_consonant && this_inv_interval_consonant) {\n //System.out.println(cand_pitch + \" against \" + cf_pitch + \"is consonant\");\n if (this_interval ==0) {//decrement if an octave\n myPC.decrementRank(Decrements.octave);\n }\n }\n \n else {\n //System.out.println(cand_pitch + \" against \" + cf_pitch + \"is dissonant\");\n myPC.decrementRank(Decrements.dissonance);\n\t\t//decrement if a minor 9th\n if (this_interval == 1 && (abs(cand_pitch - cf_pitch)<14 || large_dissonance_bad)){\n myPC.decrementRank(Decrements.minor_9th);\n myPC.set_minor_9th();\n }\n if (this_inv_interval == 1 && (abs(cf_pitch - cand_pitch)<14 || large_dissonance_bad)){\n myPC.decrementRank(Decrements.minor_9th);\n myPC.set_minor_9th();\n }\n //decrement accented dissonance\n if (CF_note.getStartTime() > fragment_note.getStartTime())\n use_CF_accent = true;\n \n if (!use_CF_accent) {\n if (fragment_note.getAccent() && (abs(cand_pitch - cf_pitch)<36 || large_dissonance_bad)) {\n //System.out.println(\"caught accented dissoance\");\n myPC.decrementRank(Decrements.accented_dissonance);\n myPC.set_accent_diss();\n }\n if (fragment_note.getAccent() && (abs(cf_pitch - cand_pitch)<36 || large_dissonance_bad)) {\n //System.out.println(\"caught accented dissoance\");\n myPC.decrementRank(Decrements.accented_dissonance);\n myPC.set_accent_diss();\n } \n }\n else {\n if (CF_note.getAccent() && (abs(cand_pitch - cf_pitch)<36 || large_dissonance_bad)) {\n System.out.println(\"caught accented dissonance between cand pitch \" + cand_pitch + \" and cf_pitch \" + cf_pitch);\n myPC.decrementRank(Decrements.accented_dissonance);\n myPC.set_accent_diss();\n }\n if (CF_note.getAccent() && (abs(cf_pitch - cand_pitch)<36 || large_dissonance_bad)) {\n System.out.println(\"caught accented dissonance between cand pitch \" + cand_pitch + \" and cf_pitch \" + cf_pitch);\n myPC.decrementRank(Decrements.accented_dissonance);\n myPC.set_accent_diss();\n }\n }\n\n }\n \n\t //check for pitch candidate dissonance against previous cantus firmus\n for (Integer consonance : consonances) {\n if (abs(cand_pitch - previous_cf_pitch)%12 == consonance) {\n\t\t cand_prev_cf_diss = false; \n }\n }\n for (Integer consonance : consonances) {\n if (abs(previous_cf_pitch - cand_pitch)%12 == consonance) {\n inv_cand_prev_cf_diss = false; \n }\n } \n if (cand_prev_cf_diss ||inv_cand_prev_cf_diss) {\n\t\tmyPC.decrementRank(Decrements.diss_cp_previous_cf);\n }\n\t\t\t\n //compute whether previous_interval consonant\n for (Integer consonance : consonances) {\n if (previous_interval == consonance) previous_interval_consonant = true;\n\t\tbreak;\n }\n for (Integer consonance : consonances) {\n if (previous_inv_interval == consonance) previous_inv_interval_consonant = true;\n\t\tbreak;\n }\n\t\t\t\n\t //check for same type of consonance\n if (previous_interval_consonant && (previous_interval == this_interval) ){\n\t\tmyPC.decrementRank(Decrements.seq_same_type_cons);\n }\n if (previous_inv_interval_consonant && (previous_inv_interval == this_inv_interval) ){\n\t\tmyPC.decrementRank(Decrements.seq_same_type_cons);\n } \n\t\t\t\n\t //check for sequence of dissonances\n if(!previous_interval_consonant && !this_interval_consonant) {\n\t\tmyPC.decrementRank(Decrements.seq_of_diss);\n\t\tif(this_interval == previous_interval ){\n myPC.decrementRank(Decrements.seq_same_type_diss);\n\t\t}\n }\n if(!previous_inv_interval_consonant && !this_inv_interval_consonant) {\n\t\tmyPC.decrementRank(Decrements.seq_of_diss);\n\t\tif(this_inv_interval == previous_inv_interval ){\n myPC.decrementRank(Decrements.seq_same_type_diss);\n\t\t}\n } \n\t\n //check for too long a sequence of same interval\n if (previous_interval == this_interval) {\n same_consonant_count++;\n if (same_consonant_count > same_consonant_threshold) {\n myPC.decrementRank(Decrements.seq_of_same_cons);\n } \n }\n\t else {\n\t\tsame_consonant_count =0;\n\t }\n if (previous_inv_interval == this_inv_interval) {\n same_inv_consonant_count++;\n if (same_inv_consonant_count > same_consonant_threshold) {\n myPC.decrementRank(Decrements.seq_of_same_cons);\n } \n }\n\t else {\n\t\tsame_inv_consonant_count =0;\n\t }\n\n\t\t\t\n\t //if CF starts before CP \n if (cp_start_time > cf_start_time){\n\t //the following checks rely on knowing motion to pitch candidate from previous pitch\n\t //check for a bad approach to a dissonance from a consonance\n\t //ie CP pitch approached by greater than a step\n if (previous_interval_consonant){\n if ((!this_interval_consonant || !this_inv_interval_consonant) && abs(melody_motion_to_cand) >2) {\n myPC.decrementRank(Decrements.bad_diss_approach_from_cons);\n } \n }\n //check for a bad approach to consonance from dissonance\n else if (this_interval_consonant || this_inv_interval_consonant){\n if (abs(melody_motion_to_cand) >2){\n myPC.decrementRank(Decrements.bad_cons_approach_from_diss);\n } \n }\n //check for bad approach to dissonance from dissonance\n else { //implies both this interval and previous are dissonant\n if (abs(melody_motion_to_cand) > 4){\n myPC.decrementRank(Decrements.bad_diss_approach_from_diss);\n } \n }\n }\n // If CP starts before CF\n else if (cp_start_time < cf_start_time) {\n\t\t// the following checks rely on knowing motion to CF pitch from previous CF pitch\n\t\t//check for bad motion into consonance from dissonance\n if (!previous_interval_consonant) {//ie Previous_Interval is dissonant\n if (this_interval_consonant || this_inv_interval_consonant) {\n if (abs(melodic_motion_to_) > 2) {\n myPC.decrementRank(Decrements.bad_cons_approach_from_diss);\n\t\t\t}\n }\n\t\t //check for bad motion into dissonance from dissonance\n else {\n if (abs(melodic_motion_to_) > 4){\n\t\t\t myPC.decrementRank(Decrements.bad_diss_approach_from_diss); \n }\n } \n }\n }\n\t // If CP and CF start at the same time\n else {\n //Check for parallel perfect consonances\n\t\tif((melody_motion_to_cand > 0 && melodic_motion_to_ >0) || (melody_motion_to_cand < 0 && melodic_motion_to_ <0) )\n\t\t directm = true;\n if (this_interval_consonant) {\n if (previous_interval_consonant)\t{\n if (this_interval == previous_interval ){\n myPC.decrementRank(Decrements.seq_same_type_cons);\n if (directm) {\n myPC.decrementRank(Decrements.parallel_perf_consonance);\n } \n }\n else {\n //check for direct motion into a perfect consonance\n if (directm ) {\n myPC.decrementRank(Decrements.direct_motion_perf_cons);\n }\n }\n }\n }\n if (this_inv_interval_consonant) {\n if (previous_inv_interval_consonant)\t{\n if (this_inv_interval == previous_inv_interval ){\n myPC.decrementRank(Decrements.seq_same_type_cons);\n if (directm) {\n myPC.decrementRank(Decrements.parallel_perf_consonance);\n } \n }\n else {\n //check for direct motion into a perfect consonance\n if (directm ) {\n myPC.decrementRank(Decrements.direct_motion_perf_cons);\n }\n }\n }\n } \n\t\t//check for motion into a dissonance\n else { //this interval is dissonant\n myPC.decrementRank(Decrements.motion_into_diss_both_voices_change);\n\t\t if (directm ) {\n\t\t\tmyPC.decrementRank(Decrements.direct_motion_into_diss);\n }\n }\n\n }\n } \n\treturn pitch_candidates;\n }", "public float getSoundPitch() {\n return _soundPitch;\n }", "public Builder setPitch(float value) {\n bitField0_ |= 0x00000010;\n pitch_ = value;\n onChanged();\n return this;\n }", "public void wave_4(int width,int height,int lenth)\r\n\t{\r\n\t\tchar ch='0';\r\n\t\tint front_space =3;\r\n\t\tint center_space=3;\r\n\t\tint end_space=3;\r\n\t\t\r\n\t\tfor(int i=1;i<=height;i++ )\r\n\t\t{\t\t\t\t\t\t\r\n\t\t\tif(i==1) {front_space=4; center_space=1; end_space=5;}\r\n\t\t\telse if(i==height) {front_space=2; center_space=5; end_space=1;}\r\n\t\t\telse {front_space=3; center_space=3; end_space=3;}\r\n\t\t\t\r\n\t\t\tcommon.printSpace(front_space);\t\r\n\t\t\tfor(int j=0;j<lenth;j++)\r\n\t\t\t{\t\t\t\t\r\n\t\t\t\tcommon.printChar(ch);\r\n\t\t\t\tcommon.printSpace(center_space);\r\n\t\t\t\tcommon.printChar(ch);\r\n\t\t\t\tcommon.printSpace(end_space);\t\t\t\t\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t}\t\t\r\n\t}", "public Builder clearPitch() {\n bitField0_ = (bitField0_ & ~0x00000040);\n pitch_ = 0F;\n onChanged();\n return this;\n }", "public double[] getDesiredHandYawPitchRoll()\n {\n switch (this)\n {\n case STAND_PREP:\n return new double[] {0.0, Math.PI / 2.0, 0.0};\n case REACH_BACK:\n return new double[] {0.0, Math.PI / 2.0, 0.0};\n case REACH_WAY_BACK:\n return new double[] {0.0, Math.PI / 2.0, 0.0};\n case ARMS_03:\n return new double[] {0.0, Math.PI, 0.0};\n case REACH_FORWARD:\n return new double[] {0.0, 0.0, 0.0};\n case SMALL_CHICKEN_WINGS:\n return new double[] {0.0, Math.PI / 2.0, 0.0};\n case LARGE_CHICKEN_WINGS:\n return new double[] {0.0, Math.PI / 2.0, 0.0};\n case STRAIGHTEN_ELBOWS:\n return new double[] {0.0, 0.0, 0.0};\n case SUPPINATE_ARMS_IN_A_LITTLE:\n return new double[] {0.0, 0.0, 0.0};\n case ARMS_BACK:\n return new double[] {0.0, 0.0, 0.0};\n case LARGER_CHICKEN_WINGS:\n return new double[] {0.0, Math.PI / 2.0, 0.0};\n case ARMS_OUT_EXTENDED:\n return new double[] {0.0, 0.0, 0.0};\n case SUPPINATE_ARMS_IN_MORE:\n return new double[] {0.0, 0.0, 0.0};\n case SUPPINATE_ARMS_IN_A_LOT:\n return new double[] {0.0, 0.0, 0.0};\n case SUPER_CHICKEN_WINGS:\n return new double[] {0.0, Math.PI / 2.0, 0.0};\n case FLYING:\n return new double[] {0.0, Math.PI / 2.0, 0.0};\n case FLYING_PALMS_UP:\n return new double[] {0.0, 0.0, 0.0};\n case KARATE_KID_KRANE_KICK:\n return new double[] {0.0, 0.0, 0.0};\n case FLEX_UP:\n return new double[] {0.0, 0.0, 0.0};\n case FLEX_DOWN:\n return new double[] {0.0, 0.0, 0.0};\n case FLYING_SUPPINATE_IN:\n return new double[] {0.0, Math.PI / 2.0, 0.0};\n case FLYING_SUPPINATE_OUT:\n return new double[] {0.0, -Math.PI / 2.0, 0.0};\n case ARM_NINETY_ELBOW_DOWN:\n return new double[] {0.0, 0.0, 0.0};\n case ARM_NINETY_ELBOW_FORWARD:\n return new double[] {0.0, 0.0, 0.0};\n case ARM_NINETY_ELBOW_UP:\n return new double[] {0.0, 0.0, 0.0};\n case ARM_FORTFIVE_ELBOW_UP:\n return new double[] {0.0, 0.0, 0.0};\n case ARM_FORTFIVE_ELBOW_DOWN:\n return new double[] {0.0, 0.0, 0.0};\n case ARM_OUT_TRICEP_EXERCISE:\n return new double[] {0.0, 0.0, 0.0};\n case ARM_STRAIGHT_DOWN:\n return new double[] {0.0, Math.PI / 2.0, 0.0};\n\n default:\n return new double[] {0.0, 0.0, 0.0};\n }\n }", "int getLastVibrationFrequency();", "public void generateTone()\n throws LineUnavailableException {\n if ( clip!=null ) {\n clip.stop();\n clip.close();\n } else {\n clip = AudioSystem.getClip();\n }\n boolean addHarmonic = harmonic.isSelected();\n\n int intSR = ((Integer)sampleRate.getSelectedItem()).intValue();\n int intFPW = framesPerWavelength.getValue();\n\n float sampleRate = (float)intSR;\n\n // oddly, the sound does not loop well for less than\n // around 5 or so, wavelengths\n int wavelengths = 20;\n byte[] buf = new byte[2*intFPW*wavelengths];\n AudioFormat af = new AudioFormat(\n sampleRate,\n 8, // sample size in bits\n 2, // channels\n true, // signed\n false // bigendian\n );\n\n int maxVol = 127;\n for(int i=0; i<intFPW*wavelengths; i++){\n double angle = ((float)(i*2)/((float)intFPW))*(Math.PI);\n buf[i*2]=getByteValue(angle);\n if(addHarmonic) {\n buf[(i*2)+1]=getByteValue(2*angle);\n } else {\n buf[(i*2)+1] = buf[i*2];\n }\n }\n\n try {\n byte[] b = buf;\n AudioInputStream ais = new AudioInputStream(\n new ByteArrayInputStream(b),\n af,\n buf.length/2 );\n\n clip.open( ais );\n } catch(Exception e) {\n e.printStackTrace();\n }\n }", "public Note(Pitch pitch, int octave, int instrument) {\n if (octave < 0 || octave > 10) {\n throw new IllegalArgumentException(\"octave must be between 0 and 10 (inclusive)\");\n }\n\n this.pitch = pitch;\n this.octave = octave;\n this.instrument = instrument;\n }", "public void multiplyTheCorners(CubieCube multiplier) {\n\n char[] cornerPerms = new char[cornerValues.length];\n char[] cornerOrientation = new char[cornerValues.length];\n\n for (int i = 0; i < cornerValues.length; i++) {\n\n cornerPerms[i] = cp[multiplier.cp[i]];\n\n char oriA = co[multiplier.cp[i]];\n char oriB = multiplier.co[i];\n char oriResult = 0;\n\n // check if the cube are regular or mirrored\n // regular * regular = regular\n if (oriA < 3 && oriB < 3) {\n oriResult = (char) (oriA + oriB);\n if (oriResult >= 3)\n oriResult -= 3;\n }\n\n //regular * mirrored = mirrored\n else if (oriA < 3 && oriB >= 3) {\n oriResult = (char) (oriA + oriB); ;\n if (oriResult >= 6)\n oriResult -= 3;\n }\n\n // mirrored* regular = mirrored\n else if (oriA >= 3 && oriB < 3) {\n oriResult = (char) ((oriA - oriB) & 0xff);\n if (oriResult < 3) {\n oriResult += 3;\n }\n }\n\n //mirrored * mirrored = regular\n else if (oriA >= 3 && oriB >= 3) {\n oriResult = (char) ((oriA - oriB) & 0xff);\n if (oriResult < 0)\n oriResult += 3;\n }\n\n cornerOrientation[i] = oriResult;\n }\n\n this.cp = cornerPerms;\n this.co = cornerOrientation;\n }", "public Builder clearPitch() {\n bitField0_ = (bitField0_ & ~0x00000010);\n pitch_ = 0F;\n onChanged();\n return this;\n }", "public float getWavelength() {\n/* 52 */ return this.wavelength;\n/* */ }", "public void wave_3(int width,int height,int lenth)\r\n\t{\r\n\t\t\r\n\t\tfor(int i=1;i<=height;i++ )\r\n\t\t{\r\n\t\t\t\t\r\n\t\t\tcommon.printSpaceE(i, height);\r\n\t\t\t\r\n\t\t\tfor(int j=0;j<lenth;j++)\r\n\t\t\t{\t\t\t\t\r\n\t\t\t\tcommon.printCharWave(i,height,j);\r\n\t\t\t\tcommon.printSpaceC(i, height);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t}\t\t\r\n\t\t\r\n\t}", "public void addPitch(float pitch) {\n\t\tthis.pitch += pitch;\n\t\tAL10.alSourcef(id, AL10.AL_PITCH, this.pitch);\n\t}", "public void stopNote(int pitch) {\n\t\tsynthChannel.noteOff(pitch, 127);\n\t}", "public void setPitchShift(int pitchShift) {\r\n\r\n\t\t// Values are in half steps (semitones) in the \r\n\t\t// range -12..0..+12 corresponding to -/+ 1 octave for\r\n\t\t// a range of 2 octaves.\r\n\r\n\t\t// Determine which direction the sweep is going\r\n\t\tsweepUp = (pitchShift >= 0);\r\n\r\n\t\tsetIndices();\r\n\r\n\t\tdouble newStep = 1.0;\r\n\r\n\t\t// If pitch shift is 0 short circuit calculations\r\n\t\tif (pitchShift == 0)\r\n\t\t\tstep = 0;\r\n\r\n\t\telse\t{\r\n\t\t\t// Step is rate at which samples read out\r\n\t\t\tfor (int i=0; i < Math.abs(pitchShift); i++) {\r\n\t\t\t\tif (pitchShift > 0)\r\n\t\t\t\t\tnewStep *= twelvethRootOfTwo;\r\n\t\t\t\telse\r\n\t\t\t\t\tnewStep /= twelvethRootOfTwo;\r\n\t\t\t}\r\n\t\t\tstep = Math.abs(newStep - 1.0);\r\n\t\t}\r\n\t\t// Reset the following values whenever pitch shift value changes\r\n\t\tsweep = 0.0;\r\n\t\tcrossFadeCount = 0;\r\n\t\tactiveSampleCount = numberOfDelaySamples - \r\n\t\t\t(int)(numberOfCrossFadeSamples * (newStep - 1.0) - 2); \r\n\t}", "public float getAmplitude() {\n/* 70 */ return this.amplitude;\n/* */ }", "private int numberOfCritters(int wave){\n\t\treturn 9 + (wave%3)*6;\n\t}", "public float getInterpolatedPitch (float u) {\r\n\r\n float newPitch;\r\n \r\n // if linear interpolation\r\n if (this.linear == 1) {\r\n\r\n newPitch = keyFrame[1].pitch + \r\n ((keyFrame[2].pitch - keyFrame[1].pitch) * u);\r\n } else {\r\n\r\n newPitch = p0 + u * (p1 + u * (p2 + u * p3));\r\n\r\n }\r\n\r\n return newPitch;\r\n }", "public int getPitchOffset(boolean isMajor) {\n\t\tint pitchOffset;\n\t\tswitch (_degreeNumber) {\n\t\t\tcase 1:\n\t\t\t\tpitchOffset = 0;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tpitchOffset = 2;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tif (isMajor) {\n\t\t\t\t\tpitchOffset = 4;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tpitchOffset = 3;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tpitchOffset = 5;\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tpitchOffset = 7;\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\tif (isMajor) {\n\t\t\t\t\tpitchOffset = 9;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tpitchOffset = 8;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\tif (isMajor) {\n\t\t\t\t\tpitchOffset = 11;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tpitchOffset = 10;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new RuntimeException(\"Scale degree outside of 1-7\");\n\t\t}\n\t\tpitchOffset += _accidental.intValue();\n\t\t\n\t\treturn pitchOffset;\n\t}", "float compress(){\n float lower = mp.get(sequence.charAt(0)).lowRange;\n float upper = mp.get(sequence.charAt(0)).upperRange;\n for (int i = 1; i < sequence.length(); i++) {\n float newLower = lower + (upper - lower)*mp.get(sequence.charAt(i)).lowRange;\n float newUpper = lower + (upper - lower)*mp.get(sequence.charAt(i)).upperRange;\n lower = newLower;\n upper = newUpper;\n }\n ///picking value between final lower and upper\n float compressionCode = (float)(Math.floor(upper * 1000.0) / 1000.0);\n return compressionCode;\n }", "public void setPitch(int pitch) {\n mSelf.setPitch(pitch);\n }", "public int[] round_up(int[] array_of_notes) {\r\n int[] array_of_notes1 = array_of_notes.clone();\r\n for (int i = 0; i < array_of_notes1.length; i++) {\r\n if ((array_of_notes1[i] + 1) % 5 == 0)\r\n array_of_notes1[i] = array_of_notes1[i] + 1;\r\n else if ((array_of_notes1[i] + 2) % 5 == 0)\r\n array_of_notes1[i] = array_of_notes1[i] + 2;\r\n }\r\n return array_of_notes1;\r\n }", "private void adjustPitch(double tick) {\n\t\tif(pitch < targetPitch) {\n\t\t\taddPitch((float)tick * deltaPitch);\n\t\t\tif(pitch >= targetPitch)\n\t\t\t\tsetPitch(targetPitch);\n\t\t} else if(pitch > targetPitch) {\n\t\t\taddPitch((float)tick * deltaPitch);\n\t\t\tif(pitch <= targetPitch)\n\t\t\t\tsetPitch(targetPitch);\n\t\t}\n\t}", "@Override\n\tprotected float getSoundPitch() {\n\t\t// note: unused, managed in playSound()\n\t\treturn 1;\n\t}", "public float getPitchRange() {\n\treturn range;\n }", "public int getAudioJittcomp();", "public synchronized double getPitch() {\n\t\tif (isConnected) {\n\t\t\treturn gyro.getPitch();\n\t\t}\n\t\telse {\n\t\t\treturn 0;\n\t\t}\n\t}", "public void wave_1(int width,int height,int lenth)\r\n\t{\r\n\t\t\r\n\t\tfor(int i=1;i<=height;i++ )\r\n\t\t{\r\n\t\t\t\t\t\r\n\t\t\tcommon.printSpaceE(i, height);\r\n\t\t\t\r\n\t\t\tfor(int j=0;j<lenth;j++)\r\n\t\t\t{\t\t\t\t\r\n\t\t\t\tcommon.printChar(i, '/','\\\\');\r\n\t\t\t\tcommon.printSpaceC(i, height);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t/*\r\n\t\tfor(int i=0;i<height;i++)\r\n\t\t{\r\n\t\t\tfor(int s=0;s<height-i;s++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t}\r\n\t\t\tfor(int j=0;j<=i*2;j++)\r\n\t\t\t{\r\n\t\t\t\tif(j==0||j==i*2)\r\n\t\t\t\t System.out.print(\"*\");\r\n\t\t\t\telse\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t}*/\r\n\t}", "PieceOrientation(int value) {\n this.value = value;\n }", "private float hzToPeriod(float hz ) {\n\t\tint sampling = 44100;\n\t\treturn sampling / hz;\n\t}", "public double getCyclinderVolume();", "public void wave_2(int width,int height,int lenth)\r\n\t{\r\n\t\t\r\n\t\t\r\n\t\tfor(int i=1;i<=height;i++ )\r\n\t\t{\r\n\t\t\t\t\t\r\n\t\t\tcommon.printSpaceE(i, height);\r\n\t\t\t\r\n\t\t\tfor(int j=0;j<lenth;j++)\r\n\t\t\t{\t\t\t\t\r\n\t\t\t\tcommon.printNumWave(i,height,j);\r\n\t\t\t\tcommon.printSpaceC(i, height);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t}\t\t\r\n\t\t\r\n\t}", "private void four1(double data[], int nn, int isign) {\r\n int n,mmax,m,j,istep,i;\r\n double wtemp,wr,wpr,wpi,wi,theta;\r\n double tempr,tempi;\r\n double swap;\r\n\r\n n=2*nn;\r\n j=1;\r\n for (i=1;i<n;i+=2) {\r\n if (j > i) {\r\n swap=data[j];\r\n data[j]=data[i];\r\n data[i]=swap;\r\n\r\n swap=data[j+1];\r\n data[j+1]=data[i+1];\r\n data[i+1]=swap;\r\n }\r\n m=n >> 1;\r\n while (m >= 2 && j > m) {\r\n j -= m;\r\n m >>= 1;\r\n }\r\n j += m;\r\n }\r\n mmax=2;\r\n while (n > mmax) {\r\n istep=2*mmax;\r\n theta=isign*(6.28318530717959/mmax);\r\n wtemp=Math.sin(0.5*theta);\r\n wpr = -2.0*wtemp*wtemp;\r\n wpi=Math.sin(theta);\r\n wr=1.0;\r\n wi=0.0;\r\n for (m=1;m<mmax;m+=2) {\r\n for (i=m;i<=n;i+=istep) {\r\n j=i+mmax;\r\n tempr=wr*data[j]-wi*data[j+1];\r\n tempi=wr*data[j+1]+wi*data[j];\r\n data[j]=data[i]-tempr;\r\n data[j+1]=data[i+1]-tempi;\r\n data[i] += tempr;\r\n data[i+1] += tempi;\r\n }\r\n wr=(wtemp=wr)*wpr-wi*wpi+wr;\r\n wi=wi*wpr+wtemp*wpi+wi;\r\n }\r\n mmax=istep;\r\n }\r\n }", "static void SKP_Silk_encode_pulses(\n SKP_Silk_range_coder_state psRC, /* I/O Range coder state */\n final int sigtype, /* I Sigtype */\n final int QuantOffsetType,/* I QuantOffsetType */\n final byte q[], /* I quantization indices */\n final int frame_length /* I Frame length */\n )\n {\n int i, k, j, iter, bit, nLS, scale_down, RateLevelIndex = 0;\n int abs_q, minSumBits_Q6, sumBits_Q6;\n int[] abs_pulses = new int[ MAX_FRAME_LENGTH ];\n int[] sum_pulses = new int[ MAX_NB_SHELL_BLOCKS ];\n int[] nRshifts = new int[ MAX_NB_SHELL_BLOCKS ];\n int[] pulses_comb = new int[ 8 ];\n int []abs_pulses_ptr;\n int abs_pulses_ptr_offset;\n byte []pulses_ptr;\n int pulses_ptr_offset;\n final int [] cdf_ptr;\n short[] nBits_ptr;\n\n\n /****************************/\n /* Prepare for shell coding */\n /****************************/\n /* Calculate number of shell blocks */\n iter = frame_length / SHELL_CODEC_FRAME_LENGTH;\n\n /* Take the absolute value of the pulses */\n for( i = 0; i < frame_length; i+=4 ) {\n abs_pulses[i+0] = q[i+0] > 0 ? q[i+0] : (-q[i+0]);\n abs_pulses[i+1] = q[i+1] > 0 ? q[i+1] : (-q[i+1]);\n abs_pulses[i+2] = q[i+2] > 0 ? q[i+2] : (-q[i+2]);\n abs_pulses[i+3] = q[i+3] > 0 ? q[i+3] : (-q[i+3]);\n }\n\n /* Calc sum pulses per shell code frame */\n abs_pulses_ptr = abs_pulses;\n abs_pulses_ptr_offset = 0;\n for( i = 0; i < iter; i++ ) {\n nRshifts[ i ] = 0;\n\n while( true ) {\n /* 1+1 -> 2 */\n scale_down = combine_and_check( pulses_comb, abs_pulses_ptr, abs_pulses_ptr_offset,\n TablesPulsesPerBlock.SKP_Silk_max_pulses_table[ 0 ], 8 );\n\n /* 2+2 -> 4 */\n scale_down += combine_and_check( pulses_comb, pulses_comb, 0,\n TablesPulsesPerBlock.SKP_Silk_max_pulses_table[ 1 ], 4 );\n\n /* 4+4 -> 8 */\n scale_down += combine_and_check( pulses_comb, pulses_comb, 0,\n TablesPulsesPerBlock.SKP_Silk_max_pulses_table[ 2 ], 2 );\n\n /* 8+8 -> 16 */\n sum_pulses[ i ] = pulses_comb[ 0 ] + pulses_comb[ 1 ];\n if( sum_pulses[ i ] > TablesPulsesPerBlock.SKP_Silk_max_pulses_table[ 3 ] ) {\n scale_down++;\n }\n\n if( scale_down !=0 ) {\n /* We need to down scale the quantization signal */\n nRshifts[ i ]++;\n for( k = 0; k < SHELL_CODEC_FRAME_LENGTH; k++ ) {\n abs_pulses_ptr[ abs_pulses_ptr_offset + k ] = ( abs_pulses_ptr[ abs_pulses_ptr_offset + k ] >>1 );\n }\n } else {\n /* Jump out of while(1) loop and go to next shell coding frame */\n break;\n }\n }\n abs_pulses_ptr_offset += SHELL_CODEC_FRAME_LENGTH;\n }\n\n /**************/\n /* Rate level */\n /**************/\n /* find rate level that leads to fewest bits for coding of pulses per block info */\n minSumBits_Q6 = Integer.MAX_VALUE;\n for( k = 0; k < N_RATE_LEVELS - 1; k++ ) {\n nBits_ptr = TablesPulsesPerBlock.SKP_Silk_pulses_per_block_BITS_Q6[ k ];\n sumBits_Q6 = TablesPulsesPerBlock.SKP_Silk_rate_levels_BITS_Q6[sigtype][ k ];\n for( i = 0; i < iter; i++ ) {\n if( nRshifts[ i ] > 0 ) {\n sumBits_Q6 += nBits_ptr[ MAX_PULSES + 1 ];\n } else {\n sumBits_Q6 += nBits_ptr[ sum_pulses[ i ] ];\n }\n }\n if( sumBits_Q6 < minSumBits_Q6 ) {\n minSumBits_Q6 = sumBits_Q6;\n RateLevelIndex = k;\n }\n }\n RangeCoder.SKP_Silk_range_encoder( psRC, RateLevelIndex,\n TablesPulsesPerBlock.SKP_Silk_rate_levels_CDF[ sigtype ], 0);\n\n /***************************************************/\n /* Sum-Weighted-Pulses Encoding */\n /***************************************************/\n cdf_ptr = TablesPulsesPerBlock.SKP_Silk_pulses_per_block_CDF[ RateLevelIndex ];\n for( i = 0; i < iter; i++ ) {\n if( nRshifts[ i ] == 0 ) {\n RangeCoder.SKP_Silk_range_encoder( psRC, sum_pulses[ i ], cdf_ptr, 0);\n } else {\n RangeCoder.SKP_Silk_range_encoder( psRC, MAX_PULSES + 1, cdf_ptr, 0);\n for( k = 0; k < nRshifts[ i ] - 1; k++ ) {\n RangeCoder.SKP_Silk_range_encoder( psRC, MAX_PULSES + 1,\n TablesPulsesPerBlock.SKP_Silk_pulses_per_block_CDF[ N_RATE_LEVELS - 1 ], 0);\n }\n RangeCoder.SKP_Silk_range_encoder( psRC, sum_pulses[ i ],\n TablesPulsesPerBlock.SKP_Silk_pulses_per_block_CDF[ N_RATE_LEVELS - 1 ], 0);\n }\n }\n\n /******************/\n /* Shell Encoding */\n /******************/\n for( i = 0; i < iter; i++ ) {\n if( sum_pulses[ i ] > 0 ) {\n ShellCoder.SKP_Silk_shell_encoder( psRC, abs_pulses, i * SHELL_CODEC_FRAME_LENGTH);\n }\n }\n\n /****************/\n /* LSB Encoding */\n /****************/\n for( i = 0; i < iter; i++ ) {\n if( nRshifts[ i ] > 0 ) {\n pulses_ptr = q;\n pulses_ptr_offset = i * SHELL_CODEC_FRAME_LENGTH;\n nLS = nRshifts[ i ] - 1;\n for( k = 0; k < SHELL_CODEC_FRAME_LENGTH; k++ ) {\n abs_q = pulses_ptr[pulses_ptr_offset + k] > 0 ? pulses_ptr[pulses_ptr_offset + k]: (-pulses_ptr[pulses_ptr_offset + k]);\n for( j = nLS; j > 0; j-- ) {\n bit = ( abs_q >> j ) & 1;\n RangeCoder.SKP_Silk_range_encoder( psRC, bit, TablesOther.SKP_Silk_lsb_CDF, 0);\n }\n bit = abs_q & 1;\n RangeCoder.SKP_Silk_range_encoder( psRC, bit, TablesOther.SKP_Silk_lsb_CDF, 0);\n }\n }\n }\n\n /****************/\n /* Encode signs */\n /****************/\n CodeSigns.SKP_Silk_encode_signs( psRC, q, frame_length, sigtype, QuantOffsetType, RateLevelIndex );\n }", "@Override\n public void mutate(Song song, int noteIndex) {\n if (Math.random() < this.getProbability()) {\n if (noteIndex > 0) {\n MidiUtil mu = new MidiUtil();\n int nbrOfTotalReversing = nbrOfAdditionalReversing + 1\n + ((int) Math.random() * nbrRange);\n ArrayList<Integer> noteIndexes = new ArrayList<Integer>();\n ArrayList<Note> notes = new ArrayList<Note>();\n noteIndexes.add(noteIndex);\n notes.add(song.getScore().getPart(0).getPhrase(0)\n .getNote(noteIndex));\n int currentIndex = noteIndex - 1;\n noteIteration: for (int i = 1; i < nbrOfTotalReversing; i++) {\n while (mu.isBlank(currentIndex) && currentIndex >= 0) {\n currentIndex--;\n }\n if (currentIndex < 0) {\n break noteIteration;\n } else {\n noteIndexes.add(currentIndex);\n notes.add(song.getScore().getPart(0).getPhrase(0)\n .getNote(currentIndex));\n }\n }\n int totalReverses = noteIndexes.size();\n for (int j = 0; j < noteIndexes.size(); j++) {\n if (withRhythmLength) {\n song.getScore()\n .getPart(0)\n .getPhrase(0)\n .setNote(notes.get(totalReverses - 1 - j),\n noteIndexes.get(j));\n } else {\n int newPitch = notes.get(totalReverses - 1 - j)\n .getPitch();\n song.getScore().getPart(0).getPhrase(0)\n .getNote(noteIndexes.get(j)).setPitch(newPitch);\n }\n }\n }\n }\n }", "public static double semitonesToFrequencyScaler(double semitones) {\n return Math.pow(2.0, semitones / 12.0);\n }", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "@Override\n public void removeNote(int startTime, Pitch pitch, Octave octave) {\n List<Note> notes = this.notes.remove(startTime);\n\n if (notes == null) {\n throw new IllegalArgumentException(\"This beat does exist.\");\n }\n\n for (int i = 0; i < notes.size(); i++) {\n Note note = notes.get(i);\n\n if (note.sameValues(startTime, pitch, octave)) {\n notes.remove(i);\n this.notes.put(startTime, notes);\n } else {\n throw new IllegalArgumentException(\"Cant remove this note.\");\n }\n }\n\n }", "public static Integer getPitchClass(String inputNote)\r\n {\r\n //System.out.println(\"Inside getPitchClass inputNote: \" + inputNote);\r\n \r\n Integer pitchClassValue = -1;\r\n ArrayList<String> pitch0 = new ArrayList<>(Arrays.asList(\"C\",\"B#\",\"Dbb\"));\r\n ArrayList<String> pitch1 = new ArrayList<>(Arrays.asList(\"C#\",\"Db\",\"B##\"));\r\n ArrayList<String> pitch2 = new ArrayList<>(Arrays.asList(\"D\",\"C##\",\"Ebb\"));\r\n ArrayList<String> pitch3 = new ArrayList<>(Arrays.asList(\"D#\",\"Eb\",\"Fbb\"));\r\n ArrayList<String> pitch4 = new ArrayList<>(Arrays.asList(\"E\",\"D##\",\"Fb\"));\r\n ArrayList<String> pitch5 = new ArrayList<>(Arrays.asList(\"F\",\"E#\",\"Gbb\"));\r\n ArrayList<String> pitch6 = new ArrayList<>(Arrays.asList(\"F#\",\"Gb\",\"E#\"));\r\n ArrayList<String> pitch7 = new ArrayList<>(Arrays.asList(\"G\",\"F##\",\"Abb\"));\r\n ArrayList<String> pitch8 = new ArrayList<>(Arrays.asList(\"G#\",\"Ab\"));\r\n ArrayList<String> pitch9 = new ArrayList<>(Arrays.asList(\"A\",\"G##\",\"Bbb\"));\r\n ArrayList<String> pitch10 = new ArrayList<>(Arrays.asList(\"A#\",\"Bb\",\"Cbb\"));\r\n ArrayList<String> pitch11 = new ArrayList<>(Arrays.asList(\"B\",\"A##\",\"Cb\"));\r\n \r\n TreeMap<Integer, ArrayList<String>> pitchClassMap = new TreeMap<>();\r\n pitchClassMap.put(0, pitch0);\r\n pitchClassMap.put(1, pitch1);\r\n pitchClassMap.put(2, pitch2);\r\n pitchClassMap.put(3, pitch3);\r\n pitchClassMap.put(4, pitch4);\r\n pitchClassMap.put(5, pitch5);\r\n pitchClassMap.put(6, pitch6);\r\n pitchClassMap.put(7, pitch7);\r\n pitchClassMap.put(8, pitch8);\r\n pitchClassMap.put(9, pitch9);\r\n pitchClassMap.put(10, pitch10);\r\n pitchClassMap.put(11, pitch11);\r\n \r\n for(Integer index : pitchClassMap.keySet())\r\n {\r\n if(pitchClassMap.get(index).contains(inputNote))\r\n pitchClassValue = index;\r\n }\r\n //System.out.println(\"Inside getPitchClass pitchClassValue: \" + pitchClassValue);\r\n return pitchClassValue;\r\n }", "public void setPitch(float hertz) {\n\tthis.pitch = hertz;\n }", "private int critterLevel(int wave){\n\t\treturn wave/3 + 1;\n\t}", "public int getRotations();", "private void Scale()\n {\n Song scale = new Song();\n scale.add(new Note(noteA1,WHOLE_NOTE/2));\n scale.add(new Note(noteBB1,WHOLE_NOTE/2));\n scale.add(new Note(noteB1,WHOLE_NOTE/2));\n scale.add(new Note(noteC1,WHOLE_NOTE/2));\n scale.add(new Note(noteCS1,WHOLE_NOTE/2));\n scale.add(new Note(noteD1,WHOLE_NOTE/2));\n scale.add(new Note(noteDS1,WHOLE_NOTE/2));\n scale.add(new Note(noteE1,WHOLE_NOTE/2));\n scale.add(new Note(noteF1,WHOLE_NOTE/2));\n scale.add(new Note(noteFS1,WHOLE_NOTE/2));\n scale.add(new Note(noteG1,WHOLE_NOTE/2));\n scale.add(new Note(noteGS1,WHOLE_NOTE/2));\n\n\n playSong(scale);\n }", "private int melodyHelper(ArrayList<Integer> melody, int[] scale, int i) {\n int target = melody.get(i);\n int track = 0;\n while (target < 0) {\n target += scale.length - 1;\n track--; \n }\n while (target >= scale.length - 1) {\n target -= scale.length - 1;\n track++;\n }\n return scale[target] + track * 12;\n }", "public static int[] convertMedals(int value)\r\n {\n int[] output = new int[3];\r\n if (value > 0 && value < 1000000)\r\n {\r\n for (int x = 2; x >= 0; x--)\r\n {\r\n output[x] = value % 100;\r\n value = value / 100;\r\n }\r\n }\r\n return output;\r\n }", "private double noise(SpIterNoiseObs noise) {\n return 3.0 * 60.0;\n }", "public int /* sound_sample */output() {\n\t\treturn Vo;\n\t}", "public static double midiToFreq(int note) {\n return (Math.pow(2, ((note - 69) / 12.0))) * 440;\n }", "public void pitch(double angle) {\n heading = rotateVectorAroundAxis(heading, left, angle);\r\n up = rotateVectorAroundAxis(up, left, angle);\r\n\r\n }", "private List<String> allNotes() {\n List allNotes = new ArrayList();\n\n for (int i = 0; i < 10; i++) {\n Octave octave = getOctave(i);\n\n for (int x = 0; x < 12; x++) {\n Pitch pitch = getPitch(x);\n\n String note = pitch.getValue() + octave.getValue();\n allNotes.add(note);\n }\n }\n return allNotes;\n }" ]
[ "0.560087", "0.55399585", "0.5486663", "0.545882", "0.5409592", "0.5409592", "0.53425914", "0.528255", "0.51631045", "0.51382095", "0.51070964", "0.5084425", "0.50481987", "0.50403273", "0.5019637", "0.50010955", "0.49383444", "0.49063188", "0.48707622", "0.48657414", "0.4860012", "0.48570427", "0.48325205", "0.48094416", "0.4807139", "0.4807034", "0.48002654", "0.47814554", "0.47814554", "0.47799647", "0.4762646", "0.4751555", "0.47511566", "0.47197", "0.4689725", "0.46767068", "0.46752295", "0.46571112", "0.46320304", "0.46317187", "0.46317187", "0.4618461", "0.46103784", "0.4589565", "0.45834744", "0.45804742", "0.45438167", "0.45282423", "0.45228958", "0.4517049", "0.45072207", "0.4505094", "0.45007926", "0.4490883", "0.44883505", "0.44827273", "0.44761327", "0.4464077", "0.44606236", "0.44403726", "0.44335672", "0.4433278", "0.44312128", "0.44267675", "0.44067806", "0.44017765", "0.43848467", "0.4384466", "0.43717158", "0.43679395", "0.43444756", "0.4341845", "0.43413836", "0.43405393", "0.43205887", "0.4315959", "0.43048328", "0.42949906", "0.42886677", "0.42830434", "0.42801112", "0.4269262", "0.4268546", "0.42539972", "0.4253684", "0.42518035", "0.42389646", "0.42212814", "0.42161715", "0.42132536", "0.41962135", "0.41942096", "0.41926387", "0.41906303", "0.41847277", "0.41844434", "0.41827723", "0.41764224", "0.41733304", "0.41639015", "0.41547728" ]
0.0
-1
Removes all frequencies that are not in the specified band. The remaining band consists only of frequencies between minValueInHertz and maxValueInHertz (inclusive).
public static void bandwithFilter(List<Double> pitchValuesInHertz, double minValueInHertz, double maxValueInHertz) { Iterator<Double> it = pitchValuesInHertz.iterator(); while (it.hasNext()) { double value = it.next(); if (value < minValueInHertz || maxValueInHertz < value) { it.remove(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setFrequencyBand(List<Double> frequencyBand) {\n this.frequencyBand = frequencyBand;\n }", "public void unsetBand1H()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(BAND1H$4, 0);\n }\n }", "void unsetFractionalMinimum();", "public void unsetBand2H()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(BAND2H$6, 0);\n }\n }", "private void genericUnsubscribeFactory(String request, BandInfo band) {\n if (bandStreams.containsKey(band) && bandStreams.get(band).contains(request)) {\n if (bandStreams.get(band).size() == 1) {\n // Only stream open for this band, remove from bandStreams\n bandStreams.remove(band);\n } else {\n // Other streams open, remove from list\n bandStreams.get(band).remove(request);\n }\n\n // Remove stream from preferences\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());\n Set<String> streams = prefs.getStringSet(Preferences.getDeviceKey(band.getMacAddress()), new HashSet<String>());\n if (streams.contains(request)) {\n Log.v(TAG, \"Removing stream \" + request);\n streams.remove(request);\n Log.v(TAG, \"Streams after removing \" + request + \": \" + streams);\n prefs.edit().putStringSet(Preferences.getDeviceKey(band.getMacAddress()), streams).apply();\n }\n\n // Unsubscribe from the appropriate stream\n switch (request) {\n case ACCEL_REQ_EXTRA:\n if (accManager != null)\n accManager.unSubscribe(band);\n break;\n case ALT_REQ_EXTRA:\n if (altManager != null)\n altManager.unSubscribe(band);\n break;\n case AMBIENT_REQ_EXTRA:\n if (ambManager != null)\n ambManager.unSubscribe(band);\n break;\n case BAROMETER_REQ_EXTRA:\n if (barometerManager != null)\n barometerManager.unSubscribe(band);\n break;\n case CALORIES_REQ_EXTRA:\n if (calManager != null)\n calManager.unSubscribe(band);\n break;\n case CONTACT_REQ_EXTRA:\n if (conManager != null)\n conManager.unSubscribe(band);\n break;\n case DISTANCE_REQ_EXTRA:\n if (distManager != null)\n distManager.unSubscribe(band);\n break;\n case GSR_REQ_EXTRA:\n if (gsrManager != null)\n gsrManager.unSubscribe(band);\n break;\n case GYRO_REQ_EXTRA:\n if (gyroManager != null)\n gyroManager.unSubscribe(band);\n break;\n case HEART_RATE_REQ_EXTRA:\n if (heartManager != null)\n heartManager.unSubscribe(band);\n break;\n case PEDOMETER_REQ_EXTRA:\n if (pedoManager != null)\n pedoManager.unSubscribe(band);\n break;\n case SKIN_TEMP_REQ_EXTRA:\n if (skinTempManager != null)\n skinTempManager.unSubscribe(band);\n break;\n case UV_REQ_EXTRA:\n if (uvManager != null)\n uvManager.unSubscribe(band);\n break;\n default:\n Log.e(TAG, \"Unknown subscription requested \" + request);\n }\n } else {\n if (!bandStreams.containsKey(band)) {\n Log.e(TAG, \"Error: unsubscribe request for a band that isnt stored\");\n Log.v(TAG, \"Band: \" + band.toString());\n for (BandInfo info :\n bandStreams.keySet()) {\n Log.v(TAG, \"Key: \" + info.toString());\n }\n } else {\n if (!bandStreams.get(band).contains(request)) {\n Log.e(TAG, \"Error: unsubscribe request for unregistered request\");\n }\n }\n }\n }", "void setDeadband(double volts) {\r\n\t\tfor(AnalogInput m_analog : mAnalogs)\r\n\t\t{\r\n\t\t\tint deadband = (int)(volts * 1e9 / m_analog.getLSBWeight() * (1 << m_analog.getOversampleBits()));\r\n\t\t\tm_analog.setAccumulatorDeadband(deadband);\r\n\t\t}\r\n\t}", "public void setBand(Band band) {\n this.band = band;\n }", "public void unsetBand1V()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(BAND1V$8, 0);\n }\n }", "void unsetValueSampledData();", "public void removeShards(Bin shards) {\n for (String path : shards.getBinPaths()) {\n activeIndexes.remove(path);\n }\n //search all bins and remove.\n for (Integer i : radixBins.keySet()) {\n radixBins.get(i).removeAll(shards);\n }\n }", "public void setEnergyDensityBand(List<Double> energyDensityBand) {\n this.energyDensityBand = energyDensityBand;\n }", "public List<Double> getFrequencyBand() {\n return frequencyBand;\n }", "public Builder clearSampleRateHertz() {\n bitField0_ = (bitField0_ & ~0x00000002);\n sampleRateHertz_ = 0;\n onChanged();\n return this;\n }", "public void unsetBand2V()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(BAND2V$10, 0);\n }\n }", "@Override\n\tpublic void clear() {\n\t\t\n\t\tsuperset.removeRange(lower, upper, fromInclusive, toInclusive);\n\t\t\n\t\t//Alternative direct implementation:\n\t\t//while (pollFirst() != null) {\n\t\t//}\n\t\t\n\t}", "public void removeStorageQueue(StorageQueue storageQueue) {\n int queueIndex = storageQueueList.indexOf(storageQueue);\n\n if (queueIndex > -1) {\n for (Map<String, BitSet> constituentTable : constituentTables) {\n for (Map.Entry<String, BitSet> constituentRow : constituentTable.entrySet()) {\n // For every row create a new BitSet with the values for the removed storageQueue removed\n String constituent = constituentRow.getKey();\n BitSet bitSet = constituentRow.getValue();\n BitSet newBitSet = new BitSet();\n\n int bitIndex = 0;\n\n for (int i = 0; i < bitSet.size(); i++) {\n if (bitIndex == queueIndex) {\n // If the this is the index to remove then skip this round\n bitIndex++;\n }\n newBitSet.set(i, bitSet.get(bitIndex));\n bitIndex++;\n }\n\n constituentTable.put(constituent, newBitSet);\n\n }\n }\n\n // Remove the storageQueue from storageQueue list\n storageQueueList.remove(queueIndex);\n } else {\n log.warn(\"Storage queue for with name : \" + storageQueue.getName() + \" is not found to \" +\n \"remove\");\n }\n }", "private void checkBound(int lowerBound, int upperBound) {\n\t\tSet setKeys = Utility.vocabHM.keySet();\n\t\tIterator i = setKeys.iterator();\n\n\t\twhile (i.hasNext()) {\n\t\t\tString s = (String) i.next();\n\t\t\tInteger df = (Integer) Utility.vocabHM.get(s);\n\n\t\t\tif ((df.intValue() <= lowerBound) || (df.intValue() >= upperBound))\n\t\t\t\ti.remove();\n\t\t}\n\t}", "public void setCheckFactorBand(List<Double> checkFactorBand) {\n this.checkFactorBand = checkFactorBand;\n }", "@Override\r\n\tpublic void removeAll() {\r\n\t\tunregister();\r\n\t\taudioFile = null; // pas de Samples\r\n\t\tsection.setSection(0, 0);\r\n\t\tsel.setSelection(0, 0);\r\n\t\t// will issue repaint()\r\n\t\taudioDataChanged();\r\n\t\tnotifyAudioChangeListeners();\r\n\t}", "void unsetValuePeriod();", "public void removeData(double x, double y) {\n if (n > 0) {\n double dx = x - xbar;\n double dy = y - ybar;\n sumXX -= dx * dx * (double) n / (n - 1d);\n sumYY -= dy * dy * (double) n / (n - 1d);\n sumXY -= dx * dy * (double) n / (n - 1d);\n xbar -= dx / (n - 1.0);\n ybar -= dy / (n - 1.0);\n sumX -= x;\n sumY -= y;\n n--;\n\n if (n > 2) {\n distribution.setDegreesOfFreedom(n - 2);\n }\n }\n }", "public void intervalDelete(Double min, Double max) {\n\t\tcurrent = front;\n\t\tboolean DataFound = false;\n\t\tint TrueCounter = 0;\n\n\t\tif (isEmpty()) {\n\t\t\tSystem.out.println(\"The queue is empty.\");\n\t\t}\n\n\t\ttry {\n\t\t\twhile (isFull()) {\n\t\t\t\tif (current.data.getGDPperCapita() >= min && current.data.getGDPperCapita() <= max) {\n\t\t\t\t\tDataFound = true;\n\t\t\t\t\tif (DataFound == true) {\n\t\t\t\t\t\tTrueCounter++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (current == front) {\n\t\t\t\t\t\tremoveFront();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrent.previous.next = current.next;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (current == end) {\n\t\t\t\t\t\tremoveEnd();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrent.next.previous = current.previous;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcurrent = current.next;\n\t\t\t}\n\t\t} catch (NullPointerException e) {\n\t\t\t;\n\t\t}\n\n\t\tif (TrueCounter >= 1) {\n\t\t\tSystem.out.println(\"*****Values within the interval were found and deleted.*****\");\n\t\t\tSystem.out.println(\"\");\n\t\t} else {\n\t\t\tSystem.out.println(\"*****No values within the interval were found.*****\");\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "public void setBandwidthBand(List<Double> bandwidthBand) {\n this.bandwidthBand = bandwidthBand;\n }", "void unsetFractional();", "public void setGaussWeights(float peak, float low, int itmin, int itmax, int ntf) {\n float[] w = zerofloat(ntf);\n float center = (itmax+itmin)/2.0f;\n float width = (itmax-itmin)/2.0f;\n for (int i=0; i<ntf; ++i) {\n w[i] = peak*exp(-(i-center)*(i-center)/(2.0f*width*width))+low;\n }\n _w1D = w;\n _weights = true;\n }", "@Override\n public synchronized void render(DssContext dssContext, Graphics2D g2d, int width, int height) \n {\n audioChannels = dssContext.getAudioData();\n channelSamples = averageChannels(audioChannels);// channelSamples has length blockLength\n applyWindow(fftWindowLength, channelSamples); // fftWindowLength = blockLength\n binValues = computeFFT(channelSamples); // binValues has length fftWindowLength/2\n whitener.whiten ( binValues, meanValues, whiteBinValues); // binValues typically range from 0.0 dB to 96.0 dB\n whitener.pickPeaks ( whiteBinValues, peakBinValues);\n \n bandHeight = (float) height / (float) bandCount;\n \n // Rendering:\n float y = height;\n int widthm1 = width - 1;// width minus 1\n int binNum; // binNum = bin number\n int bandNum; // bandNum = band number\n int topBinNum; // topBinNum = bin number of top bin in band\n int bottomBinNum = 0; // bottomBinNum = bin number of bottom bin in band\n float binValue; // binValue = value of selected FFT bin\n float bandValue; // bandValue = value of selected band (the loudest bin in the band)\n \n // Group up available bands using band distribution table:\n for (bandNum = 0; bandNum < bandCount; bandNum++)\n {\n topBinNum = topBinNumArray[bandNum];\n float tempFloat = 0;\n \n // Find loudest bin in the band. (The band is from bins 'bottomBinNum' to 'topBinNum').\n for (binNum = bottomBinNum; binNum <= topBinNum; binNum++)\n { binValue = whiteBinValues[binNum]; // binValue = Value of bin number binNum\n if (binValue > tempFloat)\n { tempFloat = binValue;\n }\n }\n bottomBinNum = topBinNum;\n\n // Calculate gain using a static gain factor and slope.\n bandValue = tempFloat * ( gain + (slope * bandNum) );\n if (bandValue < 0.0F) { bandValue = 0.0F; } // Limit under-saturation.\n if (bandValue > 1.0F) { bandValue = 1.0F; } // Limit over-saturation.\n\n // Calculate spectrogram color shifting between foreground and background colors.\n float _bandValue = 1.0F - bandValue;\n backgroundColor.getColorComponents(brgb);\n foregroundColor.getColorComponents(frgb);\n Color color = new Color(frgb[0] * bandValue + brgb[0] * _bandValue,\n frgb[1] * bandValue + brgb[1] * _bandValue,\n frgb[2] * bandValue + brgb[2] * _bandValue);\n g2d.setColor(color);\n g2d.drawLine(widthm1, Math.round(y), widthm1, Math.round(y - bandHeight));\n\n // Optionally, draw the peaks spectrum:\n tempFloat = peakBinValues[binNum]; // peakBinValues are either 0.1 or 50.0\n if(tempFloat > 10.0F)\n { g2d.setColor(Color.red);\n g2d.drawLine(widthm1, Math.round(y), widthm1, Math.round(y - bandHeight));\n }\n \n y -= bandHeight;\n }\n\n g2d.drawImage(buffImage, -1, 0, null);\n \n }", "@Override\n\tpublic void process(TimeStamp startTime, TimeStamp endTime, float[] spectrum) {\n\t\tint numBins = maxBin - minBin;\n\t\t// 1. check to see if we need to create a new previousSpectrum cache\n\t\tif (lastBlockSize != spectrum.length) {\n\t\t\t// 2. calculate min and maxBin\n\t\t\tcalcMaxAndMinBin(spectrum.length);\n\n\t\t\t// 3. create a new spectrum cache of the appropriate size\n\t\t\tnumBins = maxBin - minBin;\n\t\t\tif (numBins > 0)\n\t\t\t\tpreviousSpectrum = new float[numBins];\n\n\t\t\tlastBlockSize = spectrum.length;\n\t\t}\n\n\t\tif (numBins > 0) {\n\t\t\tswitch (differenceType) {\n\t\t\tcase POSITIVERMS:\n\t\t\t\tfeatures = positiveRms(spectrum, minBin, previousSpectrum, 0,\n\t\t\t\t\t\tnumBins);\n\t\t\t\tbreak;\n\t\t\tcase RMS:\n\t\t\t\tfeatures = rms(spectrum, minBin, previousSpectrum, 0, numBins);\n\t\t\t\tbreak;\n\t\t\tcase POSITIVEMEANDIFFERENCE:\n\t\t\t\tfeatures = positiveMeanDifference(spectrum, minBin,\n\t\t\t\t\t\tpreviousSpectrum, 0, numBins);\n\t\t\t\tbreak;\n\t\t\tcase MEANDIFFERENCE:\n\t\t\t\tfeatures = meanDifference(spectrum, minBin, previousSpectrum,\n\t\t\t\t\t\t0, numBins);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// finally copy the current spectrum\n\t\t\tSystem.arraycopy(spectrum, minBin, previousSpectrum, 0, numBins);\n\t\t}\n\t\tforward(startTime, endTime);\n\t}", "public void setGaussWeights(float peak, float low, int itmin, int itmax, \n int ixmin, int ixmax, int ntf, int nx) {\n float[][] w = zerofloat(ntf,nx);\n float centert = (itmax+itmin)/2.0f;\n float centerx = (ixmax+ixmin)/2.0f;\n float widtht = (itmax-itmin)/2.0f;\n float widthx = (ixmax-ixmin)/2.0f;\n float x = 0.0f;\n float t = 0.0f;\n for (int ix=0; ix<nx; ++ix) {\n for (int it=0; it<ntf; ++it) {\n x = (ix-centerx)*(ix-centerx)/(2.0f*widthx*widthx); \n t = (it-centert)*(it-centert)/(2.0f*widtht*widtht); \n w[ix][it] = peak*exp(-(x+t))+low;\n }\n }\n _w2D = w;\n _weights = true;\n }", "static public float filter4 (double inumbr) {\n float number;\n int intermed;\n \n intermed = (int) (inumbr * 10000.);\n number = (float) (intermed / 10000. );\n return number;\n }", "private void deletePeak(double peak)\n {\n \tfor (int i = 0; i < peakList.size(); i++) {\n\t\t\tif(peakList.get(i).getMass() == peak)\n\t\t\t{\n\t\t\t\tpeakList.remove(i);\n\t\t\t\t//set new minimum weight\n\t\t\t\tthis.minWeight = Double.MAX_VALUE;\n\t\t\t\tsetMinWeight();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n }", "@Test\r\n public void lowerHigherDoNotContains() throws Exception {\r\n TreeSet<Integer> check = new TreeSet<>();\r\n check.addAll(sInt);\r\n check.remove(3);\r\n assertEquals(2, (int) check.lower(3));\r\n assertEquals(4, (int) check.higher(3));\r\n assertEquals(4, (int) check.ceiling(3));\r\n assertEquals(2, (int) check.floor(3));\r\n }", "void unsetWBMaximum();", "java.util.List<java.lang.Float> getNotInList();", "void removeMatching(MetricFilter filter);", "static public float filter9 (double inumbr) {\n float number;\n int intermed;\n \n intermed = (int) (inumbr * 1000000000.);\n number = (float) (intermed / 1000000000. );\n return number;\n }", "public synchronized void setBandCount(int count)\n { bandCount = count;\n }", "static public float filter1 (double inumbr) {\n float number;\n int intermed;\n \n intermed = (int) (inumbr * 10.);\n number = (float) (intermed / 10. );\n return number;\n }", "void clearPowertypeRanges();", "public List<Peak> filterNoise(List<Peak> peaks, double threshold, double experimentalPrecursorMzRatio);", "@Override\n public void adjustFilter(int key_min, int key_max) {\n //do nothing\n }", "boolean removePowertypeRange(Generalization powertypeRange);", "@Override\n\tpublic void removeAll() {\n\t\tif(isEmpty())\n\t\t\treturn;\n\t\t// Remove until the frontier is empty\n\t\twhile(!isEmpty())\n\t\t\tfrontier.removeFirst();\n\t}", "void removeAllEntries();", "@Override public void setMinMax(float minValue, float maxValue) {\n this.valueTrack.min = minValue; this.valueTrack.max = maxValue;\n }", "@Override\r\n\tpublic void removeRange(int first, int last) {\r\n\r\n try {\r\n super.removeRange(first, last);\r\n fireVOIremoved(null);\r\n } catch (ArrayIndexOutOfBoundsException badIndex) {\r\n throw badIndex;\r\n }\r\n }", "public void setDirectionBand(List<Double> directionBand) {\n this.directionBand = directionBand;\n }", "private void removeQueryBoundsFromGeometryRegistry(QueryRegion region)\r\n {\r\n myToolbox.getGeometryRegistry().removeGeometriesForSource(this, new HashSet<Geometry>(region.getGeometries()));\r\n }", "protected void clearRangeTest() {\n\tneedRangeTest = false;\n }", "public void performSuppression() {\n \n for (int row = 0; row < dataOutput.getNumRows(); row++) {\n if (privacyModelDefinesSubset == null || privacyModelDefinesSubset.contains(row)) {\n final int hash = dataOutput.hashCode(row);\n final int index = hash & (hashTableBuckets.length - 1);\n HashGroupifyEntry m = hashTableBuckets[index];\n while ((m != null) && ((m.hashcode != hash) || !dataOutput.equalsIgnoringOutliers(row, m.row))) {\n m = m.next;\n }\n if (m == null) {\n throw new RuntimeException(\"Invalid state! Group the data before suppressing records!\");\n }\n if (!m.isNotOutlier || this.isCompletelyGeneralized(m)) {\n dataOutput.or(row, Data.OUTLIER_MASK);\n m.isNotOutlier = false;\n }\n } else {\n dataOutput.or(row, Data.OUTLIER_MASK);\n }\n }\n }", "public void setA1Band(List<Double> a1Band) {\n this.a1Band = a1Band;\n }", "public void prune(double belowThreshold) {\n \n for(T first : getFirstDimension()) {\n \n for(T second : getMatches(first)) {\n \n if(get(first, second)<belowThreshold) {\n set(first, second, 0.0);\n }\n \n }\n \n }\n \n }", "public void removeFromZ(int z){\n\t\tcurrentSet().Z.remove(new Integer(z));\n\t\tcurrentSet().inZ[z] = false;\n\t}", "public void dropRamp() {\n if (currentSpeed == 0) {\n storage.dropRamp();\n }\n }", "public static HashMap<String, HashMap<Integer, Integer>> binHiggsData(HashMap<String, ArrayList<Double>> energyMap){\r\n\r\n\t\t//hashmap. Keys: detector name. Value: the hashmap above\r\n\t\tHashMap<String, HashMap<Integer, Integer>> bothDetectorsBinnedData = new HashMap<String, HashMap<Integer, Integer>>();\r\n\r\n\t\t//arraylist of the detector in the map so we can loop through all of them \r\n\t\tArrayList<String> detectorList = new ArrayList<String>();\r\n\t\tdetectorList.addAll(energyMap.keySet());\r\n\r\n\t\t//loop through all of the detectors (in this case, just GG and ZZ)\r\n\t\tfor (String detector : detectorList){\r\n\r\n\t\t\t//initialise values - this needs to be done in this for loop to reset for each detector\r\n\t\t\tint currentValueBin;\r\n\t\t\tint currentFreq;\t\r\n\t\t\tint newFreq;\r\n\t\t\tdouble currentValueBinD;\r\n\r\n\t\t\t//hashmap. Keys: each bin minimum. Value: number of readings in that bin\r\n\t\t\tHashMap<Integer, Integer> numberOfReadingsInEachBin = new HashMap<Integer, Integer>();\r\n\r\n\t\t\t//find the current list of data for this detector\r\n\t\t\tArrayList<Double> currentData = energyMap.get(detector);\r\n\r\n\t\t\tArrayList<Integer> flooredValues = new ArrayList<Integer>();\r\n\r\n\t\t\t//loop through all of the data in the set for this detector\r\n\t\t\tfor (double currentE : currentData){\r\n\r\n\t\t\t\t//round the value down, this is what the bin will be\r\n\t\t\t\tcurrentValueBinD = Math.floor(currentE);\r\n\t\t\t\tcurrentValueBin = (int) currentValueBinD;\r\n\r\n\t\t\t\tflooredValues.add(currentValueBin);\r\n\r\n\r\n\t\t\t\t//look for this value in the hashmap of bins and frequency\r\n\t\t\t\tInteger frequency = numberOfReadingsInEachBin.get(currentValueBin);\r\n\r\n\r\n\r\n\t\t\t\t//if this bin hasn't been put into the hashmap yet, put it in\r\n\t\t\t\tif (frequency == null){\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(currentValueBin, 1);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//if it has, add one to the frequency\r\n\t\t\t\telse{\r\n\t\t\t\t\tcurrentFreq = numberOfReadingsInEachBin.get(currentValueBin);\r\n\t\t\t\t\tnewFreq = currentFreq +1;\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(currentValueBin, newFreq);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//System.out.println(Collections.min(currentData));\r\n\r\n\t\t\t//if there have been frequencies of zero, they won't have been added, add them now\r\n\t\t\tfor (int i = Collections.min(flooredValues); i < Collections.max(flooredValues); i++){\r\n\t\t\t\tInteger currentReadings = numberOfReadingsInEachBin.get(i);\r\n\r\n\t\t\t\tif (currentReadings == null){\r\n\r\n\t\t\t\t\tnumberOfReadingsInEachBin.put(i, 0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//put the detector and the corresponding frequency data into the hashmap\r\n\t\t\tbothDetectorsBinnedData.put(detector, numberOfReadingsInEachBin);\r\n\r\n\t\t}\r\n\t\treturn bothDetectorsBinnedData;\r\n\t}", "@Override\n\t\t\tpublic IFuzzySet cut(double minValue) {\n\t\t\t\treturn null;\n\t\t\t}", "@Override\n\t\t\tpublic IFuzzySet cut(double minValue) {\n\t\t\t\treturn null;\n\t\t\t}", "public Double filter(Double value) throws NullValueException, EmptyListException, IncorrectSizeException;", "static public float filter5 (double inumbr) {\n float number;\n int intermed;\n \n intermed = (int) (inumbr * 100000.);\n number = (float) (intermed / 100000. );\n return number;\n }", "public com.dj.model.avro.LargeObjectAvro.Builder clearVar95() {\n var95 = null;\n fieldSetFlags()[96] = false;\n return this;\n }", "private void removeDigits(List<Integer> digits) {\n log.debug(\"method=removeDigitsStart, digits=\" + digits);\n digits.removeIf(s -> (s == 7));\n log.debug(\"method=removeDigitsEnd, digits=\" + digits);\n }", "public baconhep.TTau.Builder clearRawIso3Hits() {\n fieldSetFlags()[12] = false;\n return this;\n }", "public void narrowRange(int min, int max, Boolean axis) {\n\t\tint counter=0; // how much points we erasing total ?\n\t\tboolean erasingAll=false; // if we eventually erasing all the database\n\t\t// by axis X-----------------------------------------//\n\t\tif (axis){ \n\t\t\tthis.current = this.minx;\n\t\t\twhile (!erasingAll && this.current.getData().getX()<min){\n\t\t\t\tnarrowOppPoint(this.current,axis); // deleting this point in y axis\n\t\t\t\tthis.current = this.current.getNextX(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setPrevX(null);\n\t\t\tthis.minx = this.current; // the actual erasing\n\t\t\t//---//\n\t\t\tthis.current = this.maxx;\n\t\t\twhile (!erasingAll && this.current.getData().getX() > max){\n\t\t\t\tnarrowOppPoint(this.current,axis);\n\t\t\t\tthis.current = this.current.getPrevX(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setNextX(null);\n\t\t\tthis.maxx = this.current; //the actual erasing\n\t\t}\n\t\t// by axis Y -----------------------------------------------------------//\n\t\telse{ \n\t\t\tthis.current = this.miny;\n\t\t\twhile (!erasingAll && this.current.getData().getY()<min){\n\t\t\t\tnarrowOppPoint(this.current,axis);\n\t\t\t\tthis.current = this.current.getNextY(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setPrevY(null);\n\t\t\tthis.miny = this.current; //the actual erasing\n\t\t\t//--//\n\t\t\tthis.current = this.maxy;\n\t\t\twhile (!erasingAll && this.current.getData().getY() > max){\n\t\t\t\tnarrowOppPoint(this.current,axis);\n\t\t\t\tthis.current = this.current.getPrevY(); \n\t\t\t\tcounter++;\n\t\t\t\tif (this.current==null) //if we get to the edge of the DS\n\t\t\t\t\terasingAll=true;\n\t\t\t}\n\t\t\tif (!erasingAll)\n\t\t\t\tthis.current.setNextY(null);\n\t\t\tthis.maxy = this.current; //the actual erasing\n\t\t}\n\t\tthis.size = this.size - counter; // Update the size of the DS\n\t}", "void unsetSignalPeriod();", "public int[] getBarkUpperBoundaries(double sampleRate) throws IllegalArgumentException\n {\n int bark_upper[] = {100, 200, 300, 400, 510, 630, 770, 920, 1080, 1270, 1480, 1720, 2000, 2320, 2700, 3150, 3700, 4400, 5300, 6400, 7700, 9500, 12000, 15500}; // Hz\n int max = 0;\n int boundaries[];\n\n //check sampleRate\n if(sampleRate <= 0.0f)\n throw new IllegalArgumentException(\"the sample rate must be a positive value\");\n\n\n // ignore critical bands higher than the sampling frequnecy\n for (max = bark_upper.length-1; max >= 0 && bark_upper[max] > sampleRate/2; max--);\n\n //create new array of appropriate size\n boundaries = new int[max + 2];\n\n //copy upper boundaries\n for (int i = 0; i < boundaries.length; i++)\n boundaries[i] = bark_upper[i];\n\n return boundaries;\n }", "static public float filter3 (double inumbr) {\n float number;\n int intermed;\n \n intermed = (int) (inumbr * 1000.);\n number = (float) (intermed / 1000. );\n return number;\n }", "public void setB1Band(List<Double> b1Band) {\n this.b1Band = b1Band;\n }", "boolean unregister(HistogramInterface histogram);", "public CCNotchFilter(double freq, double bandWidth, double sampleRate) {\n\t\tsuper(freq, sampleRate);\n\t\tsetBandWidth(bandWidth);\n\t}", "@ApiModelProperty(value = \"The lower band value of the Keltner Channel calculation\")\n public Float getLowerBand() {\n return lowerBand;\n }", "public int removeTracks(int first, int last) {\n\t\tint numremoved = removeTracksInternal(first, last);\n\t\tif (numremoved > 0) {\n\t\t\tnotifyChange(EVENT_QUEUE_CHANGED);\n\t\t}\n\t\treturn numremoved;\n\t}", "@ApiModelProperty(value = \"The upper band value of the Keltner Channel calculation\")\n public Float getUpperBand() {\n return upperBand;\n }", "void unsetValueRatio();", "public void deconvolute(Spectrum spectrum){\n//\t\tTimer time = new Timer();\n\t\tif(spectrum == null)\n\t\t\treturn;\n\t\tmatcher.setResolution(spectrum.resolution);\n\t\t\n\t\tPeakSet unassigned = spectrum.copy();\n\t\t\n\t\tif(spectrum.scanMode == 0)\n\t\t\tapplyCache(spectrum, unassigned);\n\t\tdeisotope(spectrum, unassigned);\n\t\tdechargeDeisotoped(spectrum);\n\t\tdecharge(spectrum, unassigned);\n//\t\tSystem.out.println(\"Took \" + time.ms() + \" ms for an MS\" + (spectrum.scanMode + 1));\n\t}", "public static double[] filter(double[] b, double[] a, double[] signal){\n\t\treturn filter(b,a,signal,new double[a.length-1]);\n\t}", "public void rasterScanning(){\r\n ReadParameter embedPara = new ReadParameter();\r\n QuantisationEmbedding subband = new QuantisationEmbedding();\r\n int i,j,k,p;\r\n double[] coeffStream, modCoeffStream;\r\n //Modification in selected subband only\r\n if(embedPara.getSubbandChoice().compareTo(\"LF\") == 0){\r\n //Embed in low low subband only\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n coeffStream[k++] = subband.getSubbandLL()[i][j];\r\n }\r\n }\r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n // Write it back in proper order\r\n k = 0; // Reset k value\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n \r\n } else if(embedPara.getSubbandChoice().compareTo(\"HF\") == 0){\r\n //Embed in high frequency subband only\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length * 3];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n \r\n // Make it fir three high frequency subbands\r\n for(p=0; p<3; p++){\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n if(p==0){ //Get LH Subband values\r\n coeffStream[k++] = subband.getSubbandLH()[i][j];\r\n \r\n } else if(p==1){ //Get HL Subband values\r\n coeffStream[k++] = subband.getSubbandHL()[i][j];\r\n \r\n } else if(p==2){ //Get HH Subband values\r\n coeffStream[k++] = subband.getSubbandHH()[i][j];\r\n \r\n } // End of if-else condition \r\n } // End of inner loop\r\n } \r\n } // End of outer loop\r\n \r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n \r\n // Write it back in proper order\r\n k=0; // Reset k value\r\n //Write back LH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n \r\n \r\n } else if(embedPara.getSubbandChoice().compareTo(\"AF\") == 0){\r\n //Embed in all subbands\r\n //Initialise the coefficient stream to be modified\r\n coeffStream = new double[subband.getSubbandLL().length * subband.getSubbandLL()[0].length * 4];\r\n modCoeffStream = coeffStream; \r\n k=0;\r\n \r\n // Make it fir three high frequency subbands\r\n for(p=0; p<4; p++){\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n if(p==0){ //Get LL Subband values\r\n coeffStream[k++] = subband.getSubbandLL()[i][j];\r\n \r\n } else if(p==1){ //Get LH Subband values\r\n coeffStream[k++] = subband.getSubbandLH()[i][j];\r\n \r\n } else if(p==2){ //Get HL Subband values\r\n coeffStream[k++] = subband.getSubbandHL()[i][j];\r\n \r\n } else if(p==3){ //Get HH Subband values\r\n coeffStream[k++] = subband.getSubbandHH()[i][j];\r\n \r\n } // End of if-else condition \r\n } // End of inner loop\r\n } \r\n } // End of outer loop\r\n \r\n \r\n \r\n // Coeff modification\r\n modCoeffStream = subband.rasterEmbed(coeffStream);\r\n \r\n \r\n \r\n // Write it back in proper order\r\n k = 0; //Reset k value\r\n //Write back LL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back LH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandLH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HL Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHL()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n //Write back HH Subband\r\n for(i=0; i<subband.getSubbandLL().length; i++){\r\n for(j=0; j<subband.getSubbandLL()[0].length; j++){\r\n subband.getSubbandHH()[i][j] = modCoeffStream[k++];\r\n }\r\n }\r\n \r\n } // End subband choice if-else condition\r\n \r\n }", "private void removeSmallRoots(int threshold) {\n\t\tArrayList<Root> smallRoots = new ArrayList<Root>();\n\t\tfor (Root r: allRoots) {\n\t\t\tif (r.volume() < threshold) {\n\t\t\t\tsmallRoots.add(r);\n\t\t\t}\n\t\t}\n\t\tfor (Root r: smallRoots) {\n\t\t\tallRoots.remove(r);\n\t\t}\n\t}", "public static int[] getGeqBandFrequencies()\n {\n return akParam_gebf_;\n }", "private void DeleteBurnInsOnPreviousSamples() {\n\t\tif (gibbs_sample_num <= num_gibbs_burn_in + 1 && gibbs_sample_num >= 2){\n\t\t\tgibbs_samples_of_bart_trees[gibbs_sample_num - 2] = null;\n\t\t}\n\t}", "void unsetMaximum();", "@Test\n public void testHighPassFilter() {\n int freq1;\n int freq2;\n for (int i = 1; i < 10; i += 2) {\n freq1 = i * 100;\n freq2 = i * 200;\n SoundWave wave1 = new SoundWave(freq1, 0, 0.4, 0.1);\n SoundWave wave2 = new SoundWave(freq2, 2, 0.3, 0.1);\n SoundWave wave = wave1.add(wave2);\n\n double maxFreq = wave.highAmplitudeFreqComponent();\n assertEquals(freq1, maxFreq, 0.00001);\n\n wave = wave.highPassFilter(5, 6);\n\n maxFreq = wave.highAmplitudeFreqComponent();\n assertEquals(freq2, maxFreq, 0.00001);\n }\n }", "@Test\n\tpublic void missingBoundaryValuesAreFilledWithBadQualityValues() {\n\t\tfinal FloatTimeSeries t0 = new FloatTreeTimeSeries();\n\t\tt0.addValues(TimeSeriesUtils.createStepFunction(10, 10, 10, 10, 0)); // constant function = 10\n\t\tfinal FloatTimeSeries t1 = new FloatTreeTimeSeries();\n\t\tt1.addValues(TimeSeriesUtils.createStepFunction(5, 20, 25, 20, 0)); // constant function = 20\n\t\tt1.addValue(new SampledValue(new FloatValue(234F), 60, Quality.BAD));\n\t\tt0.setInterpolationMode(InterpolationMode.STEPS);\n\t\tt1.setInterpolationMode(InterpolationMode.STEPS);\n\t\tfinal ReadOnlyTimeSeries avg = MultiTimeSeriesUtils.getAverageTimeSeries(Arrays.<ReadOnlyTimeSeries> asList(t0, t1), 0L, 130);\n\t\tAssert.assertEquals(\"Time series sum has wrong number of data points\", 14, avg.size());\n\t\tAssert.assertEquals(InterpolationMode.STEPS, avg.getInterpolationMode());\n\t\t// now we calculate it again, this time demanding boundary markers\n\t\tfinal ReadOnlyTimeSeries avg2 = MultiTimeSeriesUtils.getAverageTimeSeries(Arrays.<ReadOnlyTimeSeries> asList(t0, t1), 0L, 130, true, null, true);\n\t\tAssert.assertEquals(\"Time series sum has wrong number of data points\", 15, avg2.size());\n\t\tAssert.assertEquals(Quality.BAD, avg2.getValue(0).getQuality());\n\t\tAssert.assertEquals(Quality.BAD, avg2.getValue(9).getQuality());\n\t\tAssert.assertEquals(Quality.GOOD, avg2.getValue(10).getQuality());\n\t\tAssert.assertEquals(Quality.GOOD, avg2.getValue(11).getQuality());\n\t\tAssert.assertEquals(Quality.GOOD, avg2.getValue(130).getQuality());\n\t}", "float getNotIn(int index);", "@Override\n public void unsubscribe(final Set<ValueSpecification> valueSpecifications) {\n LOGGER.debug(\"Unsubscribed from {}\", valueSpecifications);\n }", "public static double deadband(double input, double tolerance){\n\t\tif(Math.abs(input) < tolerance){\n\t\t\treturn 0;\n\t\t}\n\t\telse{\n\t\t\treturn input;\n\t\t}\t\n\t}", "void removeTrafficVolume(int i);", "public Builder clearFreq() {\n bitField0_ = (bitField0_ & ~0x00000008);\n freq_ = 0;\n onChanged();\n return this;\n }", "public void clear() {\n\t\tsample.clear();\n\t\tcount.set(0);\n\t\t_max.set(Long.MIN_VALUE);\n\t\t_min.set(Long.MAX_VALUE);\n\t\t_sum.set(0);\n\t\tvarianceM.set(-1);\n\t\tvarianceS.set(0);\n\t}", "public edu.pa.Rat.Builder clearFrequency() {\n fieldSetFlags()[1] = false;\n return this;\n }", "@Test\n public void testReset() throws Exception {\n assertEquals(300.0, maxFilter.filter(300.0), .01);\n assertEquals(2342342.213, maxFilter.filter(2342342.213), .01);\n assertEquals(840958239423.123213123, maxFilter.filter(840958239423.123213123), .01);\n assertEquals(840958239423.123213123, maxFilter.filter(0.000001232123), .01);\n maxFilter.reset(0.0);\n assertEquals(0.0, maxFilter.getMax(), 0.01);\n }", "protected synchronized void prune()\n {\n long ldtStart = Base.getSafeTimeMillis();\n int cCur = getUnits();\n int cMin = getLowUnits();\n if (cCur < cMin)\n {\n return;\n }\n\n int nType = getEvictionType();\n switch (nType)\n {\n default:\n case EVICTION_POLICY_HYBRID:\n {\n // sum the entries' units per priority\n int[] acUnits;\n while (true)\n {\n try\n {\n acUnits = new int[11];\n for (Iterator iter = entrySet().iterator(); iter.hasNext(); )\n {\n Entry entry = (Entry) iter.next();\n int cUnits = entry.getUnits();\n try\n {\n acUnits[entry.getPriority()] += cUnits;\n }\n catch (IndexOutOfBoundsException e)\n {\n acUnits[Math.max(0, Math.min(entry.getPriority(), 10))] += cUnits;\n }\n }\n break;\n }\n catch (ConcurrentModificationException e)\n {\n }\n }\n\n int cTotal = 0;\n int nPrunePriority = 0;\n while (nPrunePriority <= 10)\n {\n cTotal += acUnits[nPrunePriority];\n if (cTotal > cMin)\n {\n break;\n }\n ++nPrunePriority;\n }\n\n // build a list of entries to discard\n Entry entryDiscardHead = null;\n Entry entryDiscardTail = null;\n\n // determine the number at the cut-off priority that must be pruned\n int cAdditional = Math.max(0, cTotal - cMin);\n\n while (cCur > cMin)\n {\n try\n {\n for (Iterator iter = entrySet().iterator(); iter.hasNext() && cCur > cMin; )\n {\n Entry entry = (Entry) iter.next();\n int nPriority = entry.getPriority();\n if (nPriority >= nPrunePriority)\n {\n int cUnits = entry.getUnits();\n if (nPriority == nPrunePriority)\n {\n if (cAdditional <= 0)\n {\n continue;\n }\n cAdditional -= cUnits;\n }\n cCur -= cUnits;\n\n // remove the entry from the map\n super.removeEntryInternal(entry);\n\n // link the entry into the list of deferred\n // removals, but without changing its \"next\"\n // reference because the iterator that we are\n // using here is counting on that \"next\" ref\n if (entryDiscardHead == null)\n {\n entryDiscardHead = entry;\n }\n else\n {\n entryDiscardTail.setNext(entry);\n }\n entryDiscardTail = entry;\n }\n }\n\n // seal the end of the linked list of entries to discard\n if (entryDiscardTail != null)\n {\n entryDiscardTail.setNext(null);\n }\n break;\n }\n catch (ConcurrentModificationException e)\n {\n }\n }\n\n // process the list of deferred removals\n for (Entry entryDiscard = entryDiscardHead; entryDiscard != null; )\n {\n // unlink it altogether\n Entry entryNext = entryDiscard.getNext();\n entryDiscard.setNext(null);\n\n // discard it\n removeExpired(entryDiscard, false);\n\n entryDiscard = entryNext;\n }\n }\n break;\n\n case EVICTION_POLICY_LRU:\n case EVICTION_POLICY_LFU:\n {\n boolean fLRU = (nType == EVICTION_POLICY_LRU);\n SparseArray array;\n while (true)\n {\n try\n {\n array = new SparseArray();\n for (Iterator iter = entrySet().iterator(); iter.hasNext(); )\n {\n Entry entry = (Entry) iter.next();\n long lOrder = fLRU ? entry.getLastTouchMillis()\n : entry.getTouchCount();\n Object oPrev = array.set(lOrder, entry);\n if (oPrev != null)\n {\n // oops, more than one entry with the same order;\n // make a list of entries\n List list;\n if (oPrev instanceof List)\n {\n list = (List) oPrev;\n }\n else\n {\n list = new ArrayList();\n list.add((Entry) oPrev);\n }\n list.add(entry);\n array.set(lOrder, list);\n }\n }\n break;\n }\n catch (ConcurrentModificationException e)\n {\n }\n }\n\n for (Iterator iter = array.iterator();\n getUnits() > cMin && iter.hasNext(); )\n {\n Object o = iter.next();\n if (o instanceof Entry)\n {\n Entry entry = (Entry) o;\n removeExpired(entry, true);\n }\n else\n {\n List list = (List) o;\n for (Iterator iterList = list.iterator();\n getUnits() > cMin && iterList.hasNext(); )\n {\n Entry entry = (Entry) iterList.next();\n removeExpired(entry, true);\n }\n }\n }\n }\n break;\n\n case EVICTION_POLICY_EXTERNAL:\n getEvictionPolicy().requestEviction(cMin);\n break;\n }\n m_stats.registerCachePrune(ldtStart);\n }", "public synchronized void setLowUnits(int cUnits)\n {\n if (cUnits < 0)\n {\n throw new IllegalArgumentException(\"low units out of bounds\");\n }\n\n if (cUnits >= m_cMaxUnits)\n {\n cUnits = (int) (m_dflPruneLevel * m_cMaxUnits);\n }\n\n m_cPruneUnits = cUnits;\n }", "public int nUnfilteredSamples() {\n return Math.max(0, nHeaderFields - sampleOffset);\n }", "@Test\n public void testGetFrequencyRange_invalidFrequencyMappingReturnsEmptyRange() {\n assertEquals(Range.create(0f, 0f), new VibratorInfo.Builder(\n TEST_VIBRATOR_ID).build().getFrequencyRange());\n assertEquals(Range.create(0f, 0f), new VibratorInfo.Builder(TEST_VIBRATOR_ID)\n .setFrequencyMapping(new VibratorInfo.FrequencyMapping(\n Float.NaN, 150, 25, 50, TEST_AMPLITUDE_MAP))\n .build().getFrequencyRange());\n assertEquals(Range.create(0f, 0f), new VibratorInfo.Builder(TEST_VIBRATOR_ID)\n .setFrequencyMapping(new VibratorInfo.FrequencyMapping(\n 50, Float.NaN, 25, 50, TEST_AMPLITUDE_MAP))\n .build().getFrequencyRange());\n assertEquals(Range.create(0f, 0f), new VibratorInfo.Builder(TEST_VIBRATOR_ID)\n .setFrequencyMapping(new VibratorInfo.FrequencyMapping(\n 50, 150, Float.NaN, 50, TEST_AMPLITUDE_MAP))\n .build().getFrequencyRange());\n assertEquals(Range.create(0f, 0f), new VibratorInfo.Builder(TEST_VIBRATOR_ID)\n .setFrequencyMapping(new VibratorInfo.FrequencyMapping(\n 50, 150, 25, Float.NaN, TEST_AMPLITUDE_MAP))\n .build().getFrequencyRange());\n assertEquals(Range.create(0f, 0f), new VibratorInfo.Builder(TEST_VIBRATOR_ID)\n .setFrequencyMapping(new VibratorInfo.FrequencyMapping(50, 150, 25, 50, null))\n .build().getFrequencyRange());\n // Invalid, minFrequency > resonantFrequency\n assertEquals(Range.create(0f, 0f), new VibratorInfo.Builder(TEST_VIBRATOR_ID)\n .setFrequencyMapping(new VibratorInfo.FrequencyMapping(\n /* minFrequencyHz= */ 250, /* resonantFrequency= */ 150, 25, 50, null))\n .build().getFrequencyRange());\n // Invalid, maxFrequency < resonantFrequency by changing resolution.\n assertEquals(Range.create(0f, 0f), new VibratorInfo.Builder(TEST_VIBRATOR_ID)\n .setFrequencyMapping(new VibratorInfo.FrequencyMapping(\n 50, 150, /* frequencyResolutionHz= */10, 50, null))\n .build().getFrequencyRange());\n }", "public void setBand(String value) {\n _avTable.set(ATTR_BAND, value);\n }", "public void clearAllFields(){\n\t\tclearFilter(eleGradePanelUc);\n\t\tclearFilter(middleGradePanelUc);\n\t\tclearFilter(highrGradePanelUc);\n\t\tclearFilter(subjectPanelUc);\n\t}", "public static void correctForZeroInitialEstimate( double[] array, int upperlim ) {\r\n int intzero = findZeroCrossing(array, upperlim, 0);\r\n if (intzero > 1) {\r\n double[] arrset = Arrays.copyOfRange( array, 1, intzero );\r\n ArrayStats arrsub = new ArrayStats( arrset );\r\n removeValue(array, arrsub.getMean());\r\n }\r\n }", "public static void main(String[] args) {\n\t\tHashSet<Double> hash = new HashSet<>();\n\t\thash.add(1.5);\n\t\thash.add(8.25);\n\t\thash.add(-7.32);\n\t\thash.add(13.3);\n\t\thash.add(-12.45);\n\t\thash.add(48.5);\n\t\thash.add(0.01);\n\t\tdouble max = 0;\n\t\tdouble min = 0;\n\t\t\n\t\tfor (Double double1 : hash) {\n\t\t\tSystem.out.println(double1);\n\t\t\tif (double1 > max) {\n\t\t\t\tmax = double1;\n\t\t\t}\n\t\t\tif (double1 < min) {\n\t\t\t\tmin = double1;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Max : \" + max);\n\t\tSystem.out.println(\"Min : \" + min);\n\t\thash.remove(min);\n\t\tfor (Double double1 : hash)\n\t\t\tSystem.out.println(double1);\n\t}", "void unsetValueQuantity();", "public int[] filterByPlateauSize(double lower_threshold, double upper_threshold) {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n for (int i=0; i<this.plateau_size.length; i++) {\n if (this.plateau_size[i] >= lower_threshold && this.plateau_size[i] <= upper_threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }", "public void setA2Band(List<Double> a2Band) {\n this.a2Band = a2Band;\n }" ]
[ "0.5646694", "0.5011526", "0.4963575", "0.48992446", "0.489178", "0.47980586", "0.4769619", "0.4751913", "0.47391868", "0.46687764", "0.4657233", "0.45633757", "0.45397237", "0.45370615", "0.45340565", "0.45197046", "0.4511416", "0.44735307", "0.43722746", "0.4344948", "0.4340819", "0.43361983", "0.43336976", "0.43219107", "0.43175694", "0.431417", "0.43052474", "0.43006787", "0.4296622", "0.42902434", "0.4273693", "0.42352664", "0.42153925", "0.42016384", "0.41962725", "0.41749585", "0.41742072", "0.41676658", "0.41664958", "0.41658235", "0.41629684", "0.41543034", "0.4153726", "0.41499963", "0.41467294", "0.41391757", "0.41390678", "0.41313484", "0.4129734", "0.4128795", "0.41235566", "0.41205773", "0.41166645", "0.41159716", "0.4109859", "0.4109859", "0.41063255", "0.41060752", "0.40971604", "0.40779856", "0.40776414", "0.40631032", "0.40552753", "0.40543586", "0.40521857", "0.4044212", "0.40439186", "0.40417168", "0.4041635", "0.4038817", "0.40311268", "0.4028319", "0.4022784", "0.4019434", "0.4016832", "0.40136883", "0.39913377", "0.39676252", "0.3962688", "0.39603984", "0.39562833", "0.39531386", "0.39527485", "0.39526135", "0.39525545", "0.3933623", "0.39331818", "0.3929172", "0.39275917", "0.3924523", "0.39208725", "0.39198953", "0.3916754", "0.39151755", "0.3911819", "0.3906315", "0.3901015", "0.39007473", "0.38935494", "0.38921958" ]
0.7322675
0
Calculates the median for a list of doubles. The list is sorted inplace.
public static Double median(List<Double> list) { if (list == null || list.size() == 0) { throw new Error("Mean of an empty list is undefined"); } int size = list.size(); Collections.sort(list); double median = 0.0; if (size % 2 == 0) { median = (list.get(size / 2) + list.get((size / 2) - 1)) / 2.0; } else { median = list.get(size / 2); } return median; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Double getMedian(List<Double> sortedDouble) {\n Double median;\n if (sortedDouble.size() % 2 != 0) {\n median = sortedDouble.get(sortedDouble.size() / 2);\n } else {\n median = (sortedDouble.get((sortedDouble.size() - 1) / 2) + sortedDouble.get((sortedDouble.size() / 2)));\n }\n return median;\n }", "public double findMedian() {\n int size=list.size();\n if(size % 2 ==1) return list.get(size/2);\n else{\n return ((double)list.get(size/2)+(double)list.get(size/2-1))/2;\n }\n }", "double median(double[] a){\n int length = a.length;\n double temp;\n\n //sort array\n for( int i = 0; i < length; i++){\n for (int j = i+1; j < length; j++){\n if (a[j] < a[i]) {\n temp = a[i];\n a[i] = a[j];\n a[j] = temp;\n }\n }\n }\n double median = (a[length/2] + a[(length/2)+1])/2;\n return median;\n }", "public static double median(double[] arr) {\n if (arr == null) return Double.NaN;\n int l = arr.length;\n if (l == 0) return Double.NaN;\n Arrays.sort(arr);\n return arr[(int)Math.floor(l/2.0)] / 2 + arr[(int)Math.ceil(l/2.0)] / 2;\n }", "public static <T extends Number & Comparable> double computeMedian(ArrayList<T> nData) {\r\n if (nData.isEmpty()) // check data is empty or not\r\n throw new IllegalArgumentException(\"Size of array must be greater than 0\"); // throw exception if data is empty\r\n\r\n Collections.sort(nData); // sort ndata in ascending order.\r\n\r\n double median = nData.get(nData.size() / 2).doubleValue(); // declare median varibale and store median value of nData list\r\n if (nData.size() % 2 == 0) // check nData size even or not\r\n median = (nData.get(nData.size() / 2).doubleValue() + nData.get(nData.size() / 2 - 1).doubleValue()) / 2; // if condition is true than median value is update according expression\r\n\r\n return median; //return double type median value of ndata list\r\n }", "public static double median(double[] values)\n {\n int size = values.length;\n if (size < 1)\n return Double.NaN;\n double validationresult = validate(values);\n if (!Double.isFinite(validationresult))\n return validationresult;\n \n int middle = size / 2;\n if (size % 2 == 1)\n return values[middle];\n else\n return (values[middle - 1] + values[middle])/2;\n }", "private static double median(double[] m) {\n\t\tint middle = m.length/2; // subscript of middle element\n\t\tif (m.length%2 == 1) {\n\t\t\t// Odd number of elements -- return the middle one.\n\t\t\treturn m[middle];\n\t\t} else {\n\t\t\t// Even number -- return average of middle two\n\t\t\t// Must cast the numbers to double before dividing.\n\t\t\treturn (m[middle-1] + m[middle]) / 2.0;\n\t\t}\n\t}", "public static double median(double[] a) {\n\t\tArrays.sort(a);\n\t\tif (a.length%2==1)\n\t\t\treturn a[a.length/2];\n\t\telse\n\t\t\treturn (a[a.length/2-1]+a[a.length/2])/2.0;\n\t}", "public T median();", "public static double getMedian(double[] data) {\n Objects.requireNonNull(data, \"The supplied array was null\");\n Arrays.sort(data);\n int size = data.length;\n double median = -1;\n if (size % 2 == 0) {//even\n int firstIndex = (size / 2) - 1;\n int secondIndex = firstIndex + 1;\n double firstValue = data[firstIndex];\n double secondValue = data[secondIndex];\n median = (firstValue + secondValue) / 2.0;\n } else {//odd\n int index = (int) Math.ceil(size / 2.0);\n median = data[index];\n }\n return median;\n }", "private static int getMedian(ArrayList<Integer> inList) \n\t{\n\t\tCollections.sort(inList);\n\t\tint median = 0;\n\t\t\n\t\tif (inList.size()%2 == 0)\n\t\t{\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint position = inList.size()/2;\n\t\t\tmedian = inList.get(position);\n\t\t}\n\t\t\n\t\treturn median; \n\t\t\n\t\t\n\t}", "public static Double calculateMedian(Double[] arr)\n {\n\n // Sort our array\n Double[] sortedArr = arr;// bubbleSort(arr);\n\n double median = 0;\n\n // If our array's length is even, then we need to find the average of the two centered values\n if (arr.length % 2 == 0)\n {\n int indexA = (arr.length - 1) / 2;\n int indexB = arr.length / 2;\n\n median = (sortedArr[indexA] + sortedArr[indexB]) / 2;\n }\n // Else if our array's length is odd, then we simply find the value at the center index\n else\n {\n int index = (sortedArr.length - 1) / 2;\n median = sortedArr[ index ];\n }\n\n // Print the values of the sorted array\n// for (double v : sortedArr)\n// {\n// System.out.println(v);\n// }\n\n return median;\n }", "public static double getMedian()\n {\n // add your code here\n if(s.size()==g.size()){\n return (double) ((s.peek()+g.peek())/2);\n }\n else if(s.size() > g.size()) {\n return (double) s.peek();\n }\n else {\n return (double) g.peek();\n }\n }", "@Override\r\n protected double getMedianDouble() {\r\n Grids_GridDouble g = getGrid();\r\n int scale = 20;\r\n double median = g.getNoDataValue(false);\r\n long n = getN();\r\n BigInteger nBI = BigInteger.valueOf(n);\r\n if (n > 0) {\r\n double[] array = toArrayNotIncludingNoDataValues();\r\n sort1(array, 0, array.length);\r\n BigInteger[] nDivideAndRemainder2 = nBI.divideAndRemainder(\r\n new BigInteger(\"2\"));\r\n if (nDivideAndRemainder2[1].compareTo(BigInteger.ZERO) == 0) {\r\n int index = nDivideAndRemainder2[0].intValue();\r\n //median = array[ index ];\r\n //median += array[ index - 1 ];\r\n //median /= 2.0d;\r\n //return median;\r\n BigDecimal medianBigDecimal = new BigDecimal(array[index - 1]);\r\n return (medianBigDecimal.add(new BigDecimal(array[index]))).\r\n divide(new BigDecimal(2.0d), scale, BigDecimal.ROUND_HALF_DOWN).doubleValue();\r\n //return ( medianBigDecimal.add( new BigDecimal( array[ index ] ) ) ).divide( new BigDecimal( 2.0d ), scale, BigDecimal.ROUND_HALF_EVEN ).doubleValue();\r\n } else {\r\n int index = nDivideAndRemainder2[0].intValue();\r\n return array[index];\r\n }\r\n } else {\r\n return median;\r\n }\r\n }", "public double findMedian(ArrayList<double[]> partition, int dim){\n\t\t\n\t\t// temporary hash set to store the different values in\n\t\tArrayList<Double> sortedValues = new ArrayList<Double>();\n\t\t\n\t\tfor(int i = 0; i < partition.size(); i++){\n\t\t\tsortedValues.add(partition.get(i)[dim]);\n\t\t}\n\t\t\n\t\t// sort the values in an ascending order\n\t\tCollections.sort(sortedValues);\n\t\t\n\t\t// calculate the median using the sorted array and under consideration \n\t\t// of the difference between uneven and even amount of numbers\n\t\tif(sortedValues.size() % 2 == 1){\n\t\t\treturn sortedValues.get(sortedValues.size() / 2);\n\t\t}else{\n\t\t\t// Calculating median if the number of values is even \n\t\t\treturn (sortedValues.get(sortedValues.size() / 2)\n\t\t\t+sortedValues.get((sortedValues.size() - 1) / 2)) / 2;\n\t\t}\n\t}", "static double[] runningMedian(int[] a) {\r\n int n = a.length;\r\n\r\n double[] medianArr = new double[n];\r\n int i = 0;\r\n\r\n // max-heap\r\n PriorityQueue<Integer> max = new PriorityQueue<Integer>(Collections.reverseOrder());\r\n \r\n // min-heap\r\n PriorityQueue<Integer> min = new PriorityQueue<Integer>();\r\n\r\n double median = 0.0;\r\n\r\n for(int j=0; j<n; j++) {\r\n int x = a[j];\r\n if(min.size() == max.size()) {\r\n if(x < median) {\r\n max.add(x);\r\n median = (double)max.peek();\r\n medianArr[i] = median;\r\n i += 1;\r\n } else {\r\n min.add(x);\r\n median = (double)min.peek();\r\n medianArr[i] = median;\r\n i += 1;\r\n }\r\n } else if (max.size() > min.size()) {\r\n if(x < median) {\r\n min.add(max.remove());\r\n max.add(x);\r\n } else {\r\n min.add(x);\r\n }\r\n median = (double)(max.peek() + min.peek())/2;\r\n medianArr[i] = median;\r\n i += 1;\r\n } else {\r\n if(x > median) {\r\n max.add(min.remove());\r\n min.add(x);\r\n } else {\r\n max.add(x);\r\n }\r\n median = (double)(max.peek() + min.peek())/2;\r\n medianArr[i] = median;\r\n i += 1;\r\n }\r\n }\r\n\r\n return medianArr;\r\n }", "public Set<String> median(List<Set<String>> inputData) {\n if (inputData == null || inputData.size() == 0) {\n return null; // Cannot do anything\n }\n Collections.sort(inputData, new Comparator<Set<String>>() {\n public int compare(Set<String> set1, Set<String> set2) {\n int size1 = set1.size();\n int size2 = set2.size();\n return size1 - size2;\n }\n });\n // Take the median\n int size = inputData.size();\n int index = size / 2;\n return inputData.get(index);\n }", "static double[] runningMedian(int[] a) {\n\n double[] doubles = new double[a.length];\n ArrayList<Integer> integers = new ArrayList<>();\n\n //Fila de prioridade\n PriorityQueue<Integer> maxHeap = new PriorityQueue<>(Collections.reverseOrder());\n PriorityQueue<Integer> minHeap = new PriorityQueue<>();\n\n double median = 0;\n\n for (int i = 0; i < a.length; i++) {\n if (a[i] <= median) {\n maxHeap.add(a[i]);\n } else {\n minHeap.add(a[i]);\n }\n\n if (minHeap.size() > maxHeap.size()+1) {\n maxHeap.add(minHeap.peek());\n minHeap.remove();\n }\n if (maxHeap.size() > minHeap.size()+1) {\n minHeap.add(maxHeap.peek());\n maxHeap.remove();\n }\n\n if (minHeap.size() == maxHeap.size()) {\n median = (maxHeap.peek() + minHeap.peek())/2.0;\n } else if(minHeap.size() > maxHeap.size()) {\n median = (double) minHeap.peek();\n } else if (minHeap.size() < maxHeap.size()) {\n median = (double) maxHeap.peek();\n }\n doubles[i] = median;\n }\n\n return doubles;\n }", "private float calculateMedian()\n {\n int numberEmployees = employees.size();\n int position = 0; //kindex of where median is located\n float median = 0;\n \n // Create an array of all gross pays\n float[] allGrossPay = new float[numberEmployees];\n allGrossPay = calculateAllGrossPay();\n \n //Sort the array\n Arrays.sort(allGrossPay);\n // For even number of entries median is the mean of the two middle points\n if (numberEmployees % 2 == 0) \n {\n median = (allGrossPay[numberEmployees/2] + \n allGrossPay[numberEmployees/2 - 1])/2;\n }\n else\n {\n median = allGrossPay[numberEmployees/2];\n } \n return median;\n }", "private void calcMedian(SimpleProtein.ProtChain chain) {\n\t\tList<List<Double>> falseValuesList = new LinkedList<>();\n\t\tList<List<Double>> trueValuesList = new LinkedList<>();\n\t\tList<List<Double>> allValuesList = new LinkedList<>();\n\t\t\n\t\tfor (int i = 0; i < chain.resIntensityValueMatrix.length; i++) {\n\t\t\tfalseValuesList.add(new LinkedList<>());\n\t\t\ttrueValuesList.add(new LinkedList<>());\n\t\t\tallValuesList.add(new LinkedList<>());\n\t\t\tfor (int j = 0; j < chain.resIntensityValueMatrix[i].length; j++) {\n\t\t\t\tif (chain.originalPositions[j] != i) {\n\t\t\t\t\tfalseValuesList.get(i).add(chain.resIntensityValueMatrix[i][j]);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\ttrueValuesList.get(i).add(chain.resIntensityValueMatrix[i][j]);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tallValuesList.get(i).add(chain.resIntensityValueMatrix[i][j]);\n\t\t\t}\n\t\t\tCollections.sort(falseValuesList.get(i));\n\t\t\tCollections.sort(trueValuesList.get(i));\n\t\t\tCollections.sort(allValuesList.get(i));\n\t\t}\n\t\tdouble[] falseValuesMedian = new double[falseValuesList.size()];\n\t\tdouble[] trueValuesMedian = new double[trueValuesList.size()];\n\t\tdouble[] allValuesMedian = new double[allValuesList.size()];\n\t\t\n\t\t\n\t\tfor (int i = 0; i < falseValuesList.size(); i++) {\n\t\t\tif (falseValuesList.get(i).size() == 0) {\n\t\t\t\tfalseValuesMedian[i] = 0;\n\t\t\t} else {\n\t\t\t\tint middle = falseValuesList.get(i).size() / 2;\n\t\t\t\tif (falseValuesList.get(i).size() % 2 == 1) {\n\t\t\t\t\tfalseValuesMedian[i] = falseValuesList.get(i).get(middle);\n\t\t\t\t} else {\n\t\t\t\t\tfalseValuesMedian[i] = (falseValuesList.get(i).get(middle - 1) + falseValuesList.get(i).get(middle)) / 2.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < allValuesList.size(); i++) {\n\t\t\tif (allValuesList.get(i).size() == 0) {\n\t\t\t\tallValuesMedian[i] = 0;\n\t\t\t} else {\n\t\t\t\tint middle = allValuesList.get(i).size() / 2;\n\t\t\t\tif (allValuesList.get(i).size() % 2 == 1) {\n\t\t\t\t\tallValuesMedian[i] = allValuesList.get(i).get(middle);\n\t\t\t\t} else {\n\t\t\t\t\tallValuesMedian[i] = (allValuesList.get(i).get(middle - 1) + allValuesList.get(i).get(middle)) / 2.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < trueValuesList.size(); i++) {\n\t\t\tif (trueValuesList.get(i).size() == 0) {\n\t\t\t\ttrueValuesMedian[i] = 0;\n\t\t\t} else {\n\t\t\t\tint middle = trueValuesList.get(i).size() / 2;\n\t\t\t\tif (trueValuesList.get(i).size() % 2 == 1) {\n\t\t\t\t\ttrueValuesMedian[i] = trueValuesList.get(i).get(middle);\n\t\t\t\t} else {\n\t\t\t\t\ttrueValuesMedian[i] = (trueValuesList.get(i).get(middle - 1) + trueValuesList.get(i).get(middle)) / 2.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tchain.medianTrue = trueValuesMedian;\n\t\tchain.medianFalse = falseValuesMedian;\n\t\tchain.allMedian = allValuesMedian;\n\t\t\n\t\tfor (int i = 0; i < chain.signalMaybe.length; i++) {\n\t\t\tchain.signalMaybe[i] = chain.medianTrue[i] - chain.medianFalse[i];\n\t\t}\n\t\t\n\t}", "public Double median() {\n if (minHeap.isEmpty() && maxHeap.isEmpty()) {\n return null;\n } else {\n if (minHeap.size() != maxHeap.size()) {\n return Double.valueOf(maxHeap.peek());\n } else {\n return Double.valueOf(minHeap.peek() + maxHeap.peek()) / 2;\n }\n }\n }", "@Test\n public void testMedian() {\n System.out.println(\"median\");\n double[] values = new double[]{\n 8.927153515620000,\n 10.574811745900000,\n 8.894700141240000,\n 8.507551563150000,\n 9.014881630990000,\n 10.683879450300000,\n 10.142231294300000,\n 10.617826606000000,\n 10.387153749700000,\n 10.421390821500000,\n 10.415758910000000,\n 10.351636018900000,\n 8.875345257050000,\n 9.148679714420000,\n 10.349959416100000,\n 10.455234223700000,\n 10.295134872800000,\n 11.305933414200000,\n 10.511166224700000,\n 10.711717353900000,\n 10.212016243500000,\n 10.013806994600000,\n 10.474133712300000,\n 9.135694512270000,\n 9.755354878260000};\n\n double expResult = 10.3499594161;\n double result = Utilities.median(values);\n assertEquals(expResult, result, 0.0);\n\n }", "public static List<Double> medianFilter(List<Double> listToFilter, int n) {\r\n \r\n if (n % 2 == 0) {\r\n throw new Error(\"Medianfilter not implemented for even n values\");\r\n }\r\n \r\n List<Double> filteredList = new ArrayList<Double>();\r\n \r\n int numberOfZeroesToAddBefore = (n - 1) / 2;\r\n int numberOfZeroesToAddAfter = (n - 1) / 2;\r\n \r\n for (int i = 0; i < numberOfZeroesToAddBefore; i++) {\r\n listToFilter.add(0, 0.0);\r\n }\r\n for (int i = 0; i < numberOfZeroesToAddAfter; i++) {\r\n listToFilter.add(0.0);\r\n }\r\n \r\n for (int i = numberOfZeroesToAddBefore; i < listToFilter.size() - numberOfZeroesToAddAfter; i++) {\r\n double median = median(new ArrayList<Double>(listToFilter.subList(i - (n / 2), i + (n / 2) + 1)));\r\n filteredList.add(median);\r\n }\r\n \r\n for (int i = 0; i < numberOfZeroesToAddBefore; i++) {\r\n listToFilter.remove(0);\r\n }\r\n for (int i = 0; i < numberOfZeroesToAddAfter; i++) {\r\n listToFilter.remove(listToFilter.size() - 1);\r\n }\r\n return filteredList;\r\n }", "public static double median(int[] arr){\n System.out.println(\"array\" + Arrays.toString(arr));\n if (arr.length % 2 != 1){//if array even\n return arr[arr.length/2];\n }\n else{\n double right = arr[arr.length / 2];\n double left = arr[arr.length / 2 - 1];\n return (right+left)/2;\n }\n }", "private static void sort(ArrayList<Comparable> list, int startIndex, int endIndex)\n {\n if (startIndex < endIndex)\n {\n int lowerIndex = startIndex;\n int medianIndex = (startIndex + endIndex) / 2;\n int upperIndex = endIndex;\n Comparable medianValue = list.get(medianIndex);\n\n while (lowerIndex < upperIndex)\n {\n while (list.get(lowerIndex).compareTo(medianValue) < 0)\n {\n ++lowerIndex;\n }\n\n while (list.get(upperIndex).compareTo(medianValue) > 0)\n {\n --upperIndex;\n }\n\n if (lowerIndex < upperIndex)\n {\n Comparable valueAtLowerIndex = list.get(lowerIndex);\n\n list.set(lowerIndex++, list.get(upperIndex));\n list.set(upperIndex--, valueAtLowerIndex);\n }\n else if (lowerIndex == upperIndex)\n {\n ++lowerIndex;\n --upperIndex;\n }\n }\n\n sort(list, startIndex, upperIndex);\n sort(list, lowerIndex, endIndex);\n }\n }", "public double findMedian() {\n int size = maxHeap.size() + minHeap.size();\n if (size ==0) {\n return Double.MIN_VALUE;\n }\n if (size%2 == 1) {\n return maxHeap.peek();\n } else {\n return (maxHeap.peek() + minHeap.peek())/2.0f;\n }\n }", "public MedianFinder() {\n list = new ArrayList<>();\n }", "public double findMedian() {\n if (maxheap.size() == minheap.size()) {\n return (maxheap.peek() + minheap.peek()) * 0.5;\n } else {\n return maxheap.peek();\n }\n }", "public double findMedian() {\n\t\t\treturn minHeap.size() > maxHeap.size() ? minHeap.peek() : (minHeap.peek() + maxHeap.peek()) / 2.0d;\n\t\t}", "public void MedianFinder() {\n lowerPart = new PriorityQueue<>((a, b) -> (b - a));\n higherPart = new PriorityQueue<>();\n count = 0;\n }", "public double findMedian() {\n \treturn maxHeap.size() > minHeap.size() ? maxHeap.peek() : (maxHeap.peek() - minHeap.peek()) / 2.0; \n }", "public static double getMedian(int[] arr) {\n int n = arr.length;\n if (n % 2 == 0) {\n return (arr[n / 2 - 1] + arr[n / 2]) / 2.0;\n } else {\n return arr[n / 2];\n }\n }", "public static double getMedian()\n {\n PriorityQueue<Integer> smallerHeap = (leftHeap.size() < rightHeap.size() ? leftHeap : rightHeap);\n PriorityQueue<Integer> biggerHeap = (rightHeap.size() > leftHeap.size()? rightHeap: leftHeap);\n\n if(smallerHeap.size() == biggerHeap.size())\n {\n return (double)((smallerHeap.peek() + biggerHeap.peek())/2.0);\n }\n \n return biggerHeap.peek();\n }", "@SuppressWarnings(\"unchecked\")\r\n\tprivate static <E extends Comparable<? super E>> E median3(\r\n\t\t\tComparable<E>[] data, int left, int right) {\r\n\r\n\t\t// Put the left, middle and right values in their correct relative\r\n\t\t// positions\r\n\t\tint center = (left + right) / 2;\r\n\t\tif (data[left].compareTo((E) data[center]) > 0) {\r\n\t\t\tswap(data, left, center);\r\n\t\t}\r\n\t\tif (data[left].compareTo((E) data[right]) > 0) {\r\n\t\t\tswap(data, left, right);\r\n\t\t}\r\n\t\tif (data[center].compareTo((E) data[right]) > 0) {\r\n\t\t\tswap(data, center, right);\r\n\t\t}\r\n\r\n\t\t// Median is in the middle, put it at the right\r\n\t\tswap(data, center, right - 1);\r\n\t\treturn (E) data[right - 1];\r\n\t}", "int getMedian () {\n if (fillLength == 0)\n throw new IndexOutOfBoundsException(\"An error occurred in getMedian method of StepDArray class\");\n return array[fillLength / 2];\n }", "public double findMedian() {\n if (maxHeap.size() == 0) return 0;\n if (minHeap.size() == maxHeap.size())\n return (minHeap.peek() + maxHeap.peek()) / 2.0;\n else\n return maxHeap.peek();\n }", "public static double findMedian(double weight[], int n) \n { \n \tSystem.out.println(\" Calculate median : \");\n \t//System.out.println(\" weight[] size : \"+ weight.length);\n \t//System.out.println(\" n : \"+ n);\n \tdouble a[] = new double[n];\n \t\n \t//weight array > 0.0\n\t\tfor(int i=0; i < weight.length; i++ ) {\n\t\t\tif(weight[i] > 0.0) {\n\t\t\t\ta[i] = weight[i];\n\t\t\t}\n\t\t}\n\t\t//System.out.println(\" a[] size : \"+ a.length);\n\t\t\n // First we sort the array \n Arrays.sort(a); \n \n // check for even case \n if (n % 2 != 0) \n return (double)a[n / 2]; \n \n return Double.valueOf(df.format((double)(a[(n - 1) / 2] + a[n / 2]) / 2.0)); \n }", "public static double median(double[][] mat) { \n int count = 0;\n double med = 0;\n int size = mat.length * mat[0].length;\n double [] arr = new double [size];\n for (int row = 0; row < mat.length; row++) {\n for (int column = 0; column < mat[0].length; column++) {\n arr[count] = mat[row][column];\n count = count + 1;\n }\n }\n if (arr.length % 2 != 0) {\n int l1 = arr.length/2;\n med = arr[l1];\n }\n else {\n int l2 = arr.length/2;\n int l3 = l2 + 1;\n med = (arr[l2-1] + arr[l3-1]) / 2; \n }\n return med;\n }", "public static double median(double[] mainArray2) {\r\n\t\t//finds the smallest number and moves it to the end of the array\r\n\t\tint min2 = 0;\r\n\t\tfor(int lessThan = 1; lessThan < mainArray2.length; lessThan ++) {\r\n\r\n\t\t\tif(mainArray2[lessThan]<mainArray2[min2]) {\r\n\t\t\t\tmin2 = lessThan;\r\n\t\t\t}\r\n\t\t}\r\n\t\tdouble replacement = mainArray2[0];\r\n\t\tmainArray2[0] = mainArray2[min2];\r\n\t\tmainArray2[min2] = replacement;\r\n\r\n\t\t//finds the biggest number and moves it to the end of the array\r\n\t\tint max2 = 0;\r\n\t\tfor(int greaterThan = 1; greaterThan < mainArray2.length; greaterThan ++) {\r\n\r\n\t\t\tif(mainArray2[greaterThan]>mainArray2[max2]) {\r\n\t\t\t\tmax2 = greaterThan;\r\n\t\t\t}\r\n\t\t}\r\n\t\tdouble replacement2 = mainArray2.length -1;\r\n\t\tmainArray2[mainArray2.length -1] = mainArray2[max2];\r\n\t\tmainArray2[max2] = replacement;\r\n\r\n\t\t//arranges the values from smallest to largest\r\n\t\tfor(int counter = 1; counter < mainArray2.length -1; counter++) {\r\n\t\t\tif (mainArray2[counter + 1] < mainArray2[counter]) {\r\n\t\t\t\tdouble mover = mainArray2[counter +1];\r\n\t\t\t\tmainArray2[counter + 1] = mainArray2[counter];\r\n\t\t\t\tmainArray2[counter] = mover;\r\n\t\t\t} \r\n\t\t}\r\n\r\n\t\t//determines the median of the array\r\n\t\tif (mainArray2.length%2 == 0) {\r\n\t\t\tdouble median = (mainArray2[mainArray2.length /2 - 1] + mainArray2[mainArray2.length /2]) / 2;\r\n\t\t\treturn median;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdouble median = mainArray2[mainArray2.length % 2 + 1];\r\n\t\t\treturn median;\r\n\t\t}\r\n\t}", "private static double mediana(List<Double> valores){\n\t\tdouble mediana;\n\t\tif(valores.size()%2==0){\n\t\t\tmediana = (valores.get(valores.size()/2) + valores.get(valores.size()/2-1))/2;\n\t\t}else{\n\t\t\tmediana = valores.get(valores.size()/2);\n\t\t}\n\t\treturn mediana;\n\t}", "static float ver3Median(int a[], int aStart, int aEnd, int b[], int bStart, int bEnd) {\n\n\n if (aEnd == 0) return getMedian(b, bEnd);\n\n // If the smaller array has only one element\n if (aEnd == 1) {\n // Case 1: If the larger array also has one element,\n // simply call MO2()\n if (bEnd == 1) return getMedian(a[0], b[0]);\n\n // Case 2: If the larger array has odd number of elements,\n // then consider the middle 3 elements of larger array and\n // the only element of smaller array. Take few examples\n // like following\n // a = {9}, b[] = {5, 8, 10, 20, 30} and\n // a[] = {1}, b[] = {5, 8, 10, 20, 30}\n if ((bEnd - aStart) % 2 > 0)\n return getMedian(b[bEnd / 2], getMedian(a[0], b[bEnd / 2 - 1], b[bEnd / 2 + 1]));\n\n // Case 3: If the larger array has even number of element,\n // then median will be one of the following 3 elements\n // ... The middle two elements of larger array\n // ... The only element of smaller array\n return getMedian(b[bEnd / 2], b[bEnd / 2 - 1], a[0]);\n }\n\n // If the smaller array has two elements\n else if (aEnd == 2) {\n // Case 4: If the larger array also has two elements,\n // simply call MO4()\n if (bEnd == 2) return getMedian(a[aStart], a[aStart + 1], b[bStart], b[bStart + 1]);\n\n // Case 5: If the larger array has odd number of elements,\n // then median will be one of the following 3 elements\n // 1. Middle element of larger array\n // 2. Max of first element of smaller array and element\n // just before the middle in bigger array\n // 3. Min of second element of smaller array and element\n // just after the middle in bigger array\n //if ((bEnd & 1) == 1)\n if ((bEnd - aStart) % 2 > 0)\n return getMedian(b[bEnd / 2],\n max(a[0], b[bEnd / 2 - 1]),\n min(a[1], b[bEnd / 2 + 1])\n );\n\n // Case 6: If the larger array has even number of elements,\n // then median will be one of the following 4 elements\n // 1) & 2) The middle two elements of larger array\n // 3) Max of first element of smaller array and element\n // just before the first middle element in bigger array\n // 4. Min of second element of smaller array and element\n // just after the second middle in bigger array\n return getMedian(b[bEnd / 2],\n b[bEnd / 2 - 1],\n max(a[0], b[bEnd / 2 - 2]),\n min(a[1], b[bEnd / 2 + 1])\n );\n }\n\n int idxA = (aEnd - 1) / 2;\n int idxB = (bEnd - 1) / 2;\n\n Out.pln();\n Out.plnRange(\"a\", a, aStart, aEnd - 1, aStart + idxA);\n Out.plnRange(\"b\", b, bStart, bEnd - 1, bStart + idxB);\n Out.pln();\n\n if (a[aStart + idxA] <= b[bStart + idxB])\n return ver3Median(a, aStart + idxA, aEnd / 2 + 1, b, bStart, bEnd - idxA);\n else\n return ver3Median(a, aStart, aEnd / 2 + 1, b, bStart + idxA, bEnd - idxA);\n }", "private static double MedianofTwoSortedArraysTest(int[] nums1, int[] nums2) {\n\t\tint m = nums1.length;\r\n\t\tint n = nums2.length;\r\n\t\t\r\n\t\tif(m<n){\r\n\t\t\treturn MedianofTwoSortedArraysTest(nums2,nums1);\r\n\t\t}\r\n\t\t\r\n\t\tif(n==0){\r\n\t\t\treturn ((double)nums1[(m-1)/2]+(double)nums1[m/2])/2;\r\n\t\t}\r\n\t\t\r\n\t\tint lo = 0, hi = n*2;\r\n\t\twhile(lo<=hi){\r\n\t\t\tint mid2 = (lo+hi)/2;\r\n\t\t\tint mid1 = m+n-mid2;\r\n\t\t\t\r\n\t double L1 = (mid1 == 0) ? Integer.MIN_VALUE: nums1[(mid1-1)/2];\r\n\t double L2 = (mid2 == 0) ? Integer.MIN_VALUE : nums2[(mid2-1)/2];\r\n\t double R1 = (mid1 == m * 2) ? Integer.MAX_VALUE : nums1[(mid1)/2];\r\n\t double R2 = (mid2 == n * 2) ? Integer.MAX_VALUE : nums2[(mid2)/2];\r\n\t \r\n\t if(L1>R2) lo = mid2+1;\r\n\t else if(L2>R1) hi = mid2-1;\r\n\t else return (Math.max(L1, L2)+Math.min(R1, R2))/2;\r\n\t\t}\r\n\t\t\r\n\t\treturn -1;\r\n\t}", "public double getMedianAge() {\n ArrayList<Integer> guppyAges = new ArrayList<>();\n\n Iterator<Guppy> it = guppiesInPool.iterator();\n while (it.hasNext()) {\n Guppy currentGuppy = it.next();\n guppyAges.add(currentGuppy.getAgeInWeeks());\n }\n System.out.println(guppyAges);\n\n int middleOfList = Math.floorDiv(guppyAges.size(), 2);\n\n return guppyAges.get(middleOfList);\n\n }", "public static void medianQuickSort(int arr[], int first, int last) {\n if (first >= last)\n return;\n\n if (first < last) {\n\n int pivot = medianPivot(arr, first, last);\n //System.out.println(pivot);\n QuickSort(arr, first, last);\n }\n }", "public static int median(int[] arr) {\n int middle = arr.length / 2;\n int median = 0;\n if (arr.length % 2 == 1)\n median = arr[middle];\n else\n median = (arr[middle - 1] + arr[middle]) / 2;\n return median;\n }", "private static <AnyType extends Comparable<? super AnyType>> AnyType median3(AnyType[] a, int left, int right)\n {\n int center = (left + right) / 2;\n if(a[center].compareTo(a[left]) < 0)\n CommonFunc.swapReference(a, left, center);\n if(a[right].compareTo(a[left]) < 0)\n CommonFunc.swapReference(a, left, right);\n if(a[right].compareTo(a[center]) < 0)\n CommonFunc.swapReference(a, center, right);\n \n // Place pivot at position right - 1\n CommonFunc.swapReference(a, center, right - 1);\n return a[right - 1];\n }", "private int getMedian(int left, int right){\n int median = right - left + 1;\n median = (median + 1) / 2 - 1;\n return median + left;\n }", "public MedianFinder1() {\n list = new ArrayList<>();\n }", "public double getCurMedian(){\n\t\tdouble median; \n\t\tif(maxHeap.getHeapSize() == minHeap.getHeapSize()){\n\t\t\tmedian = 0.5*(maxHeap.getBestElement() + minHeap.getBestElement());\n\t\t}\n\t\telse if(maxHeap.getHeapSize() > minHeap.getHeapSize()){\n\t\t\tmedian = maxHeap.getBestElement();\n\t\t}\n\t\telse{\n\t\t\tmedian = minHeap.getBestElement();\n\t\t}\n\t\t\n\t\treturn median;\n\t}", "public static int medianPivot(int array[], int first, int last) {\n \n int mid = (last) / 2;\n\n int[] sortingArr = {array[first], array[mid], array[last]};\n Arrays.sort(sortingArr);\n\n //System.out.println(\"\\tMiddle of Arr at Index= \" + mid + \" : \" + array[mid]);\n int middleValue = sortingArr[1];\n\n //System.out.println(\"\\t\"+Arrays.toString(sortingArr));\n //Swap with the last for pivot\n \tint temp = array[last];\n \tarray[last] = middleValue;\n if (middleValue == array[first]) {\n array[first] = temp;\n } else if (middleValue == array[mid]) {\n array[mid] = temp;\n }\n return partition(array, first, last);\n }", "public LeetCode_295_FindMedian() {\n largeQueue = new PriorityQueue<>();\n smallQueue = new PriorityQueue<>(new Comparator<Integer>() {\n @Override\n public int compare(Integer integer, Integer t1) {\n return t1 - integer;\n }\n });\n }", "public MedianFinder() {\n datas = new ArrayList<>();\n }", "public static int median(int[] A) {\n int rank = A.length / 2;\n if (A.length % 2 == 0) {\n rank--;\n }\n return quickSelect(A, rank);\n }", "public static void main(String[] args) {\n\n int nums[] = {1, 2};\n int nums2[] = {3, 4};\n System.out.println(Medianof2SortedArrays.findMedianSortedArraysSol(nums, nums2));\n\n }", "public double[] medianSlidingWindow(int[] nums, int k) {\n Comparator<Integer> comparator = (a, b) -> nums[a] != nums[b] ? Integer.compare(nums[a], nums[b]) : a - b;\n \n minHeap = new TreeSet<>(comparator);\n \n maxHeap = new TreeSet<>(comparator.reversed());\n \n int n = nums.length;\n \n double output[] = new double[n - k + 1];\n \n int left = 0;\n \n //This works like a sliding window.\n //In each window we calculate the median using the above steps in comments\n for(int right = 0; right < n; right++){\n \n //Remove the indices of the element from the left as the window progresses\n if(right >= k){\n \n minHeap.remove(right - k);\n maxHeap.remove(right - k);\n }\n \n //Add the element to min heap first\n minHeap.add(right);\n \n //Remove the first element from the min heap and add that to maxHeap\n maxHeap.add(minHeap.pollFirst());\n \n //It will balance the sizes if maxHeap > minHeap\n balanceHeaps();\n \n if(right >= k - 1){\n \n output[left++] = getMedian(nums, k);\n } \n }\n \n return output;\n \n }", "public static int medianOfThree(int[] arr, int left, int right) {\n int mid = (right + left) / 2;\n\n if (arr[right] < arr[left]) {\n swap(arr, left, right);\n }\n if (arr[mid] < arr[left]) {\n swap(arr, mid, left);\n }\n if (arr[right] < arr[mid]) {\n swap(arr, right, mid);\n }\n\n return mid;\n }", "public boolean areMedianIntensities();", "public static void main(String[] args) {\n int[][] A = {\n {1, 3, 5},\n {2, 6, 9},\n {3, 6, 9}\n };\n\n System.out.println(findMedian(A));\n\n }", "@SuppressWarnings(\"unchecked\")\r\n\tprivate static <E extends Comparable<? super E>> E median3(\r\n\t\t\tComparable<E>[] data, int left, int right,\r\n\t\t\tComparator<Comparable<E>> comp) {\r\n\r\n\t\t// Put the left, middle and right values in their correct relative\r\n\t\t// positions\r\n\t\tint center = (left + right) / 2;\r\n\t\tif (comp.compare(data[left], data[center]) > 0) {\r\n\t\t\tswap(data, left, center);\r\n\t\t}\r\n\t\tif (comp.compare(data[left], data[right]) > 0) {\r\n\t\t\tswap(data, left, right);\r\n\t\t}\r\n\t\tif (comp.compare(data[center], data[right]) > 0) {\r\n\t\t\tswap(data, center, right);\r\n\t\t}\r\n\r\n\t\t// Median is in the middle, put it at the right\r\n\t\tswap(data, center, right - 1);\r\n\t\treturn (E) data[right - 1];\r\n\t}", "void deleteMedian () {\n if (fillLength > 0) {\n for (int i = fillLength / 2; i < fillLength - 1; i++) {\n array[i] = array[i + 1];\n }\n array[fillLength - 1] = 0;\n fillLength--;\n }\n }", "@Test\n\tpublic void testRunningMedian() {\n\t\tQueue<Integer> h1 = new PriorityQueue<>(Comparator.reverseOrder());\n\t\t// min-heap\n\t\tQueue<Integer> h2 = new PriorityQueue<>();\n\n\t\tint[] stream = {13, 189, 23, 26, 1, 9, 89, 67, 87, 12, 1, 23, 45, 67, 81};\n\n\t\tfor (int val : stream) {\n\t\t\tif (h1.isEmpty() || val <= h1.peek()) {\n\t\t\t\th1.add(val);\n\t\t\t} else {\n\t\t\t\th2.add(val);\n\t\t\t}\n\n\t\t\t// re-balance the heaps\n\t\t\tif (h1.size() - h2.size() > 1) {\n\t\t\t\th2.add(h1.poll());\n\t\t\t} else if (h2.size() - h1.size() > 1) {\n\t\t\t\th1.add(h2.poll());\n\t\t\t}\n\n\t\t\tint runningMedian;\n\t\t\tif (h1.size() == h2.size()) {\n\t\t\t\trunningMedian = (h1.peek() + h2.peek()) / 2;\n\t\t\t} else {\n\t\t\t\tQueue<Integer> mh = h1.size() - h2.size() == 1 ? h1 : h2;\n\t\t\t\trunningMedian = mh.peek();\n\n\t\t\t}\n\t\t\tSystem.out.println(\"Running median is: \" + runningMedian);\n\t\t}\n\n\n\t}", "@Test\n\tpublic void testExecute_doubleArr_int()\n\t{\n\t\tSystem.out.println(\"Test of MedianValue.execute()\");\n\t\tSystem.out.println(\"execute\");\n\t\tdouble[] waveforms = new double[] {1.0, 5.0, 3.0, 2.0, 2.2, -1.0, 4.4, 10.0, -9.0, 5.0};\n\t\tint recordLength = 5;\n\t\tdouble[] expResult = new double[] {2.2, 4.4};\n\t\tdouble[] result = MedianValue.execute(waveforms, recordLength);\n\t\tassertArrayEquals(expResult, result, 0.0);\n\t}", "public double cariMedian(int[] median) {\n\t\tArray2 arr = new Array2();\n\t\tint[] cek = arr.bubleShort(median);\n\t\tint p = median.length;\n\t\tdouble me = 0.0;\n\n\t\tif (median.length % 2 == 1) {\n\t\t\tme = cek[p / 2];\n\t\t} else {\n\t\t\tme = ((double) (cek[p / 2] + cek[(p / 2) - 1])) / 2;\n\t\t}\n\t\treturn me;\n\t}", "public static double medVal(int[] sample) {\n //sorting array of sample times\n Sorting.quickSort(sample);\n int middle = sample.length/2;\n if (sample.length % 2 == 1){\n return sample[middle];\n } \n else{\n return (sample[middle-1] + sample[middle]) / 2.0;\n }\n }", "public static double findMedianSortedArraysFailed(int[] nums1, int[] nums2) {\r\n\t\tboolean isOdd = true;\r\n\t\tdouble result=0;\r\n\t\tint middle = 0;\r\n\t\t\r\n\t\tArrayUtils au = new ArrayUtils();\r\n\t\tint[] concatNums = au.concatenate(nums1, nums2);\r\n\t\t\r\n\t\tArrays.sort(concatNums);\r\n\t\t\r\n\t\tif(concatNums.length == 1) {\r\n\t\t result = concatNums[0];\r\n\t\t}else if(concatNums.length % 2 == 0) {\r\n\t\t // EVEN\r\n\t\t middle = concatNums.length / 2;\r\n\t\t result = (concatNums[middle] + concatNums[middle-1]) / 2.0;\r\n\t\t} else {\r\n\t\t // ODD\r\n\t\t middle = concatNums.length /2;\r\n\t\t result = concatNums[middle];\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public MedianFinder() {\n\t maxHeap=new TreeSet<>((i1, i2) ->{\n\t \t int diff=Integer.compare(i1,i2);\n\t \t return diff==0? 1: diff;\n\t });// forward order but keeping duplicate keys\n\t minHeap=new TreeSet<>((i1,i2) ->{\n\t \t int diff=Integer.compare(i2,i1);\n\t \t return diff==0? 1: diff;\n\t });// reverse order but keeping duplicate keys\n\t }", "private static int partitionRandomMedian(double[] array, int p, int r) {\n\t\tint randomIndex[]= new int[3];\r\n\t\t\trandomIndex[0] = ThreadLocalRandom.current().nextInt(p, r + 1);\r\n\t\t\trandomIndex[1] = ThreadLocalRandom.current().nextInt(p, r + 1);\r\n\t\t\trandomIndex[2] = ThreadLocalRandom.current().nextInt(p, r + 1);\r\n\t\t\tArrays.sort(randomIndex);// SORTING THREE ELEMENTS IS CONSTANT TIME\r\n\t\t\tint median = (randomIndex[1]);\r\n\t\tcomplexityCount++;\r\n\t\tdouble temp = array[median];\r\n\t\tarray[median] = array[r];\r\n\t\tarray[r] = temp;\r\n\t\t//CALL TRADITIONAL PARTITION\r\n\t\treturn partition(array, p, r);\r\n\t}", "public double findMedianSortedArrays(int A[], int B[]) {\n\t\tif(A.length == 0 && B.length == 0)\n\t\t\treturn (double) 0;\n\t\t\n\t\tif((A.length + B.length)%2 == 0)\n\t\t{\n\t\t\t//EVEN case\n\t\t\tint target = (A.length + B.length)/2;\n\t\t\tdouble rs1 = getMedian(A, B, target);\n\t\t\tSystem.out.println(\"ANS1 => \"+rs1);\n\t\t\ttarget = target + 1;\n\t\t\tdouble rs2 = getMedian(A, B, target);\n\t\t\tSystem.out.println(\"ANS2 => \"+rs2);\n\t\t\treturn (rs1+rs2)/2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//ODD case\n\t\t\tint target = (A.length + B.length + 1)/2;\n\t\t\tdouble rs = getMedian(A, B, target);\n\t\t\treturn rs;\n\t\t}\n\t\t\n }", "public static void main(String[] args) throws IOException {\n\n int aCount = Integer.parseInt(scanner.nextLine().trim());\n\n int[] a = new int[aCount];\n\n for (int aItr = 0; aItr < aCount; aItr++) {\n int aItem = Integer.parseInt(scanner.nextLine().trim());\n a[aItr] = aItem;\n }\n\n double[] result = runningMedian(a);\n\n for (int resultItr = 0; resultItr < result.length; resultItr++) {\n //bufferedWriter.write(String.valueOf(result[resultItr]));\n //O problema de fazer sort no array pela performance está no print abaixo\n //por resultado\n System.out.println(String.valueOf(result[resultItr]));\n\n if (resultItr != result.length - 1) {\n //bufferedWriter.write(\"\\n\");\n }\n }\n\n //bufferedWriter.newLine();\n\n //bufferedWriter.close();\n }", "public double cariMedian() {\n\t\tArray2 arr = new Array2();\n\t\tint[] cek = arr.bubleShort(Array3.arrayUmum);\n\t\tint p = Array3.arrayUmum.length;\n\t\tdouble me = 0.0;\n\n\t\tif (p % 2 == 1) {\n\t\t\tme = cek[p / 2];\n\t\t} else {\n\t\t\tme = ((double) (cek[p / 2] + cek[(p / 2) - 1])) / 2;\n\t\t}\n\t\treturn me;\n\t}", "public static double getArrayListDoubleMean(ArrayList<Double> list) {\n\t\treturn 0;\n\t}", "private static void medianOfThree(int[] a, int low, int middle, int high) {\n\n if (a[middle] < a[low]) {\n swap(a, low, middle);\n }\n if (a[high] < a[low]) {\n swap(a, low, high);\n }\n\n if (a[high] < a[middle]) {\n swap(a, middle, high);\n }\n }", "public int findMedian(int[] array) {\r\n\t\tint i;\r\n\t\tint sumRight = 0;\r\n\t\tint sumLeft = 0;\r\n\t\tfloat differenceBetweenTheTwoSums = sum(array, 0, array.length);\r\n\t\tint index = 0;\r\n\t\tint medianIndex = 0;\r\n\t\tfloat absSubtraction = 0;\r\n\r\n\t\tfor (i = 0; i < array.length - 1; i++) {\r\n\t\t\tsumRight = sum(array, 0, index);\r\n\t\t\tsumLeft = sum(array, index + 1, array.length);\r\n\t\t\tabsSubtraction = Math.abs(sumLeft - sumRight);\r\n\t\t\tif (absSubtraction <= differenceBetweenTheTwoSums) {\r\n\t\t\t\tdifferenceBetweenTheTwoSums = absSubtraction;\r\n\t\t\t\tmedianIndex = index;\r\n\t\t\t}\r\n\t\t\tindex++;\r\n\t\t}\r\n\t\treturn medianIndex++;\r\n\t}", "public double findMedianSortedArrays(int[] x, int[] y) {\n if (x.length > y.length) {\n int[] z = x;\n x = y;\n y = z;\n }\n int xlen = x.length, ylen = y.length, a, b, v = Integer.MIN_VALUE;\n if (xlen == 0) {\n if (ylen % 2 == 0) {\n return (0.0 + y[ylen / 2 - 1] + y[ylen / 2]) / 2;\n } else {\n return y[ylen / 2];\n }\n }\n if ((x.length + y.length) % 2 == 1) {\n xlen--;\n v = x[xlen];\n }\n if (xlen == 0) {\n a = y[ylen / 2 - 1];\n b = y[ylen / 2];\n } else if (xlen == 1) {\n if (ylen == 1) {\n a = Math.min(x[0], y[0]);\n b = Math.max(x[0], y[0]);\n } else {\n int i = ylen / 2;\n if (x[0] > y[i]) {\n a = y[i];\n b = Math.min(x[0], y[i + 1]);\n } else {\n a = Math.max(x[0], y[i - 1]);\n b = y[i];\n }\n }\n } else {\n int xl = 0, xr = xlen - 1;\n int ymid, xmid, midIndex = (xlen + ylen) / 2 - 1;\n if (x[xr] < y[midIndex - xr]) {\n a = x[xlen - 1];\n if (xlen != ylen) {\n a = Math.max(a, y[(ylen - xlen) / 2 - 1]);\n }\n b = y[(ylen - xlen) / 2];\n } else if (y[midIndex - xl] < x[xl]) {\n a = y[(ylen + xlen) / 2 - 1];\n b = x[0];\n if (xlen != ylen) {\n b = Math.min(b, y[(ylen + xlen) / 2]);\n }\n } else {\n while (xr - xl > 1) {\n xmid = (xl + xr) / 2;\n ymid = midIndex - xmid;\n if (y[ymid] < x[xmid]) {\n xr = xmid;\n } else if (x[xmid] < y[ymid]) {\n xl = xmid;\n } else {\n xl = xmid - 1;\n xr = xmid;\n break;\n }\n }\n a = Math.max(x[xl], y[midIndex - xr]);\n b = Math.min(x[xr], y[midIndex - xl]);\n }\n }\n if ((x.length + y.length) % 2 == 1) {\n if (v < a)\n return a;\n else if (v > b)\n return b;\n else\n return v;\n } else {\n return (0.0 + a + b) / 2;\n }\n }", "static float getMedian(int ar1[], int ar2[], int n)\n\t{\n\t\t// If all elements of array 1 are smaller then\n\t\t // median is average of last element of ar1 and\n\t\t // first element of ar2\n\t\t if (ar1[n-1] < ar2[0])\n\t\t return (ar1[n-1]+ar2[0])/2;\n\n\t\t // If all elements of array 1 are smaller then\n\t\t // median is average of first element of ar1 and\n\t\t // last element of ar2\n\t\t if (ar2[n-1] < ar1[0])\n\t\t return (ar2[n-1]+ar1[0])/2;\n\n\t\t return getMedianRec(ar1, ar2, 0, n-1, n);\n\t}", "public MedianFinder() {\n maxHeap = new PriorityQueue<Integer>((x, y) -> (y - x));\n minHeap = new PriorityQueue<Integer>();\n size = 0;\n }", "public Medians(String file) {\n \n // a max priority queue that stores half of values <= median\n PriorityQueue<Integer> lo = new PriorityQueue<Integer>(new Comparator<Integer>() {\n @Override\n public int compare(Integer n1, Integer n2) {\n return n2 - n1;\n }\n });\n \n // a min priority queue that stores half of values > median\n PriorityQueue<Integer> hi = new PriorityQueue<Integer>();\n Scanner scanner = null;\n try {\n scanner = new Scanner(new File(file));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n \n lo.add(scanner.nextInt());\n medians.add(lo.peek());\n while (scanner.hasNextInt()) {\n int t = scanner.nextInt();\n if (lo.size() == hi.size()) {\n if (t > hi.peek()) {\n lo.add(hi.poll());\n hi.add(t);\n }\n else lo.add(t);\n }\n else {\n if (t < lo.peek()) {\n hi.add(lo.poll());\n lo.add(t);\n }\n else hi.add(t);\n }\n medians.add(lo.peek());\n }\n }", "private static int findMedian(int[] arr, int lo, int hi){\n\t\tfor(int i = lo + 1; i < hi; i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint j = lo;\n\t\t\t\n\t\t\twhile((j >= lo) && (arr[j] > temp)) {\n\t\t\t\tarr[j+1] = arr[j];\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tarr[j+1] = temp;\n\t\t}\n\t\t\n\t\tint median = (int)Math.ceil((hi - lo)/2);\n\t\treturn lo + median;\n\t}", "public MedianFinder() {\n low = new PriorityQueue<>(Collections.reverseOrder());\n high = new PriorityQueue<>();\n }", "public static double findMedianSortedArrays(int[] nums1, int[] nums2) {\r\n boolean isOdd = true;\r\n double result=0;\r\n int middle = 0;\r\n \r\n int nums1Len = nums1.length;\r\n int nums2Len = nums2.length;\r\n int fullLen = nums1Len + nums2Len;\r\n \r\n int nums1Cnt = 0;\r\n int nums2Cnt = 0;\r\n \r\n boolean nums1Cut = false;\r\n boolean nums2Cut = false;\r\n \r\n HashMap<Integer, Integer> hm = new HashMap<> ();\r\n \r\n if(fullLen % 2 == 0) {\r\n isOdd = false;\r\n }\r\n \r\n middle = fullLen / 2;\r\n \r\n if(fullLen != 1){\r\n for(int i =0; i <= middle; i++) {\r\n if(nums1Cnt == nums1Len) {\r\n hm.put(i, nums2[nums2Cnt]);\r\n nums2Cnt++;\r\n }else if(nums2Cnt == nums2Len) {\r\n hm.put(i, nums1[nums1Cnt]);\r\n nums1Cnt++;\r\n }else if(nums1[nums1Cnt] > nums2[nums2Cnt]) {\r\n hm.put(i, nums2[nums2Cnt]);\r\n nums2Cnt++;\r\n } else {\r\n hm.put(i, nums1[nums1Cnt]);\r\n nums1Cnt++;\r\n }\r\n }\r\n }\r\n \r\n if(fullLen == 1) {\r\n if(nums1Len > nums2Len) {\r\n result = nums1[0];\r\n } else {\r\n result = nums2[0];\r\n }\r\n } else if(isOdd) {\r\n result = hm.get(middle);\r\n } else {\r\n result = (hm.get(middle) + hm.get(middle-1)) / 2.0;\r\n }\r\n return result;\r\n }", "public MedianFinder() {\r\n left = new PriorityQueue<>((x, y) -> y - x);\r\n right = new PriorityQueue<>((x, y) -> x - y);\r\n }", "public MedianFinder() {\n min = new PriorityQueue<>();\n max = new PriorityQueue<>();\n }", "public static double findMedianSortedArraysBrutalForce(int[] nums1, int[] nums2) {\n int m = nums1.length;\n int n = nums2.length;\n if (n == 0) {\n return getMedian(nums1);\n }\n if (m == 0) {\n return getMedian(nums2);\n }\n\n int[] nums = new int[m + n];\n\n int count = 0;\n int i = 0, j = 0;\n while (count != (m + n)) {\n // if nums1 reach the end first\n if (i == m) {\n // push all the rest of the nums2 into result array\n while (j != n) {\n nums[count++] = nums2[j++];\n }\n // then get rid of the while loop\n break;\n }\n // if nums2 reach the end of the while loop\n if (j == n) {\n while (i != m) {\n nums[count++] = nums1[i++];\n }\n break;\n }\n\n // compare current value then only push the small one into result array\n if (nums1[i] < nums2[j]) {\n nums[count++] = nums1[i++];\n } else {\n nums[count++] = nums2[j++];\n }\n }\n\n return getMedian(nums);\n }", "public static void main(String[] args) {\n\n\n int [][] array = {\n {1, 4, 3, 2, 5},\n {4, 5, 3, 2, 9},\n {4, 7, 8, 1, 4}};\n\n int sum = 0;\n int mean = 0;\n int median = 0;\n double variance = 0;\n double sdev = 0; //Standard deviation\n\n //Make 2d array into 1d array\n int [] list = new int [array.length * array[0].length];\n\n int listnum = 0;\n for (int i = 0; i < array.length; i++){\n for (int j = 0; j < array.length; j++){\n list[listnum++] = array [i][j];\n }\n }\n\n //This is used to find the SUM\n for (int i = 0; i < list.length; i++) {\n sum += list[i];\n }\n System.out.println(\"This is the sum: \" + sum);\n\n //MEAN\n mean = sum/list.length;\n System.out.println(\"Mean: \" + mean);\n\n //This is used to find the MEDIAN\n Arrays.sort(list);\n\n int middle = (list.length / 2);\n if (list.length % 2 == 0) {\n int medium1 = list[middle];\n int medium2 = list[middle - 1];\n median = (medium1 + medium2) / 2;\n } else {\n median = list[middle + 1];\n }\n System.out.println(\"The MEDIAN is: \" + median);\n\n\n //This is the mode\n int[] frequencies = new int[10]; // all zero\n for(int [] row : array){\n for(int val : row){\n frequencies[val]++;\n }\n }\n\n // scan for the largest value\n int largest = 0;\n int mode = -1;\n for (int i = 0; i < 10; ++i) {\n if (frequencies[i] > largest) {\n largest = frequencies[i];\n mode = i;\n }\n }System.out.println(\"Mode: \" + mode);\n\n\n\n //VARIANCE\n double temp = 0;\n for (double a : list) {\n temp += (a - mean) * (a - mean);\n }\n variance = temp / list.length;\n System.out.println(\"Variance:\" + variance);\n\n //Standard deviation\n sdev = Math.sqrt(variance);\n System.out.println(\"Standard Deviation: \" + sdev);\n }", "public MedianFinder() {\n large=new PriorityQueue();\n small=new PriorityQueue(new Comparator<Integer>(){\n @Override\n public int compare(Integer i1,Integer i2){\n return i2-i1;\n }\n });\n }", "public native MagickImage medianFilterImage(double radius)\n\t\t\tthrows MagickException;", "public static int findMedianInt (Scanner scn)\n {\n ArrayList<Integer> lines = new ArrayList<Integer>();\n while (scn.hasNext())\n {\n lines.add(scn.nextInt());\n }\n if (lines.size() > 0)\n {\n Collections.sort(lines);\n return lines.get(lines.size() / 2);\n }\n else\n {\n throw new NoSuchElementException();\n }\n }", "private Integer chooseMedianPivot(Integer[] pivotChoices) {\n\t\tthis.qs.sort(pivotChoices);\n\t\tif ((pivotChoices.length % 2) == 0) {\n\t\t\treturn (pivotChoices[pivotChoices.length / 2 - 1]);\n\t\t} else {\n\t\t\treturn (pivotChoices[pivotChoices.length / 2]);\n\t\t}\n\t}", "@Override\r\n\tpublic void run() {\r\n\t\t//sorting the array then taking the middle point (size/2)\r\n\t\tCollections.sort(numlist);\r\n\t\tmdn=numlist.get(numlist.size()/2);\r\n\t}", "public int BruteForceMedian(int[] A) {\n\t\tint numsmaller;;\n\t\tint numequal;;\n\t\t\n\t\tint n = A.length; //Need to plus 1 as count from 1 not 0\n\t\tint k = n/2;\n\t\t\n\t\tfor (int i = 0; i < n-1; i++) {\n\t\t\t\n\t\t\tnumsmaller = 0;\n\t\t\tnumequal = 0;\n\t\t\t\n\t\t\tfor (int j = 0; j < n-1; j++) {\n\t\t\t\tif (A[j] < A[i]) {\n\t\t\t\t\tnumsmaller++;\n\t\t\t\t\tboCount++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse {\n\t\t\t\t\tif (A[j] == A[i]) {\n\t\t\t\t\t\tnumequal++; \n\t\t\t\t\t\tboCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\tif (numsmaller < k && k <= (numsmaller + numequal)) {\n\t\t\t\treturn A[i];\n\t\t\t}\n\t\t}\n\t\treturn A[0]; //If there is only one element.\n\t}", "double findMedianSortedArrays3(int A[], int B[]) {\n\t int N1 = A.length;\n\t int N2 = B.length;\n\t if (N1 < N2) return findMedianSortedArrays3(B, A); // Make sure A2 is the shorter one.\n\n\t\tif (N2 == 0)\n\t\t\treturn ((double) A[(N1 - 1) / 2] + (double) A[N1 / 2]) / 2; // If A2 is empty\n\n\t int lo = 0, hi = N2 * 2;\n\t while (lo <= hi) {\n\t int mid2 = (lo + hi) / 2; // Try Cut 2 \n\t int mid1 = N1 + N2 - mid2; // Calculate Cut 1 accordingly\n\n\t double L1 = (mid1 == 0) ? Integer.MIN_VALUE : A[(mid1-1)/2]; // Get L1, R1, L2, R2 respectively\n\t double L2 = (mid2 == 0) ? Integer.MIN_VALUE : B[(mid2-1)/2];\n\t double R1 = (mid1 == N1 * 2) ? Integer.MAX_VALUE : A[(mid1)/2];\n\t double R2 = (mid2 == N2 * 2) ? Integer.MAX_VALUE : B[(mid2)/2];\n\n\t if (L1 > R2) lo = mid2 + 1; // A1's lower half is too big; need to move C1 left (C2 right)\n\t else if (L2 > R1) hi = mid2 - 1; // A2's lower half too big; need to move C2 left.\n\t else return (Math.max(L1,L2) + Math.min(R1, R2)) / 2; // Otherwise, that's the right cut.\n\t }\n\t return -1;\n\t}", "public MedianFinder() {\n left = new PriorityQueue<>(Collections.reverseOrder());\n right = new PriorityQueue<>();\n }", "public MedianFinderElegant() {\n minHeap = new PriorityQueue<>();\n maxHeap = new PriorityQueue<>((v1, v2) -> v2 - v1);\n }", "private double[] getMeanMedStd(ArrayList<Feature> freature, String keyID, double dthresh) {\r\n\r\n ArrayList<Double> values = FeatureOps.getSpecifiedFeatureNumericalPropertyAsArrayList(freature, keyID);\r\n // threshold the data. \r\n NumericArrayListOps.removeElementsGreaterThan(values, dthresh);\r\n double[] d2 = List2Prims.doubleFromDouble(values);\r\n\r\n if (d2.length == 0) {\r\n return new double[]{dthresh, dthresh, Double.POSITIVE_INFINITY, 0d};\r\n }\r\n\r\n double mean, median, std, ratioNeighbours;\r\n mean = StatUtils.mean(d2);\r\n Median med = new Median();\r\n median = med.evaluate(d2);\r\n std = Math.sqrt(StatUtils.variance(d2));\r\n // the proportion of the set in close proximity to features in the second set. \r\n ratioNeighbours = ((double) d2.length) / (double) freature.size();\r\n return new double[]{mean, median, std, ratioNeighbours};\r\n }", "public static float getMedian(ArrayList<StatisticClass> classes, float[] classMiddles, float[] relativeOccurences)\n\t\t\tthrows IllegalArgumentException, Exception\n\t{\n\t\t// Braucht: Klassenmitten, relative Häufigkeiten\n\n\t\tif (classes.size() == 0 || classMiddles.length == 0 || relativeOccurences.length == 0)\n\t\t{\n\t\t\tthrow new IllegalArgumentException(\"Die angegebenen Wertearrays sind nicht gefüllt.\");\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\tfloat currentRelativeShare = 0;\n\t\t\tfloat relativeShareBeforeHit = 0;\n\n\t\t\tint classIndexWithMedian = -1;\n\n\t\t\tfor (int i = 0; i < classMiddles.length; i++)\n\t\t\t{\n\n\t\t\t\tcurrentRelativeShare += relativeOccurences[i];\n\n\t\t\t\tif (currentRelativeShare > 0.5f)\n\t\t\t\t{\n\t\t\t\t\tclassIndexWithMedian = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\trelativeShareBeforeHit = currentRelativeShare;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (classIndexWithMedian == -1)\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Es konnte keine Klasse ermittelt werden, in dem der Median liegt\");\n\t\t\t}\n\n\t\t\tfloat z1 = classes.get(classIndexWithMedian).getLowerValue().value;\n\t\t\tfloat z2 = classes.get(classIndexWithMedian).getUpperValue().value;\n\n\t\t\tfloat r1 = relativeShareBeforeHit;\n\t\t\tfloat r2 = currentRelativeShare;\n\n\t\t\tfloat result = z1 + ((0.5f - r1) / (r2 - r1)) * (z2 - z1);\n\t\t\treturn result;\n\n\t\t}\n\t}", "public int getMedian (int[] a, int[] b,int aLength,int bLength) {\n\n\tint left = (aLength+bLength+1) >>>1; //3,2, left = 3\n\tint right =(aLength+bLength+2) >>>1;//3,2 right =3.(3.5 =>3)\n\t//average of kth smallest, from left and right. \n\treturn (findKthSmallest(a,b,aLength,bLength,left) + findKthSmallest(a,b,aLength,bLength,right))/2;\n}", "abstract double quantileFromSorted(double level, DoubleArray sortedSample);", "public static double medianOfTwoArrays(int[] nums1, int[] nums2){\n\t\tint[] resultArr = new int[nums1.length + nums2.length];\n\t\tint midPoint = resultArr.length / 2;\n\t\tdouble result = 0.0; //initializes result to 0\n\t\tint count1 = 0; //keeps track of place in array 1\n\t\tint count2 = 0; //keeps track of place in array 2\n\n\t\t//puts the numbers from both arrays in a sorted way to the new array\n\t\tfor(int i = 0; i < resultArr.length; i++){\n\t\t\t//checks if we traversed through each number in first array\n\t\t\tif(count1 >= nums1.length && count2 < nums2.length)\n\t\t\t\tresultArr[i] = nums2[count2]; //assigns number from second array\n\n\t\t\t//checks if we traversed through each number in second array\n\t\t\telse if(count2 >= nums2.length && count1 < nums1.length)\n\t\t\t\tresultArr[i] = nums1[count1]; //assigns number from first array\n\n\t\t\t//compares the numbers from both arrays\n\t\t\telse if(nums1[count1] < nums2[count2]){\n\t\t\t\t//adds number from array 1 if it is smaller\n\t\t\t\tresultArr[i] = nums1[count1];\n\t\t\t\tcount1++; //increments count1 to keep track of where we are\n\t\t\t}\n\n\t\t\telse{\n\t\t\t\t//adds number from array 2 since it is smaller or equal\n\t\t\t\tresultArr[i] = nums2[count2];\n\t\t\t\tcount2++; //increments count2 to keep track of where we are\n\t\t\t}\n\t\t}\n\t\t\n\t\t//checks if the length of the result array is even\n\t\tif(resultArr.length % 2 == 0)\n\t\t\t//finds the average of the numbers in the middle\n\t\t\tresult = (resultArr[midPoint] + resultArr[midPoint-1])/2.0;\n\t\telse\n\t\t\t//otherwise finds the number in the middle\n\t\t\tresult = resultArr[midPoint];\n\n\t\treturn result; //returns the median\n\t}", "public double findMedianSortedArrays(int[] A, int[] B) {\n\t\tint m = A.length;\n\t\tint n = B.length;\n\t\tif (m > n) { // to ensure m<=n\n\t\t\tint[] temp = A;\n\t\t\tA = B;\n\t\t\tB = temp;\n\t\t\tint tmp = m;\n\t\t\tm = n;\n\t\t\tn = tmp;\n\t\t}\n\t\tint iMin = 0, iMax = m, halfLen = (m + n + 1) / 2;\n\t\twhile (iMin <= iMax) {\n\t\t\tint i = (iMin + iMax) / 2;\n\t\t\tint j = halfLen - i;\n\t\t\tif (i < iMax && B[j - 1] > A[i]) {\n\t\t\t\tiMin = iMin + 1; // i is too small\n\t\t\t} else if (i > iMin && A[i - 1] > B[j]) {\n\t\t\t\tiMax = iMax - 1; // i is too big\n\t\t\t} else { // i is perfect\n\t\t\t\tint maxLeft = 0;\n\t\t\t\tif (i == 0) {\n\t\t\t\t\tmaxLeft = B[j - 1];\n\t\t\t\t} else if (j == 0) {\n\t\t\t\t\tmaxLeft = A[i - 1];\n\t\t\t\t} else {\n\t\t\t\t\tmaxLeft = Math.max(A[i - 1], B[j - 1]);\n\t\t\t\t}\n\t\t\t\tif ((m + n) % 2 == 1) {\n\t\t\t\t\treturn maxLeft;\n\t\t\t\t}\n\n\t\t\t\tint minRight = 0;\n\t\t\t\tif (i == m) {\n\t\t\t\t\tminRight = B[j];\n\t\t\t\t} else if (j == n) {\n\t\t\t\t\tminRight = A[i];\n\t\t\t\t} else {\n\t\t\t\t\tminRight = Math.min(B[j], A[i]);\n\t\t\t\t}\n\n\t\t\t\treturn (maxLeft + minRight) / 2.0;\n\t\t\t}\n\t\t}\n\t\treturn 0.0;\n\t}", "@Test\n public void test13() {\n Assert.assertEquals(1, MedianOfThreeNumbers.median(1, 1, 1));\n }" ]
[ "0.7992086", "0.7561925", "0.73433", "0.71643996", "0.7160708", "0.7095936", "0.705041", "0.7031747", "0.6965246", "0.69592434", "0.68834287", "0.6847956", "0.6667568", "0.66209996", "0.66136104", "0.6609416", "0.66024446", "0.6558608", "0.6489981", "0.6461748", "0.64509815", "0.64502263", "0.6281305", "0.62645465", "0.62156445", "0.61917835", "0.607095", "0.60413635", "0.60281944", "0.60061246", "0.5991241", "0.5959449", "0.593974", "0.59273744", "0.58938974", "0.58800185", "0.5861648", "0.5846226", "0.582823", "0.5807277", "0.57742256", "0.5750796", "0.5727272", "0.57209736", "0.5684172", "0.5682218", "0.5652758", "0.56410044", "0.563689", "0.56222016", "0.56143665", "0.56011456", "0.55544555", "0.55466664", "0.554157", "0.55387807", "0.5484755", "0.54838616", "0.5483015", "0.5456089", "0.54301447", "0.5422578", "0.53727406", "0.535885", "0.5357423", "0.53572464", "0.5347009", "0.53463143", "0.533716", "0.53093", "0.5299344", "0.5262526", "0.5254213", "0.5249182", "0.52387077", "0.521049", "0.520452", "0.5190852", "0.518812", "0.51706177", "0.5166841", "0.515373", "0.5129302", "0.5128421", "0.5076233", "0.5041015", "0.50355846", "0.50198495", "0.5019145", "0.50031036", "0.49973387", "0.49954405", "0.49947342", "0.49928817", "0.4987048", "0.49850336", "0.49756217", "0.49653023", "0.49419558", "0.4928524" ]
0.80504304
0
Applies an order n onedimensional median filter to the list to filter. The function considers the signal to be 0 beyond the end points. The output has the same length as the list to filter. Returns a new list. n must be odd! The function is defined as: f(i) = median( list(in/2) .. list(i+n/2) ) So for n = 3 and list to filter: [3 7 4] 0 [3 7 4] 0 [3 4 7]
public static List<Double> medianFilter(List<Double> listToFilter, int n) { if (n % 2 == 0) { throw new Error("Medianfilter not implemented for even n values"); } List<Double> filteredList = new ArrayList<Double>(); int numberOfZeroesToAddBefore = (n - 1) / 2; int numberOfZeroesToAddAfter = (n - 1) / 2; for (int i = 0; i < numberOfZeroesToAddBefore; i++) { listToFilter.add(0, 0.0); } for (int i = 0; i < numberOfZeroesToAddAfter; i++) { listToFilter.add(0.0); } for (int i = numberOfZeroesToAddBefore; i < listToFilter.size() - numberOfZeroesToAddAfter; i++) { double median = median(new ArrayList<Double>(listToFilter.subList(i - (n / 2), i + (n / 2) + 1))); filteredList.add(median); } for (int i = 0; i < numberOfZeroesToAddBefore; i++) { listToFilter.remove(0); } for (int i = 0; i < numberOfZeroesToAddAfter; i++) { listToFilter.remove(listToFilter.size() - 1); } return filteredList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int getMedian(ArrayList<Integer> inList) \n\t{\n\t\tCollections.sort(inList);\n\t\tint median = 0;\n\t\t\n\t\tif (inList.size()%2 == 0)\n\t\t{\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint position = inList.size()/2;\n\t\t\tmedian = inList.get(position);\n\t\t}\n\t\t\n\t\treturn median; \n\t\t\n\t\t\n\t}", "public static double findMedian(double weight[], int n) \n { \n \tSystem.out.println(\" Calculate median : \");\n \t//System.out.println(\" weight[] size : \"+ weight.length);\n \t//System.out.println(\" n : \"+ n);\n \tdouble a[] = new double[n];\n \t\n \t//weight array > 0.0\n\t\tfor(int i=0; i < weight.length; i++ ) {\n\t\t\tif(weight[i] > 0.0) {\n\t\t\t\ta[i] = weight[i];\n\t\t\t}\n\t\t}\n\t\t//System.out.println(\" a[] size : \"+ a.length);\n\t\t\n // First we sort the array \n Arrays.sort(a); \n \n // check for even case \n if (n % 2 != 0) \n return (double)a[n / 2]; \n \n return Double.valueOf(df.format((double)(a[(n - 1) / 2] + a[n / 2]) / 2.0)); \n }", "public static <T extends Number & Comparable> double computeMedian(ArrayList<T> nData) {\r\n if (nData.isEmpty()) // check data is empty or not\r\n throw new IllegalArgumentException(\"Size of array must be greater than 0\"); // throw exception if data is empty\r\n\r\n Collections.sort(nData); // sort ndata in ascending order.\r\n\r\n double median = nData.get(nData.size() / 2).doubleValue(); // declare median varibale and store median value of nData list\r\n if (nData.size() % 2 == 0) // check nData size even or not\r\n median = (nData.get(nData.size() / 2).doubleValue() + nData.get(nData.size() / 2 - 1).doubleValue()) / 2; // if condition is true than median value is update according expression\r\n\r\n return median; //return double type median value of ndata list\r\n }", "public double findMedian() {\n int size=list.size();\n if(size % 2 ==1) return list.get(size/2);\n else{\n return ((double)list.get(size/2)+(double)list.get(size/2-1))/2;\n }\n }", "static float getMedian(int ar1[], int ar2[], int n)\n\t{\n\t\t// If all elements of array 1 are smaller then\n\t\t // median is average of last element of ar1 and\n\t\t // first element of ar2\n\t\t if (ar1[n-1] < ar2[0])\n\t\t return (ar1[n-1]+ar2[0])/2;\n\n\t\t // If all elements of array 1 are smaller then\n\t\t // median is average of first element of ar1 and\n\t\t // last element of ar2\n\t\t if (ar2[n-1] < ar1[0])\n\t\t return (ar2[n-1]+ar1[0])/2;\n\n\t\t return getMedianRec(ar1, ar2, 0, n-1, n);\n\t}", "static double[] runningMedian(int[] a) {\r\n int n = a.length;\r\n\r\n double[] medianArr = new double[n];\r\n int i = 0;\r\n\r\n // max-heap\r\n PriorityQueue<Integer> max = new PriorityQueue<Integer>(Collections.reverseOrder());\r\n \r\n // min-heap\r\n PriorityQueue<Integer> min = new PriorityQueue<Integer>();\r\n\r\n double median = 0.0;\r\n\r\n for(int j=0; j<n; j++) {\r\n int x = a[j];\r\n if(min.size() == max.size()) {\r\n if(x < median) {\r\n max.add(x);\r\n median = (double)max.peek();\r\n medianArr[i] = median;\r\n i += 1;\r\n } else {\r\n min.add(x);\r\n median = (double)min.peek();\r\n medianArr[i] = median;\r\n i += 1;\r\n }\r\n } else if (max.size() > min.size()) {\r\n if(x < median) {\r\n min.add(max.remove());\r\n max.add(x);\r\n } else {\r\n min.add(x);\r\n }\r\n median = (double)(max.peek() + min.peek())/2;\r\n medianArr[i] = median;\r\n i += 1;\r\n } else {\r\n if(x > median) {\r\n max.add(min.remove());\r\n min.add(x);\r\n } else {\r\n max.add(x);\r\n }\r\n median = (double)(max.peek() + min.peek())/2;\r\n medianArr[i] = median;\r\n i += 1;\r\n }\r\n }\r\n\r\n return medianArr;\r\n }", "static float ver3Median(int a[], int aStart, int aEnd, int b[], int bStart, int bEnd) {\n\n\n if (aEnd == 0) return getMedian(b, bEnd);\n\n // If the smaller array has only one element\n if (aEnd == 1) {\n // Case 1: If the larger array also has one element,\n // simply call MO2()\n if (bEnd == 1) return getMedian(a[0], b[0]);\n\n // Case 2: If the larger array has odd number of elements,\n // then consider the middle 3 elements of larger array and\n // the only element of smaller array. Take few examples\n // like following\n // a = {9}, b[] = {5, 8, 10, 20, 30} and\n // a[] = {1}, b[] = {5, 8, 10, 20, 30}\n if ((bEnd - aStart) % 2 > 0)\n return getMedian(b[bEnd / 2], getMedian(a[0], b[bEnd / 2 - 1], b[bEnd / 2 + 1]));\n\n // Case 3: If the larger array has even number of element,\n // then median will be one of the following 3 elements\n // ... The middle two elements of larger array\n // ... The only element of smaller array\n return getMedian(b[bEnd / 2], b[bEnd / 2 - 1], a[0]);\n }\n\n // If the smaller array has two elements\n else if (aEnd == 2) {\n // Case 4: If the larger array also has two elements,\n // simply call MO4()\n if (bEnd == 2) return getMedian(a[aStart], a[aStart + 1], b[bStart], b[bStart + 1]);\n\n // Case 5: If the larger array has odd number of elements,\n // then median will be one of the following 3 elements\n // 1. Middle element of larger array\n // 2. Max of first element of smaller array and element\n // just before the middle in bigger array\n // 3. Min of second element of smaller array and element\n // just after the middle in bigger array\n //if ((bEnd & 1) == 1)\n if ((bEnd - aStart) % 2 > 0)\n return getMedian(b[bEnd / 2],\n max(a[0], b[bEnd / 2 - 1]),\n min(a[1], b[bEnd / 2 + 1])\n );\n\n // Case 6: If the larger array has even number of elements,\n // then median will be one of the following 4 elements\n // 1) & 2) The middle two elements of larger array\n // 3) Max of first element of smaller array and element\n // just before the first middle element in bigger array\n // 4. Min of second element of smaller array and element\n // just after the second middle in bigger array\n return getMedian(b[bEnd / 2],\n b[bEnd / 2 - 1],\n max(a[0], b[bEnd / 2 - 2]),\n min(a[1], b[bEnd / 2 + 1])\n );\n }\n\n int idxA = (aEnd - 1) / 2;\n int idxB = (bEnd - 1) / 2;\n\n Out.pln();\n Out.plnRange(\"a\", a, aStart, aEnd - 1, aStart + idxA);\n Out.plnRange(\"b\", b, bStart, bEnd - 1, bStart + idxB);\n Out.pln();\n\n if (a[aStart + idxA] <= b[bStart + idxB])\n return ver3Median(a, aStart + idxA, aEnd / 2 + 1, b, bStart, bEnd - idxA);\n else\n return ver3Median(a, aStart, aEnd / 2 + 1, b, bStart + idxA, bEnd - idxA);\n }", "public Set<String> median(List<Set<String>> inputData) {\n if (inputData == null || inputData.size() == 0) {\n return null; // Cannot do anything\n }\n Collections.sort(inputData, new Comparator<Set<String>>() {\n public int compare(Set<String> set1, Set<String> set2) {\n int size1 = set1.size();\n int size2 = set2.size();\n return size1 - size2;\n }\n });\n // Take the median\n int size = inputData.size();\n int index = size / 2;\n return inputData.get(index);\n }", "private void calcMedian(SimpleProtein.ProtChain chain) {\n\t\tList<List<Double>> falseValuesList = new LinkedList<>();\n\t\tList<List<Double>> trueValuesList = new LinkedList<>();\n\t\tList<List<Double>> allValuesList = new LinkedList<>();\n\t\t\n\t\tfor (int i = 0; i < chain.resIntensityValueMatrix.length; i++) {\n\t\t\tfalseValuesList.add(new LinkedList<>());\n\t\t\ttrueValuesList.add(new LinkedList<>());\n\t\t\tallValuesList.add(new LinkedList<>());\n\t\t\tfor (int j = 0; j < chain.resIntensityValueMatrix[i].length; j++) {\n\t\t\t\tif (chain.originalPositions[j] != i) {\n\t\t\t\t\tfalseValuesList.get(i).add(chain.resIntensityValueMatrix[i][j]);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\ttrueValuesList.get(i).add(chain.resIntensityValueMatrix[i][j]);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tallValuesList.get(i).add(chain.resIntensityValueMatrix[i][j]);\n\t\t\t}\n\t\t\tCollections.sort(falseValuesList.get(i));\n\t\t\tCollections.sort(trueValuesList.get(i));\n\t\t\tCollections.sort(allValuesList.get(i));\n\t\t}\n\t\tdouble[] falseValuesMedian = new double[falseValuesList.size()];\n\t\tdouble[] trueValuesMedian = new double[trueValuesList.size()];\n\t\tdouble[] allValuesMedian = new double[allValuesList.size()];\n\t\t\n\t\t\n\t\tfor (int i = 0; i < falseValuesList.size(); i++) {\n\t\t\tif (falseValuesList.get(i).size() == 0) {\n\t\t\t\tfalseValuesMedian[i] = 0;\n\t\t\t} else {\n\t\t\t\tint middle = falseValuesList.get(i).size() / 2;\n\t\t\t\tif (falseValuesList.get(i).size() % 2 == 1) {\n\t\t\t\t\tfalseValuesMedian[i] = falseValuesList.get(i).get(middle);\n\t\t\t\t} else {\n\t\t\t\t\tfalseValuesMedian[i] = (falseValuesList.get(i).get(middle - 1) + falseValuesList.get(i).get(middle)) / 2.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < allValuesList.size(); i++) {\n\t\t\tif (allValuesList.get(i).size() == 0) {\n\t\t\t\tallValuesMedian[i] = 0;\n\t\t\t} else {\n\t\t\t\tint middle = allValuesList.get(i).size() / 2;\n\t\t\t\tif (allValuesList.get(i).size() % 2 == 1) {\n\t\t\t\t\tallValuesMedian[i] = allValuesList.get(i).get(middle);\n\t\t\t\t} else {\n\t\t\t\t\tallValuesMedian[i] = (allValuesList.get(i).get(middle - 1) + allValuesList.get(i).get(middle)) / 2.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < trueValuesList.size(); i++) {\n\t\t\tif (trueValuesList.get(i).size() == 0) {\n\t\t\t\ttrueValuesMedian[i] = 0;\n\t\t\t} else {\n\t\t\t\tint middle = trueValuesList.get(i).size() / 2;\n\t\t\t\tif (trueValuesList.get(i).size() % 2 == 1) {\n\t\t\t\t\ttrueValuesMedian[i] = trueValuesList.get(i).get(middle);\n\t\t\t\t} else {\n\t\t\t\t\ttrueValuesMedian[i] = (trueValuesList.get(i).get(middle - 1) + trueValuesList.get(i).get(middle)) / 2.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tchain.medianTrue = trueValuesMedian;\n\t\tchain.medianFalse = falseValuesMedian;\n\t\tchain.allMedian = allValuesMedian;\n\t\t\n\t\tfor (int i = 0; i < chain.signalMaybe.length; i++) {\n\t\t\tchain.signalMaybe[i] = chain.medianTrue[i] - chain.medianFalse[i];\n\t\t}\n\t\t\n\t}", "public static double median(int[] arr){\n System.out.println(\"array\" + Arrays.toString(arr));\n if (arr.length % 2 != 1){//if array even\n return arr[arr.length/2];\n }\n else{\n double right = arr[arr.length / 2];\n double left = arr[arr.length / 2 - 1];\n return (right+left)/2;\n }\n }", "public static Double median(List<Double> list) {\r\n if (list == null || list.size() == 0) {\r\n throw new Error(\"Mean of an empty list is undefined\");\r\n }\r\n int size = list.size();\r\n Collections.sort(list);\r\n double median = 0.0;\r\n if (size % 2 == 0) {\r\n median = (list.get(size / 2) + list.get((size / 2) - 1)) / 2.0;\r\n } else {\r\n median = list.get(size / 2);\r\n }\r\n return median;\r\n }", "private static double median(double[] m) {\n\t\tint middle = m.length/2; // subscript of middle element\n\t\tif (m.length%2 == 1) {\n\t\t\t// Odd number of elements -- return the middle one.\n\t\t\treturn m[middle];\n\t\t} else {\n\t\t\t// Even number -- return average of middle two\n\t\t\t// Must cast the numbers to double before dividing.\n\t\t\treturn (m[middle-1] + m[middle]) / 2.0;\n\t\t}\n\t}", "private static native void weightedMedianFilter_0(long joint_nativeObj, long src_nativeObj, long dst_nativeObj, int r, double sigma, int weightType, long mask_nativeObj);", "public T median();", "private static void trim( List<?> list, int n ) {\n \twhile (list.size() > n) {\n \t\tlist.remove(list.size() - 1);\n \t}\n }", "double median(double[] a){\n int length = a.length;\n double temp;\n\n //sort array\n for( int i = 0; i < length; i++){\n for (int j = i+1; j < length; j++){\n if (a[j] < a[i]) {\n temp = a[i];\n a[i] = a[j];\n a[j] = temp;\n }\n }\n }\n double median = (a[length/2] + a[(length/2)+1])/2;\n return median;\n }", "public static double getMedian(double[] data) {\n Objects.requireNonNull(data, \"The supplied array was null\");\n Arrays.sort(data);\n int size = data.length;\n double median = -1;\n if (size % 2 == 0) {//even\n int firstIndex = (size / 2) - 1;\n int secondIndex = firstIndex + 1;\n double firstValue = data[firstIndex];\n double secondValue = data[secondIndex];\n median = (firstValue + secondValue) / 2.0;\n } else {//odd\n int index = (int) Math.ceil(size / 2.0);\n median = data[index];\n }\n return median;\n }", "static double[] runningMedian(int[] a) {\n\n double[] doubles = new double[a.length];\n ArrayList<Integer> integers = new ArrayList<>();\n\n //Fila de prioridade\n PriorityQueue<Integer> maxHeap = new PriorityQueue<>(Collections.reverseOrder());\n PriorityQueue<Integer> minHeap = new PriorityQueue<>();\n\n double median = 0;\n\n for (int i = 0; i < a.length; i++) {\n if (a[i] <= median) {\n maxHeap.add(a[i]);\n } else {\n minHeap.add(a[i]);\n }\n\n if (minHeap.size() > maxHeap.size()+1) {\n maxHeap.add(minHeap.peek());\n minHeap.remove();\n }\n if (maxHeap.size() > minHeap.size()+1) {\n minHeap.add(maxHeap.peek());\n maxHeap.remove();\n }\n\n if (minHeap.size() == maxHeap.size()) {\n median = (maxHeap.peek() + minHeap.peek())/2.0;\n } else if(minHeap.size() > maxHeap.size()) {\n median = (double) minHeap.peek();\n } else if (minHeap.size() < maxHeap.size()) {\n median = (double) maxHeap.peek();\n }\n doubles[i] = median;\n }\n\n return doubles;\n }", "static float getMedianRec(int ar1[], int ar2[], int left, int right, int n)\n\t{\n\t int i, j;\n\n\t /* We have reached at the end (left or right) of ar1[] */\n\t if (left > right)\n\t return getMedianRec(ar2, ar1, 0, n-1, n);\n\n\t i = (left + right)/2;\n\t j = n - i - 1; /* Index of ar2[] */\n\n\t /* Recursion terminates here.*/\n\t if (ar1[i] > ar2[j] && (j == n-1 || ar1[i] <= ar2[j+1]))\n\t {\n\t /* ar1[i] is decided as median 2, now select the median 1\n\t (element just before ar1[i] in merged array) to get the\n\t average of both*/\n\t if (i == 0 || ar2[j] > ar1[i-1])\n\t return (float)(ar1[i] + ar2[j])/2;\n\t else\n\t return (float)(ar1[i] + ar1[i-1])/2;\n\t }\n\n\t /*Search in left half of ar1[]*/\n\t else if (ar1[i] > ar2[j] && j != n-1 && ar1[i] > ar2[j+1])\n\t return getMedianRec(ar1, ar2, left, i-1, n);\n\n\t /*Search in right half of ar1[]*/\n\t else /* ar1[i] is smaller than both ar2[j] and ar2[j+1]*/\n\t return getMedianRec(ar1, ar2, i+1, right, n);\n\t}", "private static void sort(ArrayList<Comparable> list, int startIndex, int endIndex)\n {\n if (startIndex < endIndex)\n {\n int lowerIndex = startIndex;\n int medianIndex = (startIndex + endIndex) / 2;\n int upperIndex = endIndex;\n Comparable medianValue = list.get(medianIndex);\n\n while (lowerIndex < upperIndex)\n {\n while (list.get(lowerIndex).compareTo(medianValue) < 0)\n {\n ++lowerIndex;\n }\n\n while (list.get(upperIndex).compareTo(medianValue) > 0)\n {\n --upperIndex;\n }\n\n if (lowerIndex < upperIndex)\n {\n Comparable valueAtLowerIndex = list.get(lowerIndex);\n\n list.set(lowerIndex++, list.get(upperIndex));\n list.set(upperIndex--, valueAtLowerIndex);\n }\n else if (lowerIndex == upperIndex)\n {\n ++lowerIndex;\n --upperIndex;\n }\n }\n\n sort(list, startIndex, upperIndex);\n sort(list, lowerIndex, endIndex);\n }\n }", "public void MedianFinder() {\n lowerPart = new PriorityQueue<>((a, b) -> (b - a));\n higherPart = new PriorityQueue<>();\n count = 0;\n }", "public static List<Double> gaussianFilter(List<Double> listToFilter, double parameter) {\r\n int windowSize = 7;\r\n List<Double> filteredList = new ArrayList<Double>();\r\n \r\n // double firstFactor = Math.pow(parameter/Math.PI, 0.5) *\r\n // Math.pow(Math.E, -1 * parameter);\r\n \r\n for (int j = 0; j < windowSize / 2; j++) {\r\n filteredList.add(0.0);\r\n }\r\n \r\n for (int i = windowSize / 2; i < listToFilter.size() - windowSize / 2; i++) {\r\n double sumValues = 0;\r\n double sumWeight = 0;\r\n for (int j = 0; j < windowSize; j++) {\r\n double weight = Math.pow(Math.E, -1 * (j - windowSize / 2) * (j - windowSize / 2) / 2\r\n * parameter);\r\n \r\n sumWeight += weight;\r\n sumValues += weight * listToFilter.get(i);\r\n }\r\n double newValue = 1.0 / sumWeight * sumValues / sumWeight;\r\n \r\n filteredList.add(newValue);\r\n }\r\n \r\n for (int j = 0; j < windowSize / 2; j++) {\r\n filteredList.add(0.0);\r\n }\r\n \r\n return filteredList;\r\n }", "private static ArrayList<double[]> createSamples(double p, int n) {\n\t\tArrayList<double[]> result = new ArrayList<double[]>();\n\t\tint cutoff = (int) Math.round(n * p);\n\t\tfor (int i = 0; i < cutoff; i++) result.add(new double[] {1});\n\t\tfor (int i = cutoff; i < n; i++) result.add(new double[] {0});\n\t\treturn result;\n\t}", "public double findMedian(ArrayList<double[]> partition, int dim){\n\t\t\n\t\t// temporary hash set to store the different values in\n\t\tArrayList<Double> sortedValues = new ArrayList<Double>();\n\t\t\n\t\tfor(int i = 0; i < partition.size(); i++){\n\t\t\tsortedValues.add(partition.get(i)[dim]);\n\t\t}\n\t\t\n\t\t// sort the values in an ascending order\n\t\tCollections.sort(sortedValues);\n\t\t\n\t\t// calculate the median using the sorted array and under consideration \n\t\t// of the difference between uneven and even amount of numbers\n\t\tif(sortedValues.size() % 2 == 1){\n\t\t\treturn sortedValues.get(sortedValues.size() / 2);\n\t\t}else{\n\t\t\t// Calculating median if the number of values is even \n\t\t\treturn (sortedValues.get(sortedValues.size() / 2)\n\t\t\t+sortedValues.get((sortedValues.size() - 1) / 2)) / 2;\n\t\t}\n\t}", "public static double getMedian(int[] arr) {\n int n = arr.length;\n if (n % 2 == 0) {\n return (arr[n / 2 - 1] + arr[n / 2]) / 2.0;\n } else {\n return arr[n / 2];\n }\n }", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int [] array = new int[n];\n for (int i = 0; i < n; i++) {\n array[i] = scan.nextInt();\n }\n scan.close();\n medianTracker(array);\n }", "public static int median(int[] A) {\n int rank = A.length / 2;\n if (A.length % 2 == 0) {\n rank--;\n }\n return quickSelect(A, rank);\n }", "public static <E> List<E> take(Stream<? extends E> stream, int n){\n if (stream == null) return null;\n List<E> output_list = new LinkedList<E>();\n if ( n != 0) {\n Iterator<? extends E> iter = stream.iterator();\n while( n-- != 0 && iter.hasNext()) { output_list.add(iter.next()); }\n }\n return output_list;\n }", "public MedianFinder() {\n list = new ArrayList<>();\n }", "public double[] medianSlidingWindow(int[] nums, int k) {\n Comparator<Integer> comparator = (a, b) -> nums[a] != nums[b] ? Integer.compare(nums[a], nums[b]) : a - b;\n \n minHeap = new TreeSet<>(comparator);\n \n maxHeap = new TreeSet<>(comparator.reversed());\n \n int n = nums.length;\n \n double output[] = new double[n - k + 1];\n \n int left = 0;\n \n //This works like a sliding window.\n //In each window we calculate the median using the above steps in comments\n for(int right = 0; right < n; right++){\n \n //Remove the indices of the element from the left as the window progresses\n if(right >= k){\n \n minHeap.remove(right - k);\n maxHeap.remove(right - k);\n }\n \n //Add the element to min heap first\n minHeap.add(right);\n \n //Remove the first element from the min heap and add that to maxHeap\n maxHeap.add(minHeap.pollFirst());\n \n //It will balance the sizes if maxHeap > minHeap\n balanceHeaps();\n \n if(right >= k - 1){\n \n output[left++] = getMedian(nums, k);\n } \n }\n \n return output;\n \n }", "public static void medianQuickSort(int arr[], int first, int last) {\n if (first >= last)\n return;\n\n if (first < last) {\n\n int pivot = medianPivot(arr, first, last);\n //System.out.println(pivot);\n QuickSort(arr, first, last);\n }\n }", "private static <AnyType extends Comparable<? super AnyType>> AnyType median3(AnyType[] a, int left, int right)\n {\n int center = (left + right) / 2;\n if(a[center].compareTo(a[left]) < 0)\n CommonFunc.swapReference(a, left, center);\n if(a[right].compareTo(a[left]) < 0)\n CommonFunc.swapReference(a, left, right);\n if(a[right].compareTo(a[center]) < 0)\n CommonFunc.swapReference(a, center, right);\n \n // Place pivot at position right - 1\n CommonFunc.swapReference(a, center, right - 1);\n return a[right - 1];\n }", "private static double MedianofTwoSortedArraysTest(int[] nums1, int[] nums2) {\n\t\tint m = nums1.length;\r\n\t\tint n = nums2.length;\r\n\t\t\r\n\t\tif(m<n){\r\n\t\t\treturn MedianofTwoSortedArraysTest(nums2,nums1);\r\n\t\t}\r\n\t\t\r\n\t\tif(n==0){\r\n\t\t\treturn ((double)nums1[(m-1)/2]+(double)nums1[m/2])/2;\r\n\t\t}\r\n\t\t\r\n\t\tint lo = 0, hi = n*2;\r\n\t\twhile(lo<=hi){\r\n\t\t\tint mid2 = (lo+hi)/2;\r\n\t\t\tint mid1 = m+n-mid2;\r\n\t\t\t\r\n\t double L1 = (mid1 == 0) ? Integer.MIN_VALUE: nums1[(mid1-1)/2];\r\n\t double L2 = (mid2 == 0) ? Integer.MIN_VALUE : nums2[(mid2-1)/2];\r\n\t double R1 = (mid1 == m * 2) ? Integer.MAX_VALUE : nums1[(mid1)/2];\r\n\t double R2 = (mid2 == n * 2) ? Integer.MAX_VALUE : nums2[(mid2)/2];\r\n\t \r\n\t if(L1>R2) lo = mid2+1;\r\n\t else if(L2>R1) hi = mid2-1;\r\n\t else return (Math.max(L1, L2)+Math.min(R1, R2))/2;\r\n\t\t}\r\n\t\t\r\n\t\treturn -1;\r\n\t}", "public boolean areMedianIntensities();", "private static int partitionRandomMedian(double[] array, int p, int r) {\n\t\tint randomIndex[]= new int[3];\r\n\t\t\trandomIndex[0] = ThreadLocalRandom.current().nextInt(p, r + 1);\r\n\t\t\trandomIndex[1] = ThreadLocalRandom.current().nextInt(p, r + 1);\r\n\t\t\trandomIndex[2] = ThreadLocalRandom.current().nextInt(p, r + 1);\r\n\t\t\tArrays.sort(randomIndex);// SORTING THREE ELEMENTS IS CONSTANT TIME\r\n\t\t\tint median = (randomIndex[1]);\r\n\t\tcomplexityCount++;\r\n\t\tdouble temp = array[median];\r\n\t\tarray[median] = array[r];\r\n\t\tarray[r] = temp;\r\n\t\t//CALL TRADITIONAL PARTITION\r\n\t\treturn partition(array, p, r);\r\n\t}", "private static void medianOfThree(int[] a, int low, int middle, int high) {\n\n if (a[middle] < a[low]) {\n swap(a, low, middle);\n }\n if (a[high] < a[low]) {\n swap(a, low, high);\n }\n\n if (a[high] < a[middle]) {\n swap(a, middle, high);\n }\n }", "public static int medianOfThree(int[] arr, int left, int right) {\n int mid = (right + left) / 2;\n\n if (arr[right] < arr[left]) {\n swap(arr, left, right);\n }\n if (arr[mid] < arr[left]) {\n swap(arr, mid, left);\n }\n if (arr[right] < arr[mid]) {\n swap(arr, right, mid);\n }\n\n return mid;\n }", "public void shiftedHigherPassFilter(Complex[] F, Img i, int n, int d0){\n\t\t\tfor (int u=0; u< i.width; u++){\n\t\t\t\tfor (int v=0; v < i.height; v++){\n\t\t\t\t\tint a = Math.abs(u-128);\n\t\t\t\t\tint b = Math.abs(v-128);\n\t\t\t\t\ta = Math.abs(a-42);\n\t\t\t\t\tb = Math.abs(b-45);\n\t\t\t\t\tdouble D = Math.sqrt( a*a+b*b);\n\t\t\t\t\tdouble h=\t1/ (1 + Math.pow(d0/D,2*n) );\n\t\t\t\t\tF[u*i.width+v].mul(h);\n\n\t\t\t\t\ta = Math.abs(u-128);\n\t\t\t\t\ta = Math.abs(a-84);\n\t\t\t\t\tD = Math.sqrt( a*a+b*b);\n\t\t\t\t\th=\t1/ (1 + Math.pow(d0/D,2*n) );\n\t\t\t\t\tF[u*i.width+v].mul(h);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public static void main(String[] args) {\n FindMedian sol1 = new FindMedian();\n Scanner scan = new Scanner(System.in);\n sol1.n = scan.nextInt();\n for (int i = 0 ; i < sol1.n; i++) {\n sol1.numbers.add(scan.nextInt());\n }\n sol1.process();\n }", "@SuppressWarnings(\"unchecked\")\r\n\tprivate static <E extends Comparable<? super E>> E median3(\r\n\t\t\tComparable<E>[] data, int left, int right) {\r\n\r\n\t\t// Put the left, middle and right values in their correct relative\r\n\t\t// positions\r\n\t\tint center = (left + right) / 2;\r\n\t\tif (data[left].compareTo((E) data[center]) > 0) {\r\n\t\t\tswap(data, left, center);\r\n\t\t}\r\n\t\tif (data[left].compareTo((E) data[right]) > 0) {\r\n\t\t\tswap(data, left, right);\r\n\t\t}\r\n\t\tif (data[center].compareTo((E) data[right]) > 0) {\r\n\t\t\tswap(data, center, right);\r\n\t\t}\r\n\r\n\t\t// Median is in the middle, put it at the right\r\n\t\tswap(data, center, right - 1);\r\n\t\treturn (E) data[right - 1];\r\n\t}", "public static int median(int[] arr) {\n int middle = arr.length / 2;\n int median = 0;\n if (arr.length % 2 == 1)\n median = arr[middle];\n else\n median = (arr[middle - 1] + arr[middle]) / 2;\n return median;\n }", "private int getMedian(int left, int right){\n int median = right - left + 1;\n median = (median + 1) / 2 - 1;\n return median + left;\n }", "void deleteMedian () {\n if (fillLength > 0) {\n for (int i = fillLength / 2; i < fillLength - 1; i++) {\n array[i] = array[i + 1];\n }\n array[fillLength - 1] = 0;\n fillLength--;\n }\n }", "static public float filter5 (double inumbr) {\n float number;\n int intermed;\n \n intermed = (int) (inumbr * 100000.);\n number = (float) (intermed / 100000. );\n return number;\n }", "public ListNode removeNthFromEnd(ListNode list, int n)\r\n {\r\n ListNode head = new ListNode();\r\n head.next = list;\r\n ListNode prev = head;\r\n ListNode after = head;\r\n for (int i = 0; i < n; i++)\r\n {\r\n if (after.next == null && i < n)\r\n {\r\n return head.next;\r\n }\r\n after = after.next;\r\n }\r\n while (after.next != null)\r\n {\r\n prev = prev.next;\r\n after = after.next;\r\n }\r\n prev.next = prev.next.next;\r\n return head.next;\r\n }", "private static int findMedian(int[] arr, int lo, int hi){\n\t\tfor(int i = lo + 1; i < hi; i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint j = lo;\n\t\t\t\n\t\t\twhile((j >= lo) && (arr[j] > temp)) {\n\t\t\t\tarr[j+1] = arr[j];\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tarr[j+1] = temp;\n\t\t}\n\t\t\n\t\tint median = (int)Math.ceil((hi - lo)/2);\n\t\treturn lo + median;\n\t}", "public static List<Integer> sieve(int n) {\n\t\tboolean[] arr = new boolean[n + 1];\n\t\t\n\t\tarr[0] = true;\n\t\t\n\t\t// 1 is not prime by definition\n\t\tif (arr.length > 1) {\n\t\t\tarr[1] = true;\n\t\t}\n\n\t\tint i = 2;\n\t\twhile (i < n) {\n\t\t\tarr = markMultiples(i, arr);\n\t\t\ti = getNextUnmarked(++i, arr);\n\n\t\t\t// next i exceeds n\n\t\t\tif (i == -1) { \n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn getUnmarked(arr);\n\t}", "public static double median(double[] a) {\n\t\tArrays.sort(a);\n\t\tif (a.length%2==1)\n\t\t\treturn a[a.length/2];\n\t\telse\n\t\t\treturn (a[a.length/2-1]+a[a.length/2])/2.0;\n\t}", "private float calculateMedian()\n {\n int numberEmployees = employees.size();\n int position = 0; //kindex of where median is located\n float median = 0;\n \n // Create an array of all gross pays\n float[] allGrossPay = new float[numberEmployees];\n allGrossPay = calculateAllGrossPay();\n \n //Sort the array\n Arrays.sort(allGrossPay);\n // For even number of entries median is the mean of the two middle points\n if (numberEmployees % 2 == 0) \n {\n median = (allGrossPay[numberEmployees/2] + \n allGrossPay[numberEmployees/2 - 1])/2;\n }\n else\n {\n median = allGrossPay[numberEmployees/2];\n } \n return median;\n }", "public static void main(String[] args) {\n\n int nums[] = {1, 2};\n int nums2[] = {3, 4};\n System.out.println(Medianof2SortedArrays.findMedianSortedArraysSol(nums, nums2));\n\n }", "public MedianFinder1() {\n list = new ArrayList<>();\n }", "public static double median(double[] arr) {\n if (arr == null) return Double.NaN;\n int l = arr.length;\n if (l == 0) return Double.NaN;\n Arrays.sort(arr);\n return arr[(int)Math.floor(l/2.0)] / 2 + arr[(int)Math.ceil(l/2.0)] / 2;\n }", "public static void main(String[] args) {\n\t\t\n\t\tList<Integer> list = Arrays.asList(1,5,8,9,8,5);\n\t\tConsumer<Integer> consumer = (index)-> System.out.println(list.get(index)*2);\n\t\tfilter(list, consumer);\n\t}", "public static double xavier_weight(double n_in) {\n return (2*(rand.nextDouble()-1)) * 2/Math.sqrt(n_in);\n }", "private Double getMedian(List<Double> sortedDouble) {\n Double median;\n if (sortedDouble.size() % 2 != 0) {\n median = sortedDouble.get(sortedDouble.size() / 2);\n } else {\n median = (sortedDouble.get((sortedDouble.size() - 1) / 2) + sortedDouble.get((sortedDouble.size() / 2)));\n }\n return median;\n }", "public int[] median_thresh(int[] src, int width, int height, int size,\n int con) {\n\n i_w = width;\n i_h = height;\n src_1d = new int[i_w * i_h];\n dest_1d = new int[i_w * i_h];\n int median = 0;\n int[] values = new int[size * size];\n int count = 0;\n src_1d = src;\n int[][] tmp_2d = new int[i_w][i_h];\n\n //First convert input array from 1_d to 2_d for ease of processing\n for (int i = 0; i < i_w; i++) {\n for (int j = 0; j < i_h; j++) {\n tmp_2d[i][j] = src_1d[i + (j * i_w)] & 0x000000ff;\n }\n }\n\n //Now find the values in the size X size neigbourhood\n for (int j = 0; j < i_h; j++) {\n for (int i = 0; i < i_w; i++) {\n median = 0;\n count = 0;\n values = new int[size * size];\n //Check the local neighbourhood\n for (int k = 0; k < size; k++) {\n for (int l = 0; l < size; l++) {\n try {\n values[count] = tmp_2d[(i - ((int) (size / 2)) + k)]\n [(j - ((int) (size / 2)) + l)];\n count++;\n }\n //If out of bounds then ignore pixel\n catch (ArrayIndexOutOfBoundsException e) {\n // TODO: eliminate this\n }\n }\n }\n //Find the median value\n\n //First Sort the array\n Arrays.sort(values);\n\n //Then select the median\n count = count / 2;\n median = values[count] - con;\n\n //Threshold below the median\n if (tmp_2d[i][j] >= median) {\n dest_1d[i + (j * i_w)] = 0xffffffff;\n } else {\n dest_1d[i + (j * i_w)] = 0xff000000;\n }\n }\n }\n return dest_1d;\n }", "public static void main(String[] args) {\n int[][] A = {\n {1, 3, 5},\n {2, 6, 9},\n {3, 6, 9}\n };\n\n System.out.println(findMedian(A));\n\n }", "@SuppressWarnings(\"unchecked\")\r\n\tprivate static <E extends Comparable<? super E>> E median3(\r\n\t\t\tComparable<E>[] data, int left, int right,\r\n\t\t\tComparator<Comparable<E>> comp) {\r\n\r\n\t\t// Put the left, middle and right values in their correct relative\r\n\t\t// positions\r\n\t\tint center = (left + right) / 2;\r\n\t\tif (comp.compare(data[left], data[center]) > 0) {\r\n\t\t\tswap(data, left, center);\r\n\t\t}\r\n\t\tif (comp.compare(data[left], data[right]) > 0) {\r\n\t\t\tswap(data, left, right);\r\n\t\t}\r\n\t\tif (comp.compare(data[center], data[right]) > 0) {\r\n\t\t\tswap(data, center, right);\r\n\t\t}\r\n\r\n\t\t// Median is in the middle, put it at the right\r\n\t\tswap(data, center, right - 1);\r\n\t\treturn (E) data[right - 1];\r\n\t}", "private LinkedList<Integer> pollN(LinkedList<Integer> list, int n){\n return new LinkedList<>(list).stream().limit(n).collect(Collectors.toCollection(LinkedList::new));\n }", "public native MagickImage medianFilterImage(double radius)\n\t\t\tthrows MagickException;", "public static void removeEvens(ArrayList<Integer> list)\n {\n /*\n * size method returns the number of elements in the list\n */\n //int size = list.size();//valid way to ge the size\n \n for(int i = 0; i < list.size(); )\n {\n /*\n * get method return the value of the elemtne at the index\n * list get smaller, elements are \"shifted left\"\n */\n int value = list.get(i);\n if( value %2 == 0)\n {\n /*\n * remove method deletes the element at the specified index\n */\n list.remove(i);\n //i--;// if remove move index back one to compensate\n }\n else//only increase i if you don't remove\n {\n i++;\n }\n }\n }", "private static void skipNthNumber(List<Integer> numbers, int n) {\n\t\tList<Integer> skippedNumbers = numbers.stream().skip(n).collect(Collectors.toList());\r\n\t\tint fifthNumber = numbers.stream().skip(n - 1).findFirst().orElse(0);\r\n\t\tList<Integer> firstFiveNumber = numbers.stream().limit(n).collect(Collectors.toList());\r\n\t\tSystem.out.println(\"********************* nth = \" + n + \" ***************\");\r\n\t\tSystem.out.println(\"Full List=>\" + numbers);\r\n\t\tSystem.out.println(\"Skip \" + n + \"th number ==>\" + skippedNumbers);\r\n\t\tSystem.out.println(\"Limit of \" + n + \" number = \" + firstFiveNumber);\r\n\t}", "public int findMedian(int[] array) {\r\n\t\tint i;\r\n\t\tint sumRight = 0;\r\n\t\tint sumLeft = 0;\r\n\t\tfloat differenceBetweenTheTwoSums = sum(array, 0, array.length);\r\n\t\tint index = 0;\r\n\t\tint medianIndex = 0;\r\n\t\tfloat absSubtraction = 0;\r\n\r\n\t\tfor (i = 0; i < array.length - 1; i++) {\r\n\t\t\tsumRight = sum(array, 0, index);\r\n\t\t\tsumLeft = sum(array, index + 1, array.length);\r\n\t\t\tabsSubtraction = Math.abs(sumLeft - sumRight);\r\n\t\t\tif (absSubtraction <= differenceBetweenTheTwoSums) {\r\n\t\t\t\tdifferenceBetweenTheTwoSums = absSubtraction;\r\n\t\t\t\tmedianIndex = index;\r\n\t\t\t}\r\n\t\t\tindex++;\r\n\t\t}\r\n\t\treturn medianIndex++;\r\n\t}", "static void selectKItems(int stream[], int n, int k)\n {\n int i; // index for elements in stream[]\n\n // reservoir[] is the output array. Initialize it with\n // first k elements from stream[]\n int reservoir[] = new int[k];\n for (i = 0; i < k; i++)\n reservoir[i] = stream[i];\n Random r = new Random();\n // Iterate from the (k+1)th element to nth element\n for (; i < n; i++)\n {\n // Pick a random index from 0 to i.\n int j = r.nextInt(i + 1);\n\n // If the randomly picked index is smaller than k,\n // then replace the element present at the index\n // with new element from stream\n if(j < k)\n reservoir[j] = stream[i];\n }\n System.out.println(\"Following are k randomly selected items\");\n System.out.println(Arrays.toString(reservoir));\n }", "public static double getMedian()\n {\n // add your code here\n if(s.size()==g.size()){\n return (double) ((s.peek()+g.peek())/2);\n }\n else if(s.size() > g.size()) {\n return (double) s.peek();\n }\n else {\n return (double) g.peek();\n }\n }", "public static double median(double[] mainArray2) {\r\n\t\t//finds the smallest number and moves it to the end of the array\r\n\t\tint min2 = 0;\r\n\t\tfor(int lessThan = 1; lessThan < mainArray2.length; lessThan ++) {\r\n\r\n\t\t\tif(mainArray2[lessThan]<mainArray2[min2]) {\r\n\t\t\t\tmin2 = lessThan;\r\n\t\t\t}\r\n\t\t}\r\n\t\tdouble replacement = mainArray2[0];\r\n\t\tmainArray2[0] = mainArray2[min2];\r\n\t\tmainArray2[min2] = replacement;\r\n\r\n\t\t//finds the biggest number and moves it to the end of the array\r\n\t\tint max2 = 0;\r\n\t\tfor(int greaterThan = 1; greaterThan < mainArray2.length; greaterThan ++) {\r\n\r\n\t\t\tif(mainArray2[greaterThan]>mainArray2[max2]) {\r\n\t\t\t\tmax2 = greaterThan;\r\n\t\t\t}\r\n\t\t}\r\n\t\tdouble replacement2 = mainArray2.length -1;\r\n\t\tmainArray2[mainArray2.length -1] = mainArray2[max2];\r\n\t\tmainArray2[max2] = replacement;\r\n\r\n\t\t//arranges the values from smallest to largest\r\n\t\tfor(int counter = 1; counter < mainArray2.length -1; counter++) {\r\n\t\t\tif (mainArray2[counter + 1] < mainArray2[counter]) {\r\n\t\t\t\tdouble mover = mainArray2[counter +1];\r\n\t\t\t\tmainArray2[counter + 1] = mainArray2[counter];\r\n\t\t\t\tmainArray2[counter] = mover;\r\n\t\t\t} \r\n\t\t}\r\n\r\n\t\t//determines the median of the array\r\n\t\tif (mainArray2.length%2 == 0) {\r\n\t\t\tdouble median = (mainArray2[mainArray2.length /2 - 1] + mainArray2[mainArray2.length /2]) / 2;\r\n\t\t\treturn median;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdouble median = mainArray2[mainArray2.length % 2 + 1];\r\n\t\t\treturn median;\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n System.out.println(oddFilter(Arrays.asList(1, 2, 3, 4, 5)));\n // should print [1, 3, 5]\n }", "public List<Peak> filterNoise(List<Peak> peaks, double threshold, double experimentalPrecursorMzRatio);", "public ListNode removeNthFromEnd(ListNode head, int n) {\n ListNode dummy = new ListNode(0);\n dummy.next = head;\n ListNode slowPointer = dummy;\n ListNode fastPointer = dummy;\n for(int i = 0; i <= n; i ++){\n fastPointer = fastPointer.next;\n }\n \n while(fastPointer != null){\n fastPointer = fastPointer.next;\n slowPointer = slowPointer.next;\n }\n slowPointer.next = slowPointer.next.next;\n return dummy.next;\n }", "@Test\n\tpublic void testRunningMedian() {\n\t\tQueue<Integer> h1 = new PriorityQueue<>(Comparator.reverseOrder());\n\t\t// min-heap\n\t\tQueue<Integer> h2 = new PriorityQueue<>();\n\n\t\tint[] stream = {13, 189, 23, 26, 1, 9, 89, 67, 87, 12, 1, 23, 45, 67, 81};\n\n\t\tfor (int val : stream) {\n\t\t\tif (h1.isEmpty() || val <= h1.peek()) {\n\t\t\t\th1.add(val);\n\t\t\t} else {\n\t\t\t\th2.add(val);\n\t\t\t}\n\n\t\t\t// re-balance the heaps\n\t\t\tif (h1.size() - h2.size() > 1) {\n\t\t\t\th2.add(h1.poll());\n\t\t\t} else if (h2.size() - h1.size() > 1) {\n\t\t\t\th1.add(h2.poll());\n\t\t\t}\n\n\t\t\tint runningMedian;\n\t\t\tif (h1.size() == h2.size()) {\n\t\t\t\trunningMedian = (h1.peek() + h2.peek()) / 2;\n\t\t\t} else {\n\t\t\t\tQueue<Integer> mh = h1.size() - h2.size() == 1 ? h1 : h2;\n\t\t\t\trunningMedian = mh.peek();\n\n\t\t\t}\n\t\t\tSystem.out.println(\"Running median is: \" + runningMedian);\n\t\t}\n\n\n\t}", "private static native void amFilter_0(long joint_nativeObj, long src_nativeObj, long dst_nativeObj, double sigma_s, double sigma_r, boolean adjust_outliers);", "public Medians(String file) {\n \n // a max priority queue that stores half of values <= median\n PriorityQueue<Integer> lo = new PriorityQueue<Integer>(new Comparator<Integer>() {\n @Override\n public int compare(Integer n1, Integer n2) {\n return n2 - n1;\n }\n });\n \n // a min priority queue that stores half of values > median\n PriorityQueue<Integer> hi = new PriorityQueue<Integer>();\n Scanner scanner = null;\n try {\n scanner = new Scanner(new File(file));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n \n lo.add(scanner.nextInt());\n medians.add(lo.peek());\n while (scanner.hasNextInt()) {\n int t = scanner.nextInt();\n if (lo.size() == hi.size()) {\n if (t > hi.peek()) {\n lo.add(hi.poll());\n hi.add(t);\n }\n else lo.add(t);\n }\n else {\n if (t < lo.peek()) {\n hi.add(lo.poll());\n lo.add(t);\n }\n else hi.add(t);\n }\n medians.add(lo.peek());\n }\n }", "private float vec_stdDevMod(float[] v, int n)\n\t{\n\t\tfloat iqr, med;\n\t\tfloat lb, ub;\n\t\tlong i;\n\t \n\t\tArrays.sort(v);\n\t\tmed = v[(int)(n/2)]; \n\t\tiqr = v[(int)(3*n/4)] - v[(int)(n/4)];\n\t\tlb = med - (float)2.0*iqr; ub = med + (float)2.0*iqr;\n\t \n\t\treturn vec_stdDevBounded(v,n,lb,ub);\n\t}", "static ListNode removeNthFromEnd(ListNode head, int n) {\n \tif(n<=0){\n \t\treturn null;\n \t}\n \tListNode pre=new ListNode(0);\n \tpre.next=head;\n \tListNode cur=pre;\n \tfor(int i=0;i<n;i++){\n \t\tif(head==null){\n \t\t\treturn null;\n \t\t}\n \t\thead=head.next;\n \t}\n \twhile(head!=null){\n \t\thead=head.next;\n \t\tpre=pre.next;\n \t}\n \tpre.next=pre.next.next;\n \treturn cur.next;\n }", "public static int findMedianInt (Scanner scn)\n {\n ArrayList<Integer> lines = new ArrayList<Integer>();\n while (scn.hasNext())\n {\n lines.add(scn.nextInt());\n }\n if (lines.size() > 0)\n {\n Collections.sort(lines);\n return lines.get(lines.size() / 2);\n }\n else\n {\n throw new NoSuchElementException();\n }\n }", "public List<List<Integer>> getFactors(int n) {\n List<List<Integer>> r = new ArrayList<>();\n List<Integer> t = new ArrayList<>();\n h(r, t, n, 2);\n return r;\n }", "private static void quickSort(int[] array, int begin, int end, boolean useMedian) {\n int i = begin;\n int j = end;\n if (array.length==0 || array == null) {\n return;\n }\n int pivot = array[begin];\n if (useMedian) { \n pivot = array[begin + (end - begin) / 2];\n }\n\n while (i <= j) { \n while (array[i] < pivot) { \n i++;\n }\n while (array[j] > pivot) { \n j--; r\n }\n if (i <= j) { \n swap(array, i, j); \n i++;\n j--;\n }\n }\n\n if (begin < j) { \n quickSort(array, begin, j, useMedian);\n }\n if (i < end) { \n quickSort(array, i, end, useMedian);\n }\n }", "private int partition(int first, int n) {\n int pivotIndex = first;\n int last = first + n - 1;\n int pivotValue = a[first++];\n while (first <= last) {\n\t while (first <= last && a[first] <= pivotValue)\n\t first++;\n\t while (last >= first && a[last] > pivotValue)\n last--;\n if (first < last) \n\t swap(first, last);\n }\n swap(pivotIndex, last);\n return last;\n }", "public static int medianPivot(int array[], int first, int last) {\n \n int mid = (last) / 2;\n\n int[] sortingArr = {array[first], array[mid], array[last]};\n Arrays.sort(sortingArr);\n\n //System.out.println(\"\\tMiddle of Arr at Index= \" + mid + \" : \" + array[mid]);\n int middleValue = sortingArr[1];\n\n //System.out.println(\"\\t\"+Arrays.toString(sortingArr));\n //Swap with the last for pivot\n \tint temp = array[last];\n \tarray[last] = middleValue;\n if (middleValue == array[first]) {\n array[first] = temp;\n } else if (middleValue == array[mid]) {\n array[mid] = temp;\n }\n return partition(array, first, last);\n }", "public ListNode removeNthFromEnd(ListNode head, int n){\n\t\tif ( head == null || head.next == null )\t\t\t\t\t//'n will always be valid.' mean 1<= n <= length?\n\t\t\treturn null;\n\t\t\t\n\t\t//core logic\n\t\tListNode dummy = new ListNode(-1);\n\t\tdummy.next = head;\n\t\t\n\t\tListNode slow = dummy;\t\t\t\t// slow is the node just before the one to delete, no need to set pre\n\t\tListNode fast = dummy;\n// \t\tListNode pre = dummy;\n\t\t\n// \t\tint i = n - 1;\n\t\t\n\t\twhile ( n >= 1 ){\t\t\t\t\t// slow + n_step = fast\n\t\t\tfast = fast.next;\n\t\t\tn--;\n\t\t}\n\t\t\n\t\twhile ( fast.next != null ){\n\t\t\tfast = fast.next;\n\t\t\tslow = slow.next;\n// \t\t\tpre = pre.next;\n\t\t}\n\t\t\n// \t\tslow.next = fast;\t\t\t\t\t// when n==1, fast is the one to be deleted\n\t\tslow.next = slow.next.next;\n\t\treturn dummy.next;\n\t\t\n\t}", "public static Node removeNthFromEnd2(Node head, int n) {\n\t\t\n\t\t//use 2 pointers\n Node fast = head;\n Node slow = head;\n \n \n for ( int i = 0; i < n; i++) \n \tfast = fast.next; // fast will point to 3 \n \n if (fast == null) {\n \treturn head.next;\n }\n while (fast.next != null) { // when fast points to 5, fast.next == null. dont go inside while loop\n fast = fast.next; // fast points to 4, fast points to 5\n slow = slow.next; // slow points to 2, move slow point to 3\n }\n \n slow.next = slow.next.next; // slow is pointing to 3, to remove 4, move slow.next to slow.next.next\n \n return head ;\n \n }", "public static double findMedianSortedArraysBrutalForce(int[] nums1, int[] nums2) {\n int m = nums1.length;\n int n = nums2.length;\n if (n == 0) {\n return getMedian(nums1);\n }\n if (m == 0) {\n return getMedian(nums2);\n }\n\n int[] nums = new int[m + n];\n\n int count = 0;\n int i = 0, j = 0;\n while (count != (m + n)) {\n // if nums1 reach the end first\n if (i == m) {\n // push all the rest of the nums2 into result array\n while (j != n) {\n nums[count++] = nums2[j++];\n }\n // then get rid of the while loop\n break;\n }\n // if nums2 reach the end of the while loop\n if (j == n) {\n while (i != m) {\n nums[count++] = nums1[i++];\n }\n break;\n }\n\n // compare current value then only push the small one into result array\n if (nums1[i] < nums2[j]) {\n nums[count++] = nums1[i++];\n } else {\n nums[count++] = nums2[j++];\n }\n }\n\n return getMedian(nums);\n }", "public ListNode removeNthFromEnd(ListNode head, int n) {\n\n ListNode start = new ListNode(0);\n ListNode slow = start, fast = start;\n slow.next = head;\n\n //Move fast in front so that the gap between slow and fast becomes n\n for(int i=1; i<=n+1; i++) {\n fast = fast.next;\n }\n //Move fast to the end, maintaining the gap\n while(fast != null) {\n slow = slow.next;\n fast = fast.next;\n }\n //Skip the desired node\n slow.next = slow.next.next;\n return start.next;\n }", "public ListNode removeNthFromEnd2(ListNode head, int n) {\n\n\t\tListNode dummy = new ListNode(-1);\n\t\tdummy.next = head;\n\t\tListNode p1 = dummy;\n\t\tfor (int i = 0; i < n + 1; i++) {\n\t\t\tp1 = p1.next;\n\t\t}\n\t\tListNode p2 = dummy;\n\t\twhile (p1 != null) {\n\t\t\tp1 = p1.next;\n\t\t\tp2 = p2.next;\n\t\t}\n\t\tp2.next = p2.next.next;\n\t\treturn dummy.next;\n\t}", "public int mediansMod(int mod) {\n int sum = 0;\n for (int mid : medians) {\n sum += mid;\n }\n return sum % mod;\n }", "int getMedian () {\n if (fillLength == 0)\n throw new IndexOutOfBoundsException(\"An error occurred in getMedian method of StepDArray class\");\n return array[fillLength / 2];\n }", "public static ArrayList<Integer> oddValues(ArrayList<Integer> initialList){\n\t\tfor (Iterator<Integer> i = initialList.iterator(); i.hasNext();) {\n\t\t\tif(i.next()%2 == 0) {\n\t\t\t\ti.remove();\n\t\t\t}\n\t\t}\n\t\treturn initialList;\n\t}", "public static void main(String[] args) {\n\t\tint[] data = {3,5,1,2,8,12,16,15,9,23,18};\n\t\tint[] result = findKNumsAroundMedian(data, 5);\n\t\tfor(int i = 0; i < result.length; i++){\n\t\t\tSystem.out.print(result[i] + \" \");\n\t\t}\n\t}", "public static double[] filtfilt(double[] b, double[] a, double[] signal){\n\t\tdouble[] state = prepState(b,a,new double[a.length-1]);\n\t\t//Mirror signal from the beginning and from the end, and insert signal in the middle\n\t\tint initBackwardSamples = signal.length < 3*(a.length-1) ? signal.length : 3*(a.length-1);\n\t\tdouble[] temp = getMirrored(signal,initBackwardSamples);\n\t\ttemp = filter(b,a,temp,multArray(state,temp[0]));\t//Filter forward\n\t\ttemp = reverse(temp);\t//Switch direction\n\t\ttemp = filter(b,a,temp,multArray(state,temp[0]));\t//Filter backward\n\t\ttemp = reverse(temp);\t//Switch direction\n\t\t//Return the mid-part without mirrored data\n\t\tdouble[] output = new double[signal.length];\n\t\tfor (int i = 0;i<signal.length;++i){\n\t\t\toutput[i] = temp[initBackwardSamples+i];\n\t\t}\n\t\treturn output;\n\t}", "public static double median(double[] values)\n {\n int size = values.length;\n if (size < 1)\n return Double.NaN;\n double validationresult = validate(values);\n if (!Double.isFinite(validationresult))\n return validationresult;\n \n int middle = size / 2;\n if (size % 2 == 1)\n return values[middle];\n else\n return (values[middle - 1] + values[middle])/2;\n }", "public static Double calculateMedian(Double[] arr)\n {\n\n // Sort our array\n Double[] sortedArr = arr;// bubbleSort(arr);\n\n double median = 0;\n\n // If our array's length is even, then we need to find the average of the two centered values\n if (arr.length % 2 == 0)\n {\n int indexA = (arr.length - 1) / 2;\n int indexB = arr.length / 2;\n\n median = (sortedArr[indexA] + sortedArr[indexB]) / 2;\n }\n // Else if our array's length is odd, then we simply find the value at the center index\n else\n {\n int index = (sortedArr.length - 1) / 2;\n median = sortedArr[ index ];\n }\n\n // Print the values of the sorted array\n// for (double v : sortedArr)\n// {\n// System.out.println(v);\n// }\n\n return median;\n }", "void h(List<List<Integer>> r, List<Integer> t, int n, int s){ \n for(int i = s; i*i <= n; i++){\n if(n % i != 0) continue; \n t.add(i);\n t.add(n / i);\n r.add(new ArrayList<>(t));\n t.remove(t.size() - 1);\n h(r, t, n/i, i);\n t.remove(t.size() - 1);\n }\n }", "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 }", "public static int[] bilateralFilter(int[] data, int w, int h) {\n int[] newData = new int[w * h];\n\n // apply filter\n int kernel = 3; // kernel size\n double s1 = 100, s2 = 10; // sigma values\n double i2ss1 = 0.5 / s1 / s1, i2ss2 = 0.5 / s2 / s2;\n\n for (int x = 0; x < w; x++) {\n for (int y = 0; y < h; y++) {\n double deno_sum = 0d;\n double nume_sum_l = 0d, nume_sum_a = 0d, nume_sum_b = 0d;\n\n for (int i = -kernel; i <= kernel; i++) {\n for (int j = -kernel; j <= kernel; j++) {\n int xx = x + i, yy = y + j;\n if (xx >= 0 && xx < w && yy >= 0 && yy < h) {\n int c = data[yy * w + xx];\n double ii = i * i, jj = j * j;\n double S = Math.exp(-(ii + jj) * i2ss1) * Math.exp(-Lab.distance_not_sqrt(data[y * w + x], c) * i2ss2);\n deno_sum += S;\n nume_sum_l += Lab.l(c) * S;\n nume_sum_a += Lab.a(c) * S;\n nume_sum_b += Lab.b(c) * S;\n }\n }\n }\n\n newData[y * w + x] = Lab.lab(\n (int) (nume_sum_l / deno_sum),\n (int) (nume_sum_a / deno_sum),\n (int) (nume_sum_b / deno_sum));\n }\n }\n\n return newData;\n }", "public static void main(String[] args) throws IOException {\n\n int aCount = Integer.parseInt(scanner.nextLine().trim());\n\n int[] a = new int[aCount];\n\n for (int aItr = 0; aItr < aCount; aItr++) {\n int aItem = Integer.parseInt(scanner.nextLine().trim());\n a[aItr] = aItem;\n }\n\n double[] result = runningMedian(a);\n\n for (int resultItr = 0; resultItr < result.length; resultItr++) {\n //bufferedWriter.write(String.valueOf(result[resultItr]));\n //O problema de fazer sort no array pela performance está no print abaixo\n //por resultado\n System.out.println(String.valueOf(result[resultItr]));\n\n if (resultItr != result.length - 1) {\n //bufferedWriter.write(\"\\n\");\n }\n }\n\n //bufferedWriter.newLine();\n\n //bufferedWriter.close();\n }", "public static double findMedianSortedArraysBinary(int[] nums1, int[] nums2) {\n int m = nums1.length;\n int n = nums2.length;\n if (n == 0) {\n return getMedian(nums1);\n }\n if (m == 0) {\n return getMedian(nums2);\n }\n if (m > n) {\n // Make sure the first array is the shorter one\n return findMedianSortedArraysBinary(nums2, nums1);\n }\n // Init the start curser with the first and the last point of the shorter array\n int start = 0;\n int end = m;\n\n // Loop until start and end met\n while (start <= end) {\n // The `nums1` index will be the center between `start` and `end`\n int i = (start + end) / 2;\n // The `nums2` index will be the complement of `i` from the total length\n // m+n+1(the amount of gaps)\n int j = (m + n + 1) / 2 - i;\n if (j > 0 && i < m && nums1[i] < nums2[j - 1]) {\n // If the left max of `nums2` is still larger than right min of `nums1`\n // we move start curser to the right position of the middle\n start = i + 1;\n\n } else if (i > 0 && j < n && nums2[j] < nums1[i - 1]) {\n // If the left max of `nums1` is still larger than right min of `nums2`\n // we move end curser to the left position of the middle\n end = i - 1;\n } else {\n // find the max value of left\n int maxLeft = 0;\n if (i == 0) {\n // if i-1 out of index\n maxLeft = nums2[j - 1];\n } else if (j == 0) {\n // if j-1 out of index\n maxLeft = nums1[i - 1];\n } else {\n maxLeft = Math.max(nums1[i - 1], nums2[j - 1]);\n }\n if ((m + n) % 2 == 1) {\n // If total length is odd\n // The max value of left is the median\n return maxLeft;\n }\n // find the min value of right\n int minRight = 0;\n if (i == m) {\n // If i out of index\n minRight = nums2[j];\n } else if (j == n) {\n // If j out of index\n minRight = nums1[i];\n } else {\n minRight = Math.min(nums1[i], nums2[j]);\n }\n // If total length is even\n return (maxLeft + minRight) / 2.0;\n }\n }\n // If no answer found, we give the answer of 0.0\n return 0.0;\n }", "public void remove(int n) {\n\tif(!contains(n)){\n\t\treturn; //Check\n\t}\t\n\telse{\n\t\tint index = 0;\n\t\tfor(int i = 0; i < size; i++){\n \t\tif(elements[i] == n){\n \t\t\tindex = i;\n \t\t}\n \t\t}\n\t\tfor(int c = 0;c < (size - index) - 1; c++){\n\t\t\telements[index+c] = elements[index+c+1];\n\t\t}\n\t\tsize--;\n\t}\n\n System.out.println(\"Removing \" + n + \"...\");\n }", "public Container getMedian(Boolean axis) {\n\t\tint Number = (this.size)/2 ;\n\t\tif (axis){\n\t\t\tthis.current = this.minx;\n\t\t\twhile (Number>0){\n\t\t\t\tthis.current=this.current.getNextX();\n\t\t\t\tNumber--;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tthis.current = this.miny;\n\t\t\twhile (Number>0){\n\t\t\t\tthis.current=this.current.getNextY();\n\t\t\t\tNumber--;\n\t\t\t}\n\t\t}\n\t\treturn this.current;\n\t}", "public static void solve(int n, List<Integer> a) {\n Collections.sort(a);\n Collections.reverse(a);\n double sum = a.stream().mapToDouble(num -> Double.valueOf(num)).sum();\n double currentN = Double.valueOf(n);\n double currentSum = sum;\n for(Integer next : a)\n {\n double nextDouble = Double.valueOf(next);\n if(nextDouble<=currentSum/currentN)\n {\n break;\n }\n currentSum -= nextDouble;\n currentN--;\n }\n System.out.println(currentSum/currentN);\n\n\n }", "public MedianFinder() {\n datas = new ArrayList<>();\n }" ]
[ "0.6360963", "0.6090912", "0.5965322", "0.58271307", "0.5766123", "0.5678891", "0.54310006", "0.5289881", "0.5286689", "0.5256222", "0.52324843", "0.5221395", "0.51889336", "0.517423", "0.5172823", "0.51441854", "0.508405", "0.50283074", "0.4984459", "0.49717838", "0.49695525", "0.49500945", "0.49300018", "0.4929851", "0.492215", "0.49180588", "0.48971468", "0.48771775", "0.48620382", "0.48599926", "0.48459408", "0.48393056", "0.4837444", "0.48236212", "0.48016077", "0.4800651", "0.47971353", "0.4793119", "0.47925395", "0.47594044", "0.47591496", "0.47389066", "0.47365302", "0.47241437", "0.47130907", "0.46954688", "0.46857956", "0.46851817", "0.46316522", "0.46295783", "0.4627536", "0.46159032", "0.45975572", "0.45940787", "0.45739895", "0.45549148", "0.45473877", "0.45214912", "0.45213348", "0.45196554", "0.44868085", "0.44759598", "0.44683635", "0.44576502", "0.4455533", "0.4435948", "0.44277015", "0.4420036", "0.4412963", "0.44122884", "0.44101265", "0.44073227", "0.44063094", "0.43790376", "0.43751636", "0.4374391", "0.43689087", "0.43686938", "0.4360305", "0.4354534", "0.4353793", "0.43439808", "0.43338084", "0.43327323", "0.43322775", "0.43153882", "0.43131867", "0.4307789", "0.43072948", "0.43049237", "0.4287001", "0.4283836", "0.42821062", "0.42808977", "0.42808428", "0.42742434", "0.42720467", "0.42612582", "0.42527017", "0.42480367" ]
0.8540885
0
Smooths a list of doubles using a gaussian.
public static List<Double> getGaussianSmoothed(List<Double> listToSmooth, double standardDeviation) { if (standardDeviation < 0.0) { throw new IllegalArgumentException("standardDeviation invalid"); } else if (standardDeviation == 0.0) { return listToSmooth; } // Create a new, identical but empty Histogram. List<Double> smoothedList = new ArrayList<Double>(); // Determine the number of weights (must be odd). int numWeights = (int) (2 * 2.58 * standardDeviation + 0.5); if (numWeights % 2 == 0) { numWeights++; } // Initialize the smoothing weights. double[] weights = new double[numWeights]; int m = numWeights / 2; double var = standardDeviation * standardDeviation; double gain = 1.0 / Math.sqrt(2.0 * Math.PI * var); double exp = -1.0 / (2.0 * var); for (int i = m; i < numWeights; i++) { double del = i - m; weights[i] = gain * Math.exp(exp * del * del); weights[numWeights - 1 - i] = weights[i]; } // Clear the band total count for the smoothed histogram. double sum = 0; double originalSum = 0; double[] smoothedValues = new double[listToSmooth.size()]; for (int b = 0; b < listToSmooth.size(); b++) { // Determine clipped range. int min = Math.max(b - m, 0); int max = Math.min(b + m, listToSmooth.size()); // Calculate the offset into the weight array. int offset = m > b ? m - b : 0; // Accumulate the total for the range. double acc = 0; double weightTotal = 0; for (int i = min; i < max; i++) { double w = weights[offset++]; acc += listToSmooth.get(i) * w; weightTotal += w; } // Round the accumulated value. smoothedValues[b] = acc / weightTotal; // Accumulate total for band. sum += smoothedValues[b]; originalSum += listToSmooth.get(b); } // Rescale the counts such that the band total is approximately // the same as for the same band of the original histogram. double factor = originalSum / sum; for (int b = 0; b < listToSmooth.size(); b++) { double smoothedValue = smoothedValues[b] * factor; smoothedList.add(smoothedValue); } assert smoothedList.size() == listToSmooth.size(); return smoothedList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void gaussianSmooth(double[] img, int width, int height, double sigma) {\n\t\tint radius = (int)Math.sqrt((6.908)*(2*sigma*sigma));\n\t\t// compute coefficients of the gaussian filter\n\t\tdouble[] filter = new double[2*radius+1];\n\t\tdouble filtersum = 0;\n\n\t\tfor(int i=-radius;i<=radius;i++) {\n\t\t\tdouble g = gaussian(i,sigma);\n\t\t\tfilter[i+radius]=g;\n\t\t\tfiltersum+=g;\n\t\t}\n\n\t\tfor(int i=-radius;i<=radius;i++) {\n\t\t\tfilter[i+radius]=filter[i+radius]/(2*filtersum);//2 since 1D-filter will be used in x and y directions\n\t\t}\n\n\t\tconvolveInX(img, width, height, filter, radius);\n\t\tconvolveInY(img, width, height, filter, radius);\n\n\t}", "public void gaussianSmooth(final byte[] f, int width, int height, double sigma) {\n\t\tdouble[] img = new double[width * height];\n\t\tbyteToDouble(f, img);\n\t\tgaussianSmooth(img, width, height, sigma);\n\t\tdoubleToByte(f, img);\n\t\t//System.out.println(\"finish\");\n\t}", "public static List<Double> gaussianFilter(List<Double> listToFilter) {\r\n DescriptiveStatistics stats = new DescriptiveStatistics();\r\n // Add the data from the array\r\n for (Double value : listToFilter) {\r\n stats.addValue(value);\r\n }\r\n double std = stats.getStandardDeviation();\r\n double parameter = 1.0 / (std * std * 2);\r\n return gaussianFilter(listToFilter, parameter);\r\n }", "public static List<Double> gaussianFilter(List<Double> listToFilter, double parameter) {\r\n int windowSize = 7;\r\n List<Double> filteredList = new ArrayList<Double>();\r\n \r\n // double firstFactor = Math.pow(parameter/Math.PI, 0.5) *\r\n // Math.pow(Math.E, -1 * parameter);\r\n \r\n for (int j = 0; j < windowSize / 2; j++) {\r\n filteredList.add(0.0);\r\n }\r\n \r\n for (int i = windowSize / 2; i < listToFilter.size() - windowSize / 2; i++) {\r\n double sumValues = 0;\r\n double sumWeight = 0;\r\n for (int j = 0; j < windowSize; j++) {\r\n double weight = Math.pow(Math.E, -1 * (j - windowSize / 2) * (j - windowSize / 2) / 2\r\n * parameter);\r\n \r\n sumWeight += weight;\r\n sumValues += weight * listToFilter.get(i);\r\n }\r\n double newValue = 1.0 / sumWeight * sumValues / sumWeight;\r\n \r\n filteredList.add(newValue);\r\n }\r\n \r\n for (int j = 0; j < windowSize / 2; j++) {\r\n filteredList.add(0.0);\r\n }\r\n \r\n return filteredList;\r\n }", "public double smoothPowerCurve (double x) {\n //double a = this.getThrottle();\n double a = 1.0; // Hard code to max smoothing\n double b = 0.05; // Min power to overcome motor stall\n\n if (x > 0.0)\n return (b + (1.0-b)*(a*x*x*x+(1.0-a)*x));\n\n else if (x<0.0)\n return (-b + (1.0-b)*(a*x*x*x+(1.0-a)*x));\n else return 0.0;\n }", "public double smoothPowerCurve (double x) {\n //double a = this.getThrottle();\n double a = 1.0; // Hard code to max smoothing\n double b = 0.05; // Min power to overcome motor stall\n\n if (x > 0.0)\n return (b + (1.0-b)*(a*x*x*x+(1.0-a)*x));\n\n else if (x<0.0)\n return (-b + (1.0-b)*(a*x*x*x+(1.0-a)*x));\n else return 0.0;\n }", "public static void gaussian(double a[][], int index[])\r\n {\r\n int n = index.length;\r\n double c[] = new double[n];\r\n\r\n for (int i=0; i<n; ++i)\r\n index[i] = i;\r\n\r\n for (int i=0; i<n; ++i)\r\n {\r\n double c1 = 0;\r\n for (int j=0; j<n; ++j)\r\n {\r\n double c0 = Math.abs(a[i][j]);\r\n if (c0 > c1) c1 = c0;\r\n }\r\n c[i] = c1;\r\n }\r\n\r\n int k = 0;\r\n for (int j=0; j<n-1; ++j)\r\n {\r\n double pi1 = 0;\r\n for (int i=j; i<n; ++i)\r\n {\r\n double pi0 = Math.abs(a[index[i]][j]);\r\n pi0 /= c[index[i]];\r\n if (pi0 > pi1)\r\n {\r\n pi1 = pi0;\r\n k = i;\r\n }\r\n }\r\n\r\n int itmp = index[j];\r\n index[j] = index[k];\r\n index[k] = itmp;\r\n for (int i=j+1; i<n; ++i)\r\n {\r\n double pj = a[index[i]][j]/a[index[j]][j];\r\n\r\n a[index[i]][j] = pj;\r\n\r\n for (int l=j+1; l<n; ++l)\r\n a[index[i]][l] -= pj*a[index[j]][l];\r\n }\r\n }\r\n }", "public static double gaussian(double[] parameters) {\r\n double mean, stddev;\r\n mean = parameters[0];\r\n stddev = parameters[1];\r\n return mean + stddev * gaussian();\r\n }", "public void gaussianSmooth(Img i, double sigma) {\n int half = (int) (sigma * Math.sqrt(6 * Math.log(10)));\n int size = 1 + 2 * half;\n System.out.printf(\"Size: %d\\n\", size);\n double[] mask = new double[size];\n double mask_sum = 0;\n for (int k = 0; k <= half; k++) {\n double value = Math.exp(-k * k / (2 * sigma * sigma)) / (sigma * Math.sqrt(2 * Math.PI));\n mask_sum += (k == 0) ? value : value * 2;\n mask[half + k] = value;\n mask[half - k] = value;\n }\n // normalize the mask\n for (int k = 0; k < size; k++) {\n mask[k] = mask[k] / mask_sum;\n }\n System.out.printf(\"Mask: %s\\n\", Arrays.toString(mask));\n\n // 2D convolution using 1D mask in x\n double[] i_temp = new double[i.img.length];\n for (int x = 0; x < i.img.length; x++) {\n i_temp[x] = (double) (i.img[x] & 0xFF);\n }\n for (int x = half; x < i.height - half; x++) {\n for (int y = half; y < i.width - half; y++) {\n i_temp[x * i.width + y] = 0;\n for (int s = -half; s <= half; s++) {\n i_temp[x * i.width + y] += (double) (i.img[(x + s) * i.width + y] & 0xFF) * mask[half - s];\n }\n }\n }\n\n // 2D convolution using 1D mask in y\n for (int x = half; x < i.height - half; x++) {\n for (int y = half; y < i.width - half; y++) {\n double f = 0;\n for (int s = -half; s <= half; s++) {\n f += i_temp[x * i.width + y + s] * mask[half - s];\n }\n i.img[x * i.width + y] = (byte) f;\n }\n }\n }", "@Generated\n @Selector(\"setSmoothness:\")\n public native void setSmoothness(@NFloat double value);", "public void setSmooth_factor(double smooth_factor){ \n this.smooth_factor = smooth_factor; \n }", "public LinearGaussian(double[] values) {\n\t\tsuper();\n\t\tthis.values = values;\n\t\t\n\t\t/*calculate mean*/\n\t\tmean = Utilities.averageValueOfArray(values);\n\t\tvariance = Utilities.averageValueOfArray(varianceArray());\n\t}", "double calculateSoma(List<Double> weights);", "private static double[] randomDoubles(int elements) {\n double[] array = new double[elements];\n for (int i = 0; i < array.length; i++) {\n double chance = Math.random();\n if (chance < 0.25) \n array[i] = Math.random() * (1000);\t\n else if (chance <= 0.50)\n array[i] = Math.random() * (1001);\t\n else if (chance <= 0.75)\n array[i] = Math.random() * (1002);\n else\n array[i] = Math.random() * (1003);\t\n }\n return array;\n }", "protected void smooth() {\n if (!timer.isRunning() || sequence == null) {\n return;\n }\n if (spline == null) {\n spline = Functions.getSpline(sequence, numSplinePoints, 4);\n error = Double.MAX_VALUE;\n establishPairings();\n } else if (error < ERROR_TOLERANCE) {\n if (numSplinePoints <= 4) {\n\tspline = null;\n\terror = Double.MAX_VALUE;\n\ttimer.stop();\n\treturn;\n }\n \n numSplinePoints = Math.min(numSplinePoints - 4, 4);\n error = Double.MAX_VALUE;\n\n spline = Functions.getSpline(sequence, numSplinePoints, 4);\n establishPairings();\n }\n\n error = 0.0;\n int ptCnt = 0;\n for (Pt pt : sequence) {\n Pt destination = (Pt) pt.getAttribute(\"tween\");\n\n if (pt.distance(destination) < 1.0) {\n\tpt.setLocation(destination.getX(), destination.getY());\n } else {\n\tdouble dx = (destination.getX() - pt.getX()) / C;\n\tdouble dy = (destination.getY() - pt.getY()) / C;\n\tpt.setLocation(pt.getX() + dx , pt.getY() + dy);\n\terror += Math.hypot(dx, dy);\n }\n ptCnt++;\n }\n \n }", "DataFrameSmooth<R,C> smooth(boolean inPlace);", "public double[][] smoother(double[][] path, double weight_data, double weight_smooth, double tolerance)\n\t{\n\n\t\t//copy array\n\t\tdouble[][] newPath = doubleArrayCopy(path);\n\n\t\tdouble change = tolerance;\n\t\twhile(change >= tolerance)\n\t\t{\n\t\t\tchange = 0.0;\n\t\t\tfor(int i=1; i<path.length-1; i++)\n\t\t\t\tfor(int j=0; j<path[i].length; j++)\n\t\t\t\t{\n\t\t\t\t\tdouble aux = newPath[i][j];\n\t\t\t\t\tnewPath[i][j] += weight_data * (path[i][j] - newPath[i][j]) + weight_smooth * (newPath[i-1][j] + newPath[i+1][j] - (2.0 * newPath[i][j]));\n\t\t\t\t\tchange += Math.abs(aux - newPath[i][j]);\t\n\t\t\t\t}\t\t\t\t\t\n\t\t}\n\n\t\treturn newPath;\n\n\t}", "public static double nextGaussian(final RandomEventSource source) {\r\n double v1, v2, s;\r\n do {\r\n // Generates two independent random variables U1, U2\r\n v1 = 2 * source.nextDouble() - 1;\r\n v2 = 2 * source.nextDouble() - 1;\r\n s = v1 * v1 + v2 * v2;\r\n } while (s >= 1 || s == 0);\r\n final double norm = Math.sqrt(-2 * Math.log(s) / s);\r\n final double result = v1 * norm;\r\n // On 1,000,000 calls, this would usually yield about -5 minimum value,\r\n // and +5 maximum value. So we pretend the range is [-5.5,5.5] and normalize\r\n // it to [0,1], clamping if needed.\r\n final double normalized = (result + 5.5) / 11.0;\r\n return (normalized < 0) ? 0 : (normalized > BEFORE_ONE ? BEFORE_ONE\r\n : normalized);\r\n }", "public boolean smoothing()\r\n\t{\r\n\t\treturn smooth;\r\n\t}", "public void setSmooth(boolean smooth)\r\n\t{\r\n\t\tthis.smooth = smooth;\r\n\t}", "public void useGaussianDeviates(){\n this.gaussianDeviates = true;\n }", "public static double nextGaussian() {\n return randGen.nextGaussian();\n }", "public static Picture gaussian(Picture picture) {\r\n double[][] gaussina = {\r\n {1.0/16, 2.0/16, 1.0/16},\r\n {2.0/16, 4.0/16, 2.0/16},\r\n {1.0/16, 2.0/16, 1.0/16}\r\n };\r\n return transform(picture, gaussina);\r\n }", "public void weight(double arrInOut[]) {\r\n int N = arrInOut.length;\r\n for (int n = 0; n < arrInOut.length; n++) {\r\n double multiplier = 0.5 - 0.5 * Math.cos(2 * Math.PI * n / N);\r\n arrInOut[n] = arrInOut[n] * multiplier * SCALING_COEFFICIENT;\r\n }\r\n }", "public static Spliterator.OfDouble spliterator(double[] paramArrayOfdouble, int paramInt1, int paramInt2, int paramInt3) {\n/* 371 */ checkFromToBounds(((double[])Objects.requireNonNull((T)paramArrayOfdouble)).length, paramInt1, paramInt2);\n/* 372 */ return new DoubleArraySpliterator(paramArrayOfdouble, paramInt1, paramInt2, paramInt3);\n/* */ }", "public static Picture gaussian(Picture picture) {\n double[][] weights = { { 1 / 16.0, 2 / 16.0, 1 / 16.0 }, { 2 / 16.0, 4 / 16.0, 2 / 16.0 },\n { 1 / 16.0, 2 / 16.0, 1 / 16.0 }, };\n return kernel(picture, weights);\n }", "double calculateSomaAndAxon(List<Double> weights, ActivationFunction activationFunction);", "public static Spliterator.OfDouble spliterator(double[] paramArrayOfdouble, int paramInt) {\n/* 334 */ return new DoubleArraySpliterator(Objects.<double[]>requireNonNull(paramArrayOfdouble), paramInt);\n/* */ }", "private static native void fastGlobalSmootherFilter_0(long guide_nativeObj, long src_nativeObj, long dst_nativeObj, double lambda, double sigma_color, double lambda_attenuation, int num_iter);", "public double train(double[] X, double argValue);", "public static DoubleStream generateStreamFromList(List<Double> list)\n\t{\n\t\tDoubleStream.Builder builder = DoubleStream.builder();\n\t\tfor (double n : list)\n\t\t{\n\t\t\tbuilder.add(n);\n\t\t}\n\t\treturn builder.build();\n\t}", "public double[] propagate( double t0, double[] xin, double tf);", "public double nextGaussian() {\n\n /*\n * This implementation uses the polar method to generate two gaussian\n * values at a time. One is returned, and the other is stored to be returned\n * next time.\n */\n\n if (haveStoredGaussian) {\n haveStoredGaussian = false;\n return storedGaussian;\n }\n\n double v1;\n double v2;\n double s;\n do {\n v1 = 2 * nextDouble() - 1;\n v2 = 2 * nextDouble() - 1;\n s = v1 * v1 + v2 * v2;\n } while (s >= 1 || s == 0);\n\n double m = StrictMath.sqrt(-2 * StrictMath.log(s) / s);\n storedGaussian = v2 * m;\n haveStoredGaussian = true;\n\n return v1 * m;\n }", "void nextGaussianStep(){\n \n \n int stepx=nextGaussian(2,1)*(r.nextInt(3)-1);\n int stepy=nextGaussian(2,1)*(r.nextInt(3)-1);\n \n StdDraw.line(x,y,x+stepx,y+stepy);\n x += stepx;\n y += stepy;\n }", "public double getSmooth_factor(){ \n return this.smooth_factor; \n }", "public static double uniform(double[] parameters) {\r\n double a, b;\r\n a = parameters[0];\r\n b = parameters[1];\r\n return a + uniform() * (b-a);\r\n }", "public float gaussianRandom() {\n\t\treturn (CCMath.constrain((float)nextGaussian() / 4,-1 ,1 ) + 1) / 2;\n\t}", "public void nextDoubles(double[] d, double lo, double hi) {\n real.nextDoubles(d);\n\n double l = hi - lo; \n int n = d.length;\n for (int i = 0; i < n; i++) {\n d[i] = lo + l * d[i];\n }\n }", "private Float sigmoidSmoothing(Float value){\n\t\tvalue = (float) (1/(1+Math.pow(value, -1)));\n\t\treturn value;\n\t}", "public static double berekenGemiddeldeOmzet(ArrayList<Double> omzet) {\n \tdouble result = 0;\n \tint counter = 0;\n for(double i: omzet) {\n \tcounter += 1;\n \tresult += i;\n }\n return result / counter;\n }", "public static double addGaussianJitter( double mu, double sigma) {\n\n\t\treturn mu + sigma * _random.nextGaussian();\n }", "public void smooth(int smooth) {\n\t\tthis.dst.smooth(smooth);\n\t\tthis.src.smooth(smooth);\n\t}", "public double Generate(double[] par);", "public static double f(Double[] genotype) {\n\t\t//first, interpret genotype\n\t\tDouble[] variables = new Double[variableNum];\n\t\tfor(int i = 0; i < variableNum; i++) {\n\t\t\tvariables[i] = (genotype[i] - minValue)/(maxValue - minValue)*(actMax - actMin) + actMin;\n\t\t}\n\t\t//calculate the value\n\t\tdouble value = 0.0;\n//\t\tvalue = variables[0]*variables[0]+variables[1]*variables[1]+1;\n//\t\tvalue = variables[0]*variables[0]+variables[1]*variables[1]+variables[2]*variables[2]+variables[3]*variables[3]+1;\n\t\tfor(int i = 0; i < variableNum; i++) value+=(parameters[i]*Math.pow(variables[i], pows[i]));\n\t\treturn value;\n\t}", "public void permutate(double[] x) {\n for (int i = 0; i < x.length; i++) {\n int j = i + nextInt(x.length - i);\n Math.swap(x, i, j);\n }\n }", "static double getNormalDistribution(double x) {\n return (1 / Math.sqrt(2 * Math.PI)) * Math.exp(-1 * x * x / 2.0);\n }", "public void useUniformDeviates(){\n this.gaussianDeviates = false;\n }", "public static double[] Gauss(Matriks M) {\r\n \tdouble[][] a = new double[M.BrsEff][M.KolEff-1];\r\n \tdouble[] b = new double[M.BrsEff];\r\n \tfor (int i = 0; i < M.BrsEff; i++){\r\n \t\tfor (int j = 0; j < M.KolEff-1; j++){\r\n \t\t\ta[i][j] = M.Elmt[i][j];\r\n \t\t}\r\n \t}\r\n \tfor (int i = 0; i < M.BrsEff; i++){\r\n \t\tb[i] = M.Elmt[i][M.KolEff-1];\r\n \t}\r\n int n = b.length;\r\n\r\n for (int p = 0; p < n; p++) {\r\n\r\n int max = p;\r\n for (int i = p + 1; i < n; i++) {\r\n if (Math.abs(a[i][p]) > Math.abs(a[max][p])) {\r\n max = i;\r\n }\r\n }\r\n double[] temp = a[p];\r\n a[p] = a[max];\r\n a[max] = temp;\r\n double t = b[p];\r\n b[p] = b[max];\r\n b[max] = t;\r\n\r\n for (int i = p + 1; i < n; i++) {\r\n double ratio = a[i][p] / a[p][p];\r\n b[i] -= ratio * b[p];\r\n for (int j = p; j < n; j++) {\r\n a[i][j] -= ratio * a[p][j];\r\n }\r\n }\r\n }\r\n\r\n double[] x = new double[n];\r\n for (int i = n - 1; i >= 0; i--) {\r\n double sum = 0;\r\n for (int j = i + 1; j < n; j++) {\r\n sum += a[i][j] * x[j];\r\n }\r\n x[i] = (b[i] - sum) / a[i][i];\r\n }\r\n return x;\r\n }", "@Override \n public double[] fastApply(double[] x) {\n double d = dot.norm(x);\n scale.fastDivide(x, d);\n return x;\n }", "public void setSmoothEnabled(boolean isSmoothEnabled) {\n this.isSmoothEnabled = isSmoothEnabled;\n }", "public static double gaussian() {\n // use the polar form of the Box-Muller transform\n double r, x, y;\n do {\n x = uniform( -1.0, 1.0 );\n y = uniform( -1.0, 1.0 );\n r = x*x + y*y;\n } while ( r >= 1 || r == 0 );\n \n return x * Math.sqrt(-2 * Math.log(r) / r);\n\n // Remark: y * Math.sqrt(-2 * Math.log(r) / r)\n // is an independent random gaussian\n }", "public Double[] mvNextDouble(Random rng) {\n\t\t\n Double Y[] = new Double[nVar];\n Double X[] = new Double[nVar];\n\n for (int i = 0; i <= nVar - 1; i++){\n X[i] = super.inverseF(rng.nextDouble());\n Y[i] = meanArray[i];\n }\n\n if (NotPD) {\n \tfor (int i = 0; i <= nVar - 1; i++){\n \t\tY[i] += X[i];\n }\n }\n else{\n \tfor (int i = 0; i <= nVar - 1; i++){\n \tfor (int j = 0; j <= i; j++){\n Y[i] += H[i][j] * X[j];\n \t}\n }\n }\n\t\treturn Y;\n\t}", "public static double gaussian( double mean, double stddev ) {\n return mean + stddev * gaussian();\n }", "public static double[] linearFade(double[] input, double start, double end, boolean fadeIn) {\n int len = input.length;\n double[] output = input.clone();//for convenience of keeping unchanged part intact\n if (start>=1 || end<=0 || start>=end){\n throw new IllegalArgumentException(\"Invalid start/end proportion!\");\n }else {\n int segLen = (int) ((end-start)*len);\n for (int i = (int) (start*len); i < (end*len); i++) {\n double prop = (1.0 / segLen) * (i-start*len);//proportion to the original value\n if(fadeIn){\n output[i] *= prop;\n }else {\n output[i] *= 1-prop;\n }\n }\n }\n\n return output;\n }", "private static double smootherstep(double xMin, double xMax, double x, double rMin, double rMax)\r\n\t{\n\t\tdouble xClamped = clamp((x - xMin) / (xMax - xMin), 0.0, 1.0);\r\n\t\t// Evaluate polynomial\r\n\t\treturn rMin + (rMax - rMin) * xClamped * xClamped * xClamped * (xClamped * (xClamped * 6 - 15) + 10);\r\n\t}", "public static double getArrayListDoubleMean(ArrayList<Double> list) {\n\t\treturn 0;\n\t}", "public ArrayList<Double> normalize( ArrayList<Double> data, double scale )\n {\n double min = Double.MAX_VALUE;\n double max = Double.MIN_VALUE;\n ArrayList<Double> result = new ArrayList<Double>();\n\n // First, need to find the min value in the array\n for( double value : data )\n {\n if( value < min )\n {\n min = value;\n }\n }\n\n // Next, translate by the min amount\n for( double value : data )\n {\n double temp = (value - min);\n result.add( temp );\n if( temp > max )\n {\n max = temp;\n }\n }\n\n // Finally, scale by max\n for( int i=0; i<result.size(); i++ )\n {\n result.set( i, (scale * ( result.get( i ) / max )) );\n }\n\n return result;\n }", "public void fit(double[][] data) {\n double n = data.length;\n\n double sum1 = 0;\n double sum2 = 0;\n\n // gradient descent\n for (int i = 0; i < epochs; i++) {\n\n for (double[] d : data) {\n double x = d[0];\n double y = d[1];\n double yPredicted = sigmoid((m * x) + b);\n\n sum1 += x * (y - yPredicted);\n sum2 += y - yPredicted;\n }\n\n // calculate the derivative\n double dm = (-2/n) * sum1;\n double db = (-2/n) * sum2;\n\n // update m and b\n m = m - (learningRate * dm);\n b = b - (learningRate * db);\n }\n\n }", "public double[] getDoubleList();", "public DoubleExponentialSmoothingModel( double alpha,\n double gamma )\n {\n if ( alpha < 0.0 || alpha > 1.0 )\n throw new IllegalArgumentException(\"DoubleExponentialSmoothingModel: Invalid smoothing constant, \" + alpha + \" - must be in the range 0.0-1.0.\");\n \n if ( gamma < 0.0 || gamma > 1.0 )\n throw new IllegalArgumentException(\"DoubleExponentialSmoothingModel: Invalid smoothing constant, gamma=\" + gamma + \" - must be in the range 0.0-1.0.\");\n \n slopeValues = new DataSet();\n \n this.alpha = alpha;\n this.gamma = gamma;\n }", "public static Double getGaussian(final Double average, final Double relStdDeviation){\r\n\t\tDouble absStdDeviation = average * relStdDeviation;\r\n\t\treturn new Random().nextGaussian() * absStdDeviation + average; \r\n\t}", "@Generated\n @Selector(\"smoothness\")\n @NFloat\n public native double smoothness();", "public ArrayList<DataPoint> normalizeFeatures(ArrayList<DataPoint> datapoints) {\n\t\t\n\t\tdouble[] vector = new double[featureCount];\n\t\t// now normalize ALL the points!\n\t\tfor (DataPoint aPoint : datapoints) {\n\t\t\tvector = aPoint.vector;\n\t\t\tfor (int i = 0; i < featureCount; ++i) {\n\t\t\t\tvector[i] = (vector[i] - meansOfFeatures.get(i))\n\t\t\t\t\t\t/ stdevOfFeatures.get(i);\n\t\t\t}\n\t\t\taPoint.setVector(vector);\n\t\t}\n\t\treturn datapoints;\n\t}", "public static void power(double[] vector, double a) {\r\n for (int i = 0; i < vector.length; i++) {\r\n vector[i] = Math.signum(vector[i]) * Math.pow(Math.abs(vector[i]), a);\r\n }\r\n }", "public void transform(double[] x) {\r\n int i,j;\r\n double sumWindow=nn*nn;\r\n\r\n System.arraycopy(x,0,data,1,n);\r\n if(winNum>0) {\r\n for(i=0,j=1;i<nn;i++) {\r\n data[j]=data[j]*winMult[i];\r\n j++;\r\n data[j]=data[j]*winMult[i];\r\n j++;\r\n sumWindow=sumWindow+winMult[i]*winMult[i];\r\n }\r\n }\r\n/* Test to plot windowed function\r\n nSpectrum++;\r\n for(i=0,j=0;i<nn;i++) {\r\n x[j]=i;\r\n j++;\r\n x[j]=data[j];\r\n j++;\r\n }\r\n if(ncurve>=0) ncurve = graph.deleteAllCurves();\r\n ncurve = graph.addCurve(x,nn,Color.blue);\r\n graph.paintAll=true;\r\n graph.repaint();\r\n*/\r\n four1(data,nn,1);\r\n nSpectrum++;\r\n x[0]=0;\r\n spectrum[0]+=(data[0]*data[0]+data[1]*data[1])/sumWindow;\r\n for(i=1,j=2;i<nn/2;i++) {\r\n x[j]=i*scale;\r\n j++;\r\n spectrum[i]+=2.*(data[j]*data[j]+data[j+1]*data[j+1])/sumWindow;\r\n j++;\r\n }\r\n x[j]=(nn/2)*scale;\r\n j++;\r\n spectrum[nn/2]+=(data[j]*data[j]+data[j+1]*data[j+1])/sumWindow;\r\n for(i=0,j=1;i<=nn/2;i++) {\r\n x[j]=0.434*Math.log(floor+spectrum[i]/nSpectrum);\r\n j+=2;\r\n }\r\n }", "public static void fastGlobalSmootherFilter(Mat guide, Mat src, Mat dst, double lambda, double sigma_color, double lambda_attenuation, int num_iter)\r\n {\r\n \r\n fastGlobalSmootherFilter_0(guide.nativeObj, src.nativeObj, dst.nativeObj, lambda, sigma_color, lambda_attenuation, num_iter);\r\n \r\n return;\r\n }", "static void set_bnd ( int N, int b, double[] x )\r\n{\nint i;\r\nfor ( i=1 ; i<=N ; i++ ) {\r\nx[getIndex(0 ,i)] = b==1 ? -x[getIndex(1,i)] : x[getIndex(1,i)];\r\nx[getIndex(N+1,i)] = b==1 ? -x[getIndex(N,i)] : x[getIndex(N,i)];\r\nx[getIndex(i,0 )] = b==2 ? -x[getIndex(i,1)] : x[getIndex(i,1)];\r\nx[getIndex(i,N+1)] = b==2 ? -x[getIndex(i,N)] : x[getIndex(i,N)];\r\n}\r\nx[getIndex(0 ,0 )] = 0.5f*(x[getIndex(1,0 )]+x[getIndex(0 ,1)]);\r\nx[getIndex(0 ,N+1)] = 0.5f*(x[getIndex(1,N+1)]+x[getIndex(0 ,N )]);\r\nx[getIndex(N+1,0 )] = 0.5f*(x[getIndex(N,0 )]+x[getIndex(N+1,1)]);\r\nx[getIndex(N+1,N+1)] = 0.5f*(x[getIndex(N,N+1)]+x[getIndex(N+1,N )]);\r\n\r\n//System.out.println(\"dopo\");\r\n//draw_dens ( N, x );\r\n}", "public abstract List<Double> updatePopulations();", "private float gauss (int whatMask, int size) {\n int mu = 0;\n double sigma = 1/(size*Math.sqrt(2*Math.PI));\n return (float) (1/(sigma*Math.sqrt(2*Math.PI))*Math.exp(-(whatMask-mu)*(whatMask-mu)/(2*sigma*sigma)));\n }", "public static Spliterator.OfDouble spliterator(PrimitiveIterator.OfDouble paramOfDouble, long paramLong, int paramInt) {\n/* 622 */ return new DoubleIteratorSpliterator(Objects.<PrimitiveIterator.OfDouble>requireNonNull(paramOfDouble), paramLong, paramInt);\n/* */ }", "public double functionValue(double[] var) {\n\tdouble val = 0;\n\tfor (int i=0; i<numberOfParameters; i++) { val += p[i]*Math.pow(var[0], i+1); }\n\tval +=1.;\n\treturn val;\n }", "public static Double[] mutate(Double[] genotype) {\n\t\tRandom random = new Random();\n\t\tint position = random.nextInt(variableNum);\n\t\tgenotype[position]+=((Math.random()-0.5)*mutateVal);\n\t\tif(genotype[position] > maxValue) genotype[position] = maxValue;\n\t\tif(genotype[position] < minValue) genotype[position] = minValue;\n\t\treturn genotype;\n\t}", "private static native long createFastGlobalSmootherFilter_0(long guide_nativeObj, double lambda, double sigma_color, double lambda_attenuation, int num_iter);", "private static float[] GetAppropriateSeparableGauss(int kernelSize){\n final double epsilon = 2e-2f / kernelSize;\n double searchStep = 1.0;\n double sigma = 1.0;\n while( true )\n {\n\n double[] kernelAttempt = GenerateSeparableGaussKernel( sigma, kernelSize );\n if( kernelAttempt[0] > epsilon )\n {\n if( searchStep > 0.02 )\n {\n sigma -= searchStep;\n searchStep *= 0.1;\n sigma += searchStep;\n continue;\n }\n\n float[] retVal = new float[kernelSize];\n for (int i = 0; i < kernelSize; i++)\n retVal[i] = (float)kernelAttempt[i];\n return retVal;\n }\n\n sigma += searchStep;\n\n if( sigma > 1000.0 )\n {\n assert( false ); // not tested, preventing infinite loop\n break;\n }\n }\n\n return null;\n }", "public static double nextGaussian(double mu, double sigma) {\n return randGen.nextGaussian()*sigma+mu;\n }", "static public double elastic(double complete) {\n\t\tdouble p = 0.3;\n\t\tdouble s = p / 4.0;\n\t\tif (complete == 1)\n\t\t\treturn 1.0;\n\t\treturn Math.pow(2, (-10 * complete))\n\t\t\t\t* Math.sin((complete - s) * (2 * Math.PI) / complete) + 1.0;\n\t}", "public static RegressionPrior gaussian(double[] priorVariances) {\n verifyPriorVariances(priorVariances);\n return new GaussianRegressionPrior(priorVariances);\n }", "public double update(double[] x) {\n if (x.length != n) {\n throw new IllegalArgumentException(String.format(\"Invalid input vector size: %d, expected: %d\", x.length, n));\n }\n\n projection.mv(x, y);\n\n for (int j = 0; j < p; j++) {\n for (int i = 0; i < n; i++) {\n double delta = x[i];\n for (int l = 0; l <= j; l++) {\n delta -= projection.get(l, i) * y[l];\n }\n projection.add(j, i, r.apply(t) * y[j] * delta);\n\n if (Double.isInfinite(projection.get(j, i))) {\n throw new IllegalStateException(\"GHA lost convergence. Lower learning rate?\");\n }\n }\n }\n\n t++;\n projection.mv(x, y);\n projection.tv(y, wy);\n return MathEx.squaredDistance(x, wy);\n }", "private void normalize(double[] scores, boolean wantSmall) {\n\n // Yes\n double randomLowValue = 0.00001;\n\n if (wantSmall) {\n double min = Double.MAX_VALUE;\n for (double score : scores) {\n if (score < min) min = score;\n }\n\n for (int i = 0; i < scores.length; i++) {\n scores[i] = min / Math.max(scores[i], randomLowValue);\n }\n\n } else {\n double max = Double.MIN_VALUE;\n for (double score : scores) {\n if (score > max) max = score;\n }\n\n if (max == 0) max = randomLowValue;\n for (int i = 0; i < scores.length; i++) {\n scores[i] = scores[i] / max;\n }\n }\n }", "public void nextDoubles(double[] d) {\n real.nextDoubles(d);\n }", "@Override\r\n\t\tpublic double[] gradient(double x, double... parameters) {\n\t\t\tfinal double a = parameters[0];\r\n\t\t\tfinal double b = parameters[1];\r\n\t\t\tfinal double c = parameters[2];\r\n\t\t\tfinal double d = parameters[3];\r\n\t\t\tfinal double e = parameters[4];\r\n\t\t\t\r\n\t\t\tdouble[] gradients = new double[5];\r\n\t\t\t//double den = 1 + Math.pow((x+e)/c, b);\r\n\t\t\t//gradients[0] = 1 / den; // Yes a Derivation \r\n\t\t\t//gradients[1] = -((a - d) * Math.pow(x / c, b) * Math.log(x / c)) / (den * den); // Yes b Derivation \r\n\t\t\t//gradients[2] = (b * Math.pow(x / c, b - 1) * (x / (c * c)) * (a - d)) / (den * den); // Yes c Derivation \r\n\t\t\t//gradients[3] = 1 - (1 / den); // Yes d Derivation \r\n\t\t\t\r\n\t\t\t//Derivation\r\n\t\t\tfinal double c_b = Math.pow(c, b);\r\n\t\t\tfinal double c_b1 = Math.pow(c, b+1.);\r\n\t\t\tfinal double c_2b = Math.pow(c, 2.*b);\r\n\t\t\tfinal double c_2b1 = Math.pow(c, 2.*b+1.);\r\n\t\t\t\r\n\t\t\tfinal double xe_b = Math.pow(x+e, b);\r\n\t\t\tfinal double xe_2b = Math.pow(x+e, 2.*b);\r\n\t\t\tfinal double xe_2b1 = Math.pow(x+e, 2.*b+1.);\r\n\t\t\t\r\n\t\t\tgradients[0] = c_b/(xe_b+c_b);\r\n\t\t\tgradients[1] = ((c_b*d-a*c_b)*xe_b*Math.log(x+e)+(a*c_b*Math.log(c)-c_b*Math.log(c)*d)*xe_b)/(xe_2b+2*c_b*xe_b+c_2b);\r\n\t\t\tgradients[2] = -((b*c_b*d-a*b*c_b)*xe_b)/(c*xe_2b+2*c_b1*xe_b+c_2b1);\r\n\t\t\tgradients[3] = xe_b/(xe_b+c_b);\r\n\t\t\tgradients[4] = ((b*c_b*d-a*b*c_b)*xe_b)/(xe_2b1+xe_b*(2*c_b*x+2*c_b*e)+c_2b*x+c_2b*e);\r\n\t\t\treturn gradients;\r\n\t\t}", "public static double estraiDouble(double minimo, double massimo) {\n return (minimo + (massimo - minimo) * rand.nextDouble());\n }", "public double std(ArrayList<Double> x) {\n double sum = 0;\n double round;\n for (int i = 0; i < x.size(); i++) {\n sum += Math.pow((x.get(i) - average(x)), 2) / x.size();\n }\n round = Math.sqrt(sum) * 100;\n round = Math.round(round);\n round /= 100;\n return round;\n\n\n }", "public static void main( String[] args ){\n\t\tDoubleGenerator g = gaussian();\n\t\t// DoubleGenerator g = power_law();\n\t\t// DoubleGenerator g = symmetric_power_law();\n\t\tint n = 10;\n\t\t// Generating an array of ten random values\n\t\tdouble[] x = g.generate(n);\n\t\tfor( int i=0; i<n; i++ ){\n\t\t\tSystem.out.println( x[i] );\n\t\t}\n\t\tSystem.out.println(\"****************\");\n\t\t// Generating ten random values\n\t\tfor( int i=0; i<n; i++ ){\n\t\t\tSystem.out.println(g.next());\n\t\t}\n\t}", "public void performLaplaceSmoothing() {\n // YOUR CODE HERE\n String w1, w2;\n for (int i = 0; i < NDTokens.size(); i++) {\n w1 = NDTokens.get(i);\n for (int j = 0; j < NDTokens.size(); j++) {\n w2 = NDTokens.get(j);\n // Adding one with everything\n bi_grams[NDTokens.indexOf(w1)][NDTokens.indexOf(w2)]++;\n }\n }\n smooth = true;\n normalize();\n }", "public void update(double[] x, double y, double alpha){ \n\t\tfor (int i = 0; i < x.length; i++) {\n\t\t\tdouble wi = weights[i]; \n\t\t\tdouble xi = x[i];\t\t\t\t\t\t\t// Follow the update rule\n\t\t\tweights[i] = wi + alpha*(y - eval(x)) * eval(x)*(1.0 - eval(x)) * xi;\t\n\t\t\t//System.out.printf(\"%.5f\\n\", weights[i]);\n\t\t\t\n\t\t}\n\t}", "public static double getArrayListDoubleMin(ArrayList<Double> list) {\n\t\treturn 0;\n\t}", "private static native void l0Smooth_0(long src_nativeObj, long dst_nativeObj, double lambda, double kappa);", "public static Double[] crossover(Double[] g1, Double[] g2){\n\t\tRandom random = new Random();\n\t\tint start = random.nextInt(variableNum-1);\n\t\tint end = start + 1 + random.nextInt(variableNum-start);\n\t\t//which one is better, why\n//\t\tfor(int i = start; i < end; i++) g1[i] = g2[i] + Math.random()*(g1[i]-g2[i]);\n//\t\tfor(int i = start; i < end; i++) g1[i] = g2[i];\n\t\tfor(int i = start; i < end; i++) {\n\t\t\tg1[i] = g2[i] + (Math.random()*2-1)*(g1[i]-g2[i]);\n\t\t\tif(g1[i] > maxValue) g1[i] = maxValue;\n\t\t\tif(g1[i] < minValue) g1[i] = minValue;\n\t\t}\n\t\treturn Arrays.copyOf(g1, g1.length);\n\t}", "public void antiderivative (double constant) {\n // do last index first since it requires adding a term to the list\n int size = myCoefficients.size();\n double last = myCoefficients.get(size - 1) / (size);\n\n for (int i = myCoefficients.size() - 2; i >= 0; --i) {\n myCoefficients.set(i + 1, myCoefficients.get(i) / (i + 1));\n }\n myCoefficients.set(0, constant);\n myCoefficients.add(last);\n }", "public static RandomEventSource nextGaussianWrapper(\r\n final RandomEventSource source) {\r\n if (source instanceof NextGaussianRandomEventSource) {\r\n return source;\r\n }\r\n return new NextGaussianRandomEventSource(source);\r\n }", "public static native double norm(double a[]);", "abstract Double getWeight(int i, int j);", "public static void selection(double[] list){\n \n double currentMin = 0;\n int currentMinIndex = 0;\n \n // searches overall array\n for(int i = 0; i < list.length - 1; i++){\n currentMin = list[i];\n currentMinIndex = i;\n \n // This is where the array will be sorted\n for(int j = i + 1; j < list.length; j++){\n // will comapre current numbers to next\n if(currentMin < list[j]){\n currentMin = list[j];\n currentMinIndex = j;\n }\n }\n \n // This is where the values are swaped\n if(currentMinIndex != i){\n list[currentMinIndex] = list[i];\n list[i] = currentMin;\n }\n } \n }", "public static double f1_a(double a, double m, double[] x, double[] y) {\r\n\t\tdouble f1_a = 0;\r\n\t\tfor (int i = 0; i < x.length; i++) {\r\n\t\t\tf1_a = f1_a + Math.pow(x[i], 2 * m);\r\n\t\t}\r\n\t\treturn f1_a;\r\n\t}", "@Override\n\tpublic double apply(double value) {\n\t\tfor (int i = 0; i < constants.length; i++) {\n\t\t\tnextConstant = new Constant(constants[constants.length - i - 1]);\n\t\t\tnextExponent = new LinearProduct(nextConstant, new Exponent(i));\n\t\t\tresult += nextExponent.apply(value);\n\t\t}\n\t\treturn result;\n\t}", "public static double mindouble(double ... numbers) {\r\n double min = numbers[0];\r\n for (int i=1 ; i<numbers.length ; i++) {\r\n min = (min <= numbers[i]) ? min : numbers[i];\r\n }\r\n return min;\r\n}", "static GaussianDistribution[] initGaussianDist(\n\t\t\tint SIZE,\n\t\t\tint N, \n\t\t\tCollection<float[][]> sequences) \n\t{\n\t\tdouble[] mean = new double[SIZE];\n\t\tdouble[] var = new double[SIZE];\n\n\t\tSortedSet<float[]> vectors = new TreeSet<float[]>(new SortByColumn(0));\n\t\tfor (Iterator<float[][]> i = sequences.iterator(); i.hasNext(); ) {\n\t\t\tfloat[][] sequence = (float[][]) i.next();\n\t\t\tfor (int n = 0, n_max = sequence.length; n < n_max; ++n) {\n\t\t\t\tassert sequence[n].length == SIZE;\n\t\t\t\tvectors.add(sequence[n]);\n\t\t\t}\n\t\t}\n\n\t\tfor (Iterator<float[]> i = vectors.iterator(); i.hasNext(); ) {\n\t\t\tfloat[] vector = (float[]) i.next();\n\n\t\t\tfor (int c = 0; c < SIZE; ++c) {\n\t\t\t\tmean[c] += vector[c];\n\t\t\t\tvar[c] += vector[c] * vector[c];\n\t\t\t}\n\t\t}\n\n\t\tfor (int c = 0; c < SIZE; ++c) {\n\t\t\tmean[c] /= vectors.size();\n\t\t\tvar[c] = var[c] / vectors.size() - mean[c] * mean[c];\n\t\t}\n\n\t\t// find dimension with highest variance\n\t\tint index = 0;\n\t\tfor (int i = 1; i < var.length; ++i)\n\t\t\tif (var[i] > var[index])\n\t\t\t\tindex = i;\n\n\t\t\t\t// resort \"vectors\" if necessary\n\t\tif (index > 0) {\n\t\t\tSortedSet<float[]> vectors_new = new TreeSet<float[]>(new SortByColumn(index));\n\t\t\tvectors_new.addAll(vectors);\n\t\t\tvectors = vectors_new;\n\t\t}\n\n\t\tGaussianDistribution[] dist = new GaussianDistribution[N];\n\t\tfinal int GAP = (vectors.size() - 1) / (N + 1) - 1;\n\t\tIterator<float[]> i = vectors.iterator();\n\t\tfor (int n = 0; n < N; ++n) {\n\t\t\t// fast forward (#GAP steps)\n\t\t\tfor (int k = 0; (k < GAP) && i.hasNext(); ++k)\n\t\t\t\ti.next();\n\n\t\t\tfloat[] vector = (float[]) i.next();\n\n\t\t\tfloat[] center = new float[SIZE];\n\t\t\tfloat[][] cov_inv = new float[SIZE][SIZE];\n\n\t\t\tfor (int k = 0; k < SIZE; ++k) {\n\t\t\t\tcenter[k] = vector[k]\n/*\t\t\t\t\t + (float) ((Math.random() - 0.5) / 10 * Math.sqrt(var[k])) */ \n\t\t\t\t\t;\n//\t\t\t\tcov_inv[k][k] = (float) (SIZE / var[k]); // energy is shared between SIZE distributions (better Id\n\t\t\t\tcov_inv[k][k] = (float) (1.0f / var[k] / SIZE); // energy of subband k is var[k]\n\t\t\t}\n\n\t\t\tdist[n] = new GaussianDistributionFull(center, cov_inv);\n\t\t}\n\t\t\n\t\treturn dist;\n\t}", "public void setGaussWeights(float peak, float low, int itmin, int itmax, int ntf) {\n float[] w = zerofloat(ntf);\n float center = (itmax+itmin)/2.0f;\n float width = (itmax-itmin)/2.0f;\n for (int i=0; i<ntf; ++i) {\n w[i] = peak*exp(-(i-center)*(i-center)/(2.0f*width*width))+low;\n }\n _w1D = w;\n _weights = true;\n }", "abstract void setWeight(int i, int j, Double weight);" ]
[ "0.65752494", "0.64563316", "0.60189474", "0.58704454", "0.55240494", "0.55240494", "0.55099666", "0.53924257", "0.52737784", "0.52161324", "0.5173922", "0.51341194", "0.5104942", "0.5096547", "0.5059148", "0.5028562", "0.50278115", "0.50102067", "0.49979267", "0.49954793", "0.49483493", "0.49187234", "0.48205057", "0.48194915", "0.48185113", "0.46926767", "0.46834022", "0.46713424", "0.46563897", "0.46350127", "0.4631431", "0.46176416", "0.46128765", "0.46099874", "0.46061346", "0.46053198", "0.4579421", "0.4577636", "0.45699295", "0.45508313", "0.45506224", "0.45394576", "0.4534209", "0.45129836", "0.45112023", "0.45060635", "0.4496839", "0.44940597", "0.4484799", "0.44832978", "0.44703174", "0.44612518", "0.44445953", "0.44386923", "0.4432374", "0.44283113", "0.44068635", "0.44063094", "0.4391963", "0.4390689", "0.43704322", "0.4370205", "0.4368767", "0.43562374", "0.43557793", "0.43516347", "0.4347206", "0.43462914", "0.4326376", "0.43226203", "0.43194872", "0.43175173", "0.43069845", "0.43030512", "0.42896965", "0.42872983", "0.42817178", "0.42816243", "0.42706797", "0.42643335", "0.425955", "0.42582896", "0.42503765", "0.42445287", "0.42410615", "0.42345986", "0.42340478", "0.42328516", "0.4227596", "0.42160842", "0.42096114", "0.4204053", "0.4199264", "0.41962963", "0.41962448", "0.41856366", "0.41778788", "0.41757235", "0.4172843", "0.41705492" ]
0.6805926
0
Applies a Gaussian filter to the list to filter. The parameter is arbitrary and can be 1/(2standard deviation^2).
public static List<Double> gaussianFilter(List<Double> listToFilter, double parameter) { int windowSize = 7; List<Double> filteredList = new ArrayList<Double>(); // double firstFactor = Math.pow(parameter/Math.PI, 0.5) * // Math.pow(Math.E, -1 * parameter); for (int j = 0; j < windowSize / 2; j++) { filteredList.add(0.0); } for (int i = windowSize / 2; i < listToFilter.size() - windowSize / 2; i++) { double sumValues = 0; double sumWeight = 0; for (int j = 0; j < windowSize; j++) { double weight = Math.pow(Math.E, -1 * (j - windowSize / 2) * (j - windowSize / 2) / 2 * parameter); sumWeight += weight; sumValues += weight * listToFilter.get(i); } double newValue = 1.0 / sumWeight * sumValues / sumWeight; filteredList.add(newValue); } for (int j = 0; j < windowSize / 2; j++) { filteredList.add(0.0); } return filteredList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<Double> gaussianFilter(List<Double> listToFilter) {\r\n DescriptiveStatistics stats = new DescriptiveStatistics();\r\n // Add the data from the array\r\n for (Double value : listToFilter) {\r\n stats.addValue(value);\r\n }\r\n double std = stats.getStandardDeviation();\r\n double parameter = 1.0 / (std * std * 2);\r\n return gaussianFilter(listToFilter, parameter);\r\n }", "public static List<Double> getGaussianSmoothed(List<Double> listToSmooth, double standardDeviation) {\r\n if (standardDeviation < 0.0) {\r\n throw new IllegalArgumentException(\"standardDeviation invalid\");\r\n } else if (standardDeviation == 0.0) {\r\n return listToSmooth;\r\n }\r\n \r\n // Create a new, identical but empty Histogram.\r\n List<Double> smoothedList = new ArrayList<Double>();\r\n \r\n // Determine the number of weights (must be odd).\r\n int numWeights = (int) (2 * 2.58 * standardDeviation + 0.5);\r\n if (numWeights % 2 == 0) {\r\n numWeights++;\r\n }\r\n \r\n // Initialize the smoothing weights.\r\n double[] weights = new double[numWeights];\r\n int m = numWeights / 2;\r\n double var = standardDeviation * standardDeviation;\r\n double gain = 1.0 / Math.sqrt(2.0 * Math.PI * var);\r\n double exp = -1.0 / (2.0 * var);\r\n for (int i = m; i < numWeights; i++) {\r\n double del = i - m;\r\n weights[i] = gain * Math.exp(exp * del * del);\r\n weights[numWeights - 1 - i] = weights[i];\r\n }\r\n \r\n // Clear the band total count for the smoothed histogram.\r\n double sum = 0;\r\n double originalSum = 0;\r\n \r\n double[] smoothedValues = new double[listToSmooth.size()];\r\n \r\n for (int b = 0; b < listToSmooth.size(); b++) {\r\n // Determine clipped range.\r\n int min = Math.max(b - m, 0);\r\n int max = Math.min(b + m, listToSmooth.size());\r\n \r\n // Calculate the offset into the weight array.\r\n int offset = m > b ? m - b : 0;\r\n \r\n // Accumulate the total for the range.\r\n double acc = 0;\r\n double weightTotal = 0;\r\n for (int i = min; i < max; i++) {\r\n double w = weights[offset++];\r\n acc += listToSmooth.get(i) * w;\r\n weightTotal += w;\r\n }\r\n \r\n // Round the accumulated value.\r\n smoothedValues[b] = acc / weightTotal;\r\n \r\n // Accumulate total for band.\r\n sum += smoothedValues[b];\r\n originalSum += listToSmooth.get(b);\r\n }\r\n \r\n // Rescale the counts such that the band total is approximately\r\n // the same as for the same band of the original histogram.\r\n double factor = originalSum / sum;\r\n for (int b = 0; b < listToSmooth.size(); b++) {\r\n double smoothedValue = smoothedValues[b] * factor;\r\n smoothedList.add(smoothedValue);\r\n }\r\n \r\n assert smoothedList.size() == listToSmooth.size();\r\n \r\n return smoothedList;\r\n }", "private static void gaussianSmooth(double[] img, int width, int height, double sigma) {\n\t\tint radius = (int)Math.sqrt((6.908)*(2*sigma*sigma));\n\t\t// compute coefficients of the gaussian filter\n\t\tdouble[] filter = new double[2*radius+1];\n\t\tdouble filtersum = 0;\n\n\t\tfor(int i=-radius;i<=radius;i++) {\n\t\t\tdouble g = gaussian(i,sigma);\n\t\t\tfilter[i+radius]=g;\n\t\t\tfiltersum+=g;\n\t\t}\n\n\t\tfor(int i=-radius;i<=radius;i++) {\n\t\t\tfilter[i+radius]=filter[i+radius]/(2*filtersum);//2 since 1D-filter will be used in x and y directions\n\t\t}\n\n\t\tconvolveInX(img, width, height, filter, radius);\n\t\tconvolveInY(img, width, height, filter, radius);\n\n\t}", "public static double gaussian(double[] parameters) {\r\n double mean, stddev;\r\n mean = parameters[0];\r\n stddev = parameters[1];\r\n return mean + stddev * gaussian();\r\n }", "public static Picture gaussian(Picture picture) {\n double[][] weights = { { 1 / 16.0, 2 / 16.0, 1 / 16.0 }, { 2 / 16.0, 4 / 16.0, 2 / 16.0 },\n { 1 / 16.0, 2 / 16.0, 1 / 16.0 }, };\n return kernel(picture, weights);\n }", "public void gaussianSmooth(final byte[] f, int width, int height, double sigma) {\n\t\tdouble[] img = new double[width * height];\n\t\tbyteToDouble(f, img);\n\t\tgaussianSmooth(img, width, height, sigma);\n\t\tdoubleToByte(f, img);\n\t\t//System.out.println(\"finish\");\n\t}", "public static Picture gaussian(Picture picture) {\r\n double[][] gaussina = {\r\n {1.0/16, 2.0/16, 1.0/16},\r\n {2.0/16, 4.0/16, 2.0/16},\r\n {1.0/16, 2.0/16, 1.0/16}\r\n };\r\n return transform(picture, gaussina);\r\n }", "private float gauss (int whatMask, int size) {\n int mu = 0;\n double sigma = 1/(size*Math.sqrt(2*Math.PI));\n return (float) (1/(sigma*Math.sqrt(2*Math.PI))*Math.exp(-(whatMask-mu)*(whatMask-mu)/(2*sigma*sigma)));\n }", "private static native void amFilter_0(long joint_nativeObj, long src_nativeObj, long dst_nativeObj, double sigma_s, double sigma_r, boolean adjust_outliers);", "public static double gaussian( double mean, double stddev ) {\n return mean + stddev * gaussian();\n }", "private static native long createAMFilter_0(double sigma_s, double sigma_r, boolean adjust_outliers);", "public void useGaussianDeviates(){\n this.gaussianDeviates = true;\n }", "public native MagickImage gaussianBlurImage(double raduis, double sigma)\n\t\t\tthrows MagickException;", "private void gaussianBlur() {\n targetImage = new Mat();\n Utils.bitmapToMat(lena, targetImage);\n Imgproc.cvtColor(targetImage, targetImage, Imgproc.COLOR_BGR2RGB);\n\n gaussianBlur(targetImage.getNativeObjAddr());\n\n // create a bitMap\n Bitmap bitMap = Bitmap.createBitmap(targetImage.cols(),\n targetImage.rows(), Bitmap.Config.RGB_565);\n // convert Mat to Android's bitmap:\n Imgproc.cvtColor(targetImage, targetImage, Imgproc.COLOR_RGB2BGR);\n Utils.matToBitmap(targetImage, bitMap);\n\n\n ImageView iv = (ImageView) findViewById(R.id.imageView);\n iv.setImageBitmap(bitMap);\n }", "public static void fastGlobalSmootherFilter(Mat guide, Mat src, Mat dst, double lambda, double sigma_color, double lambda_attenuation, int num_iter)\r\n {\r\n \r\n fastGlobalSmootherFilter_0(guide.nativeObj, src.nativeObj, dst.nativeObj, lambda, sigma_color, lambda_attenuation, num_iter);\r\n \r\n return;\r\n }", "public static List<Float> process(double freqDomain[], float sampleRate, int numSamples, double sigma) \n\t {\n\t double average = 0;\n\t for (double x: freqDomain) \n\t \taverage += x;\n\t average = average/freqDomain.length;\n\n\t //Calculate variance\n\t double variance = 0;\n\t for (double x: freqDomain)\n\t variance += Math.pow((x - average), 2);\n\t \n\t variance /= freqDomain.length;\n\t double stdev = Math.sqrt(variance);\n\t \n\n\t ArrayList<Float> found = new ArrayList<Float>();\n\t double max = Integer.MIN_VALUE;\n\t int maxF = -1;\n\t for (int f = 0; f < freqDomain.length/2; f++) {\n\t if (freqDomain[f] > average+sigma*stdev) \n\t {\n\t if (freqDomain[f] > max) \n\t {\n\t max = freqDomain[f];\n\t maxF = f;\n\t }\n\t } \n\t \n\t else \n\t {\n\t if (maxF != -1) \n\t {\n\t found.add(maxF * sampleRate/numSamples);\n\t max = Integer.MIN_VALUE;\n\t maxF = -1;\n\t }\n\t }\n\t \n\t }\n\n\t return (found);\n\t }", "public void setGaussian(double ragam, double x, double rataan) {\n g1 = 1 / Math.sqrt(2 * 22 / 7 * ragam * ragam);\n g3 = -((x - rataan) * (x - rataan)) / (2 * ragam * ragam);\n g2 = Math.pow(2.718, g3);\n gauss = g1 * g2;\n }", "public Double filter(Double value) throws NullValueException, EmptyListException, IncorrectSizeException;", "public List<Peak> filterNoise(List<Peak> peaks, double threshold, double experimentalPrecursorMzRatio);", "public static double[][] gaussianFunction(int size_x, int size_y, double sigma) {\n double[][] kernel;\n int center_x = size_x/2;\n int center_y = size_y/2;\n\n kernel = new double[size_y][size_x];\n for (int y=0; y<size_y; y++) {\n for (int x=0; x<size_x; x++) {\n double tmp_x = (double)((x - center_x) * (x - center_x)) / (2 * sigma * sigma);\n double tmp_y = (double)((y - center_y) * (y - center_y)) / (2 * sigma * sigma);\n kernel[y][x] = 1.0 / (2 * Math.PI * sigma * sigma) * Math.exp(-(tmp_x + tmp_y));\n }\n }\n\n return kernel;\n }", "public void gaussianSmooth(Img i, double sigma) {\n int half = (int) (sigma * Math.sqrt(6 * Math.log(10)));\n int size = 1 + 2 * half;\n System.out.printf(\"Size: %d\\n\", size);\n double[] mask = new double[size];\n double mask_sum = 0;\n for (int k = 0; k <= half; k++) {\n double value = Math.exp(-k * k / (2 * sigma * sigma)) / (sigma * Math.sqrt(2 * Math.PI));\n mask_sum += (k == 0) ? value : value * 2;\n mask[half + k] = value;\n mask[half - k] = value;\n }\n // normalize the mask\n for (int k = 0; k < size; k++) {\n mask[k] = mask[k] / mask_sum;\n }\n System.out.printf(\"Mask: %s\\n\", Arrays.toString(mask));\n\n // 2D convolution using 1D mask in x\n double[] i_temp = new double[i.img.length];\n for (int x = 0; x < i.img.length; x++) {\n i_temp[x] = (double) (i.img[x] & 0xFF);\n }\n for (int x = half; x < i.height - half; x++) {\n for (int y = half; y < i.width - half; y++) {\n i_temp[x * i.width + y] = 0;\n for (int s = -half; s <= half; s++) {\n i_temp[x * i.width + y] += (double) (i.img[(x + s) * i.width + y] & 0xFF) * mask[half - s];\n }\n }\n }\n\n // 2D convolution using 1D mask in y\n for (int x = half; x < i.height - half; x++) {\n for (int y = half; y < i.width - half; y++) {\n double f = 0;\n for (int s = -half; s <= half; s++) {\n f += i_temp[x * i.width + y + s] * mask[half - s];\n }\n i.img[x * i.width + y] = (byte) f;\n }\n }\n }", "public final EObject ruleGaussianTypeSpecifier() throws RecognitionException {\n EObject current = null;\n\n EObject lv_unit_3_0 = null;\n\n EObject lv_dimensions_6_0 = null;\n\n EObject lv_dimensions_8_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:1989:6: ( ( () 'gauss' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1990:1: ( () 'gauss' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1990:1: ( () 'gauss' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1990:2: () 'gauss' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )?\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1990:2: ()\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1991:5: \n {\n \n temp=factory.create(grammarAccess.getGaussianTypeSpecifierAccess().getGaussianTypeSpecifierAction_0().getType().getClassifier());\n current = temp; \n temp = null;\n CompositeNode newNode = createCompositeNode(grammarAccess.getGaussianTypeSpecifierAccess().getGaussianTypeSpecifierAction_0(), currentNode.getParent());\n newNode.getChildren().add(currentNode);\n moveLookaheadInfo(currentNode, newNode);\n currentNode = newNode; \n associateNodeWithAstElement(currentNode, current); \n \n\n }\n\n match(input,37,FOLLOW_37_in_ruleGaussianTypeSpecifier3490); \n\n createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getGaussKeyword_1(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2005:1: ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )?\n int alt29=2;\n int LA29_0 = input.LA(1);\n\n if ( (LA29_0==25) ) {\n alt29=1;\n }\n switch (alt29) {\n case 1 :\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2005:3: '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')'\n {\n match(input,25,FOLLOW_25_in_ruleGaussianTypeSpecifier3501); \n\n createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getLeftParenthesisKeyword_2_0(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2009:1: ( (lv_unit_3_0= ruleUnitExpression ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2010:1: (lv_unit_3_0= ruleUnitExpression )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2010:1: (lv_unit_3_0= ruleUnitExpression )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2011:3: lv_unit_3_0= ruleUnitExpression\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getGaussianTypeSpecifierAccess().getUnitUnitExpressionParserRuleCall_2_1_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleUnitExpression_in_ruleGaussianTypeSpecifier3522);\n lv_unit_3_0=ruleUnitExpression();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getGaussianTypeSpecifierRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"unit\",\n \t \t\tlv_unit_3_0, \n \t \t\t\"UnitExpression\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n match(input,26,FOLLOW_26_in_ruleGaussianTypeSpecifier3532); \n\n createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getRightParenthesisKeyword_2_2(), null); \n \n\n }\n break;\n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2037:3: ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )?\n int alt31=2;\n int LA31_0 = input.LA(1);\n\n if ( (LA31_0==33) ) {\n alt31=1;\n }\n switch (alt31) {\n case 1 :\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2037:5: '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']'\n {\n match(input,33,FOLLOW_33_in_ruleGaussianTypeSpecifier3545); \n\n createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getLeftSquareBracketKeyword_3_0(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2041:1: ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2042:1: (lv_dimensions_6_0= ruleArrayDimensionSpecification )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2042:1: (lv_dimensions_6_0= ruleArrayDimensionSpecification )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2043:3: lv_dimensions_6_0= ruleArrayDimensionSpecification\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getGaussianTypeSpecifierAccess().getDimensionsArrayDimensionSpecificationParserRuleCall_3_1_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleArrayDimensionSpecification_in_ruleGaussianTypeSpecifier3566);\n lv_dimensions_6_0=ruleArrayDimensionSpecification();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getGaussianTypeSpecifierRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tadd(\n \t \t\t\tcurrent, \n \t \t\t\t\"dimensions\",\n \t \t\tlv_dimensions_6_0, \n \t \t\t\"ArrayDimensionSpecification\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2065:2: ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )*\n loop30:\n do {\n int alt30=2;\n int LA30_0 = input.LA(1);\n\n if ( (LA30_0==14) ) {\n alt30=1;\n }\n\n\n switch (alt30) {\n \tcase 1 :\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2065:4: ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) )\n \t {\n \t match(input,14,FOLLOW_14_in_ruleGaussianTypeSpecifier3577); \n\n \t createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getCommaKeyword_3_2_0(), null); \n \t \n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2069:1: ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2070:1: (lv_dimensions_8_0= ruleArrayDimensionSpecification )\n \t {\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2070:1: (lv_dimensions_8_0= ruleArrayDimensionSpecification )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2071:3: lv_dimensions_8_0= ruleArrayDimensionSpecification\n \t {\n \t \n \t \t currentNode=createCompositeNode(grammarAccess.getGaussianTypeSpecifierAccess().getDimensionsArrayDimensionSpecificationParserRuleCall_3_2_1_0(), currentNode); \n \t \t \n \t pushFollow(FOLLOW_ruleArrayDimensionSpecification_in_ruleGaussianTypeSpecifier3598);\n \t lv_dimensions_8_0=ruleArrayDimensionSpecification();\n \t _fsp--;\n\n\n \t \t if (current==null) {\n \t \t current = factory.create(grammarAccess.getGaussianTypeSpecifierRule().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\"dimensions\",\n \t \t \t\tlv_dimensions_8_0, \n \t \t \t\t\"ArrayDimensionSpecification\", \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 break loop30;\n }\n } while (true);\n\n match(input,34,FOLLOW_34_in_ruleGaussianTypeSpecifier3610); \n\n createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getRightSquareBracketKeyword_3_3(), null); \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 }", "private final void probabilityFromRecursiveRidgeFilter( float[] filter, float[] shape) {\n\t\tint nb = 0;\n\t\tdouble min = 1e9;\n\t\tdouble max = 0.0;\n\t\tfor (int x=2;x<nx-2;x++) for (int y=2;y<ny-2;y++) for (int z=2;z<nz-2;z++) {\n\t\t\tint xyz = x + nx*y + nx*ny*z;\n\t\t\t\t// keep only the proper sign\n\t\t\t\tif (filter[xyz]<=0) filter[xyz] = 0.0f;\n\t\t\t\telse {\n\t\t\t\t\t// fit exp only to non-zero data\n\t\t\t\t\tnb++;\n\t\t\t\t\tmin = Numerics.min(filter[xyz], min);\n\t\t\t\t\tmax = Numerics.max(filter[xyz], max);\n\t\t\t\t}\n\t\t}\n\t\t\n\t\t// robust measures? pb is the exponential is not steep enough\n\t\tdouble[] response = new double[nb];\n\t\tint n=0;\n\t\tfor (int x=2;x<nx-2;x++) for (int y=2;y<ny-2;y++) for (int z=2;z<nz-2;z++) {\n\t\t\tint xyz = x + nx*y + nx*ny*z;\n\t\t\t\tif (filter[xyz]>0) {\n\t\t\t\t\tresponse[n] = filter[xyz];\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t}\n\t\tPercentile measure = new Percentile();\n\t\tdouble median = measure.evaluate(response, 50.0);\n\t\tdouble beta = median/FastMath.log(2.0);\n\t\t\n\t\tBasicInfo.displayMessage(\"exponential parameter estimates: median \"+median+\", beta \"+beta+\",\\n\");\n\t\t\n\t\t// model the filter response as something more interesting, e.g. log-normal (removing the bg samples)\n\t\tdouble[] weights = new double[nb];\n\t\tfor (int b=0;b<nb;b++) { \n\t\t\tweights[b] = (1.0-FastMath.exp( -response[b]/beta));\n\t\t\tresponse[b] = FastMath.log(response[b]);\n\t\t}\n\t\t\n\t\tdouble fmean = ImageStatistics.weightedPercentile(response,weights,50.0,nb);\n\t\t\n\t\t// stdev: 50% +/- 1/2*erf(1/sqrt(2)) (~0.341344746..)\n\t\tdouble dev = 100.0*0.5*Erf.erf(1.0/FastMath.sqrt(2.0));\n\t\tdouble fdev = 0.5*(ImageStatistics.weightedPercentile(response,weights,50.0+dev,nb) - ImageStatistics.weightedPercentile(response,weights,50.0-dev,nb));\n\t\t\n\t\tBasicInfo.displayMessage(\"Log-normal parameter estimates: mean = \"+FastMath.exp(fmean)+\", stdev = \"+FastMath.exp(fdev)+\",\\n\");\n\t\t\n\t\tfor (int x=0;x<nx;x++) for (int y=0;y<ny;y++) for (int z=0;z<nz;z++){\n\t\t\tint xyz = x + nx*y + nx*ny*z;\n\t\t\tif (filter[xyz]>0) {\n\t\t\t\tdouble pe = FastMath.exp( -filter[xyz]/beta)/beta;\n\t\t\t\tdouble plg = FastMath.exp(-Numerics.square(FastMath.log(filter[xyz])-fmean)/(2.0*fdev*fdev))/FastMath.sqrt(2.0*FastMath.PI*fdev*fdev);\n\t\t\t\tshape[xyz] = (float)(plg/(plg+pe));\n\t\t\t\t//shape[xyz] = (float)(1.0-pe);\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}", "public void filter(double[] X) {\r\n\t\tfilter(X, 0, X.length);\r\n\t}", "public void setFilter(ArrayList<ProductImageModel> newList) {\n list = new ArrayList<>();\n list.addAll(newList);\n notifyDataSetChanged();\n }", "private static float[] GetAppropriateSeparableGauss(int kernelSize){\n final double epsilon = 2e-2f / kernelSize;\n double searchStep = 1.0;\n double sigma = 1.0;\n while( true )\n {\n\n double[] kernelAttempt = GenerateSeparableGaussKernel( sigma, kernelSize );\n if( kernelAttempt[0] > epsilon )\n {\n if( searchStep > 0.02 )\n {\n sigma -= searchStep;\n searchStep *= 0.1;\n sigma += searchStep;\n continue;\n }\n\n float[] retVal = new float[kernelSize];\n for (int i = 0; i < kernelSize; i++)\n retVal[i] = (float)kernelAttempt[i];\n return retVal;\n }\n\n sigma += searchStep;\n\n if( sigma > 1000.0 )\n {\n assert( false ); // not tested, preventing infinite loop\n break;\n }\n }\n\n return null;\n }", "public static void amFilter(Mat joint, Mat src, Mat dst, double sigma_s, double sigma_r, boolean adjust_outliers)\r\n {\r\n \r\n amFilter_0(joint.nativeObj, src.nativeObj, dst.nativeObj, sigma_s, sigma_r, adjust_outliers);\r\n \r\n return;\r\n }", "public static FastGlobalSmootherFilter createFastGlobalSmootherFilter(Mat guide, double lambda, double sigma_color, double lambda_attenuation, int num_iter)\r\n {\r\n \r\n FastGlobalSmootherFilter retVal = FastGlobalSmootherFilter.__fromPtr__(createFastGlobalSmootherFilter_0(guide.nativeObj, lambda, sigma_color, lambda_attenuation, num_iter));\r\n \r\n return retVal;\r\n }", "public Gaussian() {\r\n this(1, 0, 1);\r\n }", "public void setGaussWeights(float peak, float low, int itmin, int itmax, int ntf) {\n float[] w = zerofloat(ntf);\n float center = (itmax+itmin)/2.0f;\n float width = (itmax-itmin)/2.0f;\n for (int i=0; i<ntf; ++i) {\n w[i] = peak*exp(-(i-center)*(i-center)/(2.0f*width*width))+low;\n }\n _w1D = w;\n _weights = true;\n }", "public Position sampleRandomGaussianPosition();", "public static void fastGlobalSmootherFilter(Mat guide, Mat src, Mat dst, double lambda, double sigma_color)\r\n {\r\n \r\n fastGlobalSmootherFilter_1(guide.nativeObj, src.nativeObj, dst.nativeObj, lambda, sigma_color);\r\n \r\n return;\r\n }", "public static AdaptiveManifoldFilter createAMFilter(double sigma_s, double sigma_r, boolean adjust_outliers)\r\n {\r\n \r\n AdaptiveManifoldFilter retVal = AdaptiveManifoldFilter.__fromPtr__(createAMFilter_0(sigma_s, sigma_r, adjust_outliers));\r\n \r\n return retVal;\r\n }", "protected SuspectList filterSuspectList(SuspectList baseList, Set<Set<PolicyTerm>> termGroups) {\n\t\tSuspectList suspects = new SuspectList();\n\t\t//TODO: avoid repeating the same filtering by caching filtering result?\n\t\tfor (Set<PolicyTerm> termGroup : termGroups) {\n\t\t\tSuspectList sl = new SuspectList(baseList);\n\t\t\tfor (PolicyTerm term : termGroup) {\n\t\t\t\tif (term.isStatic()) {\n\t\t\t\t\t// ignore dynamic terms when filtering\n\t\t\t\t\tsl.filter(term);\n\t\t\t\t\tif (sl.size() == 0) {\n\t\t\t\t\t\t// Empty set's union with any other set will be empty.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tsuspects.addAll(sl);\n\t\t}\n\t\treturn suspects;\n\t}", "public void reducePoints ( ArrayList<Gfa> glist, ArrayList<Gfa> snapshots) {\n\n\t\tArrayList<Gfa> smearList = new ArrayList<Gfa>(); \n\n\t\t// Do area clipping and bisection for each smear.\n\t\tfor ( Gfa gg : glist ) {\n\t\t\tsmearList.addAll( reducePoints( gg, snapshots ) );; \n\t\t}\n\t\t\n\t\t// Replace the smear list with the new list.\n\t\tglist.clear();\n\t\tglist.addAll( smearList );\n\t\t\n\t}", "public static boolean validateMagFilter(Parameter value) {\n return validateValue(value, MAG_FILTERS);\n }", "private static native long createFastGlobalSmootherFilter_0(long guide_nativeObj, double lambda, double sigma_color, double lambda_attenuation, int num_iter);", "public static Double sigmaNotNull(ArrayList<Run> runList, String name) {\n\t\tdouble mean = 0;\n\t\tint i, k=0;\n\t\tDouble temp;\n\t\tdouble weightSum = 0;\n\t\tfor (i=0; i<runList.size(); i++) {\n\t\t\ttry {\n\t\t\t\ttemp = runList.get(i).weight() * (Double)runList.get(i).get(name);\n\t\t\t\tif (!temp.isNaN()) {\n\t\t\t\t\tmean += temp;\n\t\t\t\t\tweightSum += runList.get(i).weight() ;\n\t\t\t\t}\n\t\t\t} catch (NullPointerException e) {;}\n\t\t}\n\t\tmean = mean / weightSum;\n\t\tdouble devSum = 0;\n\t\tfor (i=0; i<runList.size(); i++){\n\t\t\ttry {\n\t\t\t\ttemp = ( runList.get(i).weight() ) * Math.pow( mean - (Double)runList.get(i).get(name) , 2);\n\t\t\t\tif (!temp.isNaN()) {\n\t\t\t\t\tdevSum += temp;\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t} catch (NullPointerException e) {;}\n\t\t}\n\t\tif (runList.size()==1) {\n\t\t\treturn (Double)runList.get(0).get(name+\"_sig\");\n\t\t} else {\n\t\t\treturn Math.sqrt(devSum/weightSum/(k-1));\n\t\t}\n\t}", "@Override\n\tpublic void run() {\n\t\tspacing = checkDimensions(spacingString, input.numDimensions(), \"Spacings\");\n\t\tscales = Arrays.stream(scaleString.split(regex)).mapToInt(Integer::parseInt)\n\t\t\t.toArray();\n\t\tDimensions resultDims = Views.addDimension(input, 0, scales.length - 1);\n\t\t// create output image, potentially-filtered input\n\t\tresult = opService.create().img(resultDims, new FloatType());\n\n\t\tfor (int s = 0; s < scales.length; s++) {\n\t\t\t// Determine whether or not the user would like to apply the gaussian\n\t\t\t// beforehand and do it.\n\t\t\tRandomAccessibleInterval<T> vesselnessInput = doGauss ? opService.filter()\n\t\t\t\t.gauss(input, scales[s]) : input;\n\t\t\tIntervalView<FloatType> scaleResult = Views.hyperSlice(result, result\n\t\t\t\t.numDimensions() - 1, s);\n\t\t\topService.filter().frangiVesselness(scaleResult, vesselnessInput, spacing,\n\t\t\t\tscales[s]);\n\t\t}\n\t}", "public ArrayList<CustomerWithGoods> filterValued() {\n\t\tArrayList<CustomerWithGoods> richCustomers = new ArrayList<>();\n\t\t// uses method above to calculate average order price\n\t\tint averageOrderPrice = averageOrderPrice();\n\n\t\tfor (CustomerWithGoods customerWithGoods : allCustomers) {\n\t\t\tif (customerWithGoods.valueOfGoods() > averageOrderPrice) {\n\t\t\t\trichCustomers.add(customerWithGoods);\n\t\t\t}\n\t\t}\n\t\treturn richCustomers;\n\t}", "StandardFilterBuilder standardFilter(int count);", "void setSampleFiltering(boolean filterFlag, float cutoffFreq) {\n }", "public float gaussianRandom() {\n\t\treturn (CCMath.constrain((float)nextGaussian() / 4,-1 ,1 ) + 1) / 2;\n\t}", "public static List<Double> medianFilter(List<Double> listToFilter, int n) {\r\n \r\n if (n % 2 == 0) {\r\n throw new Error(\"Medianfilter not implemented for even n values\");\r\n }\r\n \r\n List<Double> filteredList = new ArrayList<Double>();\r\n \r\n int numberOfZeroesToAddBefore = (n - 1) / 2;\r\n int numberOfZeroesToAddAfter = (n - 1) / 2;\r\n \r\n for (int i = 0; i < numberOfZeroesToAddBefore; i++) {\r\n listToFilter.add(0, 0.0);\r\n }\r\n for (int i = 0; i < numberOfZeroesToAddAfter; i++) {\r\n listToFilter.add(0.0);\r\n }\r\n \r\n for (int i = numberOfZeroesToAddBefore; i < listToFilter.size() - numberOfZeroesToAddAfter; i++) {\r\n double median = median(new ArrayList<Double>(listToFilter.subList(i - (n / 2), i + (n / 2) + 1)));\r\n filteredList.add(median);\r\n }\r\n \r\n for (int i = 0; i < numberOfZeroesToAddBefore; i++) {\r\n listToFilter.remove(0);\r\n }\r\n for (int i = 0; i < numberOfZeroesToAddAfter; i++) {\r\n listToFilter.remove(listToFilter.size() - 1);\r\n }\r\n return filteredList;\r\n }", "public static double gaussian() {\n // use the polar form of the Box-Muller transform\n double r, x, y;\n do {\n x = uniform( -1.0, 1.0 );\n y = uniform( -1.0, 1.0 );\n r = x*x + y*y;\n } while ( r >= 1 || r == 0 );\n \n return x * Math.sqrt(-2 * Math.log(r) / r);\n\n // Remark: y * Math.sqrt(-2 * Math.log(r) / r)\n // is an independent random gaussian\n }", "public void setGaussFK() {\n for (int i = 0; i < 10; i++) {\n setGaussian(devFK[i], nilai[i], meanFK[i]);\n gaussFK[i] = getGaussian();\n }\n }", "public void filterList(ArrayList<GroupChannel> filteredList) {\n }", "public void setGaussWeights(float peak, float low, int itmin, int itmax, \n int ixmin, int ixmax, int ntf, int nx) {\n float[][] w = zerofloat(ntf,nx);\n float centert = (itmax+itmin)/2.0f;\n float centerx = (ixmax+ixmin)/2.0f;\n float widtht = (itmax-itmin)/2.0f;\n float widthx = (ixmax-ixmin)/2.0f;\n float x = 0.0f;\n float t = 0.0f;\n for (int ix=0; ix<nx; ++ix) {\n for (int it=0; it<ntf; ++it) {\n x = (ix-centerx)*(ix-centerx)/(2.0f*widthx*widthx); \n t = (it-centert)*(it-centert)/(2.0f*widtht*widtht); \n w[ix][it] = peak*exp(-(x+t))+low;\n }\n }\n _w2D = w;\n _weights = true;\n }", "public static List<Student> filterExample(){\n\t\tList<Student> genderFilter = StudentDataBase.getAllStudents().stream()\n\t\t\t\t.filter(stu->stu.getGender().equals(\"female\")).collect(Collectors.toList());\n\t\treturn genderFilter;\n\t}", "public static Double median(List<Double> list) {\r\n if (list == null || list.size() == 0) {\r\n throw new Error(\"Mean of an empty list is undefined\");\r\n }\r\n int size = list.size();\r\n Collections.sort(list);\r\n double median = 0.0;\r\n if (size % 2 == 0) {\r\n median = (list.get(size / 2) + list.get((size / 2) - 1)) / 2.0;\r\n } else {\r\n median = list.get(size / 2);\r\n }\r\n return median;\r\n }", "public static int verifyDistribution(ArrayList<Double> gasnum, double mean, double stdDeviation, double numberofStdDeviation){\n\t\t\n\t\tint index = 0;//this will be used to go to the next index of the ArrayList\n\t\tint count = 0; //to count the number of randomnumbers that deviation away from the mean; also for calculating percentage\n\t\t\n\t\twhile(index < gasnum.size()){ //keep running so long as we don't go beyond the ArrayList size\n\t\t\t\n\t\t\t//this is pretty much the same logic as in the assignment sheet; check if the numbers fall between (0.0-(1.0*1.0)) and (0.0+(1.0*1.0))\n\t\t\tif((gasnum.get(index) < (mean + (stdDeviation*numberofStdDeviation))) && (gasnum.get(index) > (mean - (stdDeviation*numberofStdDeviation)))){\n\t\t\t\tcount++; //if show increase count by one\n\t\t\t}\n\t\t\tindex++;//go to the next index of the ArrayList\n\t\t}\n\t\t\n\t\treturn ((count*100)/gasnum.size()); //calculate the percentage within the standard deviation\n\t}", "public static void amFilter(Mat joint, Mat src, Mat dst, double sigma_s, double sigma_r)\r\n {\r\n \r\n amFilter_1(joint.nativeObj, src.nativeObj, dst.nativeObj, sigma_s, sigma_r);\r\n \r\n return;\r\n }", "public void setFilters(List<COSName> filters) {\n/* 333 */ COSArray cOSArray = COSArrayList.converterToCOSArray(filters);\n/* 334 */ this.stream.setItem(COSName.FILTER, (COSBase)cOSArray);\n/* */ }", "public static FastGlobalSmootherFilter createFastGlobalSmootherFilter(Mat guide, double lambda, double sigma_color)\r\n {\r\n \r\n FastGlobalSmootherFilter retVal = FastGlobalSmootherFilter.__fromPtr__(createFastGlobalSmootherFilter_1(guide.nativeObj, lambda, sigma_color));\r\n \r\n return retVal;\r\n }", "private void doGaussainBlurRGB(BufferedImage img, int minBlurX, int maxBlurX, int minBlurY, int maxBlurY, int x, int y,\n\t\t\tint blurWidth, int blurHeight, int srcRgb) {\n\t\timg.setRGB(x, y, srcRgb); // Nothing blur\n\n\t\t// int[] inPixels = new int[blurWidth * blurHeight];\n\t\t// int[] outPixels = new int[blurWidth * blurHeight];\n\t\t// java.awt.image.Kernel kernel = GaussianFilter.makeKernel(0.667f);\n\t\t// GaussianFilter.convolveAndTranspose(kernel, inPixels, outPixels,\n\t\t// blurWidth, blurHeight, true, GaussianFilter.CLAMP_EDGES);\n\t\t// GaussianFilter.convolveAndTranspose(kernel, outPixels, inPixels,\n\t\t// blurHeight, blurWidth, true, GaussianFilter.CLAMP_EDGES);\n\t\t// img.setRGB(x, y, blurWidth, blurHeight, inPixels, 0, blurWidth);\n\n\t\t// int v = 0;\n\t\t// if ((maxBlurY - minBlurY) > (maxBlurX - minBlurX)) { // Left/Right?\n\t\t// v = (int) (Math.abs(240 - Math.abs(x - minBlurX) * 20));\n\t\t// } else {\n\t\t// v = (int) (Math.abs(240 - Math.abs(y - minBlurY) * 20));\n\t\t// }\n\t\t// img.setRGB(x, y, new Color(v, v, v).getRGB());\n\n\t\t// NormalDistribution nd = new NormalDistribution(0, 1.44);\n\n\t\t// int r = (0xff & srcRgb);\n\t\t// int g = (0xff & (srcRgb >> 8));\n\t\t// int b = (0xff & (srcRgb >> 16));\n\t\t// srcRgb = r + (g << 8) + (b << 4) + (100 << 24);\n\t\t// img.setRGB(x, y, Color.white.getRGB());\n\t\t// img.setRGB(x, y, new Color(220, 220, 220).getRGB());\n\t}", "public LinearGaussian(double[] values) {\n\t\tsuper();\n\t\tthis.values = values;\n\t\t\n\t\t/*calculate mean*/\n\t\tmean = Utilities.averageValueOfArray(values);\n\t\tvariance = Utilities.averageValueOfArray(varianceArray());\n\t}", "public double nextGaussian() {\n\n /*\n * This implementation uses the polar method to generate two gaussian\n * values at a time. One is returned, and the other is stored to be returned\n * next time.\n */\n\n if (haveStoredGaussian) {\n haveStoredGaussian = false;\n return storedGaussian;\n }\n\n double v1;\n double v2;\n double s;\n do {\n v1 = 2 * nextDouble() - 1;\n v2 = 2 * nextDouble() - 1;\n s = v1 * v1 + v2 * v2;\n } while (s >= 1 || s == 0);\n\n double m = StrictMath.sqrt(-2 * StrictMath.log(s) / s);\n storedGaussian = v2 * m;\n haveStoredGaussian = true;\n\n return v1 * m;\n }", "public static double nextGaussian(final RandomEventSource source) {\r\n double v1, v2, s;\r\n do {\r\n // Generates two independent random variables U1, U2\r\n v1 = 2 * source.nextDouble() - 1;\r\n v2 = 2 * source.nextDouble() - 1;\r\n s = v1 * v1 + v2 * v2;\r\n } while (s >= 1 || s == 0);\r\n final double norm = Math.sqrt(-2 * Math.log(s) / s);\r\n final double result = v1 * norm;\r\n // On 1,000,000 calls, this would usually yield about -5 minimum value,\r\n // and +5 maximum value. So we pretend the range is [-5.5,5.5] and normalize\r\n // it to [0,1], clamping if needed.\r\n final double normalized = (result + 5.5) / 11.0;\r\n return (normalized < 0) ? 0 : (normalized > BEFORE_ONE ? BEFORE_ONE\r\n : normalized);\r\n }", "public void filterImage()\r\n {\r\n\t if (!isInverted && !isBlured )\r\n {\r\n cropedEdited = cropedPart;\r\n }\r\n\t float[] elements = {0.0f, 1.0f, 0.0f, -1.0f,brightnessLevel,1.0f,0.0f,0.0f,0.0f}; \r\n\t Kernel kernel = new Kernel(3, 3, elements); \r\n\t BufferedImageOp change = new ConvolveOp(kernel); \r\n\t cropedEdited = change.filter(cropedEdited, null);\r\n repaint();\r\n }", "protected void validateFilters(cwterm.service.rigctl.xsd.Filter[] param) {\n }", "public void filter(List<String> filters){\n filteredList.clear();\n\n if(filters == null || filters.size() == 0 || filters.get(0).toLowerCase().equals(\"NONE\")){\n filteredList = new ArrayList<>(sensorList);\n }\n\n for(int i=0; i<sensorList.size(); i++) {\n for (int j = 0; j < filters.size(); j++) {\n if(!filteredList.contains(sensorList.get(i))) {\n if (sensorList.get(i).getSensor_Type().equals(filters.get(j))) {\n filteredList.add(sensorList.get(i));\n }\n if (filters.get(j).equals(\"Heartbeat=0\")) {\n if (sensorList.get(i).getSensor_Type().equals(\"HeartRate\") && sensorList.get(i).getSensor_Val() == 0) {\n filteredList.add(sensorList.get(i));\n }\n }\n if (filters.get(j).equals(\"Tripped Vibration Sensor\")) {\n if (sensorList.get(i).getSensor_Type().equals(\"Vibration\") && sensorList.get(i).getSensor_Val() > 0) {\n filteredList.add(sensorList.get(i));\n }\n }\n if (filters.get(j).equals(\"Health=Service\")) {\n if (sensorList.get(i).getSensorHealth().equals(\"Service\")) {\n filteredList.add(sensorList.get(i));\n }\n }\n if (filters.get(j).equals(\"Health=EOL\")) {\n if (sensorList.get(i).getSensorHealth().equals(\"EOL\")) {\n filteredList.add(sensorList.get(i));\n }\n }\n if (filters.get(j).equals(\"Dead Battery\")) {\n if (sensorList.get(i).getBattery() == 0) {\n filteredList.add(sensorList.get(i));\n }\n }\n }\n }\n }\n filteredListForSearch.clear();\n filteredListForSearch.addAll(filteredList);\n removeDuplicates();\n notifyDataSetChanged();\n }", "private static native void fastGlobalSmootherFilter_0(long guide_nativeObj, long src_nativeObj, long dst_nativeObj, double lambda, double sigma_color, double lambda_attenuation, int num_iter);", "public static ArrayList<Sample> filterSample(ArrayList<Sample> samples , Predicate<Sample> predicate)\n\t{\n\t\treturn (ArrayList<Sample>) samples.stream().filter(predicate).collect(Collectors.<Sample>toList());\n\t}", "public static void gaussian(double a[][], int index[])\r\n {\r\n int n = index.length;\r\n double c[] = new double[n];\r\n\r\n for (int i=0; i<n; ++i)\r\n index[i] = i;\r\n\r\n for (int i=0; i<n; ++i)\r\n {\r\n double c1 = 0;\r\n for (int j=0; j<n; ++j)\r\n {\r\n double c0 = Math.abs(a[i][j]);\r\n if (c0 > c1) c1 = c0;\r\n }\r\n c[i] = c1;\r\n }\r\n\r\n int k = 0;\r\n for (int j=0; j<n-1; ++j)\r\n {\r\n double pi1 = 0;\r\n for (int i=j; i<n; ++i)\r\n {\r\n double pi0 = Math.abs(a[index[i]][j]);\r\n pi0 /= c[index[i]];\r\n if (pi0 > pi1)\r\n {\r\n pi1 = pi0;\r\n k = i;\r\n }\r\n }\r\n\r\n int itmp = index[j];\r\n index[j] = index[k];\r\n index[k] = itmp;\r\n for (int i=j+1; i<n; ++i)\r\n {\r\n double pj = a[index[i]][j]/a[index[j]][j];\r\n\r\n a[index[i]][j] = pj;\r\n\r\n for (int l=j+1; l<n; ++l)\r\n a[index[i]][l] -= pj*a[index[j]][l];\r\n }\r\n }\r\n }", "public static Double getGaussian(final Double average, final Double relStdDeviation){\r\n\t\tDouble absStdDeviation = average * relStdDeviation;\r\n\t\treturn new Random().nextGaussian() * absStdDeviation + average; \r\n\t}", "public static double addGaussianJitter( double mu, double sigma) {\n\n\t\treturn mu + sigma * _random.nextGaussian();\n }", "public static double nextGaussian() {\n return randGen.nextGaussian();\n }", "public List<PedidoIndividual> filtrar(PedidoIndividual filtro);", "public static Double standardDeviation(ArrayList<Double> values, Double mean) {\n\t\tDouble diff = 0.0;\n\t\t// iterate though the values and add to the difference the (index minus the mean)^2\n\t\tfor (int i = 0; i < values.size(); i++) {\n\t\t\tdiff += Math.pow((values.get(i) - mean),2);\n\t\t}\n\t\t// return the sqrt of the difference devided by the length of values minus 1\n\t\treturn Math.sqrt(diff / values.size() - 1);\n\t}", "public ArrayList<DataPoint> normalizeFeatures(ArrayList<DataPoint> datapoints) {\n\t\t\n\t\tdouble[] vector = new double[featureCount];\n\t\t// now normalize ALL the points!\n\t\tfor (DataPoint aPoint : datapoints) {\n\t\t\tvector = aPoint.vector;\n\t\t\tfor (int i = 0; i < featureCount; ++i) {\n\t\t\t\tvector[i] = (vector[i] - meansOfFeatures.get(i))\n\t\t\t\t\t\t/ stdevOfFeatures.get(i);\n\t\t\t}\n\t\t\taPoint.setVector(vector);\n\t\t}\n\t\treturn datapoints;\n\t}", "public ArrayList<Sighting> filter(ArrayList<Sighting> rawSightings);", "public static void main(String... args) throws Exception {\n\t\tString dataDir = Utils.getSharedDataDir(BluranImage.class) + \"ModifyingImages/\";\r\n\t\t//ExStart:BluranImage\r\n\t\tImage image = Image.load(dataDir + \"aspose-logo.jpg\");\r\n\t\t// Convert the image into RasterImage.\r\n\t\tRasterImage rasterImage = (RasterImage) image;\r\n\r\n\t\t// Pass Bounds[rectangle] of image and GaussianBlurFilterOptions\r\n\t\t// instance to Filter method.\r\n\t\trasterImage.filter(rasterImage.getBounds(), new GaussianBlurFilterOptions(5, 5));\r\n\r\n\t\t// Save the results to output path.\r\n\t\trasterImage.save(dataDir + \"BluranImage_out.gif\");\r\n\t\t//ExEnd:BluranImage\r\n\t}", "public static void streamFilter(List<Associate> associateList, String filter) {\n\n\t\tString filter2 = filter.toLowerCase();\n\n\t\tassociateList.stream()\n\t\t\t\t.filter((Associate a) -> new StringBuilder(a.getFirstname().toLowerCase()).indexOf(filter2) != -1)\n\n\t\t\t\t.forEach((Associate a) -> {\n\t\t\t\t\tSystem.out.println(a.getFirstname());\n\n\t\t\t\t});\n\t}", "public ArrayList<CampusEvent> eventListFilter (ArrayList<CampusEvent> campusEvents, Filters filter) {\n ArrayList<CampusEvent> newList = new ArrayList<CampusEvent>();\n //if all the filters are zero, return original list\n Log.d(Globals.TAGG, \"Showing what the filters are\");\n\n if (filter == null) {\n Log.d(Globals.TAGG, \"All filters are null\");\n return campusEvents;\n } else {\n if (filter.getfFood() == 0 && filter.getfEventType() == 0 && filter.getfProgramType() == 0 && filter.getfGender() == 0 && filter.getfGreekSociety() == 0 && filter.getfMajor() == 0 && filter.getfYear() == 0) {\n return campusEvents;\n }\n if (filter.getfFood() != 0) {\n for (CampusEvent event : campusEvents) {\n int scaleval = filter.getfFood() - 1;\n if (event.getFood() == scaleval) {\n newList.add(event);\n }\n }\n }\n if (filter.getfEventType() != 0) {\n for (CampusEvent event : campusEvents) {\n int scaleval = filter.getfEventType() - 1;\n if (event.getEventType() == scaleval) {\n newList.add(event);\n }\n }\n }\n\n if (filter.getfProgramType() != 0) {\n for (CampusEvent event : campusEvents) {\n if (event.getProgramType() == filter.getfProgramType()) {\n newList.add(event);\n }\n }\n }\n\n if (filter.getfYear() != 0) {\n for (CampusEvent event : campusEvents) {\n if (event.getYear() == filter.getfYear()) {\n newList.add(event);\n }\n }\n }\n\n if (filter.getfMajor() != 0) {\n for (CampusEvent event : campusEvents) {\n if (event.getMajor() == filter.getfMajor()) {\n newList.add(event);\n }\n }\n }\n\n if (filter.getfGender() != 0) {\n for (CampusEvent event : campusEvents) {\n if (event.getGender() == filter.getfGender()) {\n newList.add(event);\n }\n }\n }\n\n if (filter.getfGreekSociety() != 0) {\n for (CampusEvent event : campusEvents) {\n if (event.getGreekSociety() == filter.getfGreekSociety()) {\n newList.add(event);\n }\n }\n }\n\n return newList;\n }\n }", "public void useUniformDeviates(){\n this.gaussianDeviates = false;\n }", "public static List<Student> filterMaleValues(){\n\n\t\tList<Student> filterMaleExe = StudentDataBase.getAllStudents().stream()\n\t\t\t\t.filter(k->k.getGradeLevel()>=3.9)\n\t\t\t\t.filter(j->j.getGender().equals(\"male\")).collect(Collectors.toList());\n\t\treturn filterMaleExe;\n\t}", "public static double getArrayListDoubleMean(ArrayList<Double> list) {\n\t\treturn 0;\n\t}", "public void filterByFoMostRece(){\n // for each mood event in the list\n for (int i = 0; i < moodListBeforeFilterFo.getCount(); i++ ){\n // get the mood's date\n dateOfMood = moodListBeforeFilterFo.getMoodEvent(i).getDateOfRecord();\n // if it within the range, then add it to the new list\n if (dateOfMood.compareTo(lowerBoundDATE) >= 0 && dateOfMood.compareTo(currentDATE) <= 0) {\n moodListAfterFilter.add(moodListBeforeFilterFo.getMoodEvent(i));\n }\n }\n }", "private void addAnnotationFilters(Query query, List<Predicate<Variant>> filters) {\n addClinicalFilters(query, filters);\n\n if (VariantQueryUtils.isValidParam(query, ANNOT_POPULATION_ALTERNATE_FREQUENCY)) {\n ParsedQuery<KeyOpValue<String, Float>> freqQuery\n = VariantQueryParser.parseFreqFilter(query, ANNOT_POPULATION_ALTERNATE_FREQUENCY);\n List<PopulationFrequencyVariantFilter.AltFreqFilter> freqFilters = freqQuery.mapValues(popFreq -> {\n String[] split = popFreq.getKey().split(VariantQueryUtils.STUDY_POP_FREQ_SEPARATOR);\n return new PopulationFrequencyVariantFilter.AltFreqFilter(split[0], split[1], popFreq.getOp(), popFreq.getValue());\n });\n filters.add(new PopulationFrequencyVariantFilter(freqQuery.getOperation(), freqFilters));\n }\n if (VariantQueryUtils.isValidParam(query, ANNOT_POPULATION_REFERENCE_FREQUENCY)) {\n ParsedQuery<KeyOpValue<String, Float>> freqQuery\n = VariantQueryParser.parseFreqFilter(query, ANNOT_POPULATION_REFERENCE_FREQUENCY);\n List<PopulationFrequencyVariantFilter.RefFreqFilter> freqFilters = freqQuery.mapValues(popFreq -> {\n String[] split = popFreq.getKey().split(VariantQueryUtils.STUDY_POP_FREQ_SEPARATOR);\n return new PopulationFrequencyVariantFilter.RefFreqFilter(split[0], split[1], popFreq.getOp(), popFreq.getValue());\n });\n filters.add(new PopulationFrequencyVariantFilter(freqQuery.getOperation(), freqFilters));\n }\n if (VariantQueryUtils.isValidParam(query, ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY)) {\n ParsedQuery<KeyOpValue<String, Float>> freqQuery\n = VariantQueryParser.parseFreqFilter(query, ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY);\n List<PopulationFrequencyVariantFilter.MafFreqFilter> freqFilters = freqQuery.mapValues(popFreq -> {\n String[] split = popFreq.getKey().split(VariantQueryUtils.STUDY_POP_FREQ_SEPARATOR);\n return new PopulationFrequencyVariantFilter.MafFreqFilter(split[0], split[1], popFreq.getOp(), popFreq.getValue());\n });\n filters.add(new PopulationFrequencyVariantFilter(freqQuery.getOperation(), freqFilters));\n }\n\n }", "public void compute2() {\n\n ILineString lsInitiale = this.geom;\n ILineString lsLisse = Operateurs.resampling(lsInitiale, 1);\n // ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 10, 1);\n // ILineString\n // lsLisse=LissageGaussian.AppliquerLissageGaussien((GM_LineString)\n // lsInitiale, 10, 1, false);\n\n logger.debug(\"Gaussian Smoothing of : \" + lsInitiale);\n\n // On determine les séquences de virages\n List<Integer> listSequence = determineSequences(lsLisse);\n\n // On applique le filtre gaussien\n\n // On crée une collection de points qui servira à découper tous les\n // virages\n\n if (listSequence.size() > 0) {\n List<Integer> listSequenceFiltre = filtrageSequences(listSequence, 1);\n DirectPositionList dplPointsInflexionLsLissee = determinePointsInflexion(\n lsInitiale, listSequenceFiltre);\n\n for (IDirectPosition directPosition : dplPointsInflexionLsLissee) {\n this.jddPtsInflexion.add(directPosition.toGM_Point().getPosition());\n // dplPtsInflexionVirages.add(directPosition);\n }\n\n // jddPtsInflexion.addAll(jddPtsInflexionLsInitiale);\n\n }\n // dplPtsInflexionVirages.add(lsInitiale.coord().get(lsInitiale.coord().size()-1));\n\n }", "List<List<Pixel>> filter(Image img, int multiplier, String operation);", "public static RegressionPrior gaussian(double[] priorVariances) {\n verifyPriorVariances(priorVariances);\n return new GaussianRegressionPrior(priorVariances);\n }", "protected Vector filterInputInternal(Vector before)\n\t{\n\t\treturn filterInternal(before, featureMins, featureMaxes);\n\t}", "public SimpleKalmanFilter(double noiseDeviation) {\n\t\tthis(noiseDeviation, 0);\n\t}", "public void addFilters(){\r\n filter.getItems().clear();\r\n filter.setPromptText(\"Select Filter\");\r\n filter.setButtonCell(new ListCell<String>() {\r\n @Override\r\n protected void updateItem(String item, boolean empty) {\r\n super.updateItem(item, empty);\r\n if (empty || item == null)\r\n setText(\"Select Filter\");\r\n else\r\n setText(item);\r\n }\r\n });\r\n\r\n //Adds filters to filter combobox based on tx power rating and filter power rating\r\n\r\n DocumentBuilderFactory filteringFactory = DocumentBuilderFactory.newInstance();\r\n DocumentBuilder filterBuilder = null;\r\n try { filterBuilder = filteringFactory.newDocumentBuilder(); }\r\n catch (ParserConfigurationException e) { e.printStackTrace(); }\r\n\r\n Document filterDocument = null;\r\n try { filterDocument = Objects.requireNonNull(filterBuilder).parse(new File(\"maskFiltersCouplers.xml\")); }\r\n catch (SAXException | IOException e) { e.printStackTrace(); }\r\n\r\n List<sample.Filtering> theFilters = new ArrayList<sample.Filtering>();\r\n NodeList filtersNodeList = filterDocument.getDocumentElement().getChildNodes();\r\n for (int i = 0; i < filtersNodeList.getLength(); i++) {\r\n Node filtersNode = filtersNodeList.item(i);\r\n if (filtersNode.getNodeType() == Node.ELEMENT_NODE) {\r\n Element filtersElement = (Element) filtersNode;\r\n\r\n filterPower = Double.parseDouble((filtersElement.getElementsByTagName(\"Power\").item(0).getChildNodes().item(0).getNodeValue()));\r\n filterPIDDescription = filtersElement.getElementsByTagName(\"PIDDESCRIPTION\").item(0).getChildNodes().item(0).getNodeValue();\r\n filterSize = filtersElement.getElementsByTagName(\"Size\").item(0).getChildNodes().item(0).getNodeValue();\r\n filterPID = filtersElement.getElementsByTagName(\"PID\").item(0).getChildNodes().item(0).getNodeValue();\r\n\r\n if (filterPower > powerRating * 1000 || filterPower * cabinets > powerRating * 1000) { //powerRating is KW need to multiply by 1000 to get into watts\r\n theFilters.add(new sample.Filtering(filterPower, filterPIDDescription, filterSize, filterPID));//filterPower is set in watts (1,000 watts = 1KW)\r\n filter.getItems().add(filterPIDDescription + \" input size \" + filterSize);\r\n }\r\n }\r\n }\r\n }", "public static void main(String[] args) {\n\t\t List<Product> list = new ArrayList<>();\r\n\t list.add(new Product(1, 1.58));\r\n\t list.add(new Product(2, 1.45));\r\n\t list.add(new Product(3, 2.25));\r\n\t list.add(new Product(4, 2.58));\r\n\r\n\t Double ans = list.stream().filter(p -> p.price < 2.5).mapToDouble\r\n\t (p -> p.price).average().orElse(0);\r\n\r\n\t System.out.println(ans);\r\n\t}", "public static double standardDeviation(double average, List<Double> examples) {\n\t\tdouble result = 0;\n\t\tfor (int i = 0; i < examples.size(); i++) {\n\t\t\tdouble temp = examples.get(i) - average;\n\t\t\tresult += temp * temp;\n\t\t}\n\t\tresult /= examples.size() - 1;\n\t\treturn Math.sqrt(result);\n\t}", "public static void blur (BufferedImage bi)\n {\n imageList.add(deepCopy(bi)); // add the image to the undo list\n\n float[] matrix = {\n 0.111f, 0.111f, 0.111f, \n 0.111f, 0.111f, 0.111f, \n 0.111f, 0.111f, 0.111f, \n };\n\n BufferedImageOp op = new ConvolveOp( new Kernel(3, 3, matrix) );\n BufferedImage sourceImage = deepCopy(bi);\n op.filter(sourceImage, bi);\n redoList.add(deepCopy(bi)); // add the image to the redo list\n }", "public static Double calculateStanderedDeviation(List<Person> personsList)\n\t{\n\t\t\n\t\tdouble standardDeviation = 0.0;\n\t\tDouble meanValue = personsList.stream().collect(Collectors.averagingDouble(Person::getAnualIncome));\n\t\t//System.out.println(perCapitaIncome);\n\t\t\t\n\t\tfor (Person person : personsList) {\n\t\t\tstandardDeviation += Math.pow(person.getAnualIncome()- meanValue, 2) ;\n\t\t\t\n\t\t}\n\t\t\n\t\treturn Math.sqrt(standardDeviation/personsList.size());\t\n\t}", "public GaussianNormailizerFeature(ArrayList<EssayInstance> trainingSample, Features base, String baseName, Type type) {\n means = new HashMap<>();\n stddev = new HashMap<>();\n this.baseFeature = base;\n this.baseName = baseName;\n this.name = baseName + \"_\" + type.toString().toLowerCase() + \"_gaussiannorm_task\";\n this.type = type;\n HashMap<Integer, int[]> docs = new HashMap<>();\n // compute the sums\n for (EssayInstance instance : trainingSample) {\n double value = getBaseValue(instance);\n if (!means.containsKey(instance.set)) means.put(instance.set, new double[]{value});\n else means.get(instance.set)[0] += value;\n\n if (!docs.containsKey(instance.set)) docs.put(instance.set, new int[]{1});\n else docs.get(instance.set)[0]++;\n }\n // convert to mean\n for (Integer i : means.keySet()) means.get(i)[0] /= docs.get(i)[0];\n // compute standard deviation\n for (EssayInstance instance : trainingSample) {\n double value = getBaseValue(instance);\n double dev = means.get(instance.set)[0] - value;\n dev *= dev;\n if (!stddev.containsKey(instance.set))\n stddev.put(instance.set, new double[]{dev});\n else stddev.get(instance.set)[0] += dev;\n }\n // normalize the stddev\n for (Integer i : stddev.keySet()) stddev.get(i)[0] = Math.sqrt(stddev.get(i)[0] / (docs.get(i)[0] - 1));\n // debug\n if (EssayScoring.DEBUG) {\n List<Integer> tasks = new ArrayList<>(means.keySet());\n Collections.sort(tasks);\n for (Integer task : tasks) {\n System.out.println(\"Feature \" + baseName + \" for task/set \" + task + \":\");\n System.out.println(\"\\tx: \" + means.get(task)[0]);\n System.out.println(\"\\ts: \" + stddev.get(task)[0]);\n }\n }\n }", "public void setFilters(List<COSName> filters)\n {\n stream.setItem(COSName.FILTER, new COSArray(filters));\n }", "private static native void weightedMedianFilter_0(long joint_nativeObj, long src_nativeObj, long dst_nativeObj, int r, double sigma, int weightType, long mask_nativeObj);", "public void blurImage()\r\n {\r\n if (!isChanged && !isBlured )\r\n {\r\n cropedEdited = cropedPart;\r\n }\r\n\t float[] elements = {1/9f, 1/9f, 1/9f, 1/9f,1/9f,1/9f,1/9f,1/9f,1/9f,1/9f}; \r\n\t Kernel kernel = new Kernel(3, 3, elements); \r\n\t BufferedImageOp blur = new ConvolveOp(kernel); \r\n\t cropedEdited = blur.filter(cropedEdited, null);\r\n repaint();\r\n }", "public abstract void filter();", "private static ArrayList<Float> manipulate(Set manipulatePosList, int anomaly, ArrayList<Float> simList) {\r\n for (Object elem : manipulatePosList) {\r\n switch (anomaly) {\r\n case 3:\r\n if ((Integer) elem == 0) {\r\n lowerLimNext = startHum + max_rateOfChange;\r\n } else {\r\n lowerLimNext = (float) simList.get((Integer) elem - 1) + max_rateOfChange;\r\n }\r\n upperLimNext = upperLimit;\r\n nextValue = calcNextValue(lowerLimNext, upperLimNext);\r\n simList.add((Integer) elem, nextValue);\r\n break;\r\n case 4:\r\n simList.add((Integer) elem, -1f);\r\n break;\r\n case 5:\r\n simList.add((Integer) elem, -1f);\r\n break;\r\n }\r\n }\r\n return simList;\r\n }", "@Override\n\tpublic Object process(Object input) {\n\t\treturn filter.process((Waveform2)input);\n\t}", "public static float getRandomFloatNormal(float mean, float stdDev)\n\t{\n\t\treturn (float) ThreadLocalRandom.current().nextGaussian() * stdDev + mean;\n\t}", "public static DoubleStream generateStreamFromList(List<Double> list)\n\t{\n\t\tDoubleStream.Builder builder = DoubleStream.builder();\n\t\tfor (double n : list)\n\t\t{\n\t\t\tbuilder.add(n);\n\t\t}\n\t\treturn builder.build();\n\t}", "public void addFilter(String token, String value) {\n if (token == null) {\n return;\n }\n globalFilterSet.addFilter(new FilterSet.Filter(token, value));\n }", "public interface SightingFilterFunction {\n\t/**\n\t * Takes in a list of sightings and returns the ones which are valid.\n\t * Can additionally be used to combine sightings using the Sighting.addSighting() method if \n\t * user-supplied logic determines that a single instance of a target has been split into two\n\t * sightings.\n\t * @param rawSightings the unfiltered list of Sightings\n\t * @return the Sightings from rawSightings that are valid according to user-defined logic.\n\t */\n\tpublic ArrayList<Sighting> filter(ArrayList<Sighting> rawSightings);\n}" ]
[ "0.81152356", "0.67914295", "0.59041", "0.56685454", "0.56266516", "0.5427177", "0.5423228", "0.5162282", "0.5069758", "0.5063751", "0.50613505", "0.50088453", "0.48567483", "0.48330328", "0.47813758", "0.47812602", "0.47339067", "0.4702628", "0.46742815", "0.46687427", "0.46680504", "0.4663841", "0.46595535", "0.46533528", "0.45692065", "0.45372277", "0.45185176", "0.45175457", "0.45009643", "0.44846556", "0.44816077", "0.44272667", "0.44235733", "0.44221795", "0.44190794", "0.44065621", "0.44042838", "0.43779886", "0.43772772", "0.4373224", "0.4352408", "0.43520683", "0.4345524", "0.43446785", "0.43372434", "0.43295223", "0.43254864", "0.43232647", "0.43162873", "0.43137026", "0.43122566", "0.43099618", "0.43073186", "0.42840627", "0.42832366", "0.42812666", "0.42756534", "0.42665765", "0.42585528", "0.42548427", "0.42531002", "0.4247548", "0.4247365", "0.42424253", "0.4238833", "0.42385232", "0.42286798", "0.4216037", "0.42057773", "0.41966954", "0.41918865", "0.41809064", "0.41775113", "0.4168781", "0.4151925", "0.41440135", "0.41313294", "0.41275552", "0.41215056", "0.4121479", "0.41047484", "0.41023478", "0.40906012", "0.4083446", "0.40786156", "0.406832", "0.40538326", "0.4043644", "0.4034343", "0.40249175", "0.4013967", "0.40123257", "0.4012119", "0.4010281", "0.4008878", "0.39947236", "0.3989297", "0.39856043", "0.39824724", "0.3982265" ]
0.79482555
1
Applies a Gaussian filter to the list to filter. The parameter is 1/(2standard deviation^2).
public static List<Double> gaussianFilter(List<Double> listToFilter) { DescriptiveStatistics stats = new DescriptiveStatistics(); // Add the data from the array for (Double value : listToFilter) { stats.addValue(value); } double std = stats.getStandardDeviation(); double parameter = 1.0 / (std * std * 2); return gaussianFilter(listToFilter, parameter); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<Double> gaussianFilter(List<Double> listToFilter, double parameter) {\r\n int windowSize = 7;\r\n List<Double> filteredList = new ArrayList<Double>();\r\n \r\n // double firstFactor = Math.pow(parameter/Math.PI, 0.5) *\r\n // Math.pow(Math.E, -1 * parameter);\r\n \r\n for (int j = 0; j < windowSize / 2; j++) {\r\n filteredList.add(0.0);\r\n }\r\n \r\n for (int i = windowSize / 2; i < listToFilter.size() - windowSize / 2; i++) {\r\n double sumValues = 0;\r\n double sumWeight = 0;\r\n for (int j = 0; j < windowSize; j++) {\r\n double weight = Math.pow(Math.E, -1 * (j - windowSize / 2) * (j - windowSize / 2) / 2\r\n * parameter);\r\n \r\n sumWeight += weight;\r\n sumValues += weight * listToFilter.get(i);\r\n }\r\n double newValue = 1.0 / sumWeight * sumValues / sumWeight;\r\n \r\n filteredList.add(newValue);\r\n }\r\n \r\n for (int j = 0; j < windowSize / 2; j++) {\r\n filteredList.add(0.0);\r\n }\r\n \r\n return filteredList;\r\n }", "public static List<Double> getGaussianSmoothed(List<Double> listToSmooth, double standardDeviation) {\r\n if (standardDeviation < 0.0) {\r\n throw new IllegalArgumentException(\"standardDeviation invalid\");\r\n } else if (standardDeviation == 0.0) {\r\n return listToSmooth;\r\n }\r\n \r\n // Create a new, identical but empty Histogram.\r\n List<Double> smoothedList = new ArrayList<Double>();\r\n \r\n // Determine the number of weights (must be odd).\r\n int numWeights = (int) (2 * 2.58 * standardDeviation + 0.5);\r\n if (numWeights % 2 == 0) {\r\n numWeights++;\r\n }\r\n \r\n // Initialize the smoothing weights.\r\n double[] weights = new double[numWeights];\r\n int m = numWeights / 2;\r\n double var = standardDeviation * standardDeviation;\r\n double gain = 1.0 / Math.sqrt(2.0 * Math.PI * var);\r\n double exp = -1.0 / (2.0 * var);\r\n for (int i = m; i < numWeights; i++) {\r\n double del = i - m;\r\n weights[i] = gain * Math.exp(exp * del * del);\r\n weights[numWeights - 1 - i] = weights[i];\r\n }\r\n \r\n // Clear the band total count for the smoothed histogram.\r\n double sum = 0;\r\n double originalSum = 0;\r\n \r\n double[] smoothedValues = new double[listToSmooth.size()];\r\n \r\n for (int b = 0; b < listToSmooth.size(); b++) {\r\n // Determine clipped range.\r\n int min = Math.max(b - m, 0);\r\n int max = Math.min(b + m, listToSmooth.size());\r\n \r\n // Calculate the offset into the weight array.\r\n int offset = m > b ? m - b : 0;\r\n \r\n // Accumulate the total for the range.\r\n double acc = 0;\r\n double weightTotal = 0;\r\n for (int i = min; i < max; i++) {\r\n double w = weights[offset++];\r\n acc += listToSmooth.get(i) * w;\r\n weightTotal += w;\r\n }\r\n \r\n // Round the accumulated value.\r\n smoothedValues[b] = acc / weightTotal;\r\n \r\n // Accumulate total for band.\r\n sum += smoothedValues[b];\r\n originalSum += listToSmooth.get(b);\r\n }\r\n \r\n // Rescale the counts such that the band total is approximately\r\n // the same as for the same band of the original histogram.\r\n double factor = originalSum / sum;\r\n for (int b = 0; b < listToSmooth.size(); b++) {\r\n double smoothedValue = smoothedValues[b] * factor;\r\n smoothedList.add(smoothedValue);\r\n }\r\n \r\n assert smoothedList.size() == listToSmooth.size();\r\n \r\n return smoothedList;\r\n }", "private static void gaussianSmooth(double[] img, int width, int height, double sigma) {\n\t\tint radius = (int)Math.sqrt((6.908)*(2*sigma*sigma));\n\t\t// compute coefficients of the gaussian filter\n\t\tdouble[] filter = new double[2*radius+1];\n\t\tdouble filtersum = 0;\n\n\t\tfor(int i=-radius;i<=radius;i++) {\n\t\t\tdouble g = gaussian(i,sigma);\n\t\t\tfilter[i+radius]=g;\n\t\t\tfiltersum+=g;\n\t\t}\n\n\t\tfor(int i=-radius;i<=radius;i++) {\n\t\t\tfilter[i+radius]=filter[i+radius]/(2*filtersum);//2 since 1D-filter will be used in x and y directions\n\t\t}\n\n\t\tconvolveInX(img, width, height, filter, radius);\n\t\tconvolveInY(img, width, height, filter, radius);\n\n\t}", "public static double gaussian(double[] parameters) {\r\n double mean, stddev;\r\n mean = parameters[0];\r\n stddev = parameters[1];\r\n return mean + stddev * gaussian();\r\n }", "public static Picture gaussian(Picture picture) {\n double[][] weights = { { 1 / 16.0, 2 / 16.0, 1 / 16.0 }, { 2 / 16.0, 4 / 16.0, 2 / 16.0 },\n { 1 / 16.0, 2 / 16.0, 1 / 16.0 }, };\n return kernel(picture, weights);\n }", "public void gaussianSmooth(final byte[] f, int width, int height, double sigma) {\n\t\tdouble[] img = new double[width * height];\n\t\tbyteToDouble(f, img);\n\t\tgaussianSmooth(img, width, height, sigma);\n\t\tdoubleToByte(f, img);\n\t\t//System.out.println(\"finish\");\n\t}", "public static double gaussian( double mean, double stddev ) {\n return mean + stddev * gaussian();\n }", "public static Picture gaussian(Picture picture) {\r\n double[][] gaussina = {\r\n {1.0/16, 2.0/16, 1.0/16},\r\n {2.0/16, 4.0/16, 2.0/16},\r\n {1.0/16, 2.0/16, 1.0/16}\r\n };\r\n return transform(picture, gaussina);\r\n }", "private static native long createAMFilter_0(double sigma_s, double sigma_r, boolean adjust_outliers);", "private float gauss (int whatMask, int size) {\n int mu = 0;\n double sigma = 1/(size*Math.sqrt(2*Math.PI));\n return (float) (1/(sigma*Math.sqrt(2*Math.PI))*Math.exp(-(whatMask-mu)*(whatMask-mu)/(2*sigma*sigma)));\n }", "public void useGaussianDeviates(){\n this.gaussianDeviates = true;\n }", "private static native void amFilter_0(long joint_nativeObj, long src_nativeObj, long dst_nativeObj, double sigma_s, double sigma_r, boolean adjust_outliers);", "public static List<Float> process(double freqDomain[], float sampleRate, int numSamples, double sigma) \n\t {\n\t double average = 0;\n\t for (double x: freqDomain) \n\t \taverage += x;\n\t average = average/freqDomain.length;\n\n\t //Calculate variance\n\t double variance = 0;\n\t for (double x: freqDomain)\n\t variance += Math.pow((x - average), 2);\n\t \n\t variance /= freqDomain.length;\n\t double stdev = Math.sqrt(variance);\n\t \n\n\t ArrayList<Float> found = new ArrayList<Float>();\n\t double max = Integer.MIN_VALUE;\n\t int maxF = -1;\n\t for (int f = 0; f < freqDomain.length/2; f++) {\n\t if (freqDomain[f] > average+sigma*stdev) \n\t {\n\t if (freqDomain[f] > max) \n\t {\n\t max = freqDomain[f];\n\t maxF = f;\n\t }\n\t } \n\t \n\t else \n\t {\n\t if (maxF != -1) \n\t {\n\t found.add(maxF * sampleRate/numSamples);\n\t max = Integer.MIN_VALUE;\n\t maxF = -1;\n\t }\n\t }\n\t \n\t }\n\n\t return (found);\n\t }", "public native MagickImage gaussianBlurImage(double raduis, double sigma)\n\t\t\tthrows MagickException;", "public static void fastGlobalSmootherFilter(Mat guide, Mat src, Mat dst, double lambda, double sigma_color, double lambda_attenuation, int num_iter)\r\n {\r\n \r\n fastGlobalSmootherFilter_0(guide.nativeObj, src.nativeObj, dst.nativeObj, lambda, sigma_color, lambda_attenuation, num_iter);\r\n \r\n return;\r\n }", "public Double filter(Double value) throws NullValueException, EmptyListException, IncorrectSizeException;", "private void gaussianBlur() {\n targetImage = new Mat();\n Utils.bitmapToMat(lena, targetImage);\n Imgproc.cvtColor(targetImage, targetImage, Imgproc.COLOR_BGR2RGB);\n\n gaussianBlur(targetImage.getNativeObjAddr());\n\n // create a bitMap\n Bitmap bitMap = Bitmap.createBitmap(targetImage.cols(),\n targetImage.rows(), Bitmap.Config.RGB_565);\n // convert Mat to Android's bitmap:\n Imgproc.cvtColor(targetImage, targetImage, Imgproc.COLOR_RGB2BGR);\n Utils.matToBitmap(targetImage, bitMap);\n\n\n ImageView iv = (ImageView) findViewById(R.id.imageView);\n iv.setImageBitmap(bitMap);\n }", "public List<Peak> filterNoise(List<Peak> peaks, double threshold, double experimentalPrecursorMzRatio);", "public void gaussianSmooth(Img i, double sigma) {\n int half = (int) (sigma * Math.sqrt(6 * Math.log(10)));\n int size = 1 + 2 * half;\n System.out.printf(\"Size: %d\\n\", size);\n double[] mask = new double[size];\n double mask_sum = 0;\n for (int k = 0; k <= half; k++) {\n double value = Math.exp(-k * k / (2 * sigma * sigma)) / (sigma * Math.sqrt(2 * Math.PI));\n mask_sum += (k == 0) ? value : value * 2;\n mask[half + k] = value;\n mask[half - k] = value;\n }\n // normalize the mask\n for (int k = 0; k < size; k++) {\n mask[k] = mask[k] / mask_sum;\n }\n System.out.printf(\"Mask: %s\\n\", Arrays.toString(mask));\n\n // 2D convolution using 1D mask in x\n double[] i_temp = new double[i.img.length];\n for (int x = 0; x < i.img.length; x++) {\n i_temp[x] = (double) (i.img[x] & 0xFF);\n }\n for (int x = half; x < i.height - half; x++) {\n for (int y = half; y < i.width - half; y++) {\n i_temp[x * i.width + y] = 0;\n for (int s = -half; s <= half; s++) {\n i_temp[x * i.width + y] += (double) (i.img[(x + s) * i.width + y] & 0xFF) * mask[half - s];\n }\n }\n }\n\n // 2D convolution using 1D mask in y\n for (int x = half; x < i.height - half; x++) {\n for (int y = half; y < i.width - half; y++) {\n double f = 0;\n for (int s = -half; s <= half; s++) {\n f += i_temp[x * i.width + y + s] * mask[half - s];\n }\n i.img[x * i.width + y] = (byte) f;\n }\n }\n }", "public static Double standardDeviation(ArrayList<Double> values, Double mean) {\n\t\tDouble diff = 0.0;\n\t\t// iterate though the values and add to the difference the (index minus the mean)^2\n\t\tfor (int i = 0; i < values.size(); i++) {\n\t\t\tdiff += Math.pow((values.get(i) - mean),2);\n\t\t}\n\t\t// return the sqrt of the difference devided by the length of values minus 1\n\t\treturn Math.sqrt(diff / values.size() - 1);\n\t}", "public final EObject ruleGaussianTypeSpecifier() throws RecognitionException {\n EObject current = null;\n\n EObject lv_unit_3_0 = null;\n\n EObject lv_dimensions_6_0 = null;\n\n EObject lv_dimensions_8_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:1989:6: ( ( () 'gauss' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1990:1: ( () 'gauss' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1990:1: ( () 'gauss' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )? )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1990:2: () 'gauss' ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )? ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )?\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1990:2: ()\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:1991:5: \n {\n \n temp=factory.create(grammarAccess.getGaussianTypeSpecifierAccess().getGaussianTypeSpecifierAction_0().getType().getClassifier());\n current = temp; \n temp = null;\n CompositeNode newNode = createCompositeNode(grammarAccess.getGaussianTypeSpecifierAccess().getGaussianTypeSpecifierAction_0(), currentNode.getParent());\n newNode.getChildren().add(currentNode);\n moveLookaheadInfo(currentNode, newNode);\n currentNode = newNode; \n associateNodeWithAstElement(currentNode, current); \n \n\n }\n\n match(input,37,FOLLOW_37_in_ruleGaussianTypeSpecifier3490); \n\n createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getGaussKeyword_1(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2005:1: ( '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')' )?\n int alt29=2;\n int LA29_0 = input.LA(1);\n\n if ( (LA29_0==25) ) {\n alt29=1;\n }\n switch (alt29) {\n case 1 :\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2005:3: '(' ( (lv_unit_3_0= ruleUnitExpression ) ) ')'\n {\n match(input,25,FOLLOW_25_in_ruleGaussianTypeSpecifier3501); \n\n createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getLeftParenthesisKeyword_2_0(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2009:1: ( (lv_unit_3_0= ruleUnitExpression ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2010:1: (lv_unit_3_0= ruleUnitExpression )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2010:1: (lv_unit_3_0= ruleUnitExpression )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2011:3: lv_unit_3_0= ruleUnitExpression\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getGaussianTypeSpecifierAccess().getUnitUnitExpressionParserRuleCall_2_1_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleUnitExpression_in_ruleGaussianTypeSpecifier3522);\n lv_unit_3_0=ruleUnitExpression();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getGaussianTypeSpecifierRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"unit\",\n \t \t\tlv_unit_3_0, \n \t \t\t\"UnitExpression\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n match(input,26,FOLLOW_26_in_ruleGaussianTypeSpecifier3532); \n\n createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getRightParenthesisKeyword_2_2(), null); \n \n\n }\n break;\n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2037:3: ( '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']' )?\n int alt31=2;\n int LA31_0 = input.LA(1);\n\n if ( (LA31_0==33) ) {\n alt31=1;\n }\n switch (alt31) {\n case 1 :\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2037:5: '[' ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) ) ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )* ']'\n {\n match(input,33,FOLLOW_33_in_ruleGaussianTypeSpecifier3545); \n\n createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getLeftSquareBracketKeyword_3_0(), null); \n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2041:1: ( (lv_dimensions_6_0= ruleArrayDimensionSpecification ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2042:1: (lv_dimensions_6_0= ruleArrayDimensionSpecification )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2042:1: (lv_dimensions_6_0= ruleArrayDimensionSpecification )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2043:3: lv_dimensions_6_0= ruleArrayDimensionSpecification\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getGaussianTypeSpecifierAccess().getDimensionsArrayDimensionSpecificationParserRuleCall_3_1_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleArrayDimensionSpecification_in_ruleGaussianTypeSpecifier3566);\n lv_dimensions_6_0=ruleArrayDimensionSpecification();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getGaussianTypeSpecifierRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tadd(\n \t \t\t\tcurrent, \n \t \t\t\t\"dimensions\",\n \t \t\tlv_dimensions_6_0, \n \t \t\t\"ArrayDimensionSpecification\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2065:2: ( ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) ) )*\n loop30:\n do {\n int alt30=2;\n int LA30_0 = input.LA(1);\n\n if ( (LA30_0==14) ) {\n alt30=1;\n }\n\n\n switch (alt30) {\n \tcase 1 :\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2065:4: ',' ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) )\n \t {\n \t match(input,14,FOLLOW_14_in_ruleGaussianTypeSpecifier3577); \n\n \t createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getCommaKeyword_3_2_0(), null); \n \t \n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2069:1: ( (lv_dimensions_8_0= ruleArrayDimensionSpecification ) )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2070:1: (lv_dimensions_8_0= ruleArrayDimensionSpecification )\n \t {\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2070:1: (lv_dimensions_8_0= ruleArrayDimensionSpecification )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:2071:3: lv_dimensions_8_0= ruleArrayDimensionSpecification\n \t {\n \t \n \t \t currentNode=createCompositeNode(grammarAccess.getGaussianTypeSpecifierAccess().getDimensionsArrayDimensionSpecificationParserRuleCall_3_2_1_0(), currentNode); \n \t \t \n \t pushFollow(FOLLOW_ruleArrayDimensionSpecification_in_ruleGaussianTypeSpecifier3598);\n \t lv_dimensions_8_0=ruleArrayDimensionSpecification();\n \t _fsp--;\n\n\n \t \t if (current==null) {\n \t \t current = factory.create(grammarAccess.getGaussianTypeSpecifierRule().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\"dimensions\",\n \t \t \t\tlv_dimensions_8_0, \n \t \t \t\t\"ArrayDimensionSpecification\", \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 break loop30;\n }\n } while (true);\n\n match(input,34,FOLLOW_34_in_ruleGaussianTypeSpecifier3610); \n\n createLeafNode(grammarAccess.getGaussianTypeSpecifierAccess().getRightSquareBracketKeyword_3_3(), null); \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 static Double sigmaNotNull(ArrayList<Run> runList, String name) {\n\t\tdouble mean = 0;\n\t\tint i, k=0;\n\t\tDouble temp;\n\t\tdouble weightSum = 0;\n\t\tfor (i=0; i<runList.size(); i++) {\n\t\t\ttry {\n\t\t\t\ttemp = runList.get(i).weight() * (Double)runList.get(i).get(name);\n\t\t\t\tif (!temp.isNaN()) {\n\t\t\t\t\tmean += temp;\n\t\t\t\t\tweightSum += runList.get(i).weight() ;\n\t\t\t\t}\n\t\t\t} catch (NullPointerException e) {;}\n\t\t}\n\t\tmean = mean / weightSum;\n\t\tdouble devSum = 0;\n\t\tfor (i=0; i<runList.size(); i++){\n\t\t\ttry {\n\t\t\t\ttemp = ( runList.get(i).weight() ) * Math.pow( mean - (Double)runList.get(i).get(name) , 2);\n\t\t\t\tif (!temp.isNaN()) {\n\t\t\t\t\tdevSum += temp;\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t} catch (NullPointerException e) {;}\n\t\t}\n\t\tif (runList.size()==1) {\n\t\t\treturn (Double)runList.get(0).get(name+\"_sig\");\n\t\t} else {\n\t\t\treturn Math.sqrt(devSum/weightSum/(k-1));\n\t\t}\n\t}", "private final void probabilityFromRecursiveRidgeFilter( float[] filter, float[] shape) {\n\t\tint nb = 0;\n\t\tdouble min = 1e9;\n\t\tdouble max = 0.0;\n\t\tfor (int x=2;x<nx-2;x++) for (int y=2;y<ny-2;y++) for (int z=2;z<nz-2;z++) {\n\t\t\tint xyz = x + nx*y + nx*ny*z;\n\t\t\t\t// keep only the proper sign\n\t\t\t\tif (filter[xyz]<=0) filter[xyz] = 0.0f;\n\t\t\t\telse {\n\t\t\t\t\t// fit exp only to non-zero data\n\t\t\t\t\tnb++;\n\t\t\t\t\tmin = Numerics.min(filter[xyz], min);\n\t\t\t\t\tmax = Numerics.max(filter[xyz], max);\n\t\t\t\t}\n\t\t}\n\t\t\n\t\t// robust measures? pb is the exponential is not steep enough\n\t\tdouble[] response = new double[nb];\n\t\tint n=0;\n\t\tfor (int x=2;x<nx-2;x++) for (int y=2;y<ny-2;y++) for (int z=2;z<nz-2;z++) {\n\t\t\tint xyz = x + nx*y + nx*ny*z;\n\t\t\t\tif (filter[xyz]>0) {\n\t\t\t\t\tresponse[n] = filter[xyz];\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t}\n\t\tPercentile measure = new Percentile();\n\t\tdouble median = measure.evaluate(response, 50.0);\n\t\tdouble beta = median/FastMath.log(2.0);\n\t\t\n\t\tBasicInfo.displayMessage(\"exponential parameter estimates: median \"+median+\", beta \"+beta+\",\\n\");\n\t\t\n\t\t// model the filter response as something more interesting, e.g. log-normal (removing the bg samples)\n\t\tdouble[] weights = new double[nb];\n\t\tfor (int b=0;b<nb;b++) { \n\t\t\tweights[b] = (1.0-FastMath.exp( -response[b]/beta));\n\t\t\tresponse[b] = FastMath.log(response[b]);\n\t\t}\n\t\t\n\t\tdouble fmean = ImageStatistics.weightedPercentile(response,weights,50.0,nb);\n\t\t\n\t\t// stdev: 50% +/- 1/2*erf(1/sqrt(2)) (~0.341344746..)\n\t\tdouble dev = 100.0*0.5*Erf.erf(1.0/FastMath.sqrt(2.0));\n\t\tdouble fdev = 0.5*(ImageStatistics.weightedPercentile(response,weights,50.0+dev,nb) - ImageStatistics.weightedPercentile(response,weights,50.0-dev,nb));\n\t\t\n\t\tBasicInfo.displayMessage(\"Log-normal parameter estimates: mean = \"+FastMath.exp(fmean)+\", stdev = \"+FastMath.exp(fdev)+\",\\n\");\n\t\t\n\t\tfor (int x=0;x<nx;x++) for (int y=0;y<ny;y++) for (int z=0;z<nz;z++){\n\t\t\tint xyz = x + nx*y + nx*ny*z;\n\t\t\tif (filter[xyz]>0) {\n\t\t\t\tdouble pe = FastMath.exp( -filter[xyz]/beta)/beta;\n\t\t\t\tdouble plg = FastMath.exp(-Numerics.square(FastMath.log(filter[xyz])-fmean)/(2.0*fdev*fdev))/FastMath.sqrt(2.0*FastMath.PI*fdev*fdev);\n\t\t\t\tshape[xyz] = (float)(plg/(plg+pe));\n\t\t\t\t//shape[xyz] = (float)(1.0-pe);\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}", "public void setGaussian(double ragam, double x, double rataan) {\n g1 = 1 / Math.sqrt(2 * 22 / 7 * ragam * ragam);\n g3 = -((x - rataan) * (x - rataan)) / (2 * ragam * ragam);\n g2 = Math.pow(2.718, g3);\n gauss = g1 * g2;\n }", "public void filter(double[] X) {\r\n\t\tfilter(X, 0, X.length);\r\n\t}", "public static int verifyDistribution(ArrayList<Double> gasnum, double mean, double stdDeviation, double numberofStdDeviation){\n\t\t\n\t\tint index = 0;//this will be used to go to the next index of the ArrayList\n\t\tint count = 0; //to count the number of randomnumbers that deviation away from the mean; also for calculating percentage\n\t\t\n\t\twhile(index < gasnum.size()){ //keep running so long as we don't go beyond the ArrayList size\n\t\t\t\n\t\t\t//this is pretty much the same logic as in the assignment sheet; check if the numbers fall between (0.0-(1.0*1.0)) and (0.0+(1.0*1.0))\n\t\t\tif((gasnum.get(index) < (mean + (stdDeviation*numberofStdDeviation))) && (gasnum.get(index) > (mean - (stdDeviation*numberofStdDeviation)))){\n\t\t\t\tcount++; //if show increase count by one\n\t\t\t}\n\t\t\tindex++;//go to the next index of the ArrayList\n\t\t}\n\t\t\n\t\treturn ((count*100)/gasnum.size()); //calculate the percentage within the standard deviation\n\t}", "public static double[][] gaussianFunction(int size_x, int size_y, double sigma) {\n double[][] kernel;\n int center_x = size_x/2;\n int center_y = size_y/2;\n\n kernel = new double[size_y][size_x];\n for (int y=0; y<size_y; y++) {\n for (int x=0; x<size_x; x++) {\n double tmp_x = (double)((x - center_x) * (x - center_x)) / (2 * sigma * sigma);\n double tmp_y = (double)((y - center_y) * (y - center_y)) / (2 * sigma * sigma);\n kernel[y][x] = 1.0 / (2 * Math.PI * sigma * sigma) * Math.exp(-(tmp_x + tmp_y));\n }\n }\n\n return kernel;\n }", "protected SuspectList filterSuspectList(SuspectList baseList, Set<Set<PolicyTerm>> termGroups) {\n\t\tSuspectList suspects = new SuspectList();\n\t\t//TODO: avoid repeating the same filtering by caching filtering result?\n\t\tfor (Set<PolicyTerm> termGroup : termGroups) {\n\t\t\tSuspectList sl = new SuspectList(baseList);\n\t\t\tfor (PolicyTerm term : termGroup) {\n\t\t\t\tif (term.isStatic()) {\n\t\t\t\t\t// ignore dynamic terms when filtering\n\t\t\t\t\tsl.filter(term);\n\t\t\t\t\tif (sl.size() == 0) {\n\t\t\t\t\t\t// Empty set's union with any other set will be empty.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tsuspects.addAll(sl);\n\t\t}\n\t\treturn suspects;\n\t}", "public void reducePoints ( ArrayList<Gfa> glist, ArrayList<Gfa> snapshots) {\n\n\t\tArrayList<Gfa> smearList = new ArrayList<Gfa>(); \n\n\t\t// Do area clipping and bisection for each smear.\n\t\tfor ( Gfa gg : glist ) {\n\t\t\tsmearList.addAll( reducePoints( gg, snapshots ) );; \n\t\t}\n\t\t\n\t\t// Replace the smear list with the new list.\n\t\tglist.clear();\n\t\tglist.addAll( smearList );\n\t\t\n\t}", "private static float[] GetAppropriateSeparableGauss(int kernelSize){\n final double epsilon = 2e-2f / kernelSize;\n double searchStep = 1.0;\n double sigma = 1.0;\n while( true )\n {\n\n double[] kernelAttempt = GenerateSeparableGaussKernel( sigma, kernelSize );\n if( kernelAttempt[0] > epsilon )\n {\n if( searchStep > 0.02 )\n {\n sigma -= searchStep;\n searchStep *= 0.1;\n sigma += searchStep;\n continue;\n }\n\n float[] retVal = new float[kernelSize];\n for (int i = 0; i < kernelSize; i++)\n retVal[i] = (float)kernelAttempt[i];\n return retVal;\n }\n\n sigma += searchStep;\n\n if( sigma > 1000.0 )\n {\n assert( false ); // not tested, preventing infinite loop\n break;\n }\n }\n\n return null;\n }", "public void StandardDeviation(){\r\n\t\tAverage();\r\n\t\tif (count<=1){\r\n\t\t\tSystem.out.println(\"The Standard Deviation is \"+0.0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tStandardDeviation=(float)Math.sqrt((Total2-Total*Total/count)/(count-1));\r\n\t\t}\r\n\t}", "public static Double median(List<Double> list) {\r\n if (list == null || list.size() == 0) {\r\n throw new Error(\"Mean of an empty list is undefined\");\r\n }\r\n int size = list.size();\r\n Collections.sort(list);\r\n double median = 0.0;\r\n if (size % 2 == 0) {\r\n median = (list.get(size / 2) + list.get((size / 2) - 1)) / 2.0;\r\n } else {\r\n median = list.get(size / 2);\r\n }\r\n return median;\r\n }", "public void setFilter(ArrayList<ProductImageModel> newList) {\n list = new ArrayList<>();\n list.addAll(newList);\n notifyDataSetChanged();\n }", "public static void amFilter(Mat joint, Mat src, Mat dst, double sigma_s, double sigma_r, boolean adjust_outliers)\r\n {\r\n \r\n amFilter_0(joint.nativeObj, src.nativeObj, dst.nativeObj, sigma_s, sigma_r, adjust_outliers);\r\n \r\n return;\r\n }", "public void setGaussWeights(float peak, float low, int itmin, int itmax, int ntf) {\n float[] w = zerofloat(ntf);\n float center = (itmax+itmin)/2.0f;\n float width = (itmax-itmin)/2.0f;\n for (int i=0; i<ntf; ++i) {\n w[i] = peak*exp(-(i-center)*(i-center)/(2.0f*width*width))+low;\n }\n _w1D = w;\n _weights = true;\n }", "public static double standardDeviation(double average, List<Double> examples) {\n\t\tdouble result = 0;\n\t\tfor (int i = 0; i < examples.size(); i++) {\n\t\t\tdouble temp = examples.get(i) - average;\n\t\t\tresult += temp * temp;\n\t\t}\n\t\tresult /= examples.size() - 1;\n\t\treturn Math.sqrt(result);\n\t}", "public static void fastGlobalSmootherFilter(Mat guide, Mat src, Mat dst, double lambda, double sigma_color)\r\n {\r\n \r\n fastGlobalSmootherFilter_1(guide.nativeObj, src.nativeObj, dst.nativeObj, lambda, sigma_color);\r\n \r\n return;\r\n }", "public static FastGlobalSmootherFilter createFastGlobalSmootherFilter(Mat guide, double lambda, double sigma_color, double lambda_attenuation, int num_iter)\r\n {\r\n \r\n FastGlobalSmootherFilter retVal = FastGlobalSmootherFilter.__fromPtr__(createFastGlobalSmootherFilter_0(guide.nativeObj, lambda, sigma_color, lambda_attenuation, num_iter));\r\n \r\n return retVal;\r\n }", "@Override\n\tpublic void run() {\n\t\tspacing = checkDimensions(spacingString, input.numDimensions(), \"Spacings\");\n\t\tscales = Arrays.stream(scaleString.split(regex)).mapToInt(Integer::parseInt)\n\t\t\t.toArray();\n\t\tDimensions resultDims = Views.addDimension(input, 0, scales.length - 1);\n\t\t// create output image, potentially-filtered input\n\t\tresult = opService.create().img(resultDims, new FloatType());\n\n\t\tfor (int s = 0; s < scales.length; s++) {\n\t\t\t// Determine whether or not the user would like to apply the gaussian\n\t\t\t// beforehand and do it.\n\t\t\tRandomAccessibleInterval<T> vesselnessInput = doGauss ? opService.filter()\n\t\t\t\t.gauss(input, scales[s]) : input;\n\t\t\tIntervalView<FloatType> scaleResult = Views.hyperSlice(result, result\n\t\t\t\t.numDimensions() - 1, s);\n\t\t\topService.filter().frangiVesselness(scaleResult, vesselnessInput, spacing,\n\t\t\t\tscales[s]);\n\t\t}\n\t}", "public ArrayList<DataPoint> normalizeFeatures(ArrayList<DataPoint> datapoints) {\n\t\t\n\t\tdouble[] vector = new double[featureCount];\n\t\t// now normalize ALL the points!\n\t\tfor (DataPoint aPoint : datapoints) {\n\t\t\tvector = aPoint.vector;\n\t\t\tfor (int i = 0; i < featureCount; ++i) {\n\t\t\t\tvector[i] = (vector[i] - meansOfFeatures.get(i))\n\t\t\t\t\t\t/ stdevOfFeatures.get(i);\n\t\t\t}\n\t\t\taPoint.setVector(vector);\n\t\t}\n\t\treturn datapoints;\n\t}", "public static List<Double> medianFilter(List<Double> listToFilter, int n) {\r\n \r\n if (n % 2 == 0) {\r\n throw new Error(\"Medianfilter not implemented for even n values\");\r\n }\r\n \r\n List<Double> filteredList = new ArrayList<Double>();\r\n \r\n int numberOfZeroesToAddBefore = (n - 1) / 2;\r\n int numberOfZeroesToAddAfter = (n - 1) / 2;\r\n \r\n for (int i = 0; i < numberOfZeroesToAddBefore; i++) {\r\n listToFilter.add(0, 0.0);\r\n }\r\n for (int i = 0; i < numberOfZeroesToAddAfter; i++) {\r\n listToFilter.add(0.0);\r\n }\r\n \r\n for (int i = numberOfZeroesToAddBefore; i < listToFilter.size() - numberOfZeroesToAddAfter; i++) {\r\n double median = median(new ArrayList<Double>(listToFilter.subList(i - (n / 2), i + (n / 2) + 1)));\r\n filteredList.add(median);\r\n }\r\n \r\n for (int i = 0; i < numberOfZeroesToAddBefore; i++) {\r\n listToFilter.remove(0);\r\n }\r\n for (int i = 0; i < numberOfZeroesToAddAfter; i++) {\r\n listToFilter.remove(listToFilter.size() - 1);\r\n }\r\n return filteredList;\r\n }", "public void setGaussFK() {\n for (int i = 0; i < 10; i++) {\n setGaussian(devFK[i], nilai[i], meanFK[i]);\n gaussFK[i] = getGaussian();\n }\n }", "public static Double calculateStanderedDeviation(List<Person> personsList)\n\t{\n\t\t\n\t\tdouble standardDeviation = 0.0;\n\t\tDouble meanValue = personsList.stream().collect(Collectors.averagingDouble(Person::getAnualIncome));\n\t\t//System.out.println(perCapitaIncome);\n\t\t\t\n\t\tfor (Person person : personsList) {\n\t\t\tstandardDeviation += Math.pow(person.getAnualIncome()- meanValue, 2) ;\n\t\t\t\n\t\t}\n\t\t\n\t\treturn Math.sqrt(standardDeviation/personsList.size());\t\n\t}", "public static AdaptiveManifoldFilter createAMFilter(double sigma_s, double sigma_r, boolean adjust_outliers)\r\n {\r\n \r\n AdaptiveManifoldFilter retVal = AdaptiveManifoldFilter.__fromPtr__(createAMFilter_0(sigma_s, sigma_r, adjust_outliers));\r\n \r\n return retVal;\r\n }", "public Gaussian() {\r\n this(1, 0, 1);\r\n }", "public static Double getGaussian(final Double average, final Double relStdDeviation){\r\n\t\tDouble absStdDeviation = average * relStdDeviation;\r\n\t\treturn new Random().nextGaussian() * absStdDeviation + average; \r\n\t}", "public static <T extends Number> double computeStandardDeviation(ArrayList<T> nData) {\r\n if (nData.size() <= 1) // check nData size is less than 1 or not\r\n throw new IllegalArgumentException(\"Size of array must be greater than 1\"); // throw exception if data is less than 1\r\n\r\n int sizeOfNumbers = nData.size(); // declare size Of Numbers local variable to store value of nData list size\r\n double sum = 0.0; // declare and inisilize sum variable\r\n double average = computeAverage(nData, true); // compute average of nData by calling computeAverage method and store in average variable\r\n\r\n for (int i = 0; i < sizeOfNumbers; i++) { // for loop for get all data of list\r\n double valueInDouble = nData.get(i).doubleValue(); // convert each nData number to double type and store in valueInDouble variable\r\n sum += Math.pow(valueInDouble - average, 2); // increament value of sum by use function of math power\r\n }\r\n return Math.sqrt(sum / (sizeOfNumbers - 1)); // return double type standard Deviation value \r\n }", "public ArrayList<CustomerWithGoods> filterValued() {\n\t\tArrayList<CustomerWithGoods> richCustomers = new ArrayList<>();\n\t\t// uses method above to calculate average order price\n\t\tint averageOrderPrice = averageOrderPrice();\n\n\t\tfor (CustomerWithGoods customerWithGoods : allCustomers) {\n\t\t\tif (customerWithGoods.valueOfGoods() > averageOrderPrice) {\n\t\t\t\trichCustomers.add(customerWithGoods);\n\t\t\t}\n\t\t}\n\t\treturn richCustomers;\n\t}", "public static double getArrayListDoubleMean(ArrayList<Double> list) {\n\t\treturn 0;\n\t}", "private static native long createFastGlobalSmootherFilter_0(long guide_nativeObj, double lambda, double sigma_color, double lambda_attenuation, int num_iter);", "public double sampleStandardDeviation() {\n/* 288 */ return Math.sqrt(sampleVariance());\n/* */ }", "public static List<Student> filterExample(){\n\t\tList<Student> genderFilter = StudentDataBase.getAllStudents().stream()\n\t\t\t\t.filter(stu->stu.getGender().equals(\"female\")).collect(Collectors.toList());\n\t\treturn genderFilter;\n\t}", "public LinearGaussian(double[] values) {\n\t\tsuper();\n\t\tthis.values = values;\n\t\t\n\t\t/*calculate mean*/\n\t\tmean = Utilities.averageValueOfArray(values);\n\t\tvariance = Utilities.averageValueOfArray(varianceArray());\n\t}", "public void compute2() {\n\n ILineString lsInitiale = this.geom;\n ILineString lsLisse = Operateurs.resampling(lsInitiale, 1);\n // ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 10, 1);\n // ILineString\n // lsLisse=LissageGaussian.AppliquerLissageGaussien((GM_LineString)\n // lsInitiale, 10, 1, false);\n\n logger.debug(\"Gaussian Smoothing of : \" + lsInitiale);\n\n // On determine les séquences de virages\n List<Integer> listSequence = determineSequences(lsLisse);\n\n // On applique le filtre gaussien\n\n // On crée une collection de points qui servira à découper tous les\n // virages\n\n if (listSequence.size() > 0) {\n List<Integer> listSequenceFiltre = filtrageSequences(listSequence, 1);\n DirectPositionList dplPointsInflexionLsLissee = determinePointsInflexion(\n lsInitiale, listSequenceFiltre);\n\n for (IDirectPosition directPosition : dplPointsInflexionLsLissee) {\n this.jddPtsInflexion.add(directPosition.toGM_Point().getPosition());\n // dplPtsInflexionVirages.add(directPosition);\n }\n\n // jddPtsInflexion.addAll(jddPtsInflexionLsInitiale);\n\n }\n // dplPtsInflexionVirages.add(lsInitiale.coord().get(lsInitiale.coord().size()-1));\n\n }", "public void setGaussWeights(float peak, float low, int itmin, int itmax, \n int ixmin, int ixmax, int ntf, int nx) {\n float[][] w = zerofloat(ntf,nx);\n float centert = (itmax+itmin)/2.0f;\n float centerx = (ixmax+ixmin)/2.0f;\n float widtht = (itmax-itmin)/2.0f;\n float widthx = (ixmax-ixmin)/2.0f;\n float x = 0.0f;\n float t = 0.0f;\n for (int ix=0; ix<nx; ++ix) {\n for (int it=0; it<ntf; ++it) {\n x = (ix-centerx)*(ix-centerx)/(2.0f*widthx*widthx); \n t = (it-centert)*(it-centert)/(2.0f*widtht*widtht); \n w[ix][it] = peak*exp(-(x+t))+low;\n }\n }\n _w2D = w;\n _weights = true;\n }", "void setSampleFiltering(boolean filterFlag, float cutoffFreq) {\n }", "public Position sampleRandomGaussianPosition();", "public static void amFilter(Mat joint, Mat src, Mat dst, double sigma_s, double sigma_r)\r\n {\r\n \r\n amFilter_1(joint.nativeObj, src.nativeObj, dst.nativeObj, sigma_s, sigma_r);\r\n \r\n return;\r\n }", "protected void validateFilters(cwterm.service.rigctl.xsd.Filter[] param) {\n }", "public static boolean validateMagFilter(Parameter value) {\n return validateValue(value, MAG_FILTERS);\n }", "StandardFilterBuilder standardFilter(int count);", "public float gaussianRandom() {\n\t\treturn (CCMath.constrain((float)nextGaussian() / 4,-1 ,1 ) + 1) / 2;\n\t}", "public double nextGaussian() {\n\n /*\n * This implementation uses the polar method to generate two gaussian\n * values at a time. One is returned, and the other is stored to be returned\n * next time.\n */\n\n if (haveStoredGaussian) {\n haveStoredGaussian = false;\n return storedGaussian;\n }\n\n double v1;\n double v2;\n double s;\n do {\n v1 = 2 * nextDouble() - 1;\n v2 = 2 * nextDouble() - 1;\n s = v1 * v1 + v2 * v2;\n } while (s >= 1 || s == 0);\n\n double m = StrictMath.sqrt(-2 * StrictMath.log(s) / s);\n storedGaussian = v2 * m;\n haveStoredGaussian = true;\n\n return v1 * m;\n }", "public void setFilters(List<COSName> filters) {\n/* 333 */ COSArray cOSArray = COSArrayList.converterToCOSArray(filters);\n/* 334 */ this.stream.setItem(COSName.FILTER, (COSBase)cOSArray);\n/* */ }", "public void filter(List<String> filters){\n filteredList.clear();\n\n if(filters == null || filters.size() == 0 || filters.get(0).toLowerCase().equals(\"NONE\")){\n filteredList = new ArrayList<>(sensorList);\n }\n\n for(int i=0; i<sensorList.size(); i++) {\n for (int j = 0; j < filters.size(); j++) {\n if(!filteredList.contains(sensorList.get(i))) {\n if (sensorList.get(i).getSensor_Type().equals(filters.get(j))) {\n filteredList.add(sensorList.get(i));\n }\n if (filters.get(j).equals(\"Heartbeat=0\")) {\n if (sensorList.get(i).getSensor_Type().equals(\"HeartRate\") && sensorList.get(i).getSensor_Val() == 0) {\n filteredList.add(sensorList.get(i));\n }\n }\n if (filters.get(j).equals(\"Tripped Vibration Sensor\")) {\n if (sensorList.get(i).getSensor_Type().equals(\"Vibration\") && sensorList.get(i).getSensor_Val() > 0) {\n filteredList.add(sensorList.get(i));\n }\n }\n if (filters.get(j).equals(\"Health=Service\")) {\n if (sensorList.get(i).getSensorHealth().equals(\"Service\")) {\n filteredList.add(sensorList.get(i));\n }\n }\n if (filters.get(j).equals(\"Health=EOL\")) {\n if (sensorList.get(i).getSensorHealth().equals(\"EOL\")) {\n filteredList.add(sensorList.get(i));\n }\n }\n if (filters.get(j).equals(\"Dead Battery\")) {\n if (sensorList.get(i).getBattery() == 0) {\n filteredList.add(sensorList.get(i));\n }\n }\n }\n }\n }\n filteredListForSearch.clear();\n filteredListForSearch.addAll(filteredList);\n removeDuplicates();\n notifyDataSetChanged();\n }", "public static FastGlobalSmootherFilter createFastGlobalSmootherFilter(Mat guide, double lambda, double sigma_color)\r\n {\r\n \r\n FastGlobalSmootherFilter retVal = FastGlobalSmootherFilter.__fromPtr__(createFastGlobalSmootherFilter_1(guide.nativeObj, lambda, sigma_color));\r\n \r\n return retVal;\r\n }", "public ArrayList<Sighting> filter(ArrayList<Sighting> rawSightings);", "public static double nextGaussian(final RandomEventSource source) {\r\n double v1, v2, s;\r\n do {\r\n // Generates two independent random variables U1, U2\r\n v1 = 2 * source.nextDouble() - 1;\r\n v2 = 2 * source.nextDouble() - 1;\r\n s = v1 * v1 + v2 * v2;\r\n } while (s >= 1 || s == 0);\r\n final double norm = Math.sqrt(-2 * Math.log(s) / s);\r\n final double result = v1 * norm;\r\n // On 1,000,000 calls, this would usually yield about -5 minimum value,\r\n // and +5 maximum value. So we pretend the range is [-5.5,5.5] and normalize\r\n // it to [0,1], clamping if needed.\r\n final double normalized = (result + 5.5) / 11.0;\r\n return (normalized < 0) ? 0 : (normalized > BEFORE_ONE ? BEFORE_ONE\r\n : normalized);\r\n }", "public static double gaussian() {\n // use the polar form of the Box-Muller transform\n double r, x, y;\n do {\n x = uniform( -1.0, 1.0 );\n y = uniform( -1.0, 1.0 );\n r = x*x + y*y;\n } while ( r >= 1 || r == 0 );\n \n return x * Math.sqrt(-2 * Math.log(r) / r);\n\n // Remark: y * Math.sqrt(-2 * Math.log(r) / r)\n // is an independent random gaussian\n }", "public static void gaussian(double a[][], int index[])\r\n {\r\n int n = index.length;\r\n double c[] = new double[n];\r\n\r\n for (int i=0; i<n; ++i)\r\n index[i] = i;\r\n\r\n for (int i=0; i<n; ++i)\r\n {\r\n double c1 = 0;\r\n for (int j=0; j<n; ++j)\r\n {\r\n double c0 = Math.abs(a[i][j]);\r\n if (c0 > c1) c1 = c0;\r\n }\r\n c[i] = c1;\r\n }\r\n\r\n int k = 0;\r\n for (int j=0; j<n-1; ++j)\r\n {\r\n double pi1 = 0;\r\n for (int i=j; i<n; ++i)\r\n {\r\n double pi0 = Math.abs(a[index[i]][j]);\r\n pi0 /= c[index[i]];\r\n if (pi0 > pi1)\r\n {\r\n pi1 = pi0;\r\n k = i;\r\n }\r\n }\r\n\r\n int itmp = index[j];\r\n index[j] = index[k];\r\n index[k] = itmp;\r\n for (int i=j+1; i<n; ++i)\r\n {\r\n double pj = a[index[i]][j]/a[index[j]][j];\r\n\r\n a[index[i]][j] = pj;\r\n\r\n for (int l=j+1; l<n; ++l)\r\n a[index[i]][l] -= pj*a[index[j]][l];\r\n }\r\n }\r\n }", "public static List<Student> filterMaleValues(){\n\n\t\tList<Student> filterMaleExe = StudentDataBase.getAllStudents().stream()\n\t\t\t\t.filter(k->k.getGradeLevel()>=3.9)\n\t\t\t\t.filter(j->j.getGender().equals(\"male\")).collect(Collectors.toList());\n\t\treturn filterMaleExe;\n\t}", "public void filterByFoMostRece(){\n // for each mood event in the list\n for (int i = 0; i < moodListBeforeFilterFo.getCount(); i++ ){\n // get the mood's date\n dateOfMood = moodListBeforeFilterFo.getMoodEvent(i).getDateOfRecord();\n // if it within the range, then add it to the new list\n if (dateOfMood.compareTo(lowerBoundDATE) >= 0 && dateOfMood.compareTo(currentDATE) <= 0) {\n moodListAfterFilter.add(moodListBeforeFilterFo.getMoodEvent(i));\n }\n }\n }", "public SimpleKalmanFilter(double noiseDeviation) {\n\t\tthis(noiseDeviation, 0);\n\t}", "private static native void fastGlobalSmootherFilter_0(long guide_nativeObj, long src_nativeObj, long dst_nativeObj, double lambda, double sigma_color, double lambda_attenuation, int num_iter);", "public GaussianNormailizerFeature(ArrayList<EssayInstance> trainingSample, Features base, String baseName, Type type) {\n means = new HashMap<>();\n stddev = new HashMap<>();\n this.baseFeature = base;\n this.baseName = baseName;\n this.name = baseName + \"_\" + type.toString().toLowerCase() + \"_gaussiannorm_task\";\n this.type = type;\n HashMap<Integer, int[]> docs = new HashMap<>();\n // compute the sums\n for (EssayInstance instance : trainingSample) {\n double value = getBaseValue(instance);\n if (!means.containsKey(instance.set)) means.put(instance.set, new double[]{value});\n else means.get(instance.set)[0] += value;\n\n if (!docs.containsKey(instance.set)) docs.put(instance.set, new int[]{1});\n else docs.get(instance.set)[0]++;\n }\n // convert to mean\n for (Integer i : means.keySet()) means.get(i)[0] /= docs.get(i)[0];\n // compute standard deviation\n for (EssayInstance instance : trainingSample) {\n double value = getBaseValue(instance);\n double dev = means.get(instance.set)[0] - value;\n dev *= dev;\n if (!stddev.containsKey(instance.set))\n stddev.put(instance.set, new double[]{dev});\n else stddev.get(instance.set)[0] += dev;\n }\n // normalize the stddev\n for (Integer i : stddev.keySet()) stddev.get(i)[0] = Math.sqrt(stddev.get(i)[0] / (docs.get(i)[0] - 1));\n // debug\n if (EssayScoring.DEBUG) {\n List<Integer> tasks = new ArrayList<>(means.keySet());\n Collections.sort(tasks);\n for (Integer task : tasks) {\n System.out.println(\"Feature \" + baseName + \" for task/set \" + task + \":\");\n System.out.println(\"\\tx: \" + means.get(task)[0]);\n System.out.println(\"\\ts: \" + stddev.get(task)[0]);\n }\n }\n }", "public ArrayList<CampusEvent> eventListFilter (ArrayList<CampusEvent> campusEvents, Filters filter) {\n ArrayList<CampusEvent> newList = new ArrayList<CampusEvent>();\n //if all the filters are zero, return original list\n Log.d(Globals.TAGG, \"Showing what the filters are\");\n\n if (filter == null) {\n Log.d(Globals.TAGG, \"All filters are null\");\n return campusEvents;\n } else {\n if (filter.getfFood() == 0 && filter.getfEventType() == 0 && filter.getfProgramType() == 0 && filter.getfGender() == 0 && filter.getfGreekSociety() == 0 && filter.getfMajor() == 0 && filter.getfYear() == 0) {\n return campusEvents;\n }\n if (filter.getfFood() != 0) {\n for (CampusEvent event : campusEvents) {\n int scaleval = filter.getfFood() - 1;\n if (event.getFood() == scaleval) {\n newList.add(event);\n }\n }\n }\n if (filter.getfEventType() != 0) {\n for (CampusEvent event : campusEvents) {\n int scaleval = filter.getfEventType() - 1;\n if (event.getEventType() == scaleval) {\n newList.add(event);\n }\n }\n }\n\n if (filter.getfProgramType() != 0) {\n for (CampusEvent event : campusEvents) {\n if (event.getProgramType() == filter.getfProgramType()) {\n newList.add(event);\n }\n }\n }\n\n if (filter.getfYear() != 0) {\n for (CampusEvent event : campusEvents) {\n if (event.getYear() == filter.getfYear()) {\n newList.add(event);\n }\n }\n }\n\n if (filter.getfMajor() != 0) {\n for (CampusEvent event : campusEvents) {\n if (event.getMajor() == filter.getfMajor()) {\n newList.add(event);\n }\n }\n }\n\n if (filter.getfGender() != 0) {\n for (CampusEvent event : campusEvents) {\n if (event.getGender() == filter.getfGender()) {\n newList.add(event);\n }\n }\n }\n\n if (filter.getfGreekSociety() != 0) {\n for (CampusEvent event : campusEvents) {\n if (event.getGreekSociety() == filter.getfGreekSociety()) {\n newList.add(event);\n }\n }\n }\n\n return newList;\n }\n }", "public void filterImage()\r\n {\r\n\t if (!isInverted && !isBlured )\r\n {\r\n cropedEdited = cropedPart;\r\n }\r\n\t float[] elements = {0.0f, 1.0f, 0.0f, -1.0f,brightnessLevel,1.0f,0.0f,0.0f,0.0f}; \r\n\t Kernel kernel = new Kernel(3, 3, elements); \r\n\t BufferedImageOp change = new ConvolveOp(kernel); \r\n\t cropedEdited = change.filter(cropedEdited, null);\r\n repaint();\r\n }", "public static void main(String[] args) {\n\t\t List<Product> list = new ArrayList<>();\r\n\t list.add(new Product(1, 1.58));\r\n\t list.add(new Product(2, 1.45));\r\n\t list.add(new Product(3, 2.25));\r\n\t list.add(new Product(4, 2.58));\r\n\r\n\t Double ans = list.stream().filter(p -> p.price < 2.5).mapToDouble\r\n\t (p -> p.price).average().orElse(0);\r\n\r\n\t System.out.println(ans);\r\n\t}", "private double[] getMeanMedStd(ArrayList<Feature> freature, String keyID, double dthresh) {\r\n\r\n ArrayList<Double> values = FeatureOps.getSpecifiedFeatureNumericalPropertyAsArrayList(freature, keyID);\r\n // threshold the data. \r\n NumericArrayListOps.removeElementsGreaterThan(values, dthresh);\r\n double[] d2 = List2Prims.doubleFromDouble(values);\r\n\r\n if (d2.length == 0) {\r\n return new double[]{dthresh, dthresh, Double.POSITIVE_INFINITY, 0d};\r\n }\r\n\r\n double mean, median, std, ratioNeighbours;\r\n mean = StatUtils.mean(d2);\r\n Median med = new Median();\r\n median = med.evaluate(d2);\r\n std = Math.sqrt(StatUtils.variance(d2));\r\n // the proportion of the set in close proximity to features in the second set. \r\n ratioNeighbours = ((double) d2.length) / (double) freature.size();\r\n return new double[]{mean, median, std, ratioNeighbours};\r\n }", "private static double calculateStandardDeviation(double[] array) {\n\t\tdouble sum = 0.0;\n\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tsum += array[i];\n\t\t}\n\n\t\t// getting the mean of array.\n\t\tdouble mean = sum / array.length;\n\n\t\t// calculating the standard deviation\n\t\tdouble standardDeviation = 0.0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tstandardDeviation += Math.pow(array[i] - mean, 2);\n\n\t\t}\n\n\t\treturn Math.sqrt(standardDeviation/array.length);\n\t}", "private void doGaussainBlurRGB(BufferedImage img, int minBlurX, int maxBlurX, int minBlurY, int maxBlurY, int x, int y,\n\t\t\tint blurWidth, int blurHeight, int srcRgb) {\n\t\timg.setRGB(x, y, srcRgb); // Nothing blur\n\n\t\t// int[] inPixels = new int[blurWidth * blurHeight];\n\t\t// int[] outPixels = new int[blurWidth * blurHeight];\n\t\t// java.awt.image.Kernel kernel = GaussianFilter.makeKernel(0.667f);\n\t\t// GaussianFilter.convolveAndTranspose(kernel, inPixels, outPixels,\n\t\t// blurWidth, blurHeight, true, GaussianFilter.CLAMP_EDGES);\n\t\t// GaussianFilter.convolveAndTranspose(kernel, outPixels, inPixels,\n\t\t// blurHeight, blurWidth, true, GaussianFilter.CLAMP_EDGES);\n\t\t// img.setRGB(x, y, blurWidth, blurHeight, inPixels, 0, blurWidth);\n\n\t\t// int v = 0;\n\t\t// if ((maxBlurY - minBlurY) > (maxBlurX - minBlurX)) { // Left/Right?\n\t\t// v = (int) (Math.abs(240 - Math.abs(x - minBlurX) * 20));\n\t\t// } else {\n\t\t// v = (int) (Math.abs(240 - Math.abs(y - minBlurY) * 20));\n\t\t// }\n\t\t// img.setRGB(x, y, new Color(v, v, v).getRGB());\n\n\t\t// NormalDistribution nd = new NormalDistribution(0, 1.44);\n\n\t\t// int r = (0xff & srcRgb);\n\t\t// int g = (0xff & (srcRgb >> 8));\n\t\t// int b = (0xff & (srcRgb >> 16));\n\t\t// srcRgb = r + (g << 8) + (b << 4) + (100 << 24);\n\t\t// img.setRGB(x, y, Color.white.getRGB());\n\t\t// img.setRGB(x, y, new Color(220, 220, 220).getRGB());\n\t}", "public void filterList(ArrayList<GroupChannel> filteredList) {\n }", "public static void main(String[] args) {\n\n\n int [][] array = {\n {1, 4, 3, 2, 5},\n {4, 5, 3, 2, 9},\n {4, 7, 8, 1, 4}};\n\n int sum = 0;\n int mean = 0;\n int median = 0;\n double variance = 0;\n double sdev = 0; //Standard deviation\n\n //Make 2d array into 1d array\n int [] list = new int [array.length * array[0].length];\n\n int listnum = 0;\n for (int i = 0; i < array.length; i++){\n for (int j = 0; j < array.length; j++){\n list[listnum++] = array [i][j];\n }\n }\n\n //This is used to find the SUM\n for (int i = 0; i < list.length; i++) {\n sum += list[i];\n }\n System.out.println(\"This is the sum: \" + sum);\n\n //MEAN\n mean = sum/list.length;\n System.out.println(\"Mean: \" + mean);\n\n //This is used to find the MEDIAN\n Arrays.sort(list);\n\n int middle = (list.length / 2);\n if (list.length % 2 == 0) {\n int medium1 = list[middle];\n int medium2 = list[middle - 1];\n median = (medium1 + medium2) / 2;\n } else {\n median = list[middle + 1];\n }\n System.out.println(\"The MEDIAN is: \" + median);\n\n\n //This is the mode\n int[] frequencies = new int[10]; // all zero\n for(int [] row : array){\n for(int val : row){\n frequencies[val]++;\n }\n }\n\n // scan for the largest value\n int largest = 0;\n int mode = -1;\n for (int i = 0; i < 10; ++i) {\n if (frequencies[i] > largest) {\n largest = frequencies[i];\n mode = i;\n }\n }System.out.println(\"Mode: \" + mode);\n\n\n\n //VARIANCE\n double temp = 0;\n for (double a : list) {\n temp += (a - mean) * (a - mean);\n }\n variance = temp / list.length;\n System.out.println(\"Variance:\" + variance);\n\n //Standard deviation\n sdev = Math.sqrt(variance);\n System.out.println(\"Standard Deviation: \" + sdev);\n }", "public static void streamFilter(List<Associate> associateList, String filter) {\n\n\t\tString filter2 = filter.toLowerCase();\n\n\t\tassociateList.stream()\n\t\t\t\t.filter((Associate a) -> new StringBuilder(a.getFirstname().toLowerCase()).indexOf(filter2) != -1)\n\n\t\t\t\t.forEach((Associate a) -> {\n\t\t\t\t\tSystem.out.println(a.getFirstname());\n\n\t\t\t\t});\n\t}", "public void useUniformDeviates(){\n this.gaussianDeviates = false;\n }", "public static double nextGaussian() {\n return randGen.nextGaussian();\n }", "private void addAnnotationFilters(Query query, List<Predicate<Variant>> filters) {\n addClinicalFilters(query, filters);\n\n if (VariantQueryUtils.isValidParam(query, ANNOT_POPULATION_ALTERNATE_FREQUENCY)) {\n ParsedQuery<KeyOpValue<String, Float>> freqQuery\n = VariantQueryParser.parseFreqFilter(query, ANNOT_POPULATION_ALTERNATE_FREQUENCY);\n List<PopulationFrequencyVariantFilter.AltFreqFilter> freqFilters = freqQuery.mapValues(popFreq -> {\n String[] split = popFreq.getKey().split(VariantQueryUtils.STUDY_POP_FREQ_SEPARATOR);\n return new PopulationFrequencyVariantFilter.AltFreqFilter(split[0], split[1], popFreq.getOp(), popFreq.getValue());\n });\n filters.add(new PopulationFrequencyVariantFilter(freqQuery.getOperation(), freqFilters));\n }\n if (VariantQueryUtils.isValidParam(query, ANNOT_POPULATION_REFERENCE_FREQUENCY)) {\n ParsedQuery<KeyOpValue<String, Float>> freqQuery\n = VariantQueryParser.parseFreqFilter(query, ANNOT_POPULATION_REFERENCE_FREQUENCY);\n List<PopulationFrequencyVariantFilter.RefFreqFilter> freqFilters = freqQuery.mapValues(popFreq -> {\n String[] split = popFreq.getKey().split(VariantQueryUtils.STUDY_POP_FREQ_SEPARATOR);\n return new PopulationFrequencyVariantFilter.RefFreqFilter(split[0], split[1], popFreq.getOp(), popFreq.getValue());\n });\n filters.add(new PopulationFrequencyVariantFilter(freqQuery.getOperation(), freqFilters));\n }\n if (VariantQueryUtils.isValidParam(query, ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY)) {\n ParsedQuery<KeyOpValue<String, Float>> freqQuery\n = VariantQueryParser.parseFreqFilter(query, ANNOT_POPULATION_MINOR_ALLELE_FREQUENCY);\n List<PopulationFrequencyVariantFilter.MafFreqFilter> freqFilters = freqQuery.mapValues(popFreq -> {\n String[] split = popFreq.getKey().split(VariantQueryUtils.STUDY_POP_FREQ_SEPARATOR);\n return new PopulationFrequencyVariantFilter.MafFreqFilter(split[0], split[1], popFreq.getOp(), popFreq.getValue());\n });\n filters.add(new PopulationFrequencyVariantFilter(freqQuery.getOperation(), freqFilters));\n }\n\n }", "public void StandardDeviationPair(){\r\n\t\tAveragePair();\r\n\t\tif (count<=1|| Total<=0){\r\n\t\t\tSystem.out.println(\"The Standard Deviation of x and y is \"+0.0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tStandardDeviation=(float)Math.sqrt((Total2-Total*Total/count)/(count-1));\r\n\t\t\tStandardDeviationY=(float)Math.sqrt((TotalY2-TotalY*TotalY/count)/(count-1));\r\n\t\t\t\r\n\t\t}\r\n\t}", "public static ArrayList<Sample> filterSample(ArrayList<Sample> samples , Predicate<Sample> predicate)\n\t{\n\t\treturn (ArrayList<Sample>) samples.stream().filter(predicate).collect(Collectors.<Sample>toList());\n\t}", "public void addFilters(){\r\n filter.getItems().clear();\r\n filter.setPromptText(\"Select Filter\");\r\n filter.setButtonCell(new ListCell<String>() {\r\n @Override\r\n protected void updateItem(String item, boolean empty) {\r\n super.updateItem(item, empty);\r\n if (empty || item == null)\r\n setText(\"Select Filter\");\r\n else\r\n setText(item);\r\n }\r\n });\r\n\r\n //Adds filters to filter combobox based on tx power rating and filter power rating\r\n\r\n DocumentBuilderFactory filteringFactory = DocumentBuilderFactory.newInstance();\r\n DocumentBuilder filterBuilder = null;\r\n try { filterBuilder = filteringFactory.newDocumentBuilder(); }\r\n catch (ParserConfigurationException e) { e.printStackTrace(); }\r\n\r\n Document filterDocument = null;\r\n try { filterDocument = Objects.requireNonNull(filterBuilder).parse(new File(\"maskFiltersCouplers.xml\")); }\r\n catch (SAXException | IOException e) { e.printStackTrace(); }\r\n\r\n List<sample.Filtering> theFilters = new ArrayList<sample.Filtering>();\r\n NodeList filtersNodeList = filterDocument.getDocumentElement().getChildNodes();\r\n for (int i = 0; i < filtersNodeList.getLength(); i++) {\r\n Node filtersNode = filtersNodeList.item(i);\r\n if (filtersNode.getNodeType() == Node.ELEMENT_NODE) {\r\n Element filtersElement = (Element) filtersNode;\r\n\r\n filterPower = Double.parseDouble((filtersElement.getElementsByTagName(\"Power\").item(0).getChildNodes().item(0).getNodeValue()));\r\n filterPIDDescription = filtersElement.getElementsByTagName(\"PIDDESCRIPTION\").item(0).getChildNodes().item(0).getNodeValue();\r\n filterSize = filtersElement.getElementsByTagName(\"Size\").item(0).getChildNodes().item(0).getNodeValue();\r\n filterPID = filtersElement.getElementsByTagName(\"PID\").item(0).getChildNodes().item(0).getNodeValue();\r\n\r\n if (filterPower > powerRating * 1000 || filterPower * cabinets > powerRating * 1000) { //powerRating is KW need to multiply by 1000 to get into watts\r\n theFilters.add(new sample.Filtering(filterPower, filterPIDDescription, filterSize, filterPID));//filterPower is set in watts (1,000 watts = 1KW)\r\n filter.getItems().add(filterPIDDescription + \" input size \" + filterSize);\r\n }\r\n }\r\n }\r\n }", "public static double getStd(List<Integer> list) {\n double std = 0;\n double avg = getAvg(list);\n // sum values\n for(int i = 0; i != list.size(); ++i) {\n std += Math.pow(list.get(i) - avg, 2);\n }\n // divide by number of values\n // square root\n return Math.sqrt(std/list.size());\n\n }", "public double std(ArrayList<Double> x) {\n double sum = 0;\n double round;\n for (int i = 0; i < x.size(); i++) {\n sum += Math.pow((x.get(i) - average(x)), 2) / x.size();\n }\n round = Math.sqrt(sum) * 100;\n round = Math.round(round);\n round /= 100;\n return round;\n\n\n }", "public static void main(String... args) throws Exception {\n\t\tString dataDir = Utils.getSharedDataDir(BluranImage.class) + \"ModifyingImages/\";\r\n\t\t//ExStart:BluranImage\r\n\t\tImage image = Image.load(dataDir + \"aspose-logo.jpg\");\r\n\t\t// Convert the image into RasterImage.\r\n\t\tRasterImage rasterImage = (RasterImage) image;\r\n\r\n\t\t// Pass Bounds[rectangle] of image and GaussianBlurFilterOptions\r\n\t\t// instance to Filter method.\r\n\t\trasterImage.filter(rasterImage.getBounds(), new GaussianBlurFilterOptions(5, 5));\r\n\r\n\t\t// Save the results to output path.\r\n\t\trasterImage.save(dataDir + \"BluranImage_out.gif\");\r\n\t\t//ExEnd:BluranImage\r\n\t}", "private static List<Integer> statify(List<Double> weights, double mean, double stdDev) {\n \tList<Integer> stateList = new LinkedList<Integer>();\n \t\n \tdouble stateOneLine = mean;\n\t\tdouble stateTwoLine = mean + stdDev/2;\n\t\t\n \tfor(Double weight : weights) {\n \t\tif (weight.doubleValue() < stateOneLine) {\n \t\t\tstateList.add(0);\n \t\t} else if (weight.doubleValue() < stateTwoLine) {\n \t\t\tstateList.add(1);\n \t\t} else {\n \t\t\tstateList.add(2);\n \t\t}\n \t}\n \t\n \treturn stateList;\n }", "private List<Double> sumMeanX(List<Business> business, double avg) {\n\t\tList<Double> sumMean = new ArrayList<Double>();\n\n\t\tfor (Business biz : business) {\n\t\t\tint price = biz.getPrice();\n\t\t\tsumMean.add(price - avg);\n\t\t}\n\t\treturn sumMean;\n\t}", "public static double addGaussianJitter( double mu, double sigma) {\n\n\t\treturn mu + sigma * _random.nextGaussian();\n }", "public static DoubleStream generateStreamFromList(List<Double> list)\n\t{\n\t\tDoubleStream.Builder builder = DoubleStream.builder();\n\t\tfor (double n : list)\n\t\t{\n\t\t\tbuilder.add(n);\n\t\t}\n\t\treturn builder.build();\n\t}", "public List<PedidoIndividual> filtrar(PedidoIndividual filtro);", "public static <T> void sample(List<T> inList, double prop, List<T> outList1, List<T> outList2) {\n if (prop < 0 || 1 < prop) {\n throw new IllegalStateException(\"Invalid proportion: \" + prop);\n }\n int numDev = (int) Math.ceil(prop * inList.size());\n log.info(\"Num train-as-dev examples: \" + numDev);\n boolean[] isDev = Sample.sampleWithoutReplacementBooleans(numDev, inList.size());\n for (int i = 0; i < inList.size(); i++) {\n if (isDev[i]) {\n outList1.add(inList.get(i));\n } else {\n outList2.add(inList.get(i));\n }\n }\n }", "protected Vector filterInputInternal(Vector before)\n\t{\n\t\treturn filterInternal(before, featureMins, featureMaxes);\n\t}" ]
[ "0.78079313", "0.6951475", "0.5785523", "0.5649328", "0.542067", "0.5273572", "0.5270473", "0.5253467", "0.5135618", "0.5132098", "0.5054233", "0.50394005", "0.49696884", "0.48854762", "0.48115185", "0.47630113", "0.47500688", "0.47220698", "0.4709528", "0.47061944", "0.46690267", "0.46675408", "0.4637132", "0.46361637", "0.4628987", "0.46256083", "0.4618581", "0.46043456", "0.45867786", "0.4564931", "0.4560135", "0.45574602", "0.4554211", "0.45442972", "0.45211548", "0.4511084", "0.4508314", "0.44981596", "0.44962826", "0.44786876", "0.4470597", "0.44635946", "0.4450464", "0.4439655", "0.44290853", "0.44139794", "0.44083863", "0.44079894", "0.440185", "0.4400738", "0.43933958", "0.4389835", "0.43893623", "0.4389254", "0.43751845", "0.4369337", "0.4368758", "0.43623164", "0.43520555", "0.43484622", "0.43191275", "0.43056732", "0.43055904", "0.43049422", "0.43009812", "0.4299036", "0.4295275", "0.4284169", "0.4282706", "0.42719626", "0.4269837", "0.4265525", "0.42517695", "0.4248821", "0.42397517", "0.42380747", "0.42375496", "0.42338476", "0.42333", "0.42199284", "0.42162493", "0.42105985", "0.42024598", "0.4202399", "0.42022073", "0.41979855", "0.41972515", "0.419333", "0.41908678", "0.4186702", "0.41848266", "0.41716623", "0.41550866", "0.4141889", "0.41351625", "0.41349956", "0.41309863", "0.41273183", "0.4127224", "0.41184336" ]
0.81546074
0
Creates a frequency table. The number of items in each class is returned. Classes are defined by the limit and resolution. E.g. for a limit of 1200 with a resolution of 400 there are 3 classes: [0400[, [400800[ and [8001200[.
public static Histogram createFrequencyTable(List<Double> values, double classWidth, double start, double stop) { Histogram histogram = new Histogram(start, stop, (int) ((stop - start) / classWidth)); for (Double value : values) { histogram.add(value); } assert histogram.getSumFreq() == values.size() : "Number of items in bins does not correspond with total number of items"; return histogram; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getFreq();", "public static ScannableTable fibonacciTableWithLimit( final long limit ) {\n return new ScannableTable() {\n @Override\n public AlgDataType getRowType( AlgDataTypeFactory typeFactory ) {\n return typeFactory.builder().add( \"N\", null, PolyType.BIGINT ).build();\n }\n\n\n @Override\n public Enumerable<Object[]> scan( DataContext root ) {\n return new AbstractEnumerable<Object[]>() {\n @Override\n public Enumerator<Object[]> enumerator() {\n return new Enumerator<Object[]>() {\n private long prev = 1;\n private long current = 0;\n\n\n @Override\n public Object[] current() {\n return new Object[]{ current };\n }\n\n\n @Override\n public boolean moveNext() {\n final long next = current + prev;\n if ( limit >= 0 && next > limit ) {\n return false;\n }\n prev = current;\n current = next;\n return true;\n }\n\n\n @Override\n public void reset() {\n prev = 0;\n current = 1;\n }\n\n\n @Override\n public void close() {\n }\n };\n }\n };\n }\n\n\n @Override\n public Statistic getStatistic() {\n return Statistics.UNKNOWN;\n }\n\n\n @Override\n public Long getTableId() {\n return null;\n }\n\n\n @Override\n public Schema.TableType getJdbcTableType() {\n return Schema.TableType.TABLE;\n }\n\n\n @Override\n public boolean isRolledUp( String column ) {\n return false;\n }\n\n\n @Override\n public boolean rolledUpColumnValidInsideAgg( String column, Call call, Node parent ) {\n return true;\n }\n\n };\n }", "public interface IFrequencyTable {\n\t\n\t/**\n\t * Returns the number of symbols in this frequency table, which is a positive number.\n\t * @return the number of symbols in this frequency table\n\t */\n\tpublic int getSymbolLimit();\n\t\n\t\n\t/**\n\t * Returns the frequency of the specified symbol. The returned value is at least 0.\n\t * @param symbol the symbol to query\n\t * @return the frequency of the symbol\n\t * @throws IllegalArgumentException if the symbol is out of range\n\t */\n\tpublic int get(int symbol);\n\tpublic int get(ISymbol symbol);\n\t\n\t\n\t/**\n\t * Sets the frequency of the specified symbol to the specified value.\n\t * The frequency value must be at least 0.\n\t * @param symbol the symbol to set\n\t * @param freq the frequency value to set\n\t * @throws IllegalArgumentException if the frequency is negative or the symbol is out of range\n\t * @throws ArithmeticException if an arithmetic overflow occurs\n\t */\n\tpublic void set(int symbol, int freq);\n\tpublic void set(ISymbol symbol, int freq);\n\t\n\t\n\t/**\n\t * Increments the frequency of the specified symbol.\n\t * @param symbol the symbol whose frequency to increment\n\t * @throws IllegalArgumentException if the symbol is out of range\n\t * @throws ArithmeticException if an arithmetic overflow occurs\n\t */\n\tpublic void increment(int symbol);\n\tpublic void increment(ISymbol symbol);\n\t\n\t\n\t/**\n\t * Returns the total of all symbol frequencies. The returned value is at\n\t * least 0 and is always equal to {@code getHigh(getSymbolLimit() - 1)}.\n\t * @return the total of all symbol frequencies\n\t */\n\tpublic int getTotal();\n\t\n\t\n\t/**\n\t * Returns the sum of the frequencies of all the symbols strictly\n\t * below the specified symbol value. The returned value is at least 0.\n\t * @param symbol the symbol to query\n\t * @return the sum of the frequencies of all the symbols below {@code symbol}\n\t * @throws IllegalArgumentException if the symbol is out of range\n\t */\n\tpublic int getLow(int symbol);\n\tpublic int getLow(ISymbol symbol);\n\t\n\t\n\t/**\n\t * Returns the sum of the frequencies of the specified symbol\n\t * and all the symbols below. The returned value is at least 0.\n\t * @param symbol the symbol to query\n\t * @return the sum of the frequencies of {@code symbol} and all symbols below\n\t * @throws IllegalArgumentException if the symbol is out of range\n\t */\n\tpublic int getHigh(int symbol);\n\tpublic int getHigh(ISymbol symbol);\n\t\n}", "float getFrequency();", "java.lang.String getFrequency();", "private HashMap<Integer, HashMap<String,String>> getAllFrequencies() {\n HashMap<Integer,HashMap<String,String>> freq\n = dbController.getAllFrequencies();\n if (freq == null)\n return null;\n HashMap<Integer, HashMap<String, String>> response = new HashMap<Integer, HashMap<String, String>>();\n int i = 2;\n //Passing on any frequency and creates a message to send\n for (Map.Entry<Integer,HashMap<String,String>> objs : freq.entrySet()){\n HashMap<String,String> obj = objs.getValue();\n\n response.put(i, new HashMapBuilder<String, String>().put(\"name\", obj.get(\"name\"))\n .put(\"frequency\",obj.get(\"frequency\")).build());\n i++;\n }\n return response;\n }", "public int getFreq(){ return frequency;}", "public static Histogram readFrequencyTable(String fileName) {\r\n List<String[]> data = FileUtils.readCSVFile(fileName, \";\", -1);\r\n \r\n double classWidth = Double.parseDouble(data.get(1)[0]) - Double.parseDouble(data.get(0)[0]);\r\n double start = Double.parseDouble(data.get(0)[0]) - classWidth / 2.0;\r\n double stop = Double.parseDouble(data.get(data.size() - 1)[0]) + classWidth / 2.0;\r\n \r\n Histogram table = new Histogram(start, stop, (int) ((stop - start) / classWidth));\r\n for (String[] row : data) {\r\n int frequency = (int) Double.parseDouble(row[1]);\r\n double value = Double.parseDouble(row[0]);\r\n for (int i = 0; i < frequency; i++) {\r\n table.add(value);\r\n }\r\n }\r\n return table;\r\n }", "private void buildFreqMap() {\n\t\toriginalFreq = new HashMap<String, WordOccurence>();\n\n\t\tfor (ListIterator<Caption> itr = original.captionIterator(0); itr\n\t\t\t\t.hasNext();) {\n\t\t\tfinal Caption currentCap = itr.next();\n\t\t\tfinal String[] words = currentCap.getCaption().split(\"\\\\s+\");\n\t\t\tfor (int i = 0; i < words.length; i++) {\n\t\t\t\tfinal String lowerCasedWord = words[i].toLowerCase();\n\t\t\t\tif (originalFreq.containsKey(lowerCasedWord)) {\n\t\t\t\t\toriginalFreq.get(lowerCasedWord).addOccurence(\n\t\t\t\t\t\t\t(int) currentCap.getTime());\n\t\t\t\t} else {\n\t\t\t\t\tfinal WordOccurence occ = new WordOccurence(\n\t\t\t\t\t\t\t(int) currentCap.getTime());\n\t\t\t\t\toriginalFreq.put(lowerCasedWord, occ);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < identified.size(); i++) {\n\t\t\tResultChunk curretResult = identified.get(i);\n\t\t\tfinal String[] words = curretResult.getDetectedString().split(\n\t\t\t\t\t\"\\\\s+\");\n\t\t\tint identifiedAt = curretResult.getDetectedAt();\n\t\t\tfor (int j = 0; j < words.length; j++) {\n\t\t\t\tString currentWord = words[j].toLowerCase();\n\t\t\t\tif (originalFreq.containsKey(currentWord)) {\n\t\t\t\t\tint detectedAt = (int) (identifiedAt - (words.length - j)\n\t\t\t\t\t\t\t* AVG_WORD_TIME);\n\t\t\t\t\toriginalFreq.get(currentWord).addVoiceDetection(detectedAt);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void createProbsMap() {\n\t\tif(this.counts == null) {\n\t\t\tcreateCountMap();\n\t\t}\n\t\t\n\t\tMap<String, Double> result = new HashMap<String, Double>();\n\t\t\n\t\t// Make the counts and get the highest probability found \n\t\tdouble highestProb = 0.00;\n\t\tdouble size = (double) this.getData().size();\n\t\tfor(Entry<String, Integer> entry : counts.entrySet()) {\n\t\t\tdouble value = (double) entry.getValue();\n\t\t\tresult.put(entry.getKey(), value / size);\n\t\t\t\n\t\t\tif(value/size > highestProb) {\n\t\t\t\thighestProb = value/size;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fill the highest probilities \n\t\tList<String> highestProbs = new ArrayList<String>();\n\t\tfor(Entry<String, Integer> entry : counts.entrySet()) {\n\t\t\tdouble value = (double) entry.getValue();\n\t\t\t\n\t\t\tif(value/size == highestProb) {\n\t\t\t\thighestProbs.add(entry.getKey());\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.highestProbs = highestProbs;\n\t\tthis.highestProb = highestProb;\n\t\tthis.probs \t\t = result;\n\t}", "public Frequency() {\n\n }", "public Map<Integer, Float> getPercentInFrequency() {\n\t\t\tMap<Integer, Float> percents = new LinkedHashMap<Integer, Float>();\n\t\t\t\n\t\t\tint[][] times = getTimeInFrequency();\n\t\t\tif (times == null || times.length == 0) return null;\n\t\t\t\n\t\t\tlong total = 0;\n\t\t\t\n\t\t\tfor (int i = 0; i < times.length; ++i) {\n\t\t\t\ttotal += times[i][1];\n\t\t\t}\n\t\t\t\n\t\t\tif (total == 0) return null;\n\t\t\t\n\t\t\tfor (int i = 0; i < times.length; ++i) {\n\t\t\t\tpercents.put(times[i][0], (float) times[i][1] / total * 100);\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn percents;\n\t\t}", "public Builder setFreq(int value) {\n bitField0_ |= 0x00000008;\n freq_ = value;\n onChanged();\n return this;\n }", "int getNumFrequents() {\n return numFrequents;\n }", "Limit createLimit();", "public Collection<FrequencyDTO> getSchedulingFrequencies() throws Exception;", "public static String histogram(ArrayList<Integer> frequency)\r\n {\r\n int maxFrequency;\r\n int starRepresent;\r\n maxFrequency = 0;\r\n \r\n for (int i = 0; i < frequency.size() -1; i++)\r\n {\r\n if (frequency.get(i) > maxFrequency)\r\n maxFrequency = frequency.get(i);\r\n }\r\n \r\n starRepresent = maxFrequency / 10;\r\n \r\n System.out.printf(\"%10s\", \"Frequency Distrubution\");\r\n System.out.println();\r\n System.out.printf(\"%10s\", \"( max freq is \" + maxFrequency + \")\");\r\n System.out.println();\r\n \r\n for (int i = 10; i > 0; i--)\r\n {\r\n for (int index = 0; index <= frequency.size() - 1; index++)\r\n {\r\n if (frequency.get(index) / starRepresent >= i)\r\n System.out.print(\"* \");\r\n else\r\n System.out.print(\" \");\r\n }\r\n System.out.print(\"\\n\");\r\n }\r\n return \"\";\r\n }", "private JSONObject getCPUFreqsJSON(List<Double[]> cpus) {\r\n Double[] cpu = null;\r\n int cpu_num = cpus.size();\r\n\r\n JSONObject freq_max = new JSONObject();\r\n for (int i = 0; i < cpu_num; i++) {\r\n String x = \" \" + Integer.toString(i) + \") \";\r\n cpu = cpus.get(i);\r\n double x1 = cpu[1];\r\n if (x1 != 0) {\r\n try {\r\n freq_max.put(Integer.toString(i), x1);\r\n } catch (JSONException e) {\r\n\r\n }\r\n }\r\n }\r\n return freq_max;\r\n }", "public static double []getProportionalTimes(double valMin, double valMax,double step){\n\t\tdouble[]tab=new double[(int)(Math.ceil((double)0.00001+((valMax-valMin)/step)))];\n\t\tfor (int i=0;i<tab.length;i++){\n\t\t\ttab[i]=valMin+(double)((i*step));\n\t\t}\n\t\treturn tab;\n\t}", "public static void main(String[] args) {\n\r\n\t\tint arr[]={2, 3, 2, 4, 5, 12, 2, 3, 3, 3, 12};\r\n\t\tMap<Integer,Data> map = new HashMap<>();\r\n\t\tfor(int a :arr)\r\n\t\t{\r\n\t\t\tif(map.containsKey(a))\r\n\t\t\t{\r\n\t\t\t\tmap.get(a).incrementFrequency();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tmap.put(a, new Data(a));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tSet<Data> sortedData = new TreeSet<>(map.values());\r\n\t\tList<Integer> result = new ArrayList<>();\r\n\t\tfor(Data d : sortedData)\r\n\t\t{\r\n\t\t\tfor(int i=0;i<d.frequency;i++)\r\n\t\t\t\tresult.add(d.number);\r\n\t\t}\r\n\t\tSystem.out.println(result);\r\n\t}", "public void setFrequencies() {\n\t\tleafEntries[0] = new HuffmanData(5000, 'a');\n\t\tleafEntries[1] = new HuffmanData(2000, 'b');\n\t\tleafEntries[2] = new HuffmanData(10000, 'c');\n\t\tleafEntries[3] = new HuffmanData(8000, 'd');\n\t\tleafEntries[4] = new HuffmanData(22000, 'e');\n\t\tleafEntries[5] = new HuffmanData(49000, 'f');\n\t\tleafEntries[6] = new HuffmanData(4000, 'g');\n\t}", "public Frequency(ArrayList<LottoDay> list) {\n\n\t\tfill(list);//fill the maps\n\t}", "public void createSpaceClasses(){\n\t//add the number of classe demand in a list of superchannel\n\t\tspaceSC_List = new ArrayList<OpticalSuperChannel>();\n\t\tfor ( int i = 1 ; i < this.spatialDimension+1 ; i++ ) {\n\t\t\tspaceSC_List.add(new OpticalSuperChannel( i , this.signalBw, this.channelSpacing, this.bandGuard,\n\t\t\t\t\tthis.slotBw, this.modulationFormat));\n\t\t}\n\n\n\t}", "public static Map mapearFreqObj(List objetos) {\r\n Map<String, Integer> contFreq = new HashMap<>();\r\n Iterator<Integer> it = objetos.iterator();\r\n while (it.hasNext()) {\r\n Object obj = it.next();\r\n int frequency = Collections.frequency(objetos, obj);\r\n contFreq.put(String.valueOf(obj), frequency);\r\n }\r\n\r\n return contFreq;\r\n\r\n }", "private double ticsCalc(double deltaRange, int ticlimit){\n\t\t\tdouble tics = Math.pow(10, (int)Math.log10(deltaRange/ticlimit));\n\t\t\twhile(2.0*(deltaRange/(tics)) <= ticlimit) {\n\t\t\t\ttics /= 2.0;\n\t\t\t}\n\t\t\twhile((deltaRange/(tics))/2 >= ticlimit) {\n\t\t\t\ttics *= 2.0;\n\t\t\t}\n\t\t\treturn tics;\n\t\t}", "int getMetricsCount();", "public void setFrequency(int f){\n this.frequency = f;\n }", "static List<Integer> freqQuery(List<int[]> queries) {\n HashMap<Integer, Integer> data = new HashMap<>();\n int[] counters = new int[queries.size()+1];\n ArrayList<Integer> answer = new ArrayList<>();\n for (int[] cmd : queries) {\n Integer cmdType = cmd[0];\n Integer cmdValue = cmd[1];\n\n switch (cmdType) {\n case 1:\n int previousCount = data.getOrDefault(cmdValue, 0);\n data.put(cmdValue, data.getOrDefault(cmdValue, 0) + 1);\n counters[data.get(cmdValue)]+=1;\n counters[previousCount]-=1;\n break;\n case 2:\n if (data.containsKey(cmdValue) && data.get(cmdValue) != 0) {\n int currentCounter = data.get(cmdValue);\n data.put(cmdValue, currentCounter - 1);\n counters[currentCounter]-=1;\n counters[currentCounter-1]+=1;\n }\n break;\n case 3:\n if (cmdValue < queries.size() && counters[cmdValue] > 0) {\n answer.add(1);\n } else {\n answer.add(0);\n }\n break;\n }\n }\n return answer;\n }", "public void setFreqWindow(float minf, float maxf) {\n\t\tminFreq = minf;\n\t\tmaxFreq = maxf;\n\t}", "public Exact_Period_Count create_query(String word, Date min, Date max)\r\n\t{\r\n\t\tExact_Period_Count query = new Exact_Period_Count(word, min, max);\r\n\t\tif(!m_table.containsKey(word))\r\n\t\t\tm_table.put(word, new LinkedList<Exact_Period_Count>());\r\n\t\t\r\n\t\tm_table.get(word).add(query);\r\n\t\tm_queryList.add(query);\r\n\t\treturn query;\r\n\t}", "BigInteger getMax_freq();", "@Override\n public long getFrequencyCount() {\n return count;\n }", "int getMaxCount();", "int getMaxCount();", "public static ArrayList<Integer> diceFrequency(int roll)\r\n {\r\n // variables\r\n Dice dice;\r\n int diceRoll;\r\n \r\n // program code\r\n dice = new Dice();\r\n \r\n ArrayList<Integer> frequency;\r\n frequency = new ArrayList<Integer> ();\r\n \r\n for (int i = 0; i < 11; i++)\r\n frequency.add(0);\r\n\r\n // roll the dice until the limit\r\n for (int i = 1; i <= roll; i++)\r\n {\r\n diceRoll = dice.rollDice();\r\n frequency.set(diceRoll - 2, frequency.get(diceRoll - 2) +1 ); \r\n }\r\n return frequency;\r\n }", "public int getFrequency(int height);", "public interface CardCounts {\n\n int[] FULL_SETS_CARD_COUNTS = {324, 162, 162, 180, 180, 180, 324, 180, 182, 54, 99, 189, 100, 129};\n\n int[] PREMIUM_SETS_CARD_COUNTS = {6, 11, 2, 7, 6, 18, 6, 6, 12, 12, 6, 20};\n\n int[] VIRTUAL_SETS_CARD_COUNTS = {146, 42, 15, 36, 58, 23, 14, 30, 59, 56, 47, 61, 6, 59, 22, 27, 49, 52, 32, 48, 10, 75};\n\n int[] VIRTUAL_PREMIUM_SETS_CARD_COUNTS = {8};\n\n int[] DREAM_CARD_SETS_CARD_COUNTS = {0};\n\n int[] PLAYTESTING_SETS_CARD_COUNTS = {200};\n\n int[] LEGACY_SETS_CARD_COUNTS = {999};\n}", "private void createGlobalStatsTable(int threshold) \r\n\t{\r\n\t\tTableData statsTable = new TableData(9);\r\n\r\n\t\tMap<Integer,IGlobalStats> globalStatsMap = model.getGlobalStats();\r\n\r\n\t\tfor (int key:globalStatsMap.keySet()) \r\n\t\t{\r\n\t\t\t// La global de todos los nodos tiene que heredar de SimpleGlobalStats para que se muestre\r\n\t\t\tIGlobalStats aux = globalStatsMap.get(key);\r\n\r\n\t\t\tif (!(aux instanceof SimpleGlobalStats)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tSimpleGlobalStats stats = (SimpleGlobalStats)aux;\r\n\r\n\t\t\tString obj = stats.getName(model.getMethodNames());\r\n\t\t\tif (obj==null) {\r\n\t\t\t\tint h=1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tString nodeName = Names.getDigestedName(stats.getName(model.getMethodNames()), true);\r\n\t\t\tString nodeType = stats.getTypeName();\r\n\r\n\t\t\tfloat referenceTime = stats.getAvgTotTime();\r\n\r\n\t\t\tif (referenceTime>=threshold) {\r\n\t\t\t\t// \"Name\", \"Type\", \"Count\", \"Avg. Total Time\", \"Min. Total Time\", \"Max. Total Time\", \"Avg. Ex. Time\", \"Min. Ex. Time\", \"Max. Ex. Time\" \r\n\t\t\t\tDecimalFormat dec = new DecimalFormat();\r\n\t\t\t\tdec.setMinimumFractionDigits(2);\r\n\t\t\t\tdec.setMaximumFractionDigits(2);\r\n\r\n\t\t\t\tstatsTable.addRow(stats.getId(), nodeName, nodeType, stats.getInvCount(),stats.getAvgTotTime(), stats.getMinTotTime(), stats.getMaxTotTime(), stats.getAvgExTime(),stats.getMinExTime(), stats.getMaxExTime());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tresultsTabbedPanel.setStatisticsData(statsTable);\r\n\t}", "public static Map<String, Integer> getFrequencies() {\n return UNIGRAM;\n }", "private String getMajorityClass(List<Instance> instances) {\r\n\r\n\t\tint[] counters = countClasses(instances);\r\n\r\n\t\tint max = 0;\r\n\t\tint index = 0;\r\n\t\tfor(int i = 0;i<counters.length;++i){\r\n\t\t\tif(max<counters[i]){\r\n\t\t\t\tmax=counters[i];\r\n\t\t\t\tindex = i;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn classes.get(index);\r\n\t}", "private void CreateFreq(Map<Integer, Integer> freqY, Map<Integer, Integer> freqCb, Map<Integer, Integer> freqCr) {\n for (int key : freqY.keySet()) {\n int aux = key;\n String auxs = Integer.toBinaryString(aux);\n FY.append(\"/\");\n FY.append(auxs);\n auxs = Integer.toBinaryString(freqY.get(key));\n FY.append(\"/\");\n FY.append(auxs);\n }\n\n for (int key : freqCb.keySet()) {\n int aux = key;\n String auxs = Integer.toBinaryString(aux);\n FCB.append(\"/\");\n FCB.append(auxs);\n auxs = Integer.toBinaryString(freqCb.get(key));\n FCB.append(\"/\");\n FCB.append(auxs);\n }\n\n for (int key : freqCr.keySet()) {\n int aux = key;\n String auxs = Integer.toBinaryString(aux);\n FCR.append(\"/\");\n FCR.append(auxs);\n auxs = Integer.toBinaryString(freqCr.get(key));\n FCR.append(\"/\");\n FCR.append(auxs);\n }\n FCR.append(\"/\");\n }", "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 }", "private void createRepeatNumberTagForCountFuncttion(XmlProcessor hqmfXmlProcessor, NamedNodeMap attributeMap,\n\t\t\tElement criteriaElement) {\n\t\tElement repeatNumberElement = hqmfXmlProcessor.getOriginalDoc().createElement(\"repeatNumber\");\n\t\tElement lowNode = hqmfXmlProcessor.getOriginalDoc().createElement(\"low\");\n\t\tElement highNode = hqmfXmlProcessor.getOriginalDoc().createElement(\"high\");\n\t\tif (attributeMap.getNamedItem(OPERATOR_TYPE) != null) {\n\t\t\tString operatorType = attributeMap.getNamedItem(OPERATOR_TYPE).getNodeValue();\n\t\t\tString quantity = attributeMap.getNamedItem(QUANTITY).getNodeValue();\n\t\t\tif (operatorType.startsWith(\"Greater Than\")) {\n\t\t\t\tlowNode.setAttribute(VALUE, quantity);\n\t\t\t\thighNode.setAttribute(NULL_FLAVOR, \"PINF\");\n\t\t\t\tif (\"Greater Than or Equal To\".equals(operatorType)) {\n\t\t\t\t\trepeatNumberElement.setAttribute(\"lowClosed\", TRUE);\n\t\t\t\t}\n\t\t\t} else if (\"Equal To\".equals(operatorType)) {\n\t\t\t\trepeatNumberElement.setAttribute(\"lowClosed\", TRUE);\n\t\t\t\trepeatNumberElement.setAttribute(\"highClosed\", TRUE);\n\t\t\t\tlowNode.setAttribute(VALUE, quantity);\n\t\t\t\thighNode.setAttribute(VALUE, quantity);\n\t\t\t} else if (operatorType.startsWith(\"Less Than\")) {\n\t\t\t\trepeatNumberElement.setAttribute(\"lowClosed\", TRUE);\n\t\t\t\tlowNode.setAttribute(VALUE, \"0\");\n\t\t\t\thighNode.setAttribute(VALUE, quantity);\n\t\t\t\tif (\"Less Than or Equal To\".equals(operatorType)) {\n\t\t\t\t\trepeatNumberElement.setAttribute(\"highClosed\", TRUE);\n\t\t\t\t}\n\t\t\t}\n\t\t\trepeatNumberElement.appendChild(lowNode);\n\t\t\trepeatNumberElement.appendChild(highNode);\n\t\t\tcriteriaElement.appendChild(repeatNumberElement);\n\t\t}\n\t}", "public long getFreq() {\n return freq;\n }", "public static List<MutFreqDetailRecord> create(List<MutationFrequency> freqList) {\n double maxFrequency = freqList.get(0).getFrequency();\n List<MutFreqDetailRecord> recordList = new ArrayList<MutFreqDetailRecord>(freqList.size());\n\n for (MutationFrequency freq : freqList) {\n long mutationIndex = freq.getMutation().getIndex();\n double rawFrequency = freq.getFrequency();\n double normFrequency = rawFrequency / maxFrequency;\n\n recordList.add(new MutFreqDetailRecord(mutationIndex, rawFrequency, normFrequency));\n }\n\n return recordList;\n }", "private static void fillMaxArray() {\n int maxIndex = 0;\n int maxCount = 0;\n for (int n = 0; n < LIMIT; n++) {\n if (COUNT[n] > maxCount) {\n maxIndex = n;\n maxCount = COUNT[n];\n }\n COUNT[n] = maxIndex;\n }\n //System.err.println(Arrays.toString(COUNT));\n }", "public synchronized static ComputeTermFrequencies createComputeAndPrintTermFrequency() \n\t{\n\t\treturn new ComputeTermFrequencies();\n\t}", "@ComputerMethod\n private Collection<QIOFrequency> getFrequencies() {\n return FrequencyType.QIO.getManagerWrapper().getPublicManager().getFrequencies();\n }", "public static void main(String[] args) {\n\t\tKingDataset king = KingDataset.instance();\r\n\t\tint interval=50;\r\n\t\tFrequencyTable table = new FrequencyTable(interval);\r\n\t\tfor (int i=0; i<10000; i++) {\r\n\t\t\tint point = king.next() / 2; // IMPORTANT - King is RTT\r\n\t\t\tSystem.out.print(point + \" \");\r\n\t\t\ttable.addDataPoint(point);\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tfor (int i=0; i<1000; i+=interval) {\r\n\t\t\tSystem.out.println(\"[\" + i + \"-\" + (i+interval) + \"[ : \" + table.getFrequency(i));\r\n\t\t}\r\n\t}", "private FrequencyConverter() {\n }", "public Integer getFrequency(Label prediction, Label real){\n\n\t\tint rowIx = resolveIndex(prediction);\n\t\tint colIx = resolveIndex(real);\n\n\n\t\treturn matrix.get(rowIx).get(colIx);\n\t}", "private void getFrequency(){\r\n try {\r\n BufferedReader reader = new BufferedReader(new FileReader(IConfig.FREQUENCY_PATH));\r\n String line;\r\n while((line = reader.readLine()) != null){\r\n frequency.put(line.split(\" \")[0], (Double.parseDouble(line.split(\" \")[1])/ IConfig.TOTAL_NEWS));\r\n }\r\n reader.close();\r\n }catch (Exception e){\r\n e.printStackTrace();\r\n }\r\n }", "public void setMiterLimit(float limit);", "public static Enumeration getUseCounts() \n {\n return frequency.elements();\n }", "List<Object> getCountExtent();", "public static void main(String[] args) {\n\n int response [] = {1, 2, 5, 4, 3, 5, 2, 1, 3, 3, 1, 4, 3, 3, 3, 1 ,2, 3, 3, 2, 2};\n int frequency []=new int [6];\n\n for(int counter = 1; counter < response.length; counter++)\n {\n try\n {\n ++frequency[response[counter]];\n }\n catch (ArrayIndexOutOfBoundsException e)\n {\n System.out.println(e);\n\n System.out.printf(\" response[%d] = %d\\n\", counter, response[counter]);\n }\n }\n\n System.out.printf(\"%s%10s\\n\", \"Rating\", \"Frequency\");\n\n for(int rating = 1; rating < frequency.length; rating++)\n System.out.printf(\"%5d%10d\\n\", rating, frequency[rating]);\n }", "int getScaleCount();", "static List<Extractor> byWidths(int... counts) {\n\t\t\treturn toList(IntStream.of(counts).mapToObj(Extractor::byWidth));\n\t\t}", "public static void main(String args[]) {\n int a = 0;\r\n int b = 0;\r\n int u = 0;\r\n\r\n //Declaring scanner object\r\n Scanner capture = new Scanner(System.in);\r\n System.out.println(\"How many input values [MAX: 30]?\");\r\n\r\n //Taking input\r\n int x = capture.nextInt();\r\n ArrayList<Integer> Digits = new ArrayList<>();\r\n System.out.println(\"Enter \" + x + \" numbers.\");\r\n\r\n //Declaring and initializing HashMap object\r\n HashMap<Integer, Integer> Occur = new HashMap<>();\r\n\r\n // Initialize Hashmap\r\n for(int i=0;i<10;i++){\r\n Occur.put(i,0);\r\n }\r\n\r\n\r\n\r\n\r\n int tmp = x;\r\n // Initialize ArrayList\r\n while(tmp>0){\r\n Digits.add(capture.nextInt());\r\n tmp--;\r\n }\r\n\r\n\r\n\r\n // ----------------------------\r\n while (b < x) {\r\n if (Occur.get(Digits.get(b)) != null) {\r\n int cnt = Occur.get(Digits.get(b)) + 1;\r\n Occur.put(Digits.get(b), cnt);\r\n }\r\n else {\r\n Occur.put(Digits.get(b), 1);\r\n }\r\n b++;\r\n }\r\n\r\n int height = 0;\r\n System.out.println(\"\\nNumber Occurrence\");\r\n\r\n height = 0;\r\n for(Map.Entry<Integer,Integer> entry : Occur.entrySet()){\r\n if(entry.getValue()>0){\r\n System.out.println(entry.getKey() + \" \" + entry.getValue());\r\n }\r\n if(entry.getValue()>height){\r\n height = entry.getValue();\r\n }\r\n }\r\n\r\n System.out.println(\"================= Vertical bar =================\");\r\n\r\n //Printing histogram\r\n int h = height;\r\n while ( h > 0) {\r\n\r\n System.out.print(\"| \"+h+\" | \");\r\n\r\n int g = 0;\r\n while (g < 10) {\r\n if(Occur.get(g) != null) {\r\n int kallen = Occur.get(g);\r\n if(kallen >= h)\r\n {\r\n System.out.print(\"* \");\r\n }\r\n else\r\n {\r\n System.out.print(\" \");\r\n }\r\n }\r\n else\r\n {\r\n System.out.print(\" \");\r\n }\r\n g++;\r\n }\r\n System.out.print(\"\\n\");\r\n h--;\r\n }\r\n System.out.println(\"================================================\");\r\n System.out.print(\"| N |\");\r\n while ( u < 10 ) {\r\n System.out.print(\" \"+ u );\r\n u++;\r\n }\r\n System.out.println(\"\\n================================================\");\r\n }", "boolean hasFreq();", "private static void printTable(int numberOfDocs) {\n \n Gson gs = new Gson();\n String json = gs.toJson(wor);\n // System.out.println(json);\n \n List<String> queryWords = new ArrayList();\n //to test it for other query word you can change the following two words\n //queryWords.add(\"carpet\");\n //queryWords.add(\"hous\");\n queryWords.add(\"the\");\n queryWords.add(\"crystallin\");\n queryWords.add(\"len\");\n queryWords.add(\"vertebr\");\n queryWords.add(\"includ\");\n \n \n FrequencySummary frequencySummary = new FrequencySummary();\n frequencySummary.getSummary(json,docName, queryWords);\n \n System.exit(0);\n \n Hashtable<Integer,Integer> g = new Hashtable<>();\n \n /* wor.entrySet().forEach((wordToDocument) -> {\n String currentWord = wordToDocument.getKey();\n Map<String, Integer> documentToWordCount = wordToDocument.getValue();\n freq.set(0);\n df.set(0);\n documentToWordCount.entrySet().forEach((documentToFrequency) -> {\n String document = documentToFrequency.getKey();\n Integer wordCount = documentToFrequency.getValue();\n freq.addAndGet(wordCount);\n System.out.println(\"Word \" + currentWord + \" found \" + wordCount +\n \" times in document \" + document);\n \n if(g.getOrDefault(currentWord.hashCode(), null)==null){\n g.put(currentWord.hashCode(),1);\n \n }else {\n System.out.println(\"Hello\");\n \n int i = g.get(currentWord.hashCode());\n System.out.println(\"i \"+i);\n g.put(currentWord.hashCode(), i++);\n }\n // System.out.println(currentWord+\" \"+ g.get(currentWord.hashCode()));\n // g.put(currentWord.hashCode(), g.getOrDefault(currentWord.hashCode(), 0)+wordCount);\n \n });\n // System.out.println(freq.doubleValue());\n \n // System.out.println(\"IDF for this word: \"+Math.log10( (double)(counter/freq.doubleValue())));\n });\n // System.out.println(g.get(\"plai\".hashCode()));\n //System.out.println(\"IDF for this word: \"+Math.log10( (double)(counter/(double)g.get(\"plai\".hashCode()))));\n */\n }", "static Map<Integer, Set<Integer>> dividersList(int max) {\n Map<Integer, Set<Integer>> resultMap = new TreeMap<>(); // implementacja nowej mapy, jako klucze ma Integery, jako wartosci sety integerów\n for (int i = 1; i < max; i++) {\n resultMap.put(i, getDividers(i)); // i jest kluczem, jako wartość przypisujemy jej dzielniki metodą get dividers\n\n }\n return resultMap;\n }", "public FreqLimits getFreqLimits(double nyquist, double windowLength) {\n double highpass = MiscParams.getInstance().getHighpassFrac() * nyquist;\n double highcut = MiscParams.getInstance().getHighCutFrac() * nyquist;\n\n double minfreq = prefs.getDouble(\"MIN_LOWPASS_FREQ\", 0.01);\n double tfactor = MiscParams.getInstance().getTfactor();\n double lowpass = Math.max(tfactor / windowLength, minfreq);\n double lowcut = MiscParams.getInstance().getLowCutFrac() * lowpass;\n return new FreqLimits(lowcut, lowpass, highpass, highcut);\n }", "public int getFrequency(){\n return this.frequency;\n }", "int getMetricValuesCount();", "public abstract double samplingFrequency();", "static String classificacao(ArrayList<Musica> musicas, Musica proxima, int k){\n String classeResultado = \"\";\n\n int qtdeMusicas = musicas.size();\n //System.out.println(\"Quantidade de musicas \" + qtdeMusicas);\n double distAmostra[] = new double[qtdeMusicas];\n int vetorOrdenado[] = new int[qtdeMusicas];\n\n for(int i=0; i<qtdeMusicas;i++){\n double dist = distancia(musicas.get(i), proxima);\n distAmostra[i] = dist; \n } \n System.out.println(\"ANTES\");\n for(int i = 0; i < distAmostra.length; i++){\n System.out.println(distAmostra[i]);\n }\n \n selectionSort(distAmostra,vetorOrdenado);\n \n System.out.println(\"DEPOIS\");\n for(int i = 0; i < distAmostra.length; i++){\n System.out.println(distAmostra[i]);\n }\n \n int contadorDeClasse[] = new int[6];\n int vizinhos = 0;\n for(int i=0; i < distAmostra.length; i++){\n if(vizinhos > k){\n break;\n }\n \n String classe = musicas.get(vetorOrdenado[i]).getClasse();\n //System.out.println(\"musica classe \" + classe); //Para Teste\n\n switch (classe) {\n case \"rap\":\n contadorDeClasse[0]++;\n break;\n case \"axe\":\n contadorDeClasse[1]++;\n break;\n case \"sertanejo\":\n contadorDeClasse[2]++;\n break;\n case \"samba\":\n contadorDeClasse[3]++;\n break;\n case \"forro\":\n contadorDeClasse[4]++;\n break;\n case \"bossa_nova\":\n contadorDeClasse[5]++;\n break; \n }\n vizinhos++;\n } \n /*\n for(int i = 0; i < contadorDeClasse.length; i++){\n System.out.println(contadorDeClasse[i]);\n }\n */\n int maior = 0;\n int indiceMaior = -1;\n for (int i = 0; i < contadorDeClasse.length; i++) {\n if (contadorDeClasse[i] > maior) {\n maior = contadorDeClasse[i];\n indiceMaior = i;\n }\n }\n \n switch (indiceMaior) {\n case 0:\n classeResultado = \"rap\";\n break;\n case 1:\n classeResultado = \"axe\";\n break;\n case 2:\n classeResultado = \"sertanejo\";\n break;\n case 3:\n classeResultado = \"samba\";\n break;\n case 4:\n classeResultado = \"forro\";\n break;\n case 5:\n classeResultado = \"bossa_nova\";\n break; \n }\n return classeResultado;\n }", "private static void findBigramCountsTuring() {\n\n\t\tbigramCountTI= new HashMap<Integer,Double>();\n\t\tdouble value;\n\t\tfor(int i:bucketCountT.keySet()){\n\t\t\tif(i==0)\n\t\t\t\tcontinue;\n\t\t\tvalue= ((i+1)*bucketCountT.getOrDefault(i+1, 0.0))/bucketCountT.get(i);\n\t\t\tbigramCountTI.put(i,value);\n\t\t}\n\t}", "public int getFreq() {\n return freq_;\n }", "public HitCounter() {\n q = new ArrayDeque();\n PERIOD = 300;\n }", "public void findFrequency(int size) {\r\n\t\tfor(i=0;i<size;i++) {\r\n\t\t\tfor (Entry en : dataEntries) {\t\t\r\n\t\t\t\ttemperature.add(en.getTemperature());\r\n\t\t\t\taches.add(en.getAches());\r\n\t\t\t\tcough.add(en.getCough());\r\n\t\t\t\tsoreThroat.add(en.getSoreThroat());\r\n\t\t\t\tdangerZone.add(en.getDangerZone());\r\n\t\t\t\thasCOVID19.add(en.getHasCOVID19());\r\n\t\t\t\t\r\n\t\t\t\tif (en.getHasCOVID19().equals(\"yes\")) {\r\n\t\t\t\t\ttemperatureIfCOVID19.add(en.getTemperature());\r\n\t\t\t\t\tachesIfCOVID19.add(en.getAches());\r\n\t\t\t\t\tcoughIfCOVID19.add(en.getCough());\r\n\t\t\t\t\tsoreThroatIfCOVID19.add(en.getSoreThroat());\r\n\t\t\t\t\tdangerZoneIfCOVID19.add(en.getDangerZone());\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public HitCounter() {\n q = new ArrayDeque();\n map = new HashMap();\n PERIOD = 300;\n hits = 0;\n }", "public FrequencyAnalysis()\n {\n }", "@Override\n\tpublic int showFrequency(String key) {\n\t\tint hashVal = hashFunc(key);\n\t\twhile (hashArray[hashVal] != null) {\n\t\t\tif (hashArray[hashVal].value.equals(key))\n\t\t\t\treturn hashArray[hashVal].frequency;\n\t\t\telse {\n\t\t\t\thashVal++;\n\t\t\t\thashVal = hashVal % size;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "public PageRankAnalyzer(ISet<Webpage> webpages, double decay, double epsilon, int limit) {\n // Step 1: Make a graph representing the 'internet'\n IDictionary<URI, ISet<URI>> graph = this.makeGraph(webpages);\n\n // Step 2: Use this graph to compute the page rank for each webpage\n this.pageRanks = this.makePageRanks(graph, decay, limit, epsilon);\n }", "public ScGridColumn<AcUspsInternationalSkeletonRouteOffer> newFrequencyColumn()\n {\n return newFrequencyColumn(\"Frequency\");\n }", "public void setFrequency(java.lang.Integer value) {\n this.frequency = value;\n }", "public DummyDataMaker(int entries)\n\t{\n\t\tint total = (entries < 1) ? 20 : entries;\n\n\t\tfor (int entry = 0; entry < total; entry++)\n\t\t{\n\t\t\tdevices.add(new Device());\n\t\t}\n\t}", "private void ReadFreq(char[] imagenaux) {\n if (imagenaux[29] == '/') iteradorFreq = 29;\n else iteradorFreq = 28;\n for (int x = 0; x < sizeY; ++x) {\n StringBuilder Key = new StringBuilder();\n StringBuilder Value = new StringBuilder();\n int n;\n int f;\n if (imagenaux[iteradorFreq] == '/') {\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Key.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Value.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n }\n if (Key.length() > 9) {\n //negativo\n String auxi = Key.toString();\n auxi = Utils.andOfString(auxi);\n n = Integer.parseInt(auxi, 2);\n ++n;\n n = -1 * n;\n } else {\n n = Integer.parseInt(Key.toString(), 2);\n }\n f = Integer.parseInt(Value.toString(), 2);\n FreqY.put(n, f);\n }\n\n for (int x = 0; x < sizeCB; ++x) {\n StringBuilder Key = new StringBuilder();\n StringBuilder Value = new StringBuilder();\n int n;\n int f;\n if (imagenaux[iteradorFreq] == '/') {\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Key.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Value.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n }\n if (Key.length() > 9) {\n //negativo\n String auxi = Key.toString();\n auxi = Utils.andOfString(auxi);\n n = Integer.parseInt(auxi, 2);\n ++n;\n n = -1 * n;\n } else {\n n = Integer.parseInt(Key.toString(), 2);\n }\n f = Integer.parseInt(Value.toString(), 2);\n FreqCB.put(n, f);\n }\n\n for (int x = 0; x < sizeCR; ++x) {\n StringBuilder Key = new StringBuilder();\n StringBuilder Value = new StringBuilder();\n int n;\n int f;\n if (imagenaux[iteradorFreq] == '/') {\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Key.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Value.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n }\n if (Key.length() > 9) {\n //negativo\n String auxi = Key.toString();\n auxi = Utils.andOfString(auxi);\n n = Integer.parseInt(auxi, 2);\n ++n;\n n = -1 * n;\n } else {\n n = Integer.parseInt(Key.toString(), 2);\n }\n f = Integer.parseInt(Value.toString(), 2);\n FreqCR.put(n, f);\n }\n }", "public DynamicTest generateSizeTest(int limit) {\n\t\t\tList<BigInteger> actual = FibonacciGenerator.fibonacciNumbers(limit);\n\t\t\treturn dynamicTest(\"size for limit = \" + limit, () -> {\n\t\t\t\tassertEquals(limit, actual.size());\n\t\t\t});\n\t\t}", "public static Quantile[] getQuantiles(ArrayList<StatisticClass> classes, float[] classMiddles, float[] relativeOccurences)\n\t\t\tthrows Exception\n\t{\n\t\tQuantile[] quantiles = new Quantile[6];\n\t\tquantiles[0] = new Quantile(-1f, 0.05f);\n\t\tquantiles[1] = new Quantile(-1f, 0.1f);\n\t\tquantiles[2] = new Quantile(-1f, 0.25f);\n\t\tquantiles[3] = new Quantile(-1f, 0.75f);\n\t\tquantiles[4] = new Quantile(-1f, 0.9f);\n\t\tquantiles[5] = new Quantile(-1f, 0.95f);\n\n\t\t// Für jedes gesuchte Quantil...\n\t\tfor (int i = 0; i < quantiles.length; i++)\n\t\t{\n\n\t\t\t// ...zunächst die Klasse finden, in der sich das Quantil befindet\n\t\t\t// (analog wie beim Median)\n\t\t\tfloat currentAlpha = quantiles[i].getAlpha();\n\n\t\t\t//Ri\n\t\t\tfloat currentRelativeShare = 0;\n\t\t\tfloat relativeShareBeforeHit = 0;\n\t\t\t\n\t\t\t//Alpha\n\t\t\tfloat threshholdRelativeShare = currentAlpha;\n\n\t\t\tint classIndexWithQuantile = -1;\n\n\t\t\t//Add the relative shares of the classes until their sum is bigger than the alpha threshhold. \n\t\t\t//The index of the class that was added lastly is the class in which the quantile lies.\n\t\t\tfor (int j = 0; j < relativeOccurences.length; j++)\n\t\t\t{\n\t\t\t\tcurrentRelativeShare += relativeOccurences[j];\n\n\t\t\t\tif (currentRelativeShare >= threshholdRelativeShare)\n\t\t\t\t{\n\t\t\t\t\tclassIndexWithQuantile = j;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\trelativeShareBeforeHit = currentRelativeShare;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check if a class has been found\n\t\t\tif (classIndexWithQuantile == -1)\n\t\t\t{\n\t\t\t\tthrow new Exception(\n\t\t\t\t\t\t\"Es konnte keine Klasse ermittelt werden, in dem das Quantil \" + threshholdRelativeShare + \" liegt\");\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Quantil \" + currentAlpha + \"liegt in Klasse: \" + classIndexWithQuantile + \" mit Rx:\" + currentRelativeShare);\n\t\t\tSystem.out.println(\"relativer Anteil der vorherigen Klasse: \" + relativeShareBeforeHit);\n\t\t\t\n\t\t\t// Calculate quantile\n\t\t\tfloat z1 = classes.get(classIndexWithQuantile).getLowerValue().value;\n\t\t\tfloat z2 = classes.get(classIndexWithQuantile).getUpperValue().value;\n\t\t\tfloat r1 = relativeShareBeforeHit;\n\t\t\tfloat r2 = currentRelativeShare;\n\t\t\tfloat result = z1 + ((currentAlpha - r1) / (r2 - r1)) * (z2 - z1);\n\n\t\t\tquantiles[i].setValue(result);\n\t\t}\n\n\t\treturn quantiles;\n\t}", "private CompetitiveRank[] createRankTiers(DIVISION division, int count) {\n CompetitiveRank[] ranks = new CompetitiveRank[count];\n for(int i = 0; i < ranks.length; i++) {\n ranks[i] = createRank(division, i + 1);\n }\n return ranks;\n }", "public abstract int getCntFtc();", "public void setCounts(Integer counts) {\n this.counts = counts;\n }", "@Override\n\tpublic Float getFrequency() {\n\t\treturn 3.8f;\n\t}", "private void extendTable() {\n\n FreqNode[] freqTable = frequencyTable;//create temp table\n numNodes = 0; //set nodes to 0 \n FreqNode tmpNode; //temp variable\n frequencyTable = new FreqNode[frequencyTable.length * 2];//doubles the size \n\n //for every element in the table \n for (FreqNode node : freqTable) {\n //set the node \n tmpNode = node;\n while (true) {\n //if the node currently has a value \n if (tmpNode == null) {\n break;\n }//else \n else {\n //place the key and value at the current position\n this.put(tmpNode.getKey(), tmpNode.getValue());\n tmpNode = tmpNode.getNext();\n }//end else\n }//end while \n }//end for \n }", "int fillCount();", "public int getFreq() {\n return freq_;\n }", "Limits limits();", "@Test\n public void testDFTOneFreq() {\n for (int freq = 0; freq < 1000; freq += 200) {\n SoundWave wave = new SoundWave(freq, 5, 0.5, 0.1);\n double maxFreq = wave.highAmplitudeFreqComponent();\n assertEquals(freq, maxFreq, 0.00001);\n }\n }", "public void setFrequencies(Set<Frequency> arg0) {\n \n }", "static void sortByFreq(int arr[], int n){\n Map<Integer, Integer> map = new HashMap<>(); \n List<Integer> outputArray = new ArrayList<>(); \n \n // Assign elements and their count in the list and map \n for (int current : arr) { \n int count = map.getOrDefault(current, 0); \n map.put(current, count + 1); \n outputArray.add(current); \n } \n \n // Compare the map by value \n SortComparator comp = new SortComparator(map); \n \n // Sort the map using Collections CLass \n Collections.sort(outputArray, comp); \n \n // Final Output \n for (Integer i : outputArray) { \n System.out.print(i + \" \"); \n }\n }", "public int getNumberOfClasses() {\n return 200;\n }", "public void createTotalTable() {\r\n totalTable = new HashMap<>();\r\n //create pair table\r\n\r\n //fill with values\r\n Play[] twenty = {Play.NONE, S, S, S, S, S, S, S, S, S, S, S};\r\n Play[] nineteen = {Play.NONE, S, S, S, S, S, S, S, S, S, S, S};\r\n Play[] eightteen = {Play.NONE, S, S, S, S, S, S, S, S, S, S, S};\r\n Play[] seventeen = {Play.NONE, S, S, S, S, S, S, S, S, S, S, S};\r\n Play[] sixteen = {Play.NONE, H, S, S, S, S, S, H, H, H, H, H};\r\n Play[] fifteen = {Play.NONE, H, S, S, S, S, S, H, H, H, H, H};\r\n Play[] fourteen = {Play.NONE, H, S, S, S, S, H, H, H, H, H, H};\r\n Play[] thirteen = {Play.NONE, H, S, S, S, S, H, H, H, H, H, H};\r\n Play[] twelve = {Play.NONE, H, H, H, S, S, S, H, H, H, H, H};\r\n Play[] eleven = {Play.NONE, H, D, D, D, D, D, D, D, D, D, H};\r\n Play[] ten = {Play.NONE, H, D, D, D, D, D, D, D, D, H, H};\r\n Play[] nine = {Play.NONE, H, H, D, D, D, D, H, H, H, H, H};\r\n Play[] eight = {Play.NONE, H, H, H, H, H, H, H, H, H, H, H};\r\n Play[] seven = {Play.NONE, H, H, H, H, H, H, H, H, H, H, H};\r\n Play[] six = {Play.NONE, H, H, H, H, H, H, H, H, H, H, H};\r\n Play[] five = {Play.NONE, H, H, H, H, H, H, H, H, H, H, H};\r\n\r\n totalTable.put(5, five);\r\n totalTable.put(6, six);\r\n totalTable.put(7, seven);\r\n totalTable.put(8, eight);\r\n totalTable.put(9, nine);\r\n totalTable.put(10, ten);\r\n totalTable.put(11, eleven);\r\n totalTable.put(12, twelve);\r\n totalTable.put(13, thirteen);\r\n totalTable.put(14, fourteen);\r\n totalTable.put(15, fifteen);\r\n totalTable.put(16, sixteen);\r\n totalTable.put(17, seventeen);\r\n totalTable.put(18, eightteen);\r\n totalTable.put(19, nineteen);\r\n totalTable.put(20, twenty);\r\n }", "public interface FrequencyStack {\n\n\t/**\n\t * Increases the frequency stored on stackHeight level of stack by value, if stackHeight is the\n\t * top of stack, or stackHeight is top of stack + 1\n\t * \n\t * @param stackHeight\n\t * describes the level of stack, counted from bottom on which the value is added\n\t * @param value\n\t * is the amount added\n\t */\n\tpublic void increaseFrequency(int stackHeight, int value);\n\n\t/**\n\t * This method deletes the heightTH element of stack.\n\t */\n\tpublic void popFrequency(int height);\n\n\t/**\n\t * Returns the frequency stored on height of stack.\n\t */\n\tpublic int getFrequency(int height);\n}", "public void setFrequency(String frequency)\n {\n this.frequency = frequency;\n }", "public void buildPriors() {\n\t\t// grab the list of all class labels for this fold\n\t\tList<List<String>> classListHolder = dc.getClassificationFold();\n\t\tint totalClasses = 0; // track ALL class occurrences for this fold\n\t\tint[] totalClassOccurrence = new int[classes.size()]; // track respective class occurrence\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tif (i == testingFold) {\n\t\t\t\tcontinue; // skip testing fold\n\t\t\t} else {\n\t\t\t\tcurrentFold = i;\n\t\t\t} // end if\n\n\t\t\t// grab the list of all classes for this current fold\n\t\t\tList<String> classList = classListHolder.get(currentFold);\n\t\t\t// track the total number of classes in this fold and their occurrences\n\t\t\ttotalClasses += classList.size();\n\t\t\t// for each class occurrence, match it to a class and track its occurrence\n\t\t\tfor (String className : classList) {\n\t\t\t\tfor (int j = 0; j < classes.size(); j++) {\n\t\t\t\t\tif (className.equals(classes.get(j))) {\n\t\t\t\t\t\ttotalClassOccurrence[j]++;\n\t\t\t\t\t} // end if\n\t\t\t\t} // end for\n\t\t\t} // end for\n\t\t} // end for\n\n\t\t// divide a particular class occurrence by total number of classes across training set\n\t\tfor (int i = 0; i < classPriors.length; i++) {\n\t\t\tclassPriors[i] = totalClassOccurrence[i] / totalClasses;\n\t\t} // end for\n\t}", "public Collection<ConceptClass> getConceptClasses(int limit) throws OEClientException {\r\n\t\tlogger.info(\"getConceptClasses entry\");\r\n\r\n\t\tMap<String, String> queryParameters = new HashMap<String, String>();\r\n\t\tqueryParameters.put(\"properties\", \"rdfs:label,rdfs:subClassOf\");\r\n\t\tqueryParameters.put(\"limit\", Integer.toString(limit));\r\n\t\tInvocation.Builder invocationBuilder = getInvocationBuilder(getModelURL() + \"/skos:Concept/meta:transitiveSubClass\", queryParameters);\r\n\r\n\t\tDate startDate = new Date();\r\n\t\tlogger.info(\"getConceptClasses making call : {}\", startDate.getTime());\r\n\t\tResponse response = invocationBuilder.get();\r\n\t\tlogger.info(\"getConceptClasses call complete: {}\", startDate.getTime());\r\n\r\n\t\tlogger.info(\"getConceptClasses - status: {}\", response.getStatus());\r\n\t\tif (response.getStatus() == 200) {\r\n\t\t\tString stringResponse = response.readEntity(String.class);\r\n\t\t\tif (logger.isInfoEnabled()) logger.info(\"getConceptClasses: jsonResponse {}\", stringResponse);\r\n\t\t\tJsonObject jsonResponse = JSON.parse(stringResponse);\r\n\t\t\tJsonArray jsonArray = jsonResponse.get(\"@graph\").getAsArray();\r\n\t\t\tCollection<ConceptClass> conceptClasses = new HashSet<ConceptClass>();\r\n\t\t\tIterator<JsonValue> jsonValueIterator = jsonArray.iterator();\r\n\t\t\twhile (jsonValueIterator.hasNext()) {\r\n\t\t\t\tconceptClasses.add(new ConceptClass(this, jsonValueIterator.next().getAsObject()));\r\n\t\t\t}\r\n\t\t\treturn conceptClasses;\r\n\t\t} else {\r\n\t\t\tthrow new OEClientException(String.format(\"Error(%d) %s from server\", response.getStatus(), response.getStatusInfo().toString()));\r\n\t\t}\r\n\t}", "public void realocareThreadsDistribution(){\n for(int i=1;i<=nrThreads;i++){\n if(listofIntervalsForEachThread[i] == null)\n listofIntervalsForEachThread[i] = new IntervalClass();\n this.listofIntervalsForEachThread[i].setStart(0);\n this.listofIntervalsForEachThread[i].setEnd(0);\n }\n if(this.nrThreads>=this.borderArray.size())\n for(int i=0;i<this.borderArray.size();i++){\n this.listofIntervalsForEachThread[i+1].setStart(i);\n this.listofIntervalsForEachThread[i+1].setEnd(i);\n }\n else{\n int nrForEachThread = this.borderArray.size()/nrThreads;\n int difSurplus = this.borderArray.size()%nrThreads;\n int difRate;\n int lastAdded = 0;\n for(int i=1;i<=this.nrThreads;i++){\n if(difSurplus > 0){\n difRate = 1;\n difSurplus--;\n }\n else difRate = 0;\n \n this.listofIntervalsForEachThread[i].setStart(lastAdded);\n lastAdded = lastAdded + difRate + nrForEachThread - 1;\n this.listofIntervalsForEachThread[i].setEnd(lastAdded);\n lastAdded++;\n }\n }\n }", "public int getFrequency()\n {\n return this.frequency;\n }" ]
[ "0.5345603", "0.5286419", "0.5053574", "0.5015216", "0.49946636", "0.48999748", "0.48054776", "0.47508785", "0.47360462", "0.46986678", "0.468815", "0.4686846", "0.46852574", "0.46802115", "0.46319947", "0.46315908", "0.46284148", "0.45766985", "0.45635036", "0.45368052", "0.45341074", "0.45304686", "0.45045936", "0.450146", "0.44819778", "0.44807482", "0.44735542", "0.44435397", "0.44417128", "0.44395146", "0.44277135", "0.44237518", "0.44181782", "0.44181782", "0.44078895", "0.4382496", "0.43821", "0.43618226", "0.4359514", "0.4356287", "0.4350269", "0.4337719", "0.43336695", "0.43335456", "0.43282908", "0.43218803", "0.43181193", "0.43138522", "0.43033746", "0.43022183", "0.42878553", "0.42871624", "0.4283019", "0.42800486", "0.4276787", "0.4276082", "0.4275245", "0.42729944", "0.42723557", "0.4263061", "0.42542213", "0.4253662", "0.42534816", "0.4251227", "0.42485413", "0.4248211", "0.4241151", "0.4234813", "0.42344788", "0.42340997", "0.423005", "0.4227599", "0.42235133", "0.4219476", "0.4218852", "0.4214119", "0.42083967", "0.42078397", "0.41994998", "0.4199343", "0.41933823", "0.41891402", "0.4188211", "0.41835055", "0.41823247", "0.41818768", "0.41769135", "0.41747895", "0.41738385", "0.41667444", "0.41643178", "0.41595852", "0.4158274", "0.4158032", "0.41539472", "0.41481477", "0.41479036", "0.4146478", "0.41405421", "0.41374442" ]
0.5853402
0
Reads a frequency table (histogram) from disk. The source file is expected to be a CSVfile in the format: value;frequency[;other data; is discarded;...] The lowest value is on the first row, the highest on the last!
public static Histogram readFrequencyTable(String fileName) { List<String[]> data = FileUtils.readCSVFile(fileName, ";", -1); double classWidth = Double.parseDouble(data.get(1)[0]) - Double.parseDouble(data.get(0)[0]); double start = Double.parseDouble(data.get(0)[0]) - classWidth / 2.0; double stop = Double.parseDouble(data.get(data.size() - 1)[0]) + classWidth / 2.0; Histogram table = new Histogram(start, stop, (int) ((stop - start) / classWidth)); for (String[] row : data) { int frequency = (int) Double.parseDouble(row[1]); double value = Double.parseDouble(row[0]); for (int i = 0; i < frequency; i++) { table.add(value); } } return table; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void loadAllCountData(){\n // load from csv\n try{\n FileReader file = new FileReader(\"/home/ubuntu/user_counts_small.csv\");\n //FileReader file = new FileReader(\"/Users/YHWH/Desktop/cloud computing/team project/user_counts.csv\");\n BufferedReader buff = new BufferedReader(file);\n String line = \"\";\n boolean eof = false;\n\n while(!eof){\n line = buff.readLine();\n if(line == null){\n eof = true;\n }\n else{\n String[] data = line.split(\"\\t\"); //0->id, 1->selfCount, 2->prevCount\n wholeCountData.put(data[0], Integer.parseInt(data[2]));\n }\n }\n buff.close();\n }\n catch(IOException e){\n e.printStackTrace();\n }\n }", "private void getFrequency(){\r\n try {\r\n BufferedReader reader = new BufferedReader(new FileReader(IConfig.FREQUENCY_PATH));\r\n String line;\r\n while((line = reader.readLine()) != null){\r\n frequency.put(line.split(\" \")[0], (Double.parseDouble(line.split(\" \")[1])/ IConfig.TOTAL_NEWS));\r\n }\r\n reader.close();\r\n }catch (Exception e){\r\n e.printStackTrace();\r\n }\r\n }", "@Override\n protected void read(){\n try(BufferedReader bufferedReader = new BufferedReader(new FileReader(getPath()));) {\n\n String frequencyString;\n\n String frequencyFileFormat = \"([a-z]\\\\s\\\\d+\\\\.\\\\d+)\";\n Pattern pattern = Pattern.compile(frequencyFileFormat);\n Matcher matcher;\n\n String[] frequency;\n\n // Read in each line of the frequencies file\n while ((frequencyString = bufferedReader.readLine()) != null) {\n // Match the frequency format to a individual frequency\n matcher = pattern.matcher(frequencyString);\n if(matcher.find()){\n\n // Split the string into the character and its frequency\n frequency = matcher.group(1).split(\" \");\n\n // Add the string and its corresponding frequency to the frequencies hash map\n frequencies.put(frequency[0], Double.parseDouble(frequency[1]));\n \n }\n }\n\n // Only set to true if it successfully reads the whole file\n setFileRead();\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n }\n catch(IOException e){\n e.printStackTrace();\n }\n }", "private void readFromFile() {\n\t\tPath filePath = Paths.get(inputFile);\n\n\t\ttry (BufferedReader reader = Files.newBufferedReader(filePath,\n\t\t\t\tCharset.forName(\"UTF-8\"));) {\n\t\t\tString line = null;\n\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tString[] splitLine = line.split(\",\");\n\t\t\t\tcurrentGen.setValue(Integer.parseInt(splitLine[0]),\n\t\t\t\t\t\tInteger.parseInt(splitLine[1]), true);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not find file provided.\");\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\n\t\tString fname;\n\t\tFile file;\n\t\tScanner keyboard = new Scanner(System.in);\n\t\tScanner inFile;\n\n\t\tString line, word;\n\t\tStringTokenizer token;\n\t\tint[] freqTable = new int[256];\n\n\t\tSystem.out.println (\"Enter the complete path of the file to read from: \");\n\n\t\tfname = keyboard.nextLine();\n\t\tfile = new File(fname);\n\t\tinFile = new Scanner(file);\n\n\t\twhile (inFile.hasNext()) {\n\t\t\tline = inFile.nextLine();\n\t\t\ttoken = new StringTokenizer(line, \" \");\n\t\t\twhile (token.hasMoreTokens()) {\n\t\t\t\tword = token.nextToken();\n\t\t\t\tfreqTable = updateFrequencyTable(freqTable, word);\n\t\t\t}\n\t\t}\n\n\t\t//print frequency table\n\n\t\tSystem.out.println(\"Table of frequencies\");\n\t\tSystem.out.println(\"Character \\t Frequency \\n\");\n\n\t\tfor(int i=0; i<256; i++) {\n\t\t\tif (freqTable[i]>0)\n\t\t\t\tSystem.out.println(((char)i) + \"\\t\" + freqTable[i]);\n\t\t\t}\n\n\t\tQueue<BinaryTree<Pair>> S = buildQueue(freqTable);\n\n\t\tQueue<BinaryTree<Pair>> T = new Queue<BinaryTree<Pair>>();\n\n\t\tBinaryTree<Pair> huffmanTree = createTree(S, T);\n\n\t\tString[] encodingTable = findEncoding(huffmanTree);\n\n\t\tSystem.out.println(\"Encoding Table\");\n\t\tfor(int i=0; i<256; i++) {\n\t\t\tif (encodingTable[i]!=null)\n\t\t\t\tSystem.out.println(((char)i) + \"\\t\" + encodingTable[i]);\n\t\t}\n\t\tinFile.close();\n\t}", "public static String ReadCSV() {\n File file = new File(\"Words.csv\");\n System.out.println(\"*****Program Started***** \" + Time.valueOf(LocalTime.now()));\n\n try {\n FileReader fRead = new FileReader(file);\n BufferedReader bfr = new BufferedReader(fRead);\n String line;\n line = bfr.readLine();\n line = line.replace(\"\\\"\", \"\");\n\n\n words = line.split(\",\");\n int count = 0;\n\n/** Next, read each line of numbers and put them into an Integer array.\n *\t\t\t Finally, store them in a hashmap (genre and related int array)and return\n */\n\n while ((line = bfr.readLine()) != null) {\n String[] temp = line.split(\",\");\n int[] wordCount = new int[words.length];\n for (int i = 0; i < temp.length; i++) {\n\n wordCount[i] = Integer.parseInt(temp[i]);\n }\n\n /**\n * Other than taking the count, we normalize them to improve the accuracy\n * */\n\n double[] temp2 = new double[wordCount.length];\n double total = 0;\n for (int i = 0; i < temp2.length; i++) {\n for (int j = 0; j < temp2.length; j++) {\n total = total + wordCount[j];\n }\n temp2[i] = 100.0 * wordCount[i] / total;\n\n }\n\n hMap.put(genres[count], temp2);\n count++;\n\n }\n System.out.println(\"*****Matrix Created successfully.***** \" + Time.valueOf(LocalTime.now()));\n return \"OK\";\n\n } catch (IOException e) {\n System.out.println(\"*****Creating matrix failed*****\");\n return \"END\";\n }\n }", "public void buildHuffmanList(File inputFile){\n try{\n Scanner sc = new Scanner(inputFile);\n while(sc.hasNextLine()){\n\n String line = sc.nextLine();\n for(int i =0;i<line.length();i++){\n \n if(freqTable.isEmpty())\n freqTable.put(line.charAt(i),1);\n else{\n if(freqTable.containsKey(line.charAt(i)) == false)\n freqTable.put(line.charAt(i),1);\n else{\n int oldValue = freqTable.get(line.charAt(i));\n freqTable.replace(line.charAt(i),oldValue+1);\n }\n }\n }\n }\n }\n catch(FileNotFoundException e){\n System.out.println(\"Can't find the file\");\n }\n }", "public void readTable() {\r\n\r\n try ( BufferedReader b = new BufferedReader(new FileReader(\"Hashdata.txt\"))) {\r\n\r\n String line;\r\n ArrayList<String> arr = new ArrayList<>();\r\n while ((line = b.readLine()) != null) {\r\n\r\n arr.add(line);\r\n }\r\n\r\n for (String str : arr) {\r\n this.load(str);\r\n }\r\n this.print();\r\n\r\n } catch (IOException e) {\r\n System.out.println(\"Unable to read file\");\r\n }\r\n\r\n this.userInterface();\r\n\r\n }", "private static void fillTableFromFile(HashTable table) {\n Scanner in;\n try {\n in = new Scanner(new FileInputStream(\"File.txt\"));\n } catch (FileNotFoundException e) {\n System.out.println(\"File 'File.txt' not found\");\n return;\n }\n while (in.hasNext()) {\n table.add(in.next());\n }\n }", "public static List<String> loadFGHistogram(String histFile) {\n\t\tList<String> histList = new ArrayList<String>();\n\t\t\n\t\ttry {\n\t\t\tBufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(new File(histFile))));\n\t\t\tString line = bufferedReader.readLine();\n\t\t\tboolean secondPart = false;\n\t\t\twhile (line != null && !line.equalsIgnoreCase(\"\") && !secondPart) {\n\t\t\t\tline = bufferedReader.readLine();\n\t\t\t\tif (line == null || line.equalsIgnoreCase(\"\") && !secondPart) {\n\t\t\t\t\tsecondPart = true;\n\t\t\t\t\tline = bufferedReader.readLine();\n\t\t\t\t\twhile (line != null && !line.equalsIgnoreCase(\"\")) {\n\t\t\t\t\t\tBigDecimal lb = new BigDecimal(line.split(\"\\t\")[0].split(\",\")[1]);\n\t\t\t\t\t\tBigDecimal ub = new BigDecimal(line.split(\"\\t\")[0].split(\",\")[2]);\n\t\t\t\t\t\thistList.add(lb.toString() + \"_\" + line.split(\"\\t\")[1]);\n\t\t\t\t\t\tline = bufferedReader.readLine();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbufferedReader.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\t\n\t\treturn histList;\n\t}", "public static HashMap<String, IRI> processCSVGoTHash(String path) throws FileNotFoundException {\n BufferedReader in = null;\n in = new java.io.BufferedReader(new java.io.FileReader(path));\n String currentLine;\n int lineN = 0;\n String value=\"\";\n String term=\"\";\n HashMap<String, IRI> got = new HashMap<String, IRI>();\n try {\n while ((currentLine = in.readLine()) != null) {\n if (lineN == 0) {\n lineN++; //get rid of the headers\n } else {\n //process each vocab\n String[] info = currentLine.split(\";\");\n if(info.length==2) {\n value = info[0];\n term = info[1];\n }\n got.put(value, IRI.create(term));\n\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n try {\n in.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return got ;\n }", "public static List<String> loadBGHistogram(String histFile) {\n\t\tList<String> histList = new ArrayList<String>();\n\t\t\n\t\ttry {\n\t\t\tBufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(new File(histFile))));\n\t\t\tString line = bufferedReader.readLine();\n\t\t\t\n\t\t\twhile (line != null && !line.equalsIgnoreCase(\"\")) {\n\t\t\t\tBigDecimal lb = new BigDecimal(line.split(\"\\t\")[0].split(\",\")[1]);\n\t\t\t\tBigDecimal ub = new BigDecimal(line.split(\"\\t\")[0].split(\",\")[2]);\n\t\t\t\thistList.add(lb.toString() + \"_\" + line.split(\"\\t\")[1]);\n\t\t\t\tline = bufferedReader.readLine();\n\t\t\t}\n\t\t\tbufferedReader.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\t\n\t\treturn histList;\n\t}", "public static void main(String[] args) throws IOException {\n ArgParser argParser = new ArgParser(\"Table\");\n argParser.addOption(\"header\", Boolean.class);\n argParser.addOption(\"digits\", Integer.class);\n argParser.addOption(\"out-file\", String.class);\n args = argParser.parseArgs(args, 1, 1);\n\n // If the user asks us to round to a digit after the decimal place, we\n // multiply by a power of 10 so that rounding integers after scaling is the\n // same as rounding at the desired decimal place. (We scale back below.)\n int digits = argParser.hasOption(\"digits\") ?\n argParser.getIntegerOption(\"digits\") : 0;\n final double scale = Math.pow(10, digits);\n\n CsvParser csvParser = new CsvParser(args[0]);\n String[] header = null;\n if (argParser.hasOption(\"header\")) {\n assert csvParser.hasNext();\n header = csvParser.next();\n }\n\n // Read the table from the CSV.\n List<double[]> table = new ArrayList<double[]>();\n while (csvParser.hasNext()) {\n table.add(Arrays.asList(csvParser.next()).stream()\n .mapToDouble(s -> scale * Double.parseDouble(s)).toArray());\n if (table.size() > 2) {\n assert table.get(table.size()-2).length ==\n table.get(table.size()-1).length;\n }\n }\n\n roundTable(table);\n\n // Output the rounded tables.\n PrintStream output = !argParser.hasOption(\"out-file\") ? System.out :\n new PrintStream(new FileOutputStream(\n argParser.getStringOption(\"out-file\")));\n if (header != null)\n writeRow(output, header); // echo the header to the output\n for (double[] vals : table) {\n writeRow(output,\n DoubleStream.of(vals).map(v -> v / scale).toArray(), digits);\n }\n }", "public void loadData(HistogramDataSet dataSet);", "private static void fillDataMapFromFrequencyFile(File frequencyFile, HashMap<String, Long> dataMap) throws IOException {\n\n\t\tfinal BufferedReader frequencyReader = new BufferedReader(new FileReader(frequencyFile));\n\n\t\tList<String> lines = frequencyReader.lines()\n\t\t\t\t.collect(Collectors.toList());\n\n\t\tfrequencyReader.close();\n\n\t\tfor(int i = 0, size = lines.size(); i < size; i++) { // Split each line at the delimiter, into word & frequency - put them in the data map\n\n\t\t\tfinal String[] dataSplit = lines.get(i).split(WORD_FREQUENCY_DELIMITER);\n\t\t\tfinal String word = dataSplit[0];\n\t\t\tfinal long frequency = Long.parseLong(dataSplit[1]);\n\n\t\t\tdataMap.put(word, frequency);\n\t\t}\n\t}", "public static Histogram createFrequencyTable(List<Double> values, double classWidth, double start,\r\n double stop) {\r\n Histogram histogram = new Histogram(start, stop, (int) ((stop - start) / classWidth));\r\n for (Double value : values) {\r\n histogram.add(value);\r\n }\r\n assert histogram.getSumFreq() == values.size() : \"Number of items in bins does not correspond with total number of items\";\r\n \r\n return histogram;\r\n }", "public static Frequency parse(String line) {\n\n double value = -1;\n Unit unit = null;\n Frequency freq = null;\n\n try {\n Scanner s = new Scanner(line);\n s.useDelimiter(\"[\\\\p{Lower}\\\\p{Upper}\\\\p{javaWhitespace}]\");\n\n value = s.nextDouble();\n\n s.reset();\n s.useDelimiter(\"[\\\\p{Digit}\\\\p{Punct}\\\\p{javaWhitespace}]\");\n\n long multiplier = Unit.HZ.getMagnitude();\n String unitString = \"\";\n\n if(s.hasNext()) {\n unitString = s.next();\n unit = Unit.parse(unitString);\n multiplier = unit.getMagnitude();\n }\n\n if(s.hasNext()) {\n throw new IllegalArgumentException(\n String.format(\"Invalid Frequency Format: %s\", line));\n }\n\n freq = new Frequency((long)(value * multiplier), unit);\n freq.originalString = line;\n }\n catch(Exception e) {\n throw new IllegalArgumentException(\"Error parsing: \" + line);\n }\n\n return freq;\n }", "private int[] readCharacterFrequency(BitInputStream in) throws IOException {\r\n int[] freq = new int[n];\r\n for(int i = 0; i < n; i++){\r\n freq[i] = in.readInt();\r\n }\r\n return freq;\r\n }", "public void analyzeHourlyData()\n {\n while(reader.hasNext()) {\n LogEntry entry = reader.next();\n int hour = entry.getHour();\n hourCounts[hour]++;\n }\n }", "private static Hashtable<Integer, ScoreCount<Integer>> deserializeHastableIntScoreCount(String path) {\n\t\tHashtable<Integer, ScoreCount<Integer>> result = null;\n\n\t\tFileInputStream file = ExceptHandler.createFileInputStream(path);\n\t\tObjectInputStream objStream = ExceptHandler.createObjectInputStream(file);\n\t\tresult = readHashtableObject(objStream);\n\n\t\treturn result;\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n\t\tscanner = new Scanner(new File(\"digit_data/test.csv\"));\n scanner.useDelimiter(\",\");\n scanner.nextLine();\n // Transforms the values on the csv from strings to ints\n\t\tnew drawnum().go();\n\t}", "public static void main(String[] args) {\n HistogramGenerator h = new HistogramGenerator();\n if (args.length != 1) {\n System.err.println(\"Invalid number of arguments given!\\n\" +\n \"Expected only one: the filepath of the grades file \");\n System.exit(1);\n }\n int[] grades = h.scanGrades(args[0]);\n int[] frequencies = h.countGrades(grades);\n h.generateChart(frequencies);\n }", "public void Read_Csv() {\n\t\t\n\t\tFile file = new File(\"Faucets.csv\");\n\t\tif(file.exists() == false) {\n\t\t\ttry {\n\t\t\t\t if (file.createNewFile()) {\n\t\t\t\t System.out.println(\"File created: \" + file.getName());\n\t\t\t\t } else {\n\t\t\t\t System.out.println(\"File already exists... Error\");\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\tFileWriter myWriter = new FileWriter(\"Faucets.csv\");\n\t\t\t\tmyWriter.write(\"Freebitco.in,3600,228,\");\n\t\t\t\tmyWriter.close();\n\t\t\t\t\n\t\t\t\t\n\t\t\t}catch (IOException e) {\n\t\t\t\tSystem.out.println(\"Error\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//Reading the file\n\t\tString line = null;\n\t\ttry {\n\t\t\tFileReader fileReader = new FileReader(\"Faucets.csv\");\n\t\t\tBufferedReader bufferedReader = new BufferedReader(fileReader);\n\t\t\t\n\t\t\tint x = 0;\n\t\t\tint commacounter = 0;\n\t\t\tint commaposition[] = new int[3];\n\t\t\twhile((line = bufferedReader.readLine()) != null) {\n\t\t\t\t\n\t\t\t\twhile(x < line.length()) {\n\t\t\t\t\t\n\t\t\t\t\tif(line.charAt(x) == ',') {\n\t\t\t\t\t\tcommaposition[commacounter] = x;\n\t\t\t\t\t\tcommacounter +=1;\n\t\t\t\t\t}\n\t\t\t\t\tif(commacounter == 3) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tFaucets.site[amount_counter] = line.substring(0, commaposition[0]);\n\t\t\t\t\t\tFaucets.time[amount_counter] = Integer.parseInt(line.substring(commaposition[0]+1, commaposition[1]));\n\t\t\t\t\t\tFaucets.amount[amount_counter] = Integer.parseInt(line.substring(commaposition[1]+1, commaposition[2]));\n\t\t\t\t\t\tamount_counter += 1;\n\t\t\t\t\t\tcommacounter=0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tx+=1;\n\t\t\t\t}\n\t\t\t\tx=0;\n\t\t\t}\n\t\t\tbufferedReader.close();\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t\n\t\n\t\t\t\n\t}", "float getFrequency();", "public void writeLengthHistogram(String fileName) {\n\t\tString contents = \"Length,Frequency\\n\";\n\t\tint literalLength = 0;\n\t\tint frequency = 0;\n\t\tfor(String literal : literalsList) {\n\n\t\t\tliteral = literal.substring(literal.indexOf(\"\\\"\")+1, literal.lastIndexOf(\"\\\"\"));\n\t\t\t\n\t\t\tif(literal.length() == literalLength) {\n\t\t\t\tfrequency++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcontents += Integer.toString(literalLength) + \",\" + \n\t\t\t\t\t\t\tInteger.toString(frequency) + \"\\n\";\n\t\t\t\tfrequency = 1;\n\t\t\t\tliteralLength = literal.length();\n\t\t\t}\n\t\t}\n\t\tFileManager.writeToFile(fileName, contents);\n\t}", "private void parseAvailableFrequencies(){\n\t\tString str = parser.readFile(FREQ_AVAILABLE, 256);\n\t\tif(str == null)\n\t\t\treturn;\n\t\t\n\t\tString[] frestrs = str.split(\" \");\n\t\tint[] freqs = new int[frestrs.length - 1];\n\t\tfor(int i = 0; i < freqs.length; i++)\n\t\t\tfreqs[i] = Integer.valueOf(frestrs[i]);\n\t\t\n\t\tcpuFrequencies = freqs;\n\t}", "public void read_file(String filename ,int storage_level){\n input=sqlContext.read()\r\n .format(\"com.databricks.spark.csv\")\r\n .option(\"header\",\"true\")\r\n .option(\"inferSchema\",\"true\")\r\n .load(filename);\r\n\r\n input.saveAsTable(\"crimeData\");\r\n cache_data(storage_level);\r\n }", "public void input(File inputFile){\n instantiateTable();\n try{\n String line = \"\";\n //method to scan certain words between 2 delimiting characters, usually blank lines or white spaces or tabs.\n Scanner read = new Scanner(inputFile).useDelimiter(\"\\\\W+|\\\\n|\\\\r|\\\\t|, \");\n //while there is a next word, keeps reading the file \n while (read.hasNext()){\n line = read.next().toLowerCase();\n LLNodeHash words = new LLNodeHash(line, 1, null);\n add(words);\n }\n read.close();\n }\n catch (FileNotFoundException e){\n System.out.print(\"Not found\");\n e.printStackTrace();\n }\n System.out.println(hashTable.length);\n System.out.println(space());\n System.out.println(loadFactor);\n System.out.println(collisionLength());\n print();\n }", "int getFreq();", "public static void processGradesFromFile(\n String filename, String separator, String displayMode)\n throws Exception {\n // TODO implement me!\n String table = \"\";\n int[] histArray = new int[10];\n File file = new File(filename);\n Scanner scan = new Scanner(file);\n int i = 0;\n while (scan.hasNext()) {\n String line = scan.nextLine();\n String[] array = line.split(separator);\n String newstr = String.format(\"%-10s %3s%n\", array[0].trim(),\n array[1].trim());\n table += newstr;\n i++;\n int score = Integer.parseInt(array[1].trim());\n int num = 9 - (score - 1) / 10;\n histArray[num] += 1;\n }\n if (displayMode.equals(\"TABLE\") || displayMode.equals(\"BOTH\")) {\n System.out.print(table);\n }\n if (displayMode.equals(\"HIST\") || displayMode.equals(\"BOTH\")) {\n for (int index = 0; index < histArray.length; index++) {\n int initNum = (9 - index) * 10 + 1;\n int finalNum = initNum + 9;\n int numOfSqrs = histArray[index];\n String firstPart = String.format(\"%2d-%3d | \", initNum,\n finalNum);\n String secondPart = \"\";\n for (int j = 0; j < numOfSqrs; j++) {\n secondPart += \"[]\";\n }\n System.out.println(firstPart + secondPart);\n }\n }\n }", "public Sample load(BufferedReader r) throws IOException {\n\tString line = r.readLine();\n\tif (line==null || !line.startsWith(\"HEADER:\"))\n\t throw new WrongFiletypeException(); // no HEADER: found\n\n\t// new sample, with given filename\n\tSample s = new Sample();\n\n\t// don't know end, yet\n\tYear end = null;\n\tint length = -1;\n\n\t// metadata\n\tfor (;;) {\n\t // read a line\n\t line = r.readLine();\n\n\t // got to data, stop\n\t if (line.startsWith(\"DATA:\"))\n\t\tbreak;\n\n\t // parse line as \"variable = value\", and put into s.meta\n\t int i = line.indexOf(\"=\");\n\t if (i == -1)\n\t\tthrow new WrongFiletypeException();\n\t String tag = line.substring(0, i);\n\t String value = line.substring(i+1);\n\n\t // got end-date.\n\t if (tag.equals(\"DateEnd\"))\n\t\tend = new Year(value);\n\t \n\t if (tag.equals(\"Length\"))\n\t \tlength = Integer.parseInt(value);\n\n\t // WRITE ME: parse other tags and interpret metadata as\n\t // intelligently as possible\n\t}\n\n\ts.count = new ArrayList();\n\ts.incr = new ArrayList();\n\ts.decr = new ArrayList();\n\n\t// data -- i'll assume all data is (width,count,up,down)\n\tStreamTokenizer t = new StreamTokenizer(r);\n\tint idx = 0;\n\t\n\tfor (;;) {\n\t // parse (datum, count, up, dn)\n\t\tint datum, count, up, dn;\n\t\ttry {\n\t\t\t\tt.nextToken();\n\t\t\t\tdatum = (int) t.nval;\n\t\t\t\tt.nextToken();\n\t\t\t\tcount = (int) t.nval;\n\t\t\t\tt.nextToken();\n\t\t\t\tup = (int) t.nval;\n\t\t\t\tt.nextToken();\n\t\t\t\tdn = (int) t.nval;\n\t\t} catch (IOException ioe) {\n\t\t\tthrow new WrongFiletypeException();\n\t\t}\n\n\t // (0,0,0,0) seems to mean end-of-sample\n\t if (datum == 0)\n\t \tbreak;\n\n\t // add to lists\n\t s.data.add(new Integer(datum));\n\t s.count.add(new Integer(count));\n\t s.incr.add(new Integer(up));\n\t s.decr.add(new Integer(dn));\n\t \n\t idx++;\n\t \n\t // break out if we have 'length' samples\n\t if(idx == length)\n\t \tbreak;\n\t}\n\n\t// no end? die.\n\tif (end == null)\n\t throw new WrongFiletypeException();\n\n\t// set range, and return\n\ts.range = new Range(end.add(1 - s.data.size()), end);\n\treturn s;\n }", "public static TreeHistogram<String> readNGramsFromFile(String filename) throws IOException {\n BufferedReader reader = new BufferedReader(new FileReader(filename));\n TreeHistogram<String> histogram = new TreeHistogram<>();\n String line = null;\n while(reader.ready()) {\n line = reader.readLine();\n histogram.insert(line, 1);\n }\n return histogram;\n }", "public void generateSurfacePercentages(String csvName, String fileName, int distanceBin, int timeBin) {\n Scanner csv = null;\n try {\n csv = new Scanner(new File(csvName)); //csv of answer list\n FileWriter writer = new FileWriter(fileName + \".txt\");\n ArrayList<SaTrajectory> traj = new ArrayList<SaTrajectory>();\n csv.nextLine();\n int dbi = 1; //distance bin index\n int tbi = 1; //time bin index\n double dist, ts;\n int answer;\n String id;\n while (csv.hasNextLine()) { //go through each answer entry and add trajectories of the answer list for each unique device id\n String[] line = csv.nextLine().split(\",\");\n dist = Double.parseDouble(line[0]);\n ts = Double.parseDouble(line[1]);\n //System.out.println(ts);\n id = line[3];\n answer = Integer.parseInt(line[2]);\n dbi = (int) (Math.floor(dist / (double) (distanceBin)));\n tbi = (int) (Math.floor(ts / (double) (timeBin)));\n traj.add(new SaTrajectory(dist, id, ts, answer, dbi, tbi));\n }\n\n double minTime = findMinTime(traj);\n //System.out.println(minTime);\n double maxTime = findMaxTime(traj);\n //System.out.println(maxTime); //determine the maximum and minimum time\n for (int i = 0; i < traj.size(); i++) {\n traj.get(i).modifyTimeStamp(-minTime); //format the timestamp to seconds by subtracting the minimum timestamp from each\n }\n double maxDist = findMaxDist(traj);\n maxTime = findMaxTime(traj);\n\n\n int md = (int) Math.ceil(maxDist / distanceBin); //determine the maximum number of indices\n int mt = (int) Math.ceil(maxTime / timeBin); //determine the maximum number of indices\n\n double[][] cc = new double[md][mt];\n for (int i = 0; i < md; i++) {\n dbi = i * distanceBin; //the bin range for distance\n for (int j = 0; j < mt; j++) {\n tbi = j * timeBin; //the bin range for time\n\n ArrayList<SaTrajectory> inBin = new ArrayList<SaTrajectory>();\n for (int a = 0; a < traj.size(); a++) //iterate through each trajectory and see if it is within the range of the bin\n {\n SaTrajectory sa = traj.get(a);\n double dBinLoc = sa.getDistance();\n double tBinLoc = sa.getTimeStamp();\n\n // System.out.println(dBinLoc+\":::::::\"+dbi+\"-\"+ (dbi+distanceBin)+\"\\t\"+tBinLoc+\":::::::\"+tbi+\"-\"+(tbi+timeBin)+\"\\t\"+sa.getId()+\"\\tbin#: \"+i+\",\"+j);}}\n\n //System.out.println(dBinLoc+\":::::::\"+dbi+\"-\"+ (dbi+distanceBin)+\"\\t\"+tBinLoc+\":::::::\"+tbi+\"-\"+(tbi+timeBin)+\"\\t\"+sa.getId());\n // System.out.println(dBinLoc+\" \"+tBinLoc);\n if (dBinLoc > dbi && dBinLoc < (dbi + distanceBin)) {\n if ((tBinLoc > tbi) && (tBinLoc < (tbi + timeBin))) {\n //this value is in the bin\n inBin.add(sa);\n //System.out.println(sa.toString());\n traj.remove(a);\n a--;\n }\n }\n }\n int totalCC = 0;\n for (int a = 0; a < inBin.size(); a++) // for all values found in the bin, determine the percentage of CC's inside the bin, then store it into the 2d Array\n {\n SaTrajectory sa = inBin.get(a);\n if (sa.getAnswer() == 1)\n totalCC++;\n }\n /*if(inBin.size()==0)\n cc[i][j] = (0);\n else*/\n cc[i][j] = (((double) totalCC) / ((double) inBin.size()));\n // System.out.println((((double)totalCC)/((double)inBin.size())));\n }\n }\n\n\n for (int i = 0; i < cc[0].length; i++) {\n for (int j = 0; j < cc.length; j++) {\n writer.write(\"\" + cc[j][i] + \",\");\n }\n writer.write(\"\\n\");\n }\n\n writer.flush();\n writer.close();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if (csv != null)\n csv.close();\n\n\n }\n }", "public csvFile(File f) throws FileNotFoundException{\n Scanner s;\n try {\n s = new Scanner(f); // Create scanner (reason for the try).\n headers = s.nextLine().split(\",\"); // Get column headers.\n int size = (getSize(f) - 1); // Determine number of lines (rows) in the file.\n data = new String[size][]; // Appropriately size the data array based on number of rows.\n for ( int i = 0; i < size; i++) { // Load rows from file.\n data[i] = s.nextLine().split(\",\");\n }\n s.close();\n } catch(Exception e) {\n throw new FileNotFoundException();\n }\n }", "public static HighScoresTable loadFromFile(File filename) {\n try {\n FileInputStream fis = new FileInputStream(filename);\n ObjectInputStream ois = new ObjectInputStream(fis);\n HighScoresTable table = (HighScoresTable) ois.readObject();\n ois.close();\n return table;\n } catch (Exception e) { //filename was not found - return empty table.\n return new HighScoresTable(HighScoresTable.DEFAULT_CAPACITY);\n }\n }", "private static void readArff(String fileName) {\r\n\t\ttry {\r\n\t\t\tFileInputStream stream = new FileInputStream(fileName);\r\n\t\t\tInputStreamReader reader = new InputStreamReader(stream);\r\n\t\t\tBufferedReader buffer = new BufferedReader(reader);\r\n\t\t\t\r\n\t\t\tArrayList<String> tmpColumnName = new ArrayList<String>();\r\n\t\t\t\r\n\t\t\tString line;\r\n\t\t\tint userNo = 0; // sequence number of each user\r\n\t\t\tint attributeCount = 0;\r\n\t\t\t\r\n\t\t\tmaxValue = -1;\r\n\t\t\tminValue = 99999;\r\n\t\t\t\r\n\t\t\t// Read attributes:\r\n\t\t\twhile((line = buffer.readLine()) != null && !line.equals(\"TT_EOF\")) {\r\n\t\t\t\tif (line.contains(\"@ATTRIBUTE\")) {\r\n\t\t\t\t\tString name;\r\n\t\t\t\t\t\r\n\t\t\t\t\tline = line.substring(10).trim();\r\n\t\t\t\t\tif (line.charAt(0) == '\\'') {\r\n\t\t\t\t\t\tint idx = line.substring(1).indexOf('\\'');\r\n\t\t\t\t\t\tname = line.substring(1, idx+1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tint idx = line.substring(1).indexOf(' ');\r\n\t\t\t\t\t\tname = line.substring(0, idx+1).trim();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\ttmpColumnName.add(name);\r\n\t\t\t\t\tattributeCount++;\r\n\t\t\t\t}\r\n\t\t\t\telse if (line.contains(\"@RELATION\")) {\r\n\t\t\t\t\t// do nothing\r\n\t\t\t\t}\r\n\t\t\t\telse if (line.contains(\"@DATA\")) {\r\n\t\t\t\t\t// This is the end of attribute section!\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\telse if (line.length() <= 0) {\r\n\t\t\t\t\t// do nothing\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Set item count to data structures:\r\n\t\t\titemCount = (attributeCount - 1)/2;\r\n\t\t\tcolumnName = new String[attributeCount];\r\n\t\t\ttmpColumnName.toArray(columnName);\r\n\t\t\t\r\n\t\t\tint[] itemRateCount = new int[itemCount+1];\r\n\t\t\trateMatrix = new SparseMatrix(500000, itemCount+1); // Netflix: [480189, 17770]\r\n\t\t\t\r\n\t\t\t// Read data:\r\n\t\t\twhile((line = buffer.readLine()) != null && !line.equals(\"TT_EOF\")) {\r\n\t\t\t\tif (line.length() > 0) {\r\n\t\t\t\t\tline = line.substring(1, line.length() - 1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tStringTokenizer st = new StringTokenizer (line, \",\");\r\n\t\t\t\t\t\r\n\t\t\t\t\twhile (st.hasMoreTokens()) {\r\n\t\t\t\t\t\tString token = st.nextToken().trim();\r\n\t\t\t\t\t\tint i = token.indexOf(\" \");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tint movieID, rate;\r\n\t\t\t\t\t\tint index = Integer.parseInt(token.substring(0, i));\r\n\t\t\t\t\t\tString data = token.substring(i+1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (index == 0) { // User ID\r\n\t\t\t\t\t\t\t//int userID = Integer.parseInt(data);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tuserNo++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (data.length() == 1) { // Rate\r\n\t\t\t\t\t\t\tmovieID = index;\r\n\t\t\t\t\t\t\trate = Integer.parseInt(data);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (rate > maxValue) {\r\n\t\t\t\t\t\t\t\tmaxValue = rate;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if (rate < minValue) {\r\n\t\t\t\t\t\t\t\tminValue = rate;\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(itemRateCount[movieID])++;\r\n\t\t\t\t\t\t\trateMatrix.setValue(userNo, movieID, rate);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse { // Date\r\n\t\t\t\t\t\t\t// Do not use\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tuserCount = userNo;\r\n\t\t\t\r\n\t\t\t// Reset user vector length:\r\n\t\t\trateMatrix.setSize(userCount+1, itemCount+1);\r\n\t\t\tfor (int i = 1; i <= itemCount; i++) {\r\n\t\t\t\trateMatrix.getColRef(i).setLength(userCount+1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println (\"Data File\\t\" + dataFileName);\r\n\t\t\tSystem.out.println (\"User Count\\t\" + userCount);\r\n\t\t\tSystem.out.println (\"Item Count\\t\" + itemCount);\r\n\t\t\tSystem.out.println (\"Rating Count\\t\" + rateMatrix.itemCount());\r\n\t\t\tSystem.out.println (\"Rating Density\\t\" + String.format(\"%.2f\", ((double) rateMatrix.itemCount() / (double) userCount / (double) itemCount * 100.0)) + \"%\");\r\n\t\t\t\r\n\t\t\tstream.close();\r\n\t\t}\r\n\t\tcatch (IOException ioe) {\r\n\t\t\tSystem.out.println (\"No such file: \" + ioe);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t}", "public interface IFrequencyTable {\n\t\n\t/**\n\t * Returns the number of symbols in this frequency table, which is a positive number.\n\t * @return the number of symbols in this frequency table\n\t */\n\tpublic int getSymbolLimit();\n\t\n\t\n\t/**\n\t * Returns the frequency of the specified symbol. The returned value is at least 0.\n\t * @param symbol the symbol to query\n\t * @return the frequency of the symbol\n\t * @throws IllegalArgumentException if the symbol is out of range\n\t */\n\tpublic int get(int symbol);\n\tpublic int get(ISymbol symbol);\n\t\n\t\n\t/**\n\t * Sets the frequency of the specified symbol to the specified value.\n\t * The frequency value must be at least 0.\n\t * @param symbol the symbol to set\n\t * @param freq the frequency value to set\n\t * @throws IllegalArgumentException if the frequency is negative or the symbol is out of range\n\t * @throws ArithmeticException if an arithmetic overflow occurs\n\t */\n\tpublic void set(int symbol, int freq);\n\tpublic void set(ISymbol symbol, int freq);\n\t\n\t\n\t/**\n\t * Increments the frequency of the specified symbol.\n\t * @param symbol the symbol whose frequency to increment\n\t * @throws IllegalArgumentException if the symbol is out of range\n\t * @throws ArithmeticException if an arithmetic overflow occurs\n\t */\n\tpublic void increment(int symbol);\n\tpublic void increment(ISymbol symbol);\n\t\n\t\n\t/**\n\t * Returns the total of all symbol frequencies. The returned value is at\n\t * least 0 and is always equal to {@code getHigh(getSymbolLimit() - 1)}.\n\t * @return the total of all symbol frequencies\n\t */\n\tpublic int getTotal();\n\t\n\t\n\t/**\n\t * Returns the sum of the frequencies of all the symbols strictly\n\t * below the specified symbol value. The returned value is at least 0.\n\t * @param symbol the symbol to query\n\t * @return the sum of the frequencies of all the symbols below {@code symbol}\n\t * @throws IllegalArgumentException if the symbol is out of range\n\t */\n\tpublic int getLow(int symbol);\n\tpublic int getLow(ISymbol symbol);\n\t\n\t\n\t/**\n\t * Returns the sum of the frequencies of the specified symbol\n\t * and all the symbols below. The returned value is at least 0.\n\t * @param symbol the symbol to query\n\t * @return the sum of the frequencies of {@code symbol} and all symbols below\n\t * @throws IllegalArgumentException if the symbol is out of range\n\t */\n\tpublic int getHigh(int symbol);\n\tpublic int getHigh(ISymbol symbol);\n\t\n}", "public void load(File filename) throws IOException {\n try {\n FileInputStream fis = new FileInputStream(filename);\n ObjectInputStream ois = new ObjectInputStream(fis);\n HighScoresTable table = (HighScoresTable) ois.readObject();\n ois.close();\n this.capacity = table.size();\n this.highScores = table.getHighScores();\n } catch (IOException e) {\n throw e;\n } catch (ClassNotFoundException e2) {\n System.out.println(e2);\n this.capacity = HighScoresTable.DEFAULT_CAPACITY;\n this.highScores.clear();\n System.out.println(\"table has been cleared. new size is: \" + HighScoresTable.DEFAULT_CAPACITY);\n }\n }", "private void linearFunction(File file, ProbingHashTable linearProb) throws FileNotFoundException{\n\t\tScanner numbers = new Scanner(file);\n\t\tint intervalCount = 0;\t\t\n\t\tlinearProb = new LinearProbingHashTable<Integer>(tableSize);\n\t\tprintTable(\"Linear\");\n\t\twhile(numbers.hasNextInt() && intervalCount < inputs){\n\t\t\tlinearProb.insert(numbers.nextInt());\n\t\t\tif(++intervalCount % interval == 0)\n\t\t\t\tlinearProb.print(intervalCount);\n\t\t}\n\t\tnumbers.close();\n\t}", "private void ReadFreq(char[] imagenaux) {\n if (imagenaux[29] == '/') iteradorFreq = 29;\n else iteradorFreq = 28;\n for (int x = 0; x < sizeY; ++x) {\n StringBuilder Key = new StringBuilder();\n StringBuilder Value = new StringBuilder();\n int n;\n int f;\n if (imagenaux[iteradorFreq] == '/') {\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Key.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Value.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n }\n if (Key.length() > 9) {\n //negativo\n String auxi = Key.toString();\n auxi = Utils.andOfString(auxi);\n n = Integer.parseInt(auxi, 2);\n ++n;\n n = -1 * n;\n } else {\n n = Integer.parseInt(Key.toString(), 2);\n }\n f = Integer.parseInt(Value.toString(), 2);\n FreqY.put(n, f);\n }\n\n for (int x = 0; x < sizeCB; ++x) {\n StringBuilder Key = new StringBuilder();\n StringBuilder Value = new StringBuilder();\n int n;\n int f;\n if (imagenaux[iteradorFreq] == '/') {\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Key.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Value.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n }\n if (Key.length() > 9) {\n //negativo\n String auxi = Key.toString();\n auxi = Utils.andOfString(auxi);\n n = Integer.parseInt(auxi, 2);\n ++n;\n n = -1 * n;\n } else {\n n = Integer.parseInt(Key.toString(), 2);\n }\n f = Integer.parseInt(Value.toString(), 2);\n FreqCB.put(n, f);\n }\n\n for (int x = 0; x < sizeCR; ++x) {\n StringBuilder Key = new StringBuilder();\n StringBuilder Value = new StringBuilder();\n int n;\n int f;\n if (imagenaux[iteradorFreq] == '/') {\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Key.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Value.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n }\n if (Key.length() > 9) {\n //negativo\n String auxi = Key.toString();\n auxi = Utils.andOfString(auxi);\n n = Integer.parseInt(auxi, 2);\n ++n;\n n = -1 * n;\n } else {\n n = Integer.parseInt(Key.toString(), 2);\n }\n f = Integer.parseInt(Value.toString(), 2);\n FreqCR.put(n, f);\n }\n }", "private void processFileEntries(final File filePath, Map<String, Integer> bigramHistogramMap) {\n\n BufferedInputStream bis = null;\n FileInputStream fis = null;\n\n try {\n\n // create FileInputStream object\n fis = new FileInputStream(filePath);\n\n // create object of BufferedInputStream\n bis = new BufferedInputStream(fis);\n\n String stringLine;\n\n BufferedReader br = new BufferedReader(new InputStreamReader(bis));\n\n String previousWord = \"\";\n\n while ((stringLine = br.readLine()) != null) {\n previousWord = addBigramHistogramEntry(stringLine, previousWord, bigramHistogramMap);\n }\n\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found - \" + e);\n } catch (IOException ioe) {\n System.out.println(\"Exception while reading file - \" + ioe);\n } catch (Exception e) {\n System.out.println(\"Unable to load: \" + filePath.getName());\n } finally {\n // close the streams using close method\n try {\n if (fis != null) {\n fis.close();\n }\n if (bis != null) {\n bis.close();\n }\n } catch (IOException ioe) {\n System.out.println(\"Error while closing stream : \" + ioe);\n }\n }\n }", "public void readSpeedFile(File file) {\n\t/** predefine the periods **/\n\tperiods = Period.universalDefine();\n\t\n\tspeedTables = new ArrayList<SpeedTable>();\n\t\n\ttry (BufferedReader br = new BufferedReader(new FileReader(file)))\n\t{\n\t\tString sCurrentLine;\n\t\tString [] lineElements;\n\t\t\n\t\twhile ((sCurrentLine = br.readLine()) != null) {\n//\t\t\tSystem.out.println(sCurrentLine);\n\t\t\tlineElements = sCurrentLine.split(\"\\\\s+\");\n\t\t\tSpeedTable speedTable = new SpeedTable();\n\t\t\tfor (int i = 0; i < lineElements.length; i++) {\n\t\t\t\tdouble fromTime = periods.get(i).fromTime();\n\t\t\t\tdouble toTime = periods.get(i).toTime();\n\t\t\t\tdouble speed = Double.parseDouble(lineElements[i]);\n\t\t\t\tPeriodSpeed periodSpeed = new PeriodSpeed(fromTime, toTime, speed);\n\t\t\t\tspeedTable.add(periodSpeed);\n\t\t\t}\n\t\t\t\n\t\t\tspeedTables.add(speedTable);\n\t\t}\n\t} catch (IOException e) {\n\t\te.printStackTrace();\n\t}\n\t\n\t// create the all one speed table\n\tallOneSpeedTable = new SpeedTable();\n\tfor (int i = 0; i < periods.size(); i++) {\n\t\tdouble fromTime = periods.get(i).fromTime();\n\t\tdouble toTime = periods.get(i).toTime();\n\t\tallOneSpeedTable.add(new PeriodSpeed(fromTime, toTime, 1));\n\t}\n\t/*\n\tfor (int i = 0; i < speedTables.size(); i++) {\n\t\tSystem.out.println(\"For category \" + i);\n\t\tspeedTables.get(i).printMe();\n\t}*/\n}", "public static void main(String[] args) {\n\t\tMap<String, Integer> map = new HashMap<>();\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(new File(\"story.txt\")))) {\r\n\t\t\tString line = null;\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tString tokens[] = line.split(\" \");\r\n\t\t\t\tfor (String token : tokens) {\r\n\t\t\t\t\tif (map.containsKey(token)) {\r\n\t\t\t\t\t\tInteger freq = map.get(token);\r\n\t\t\t\t\t\tmap.put(token, ++freq);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tmap.put(token, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\r\n\t\tSet<Entry<String, Integer>> entry = map.entrySet();\r\n\t\tfor (Entry<String, Integer> entryset : entry) {\r\n\t\t\tSystem.out.println(entryset.getKey() + \" : \" + entryset.getValue());\r\n\t\t}\r\n\t}", "private void loadFromFile() {\n try {\n /* Load in the data from the file */\n FileInputStream fIn = openFileInput(FILENAME);\n BufferedReader inRead = new BufferedReader(new InputStreamReader(fIn));\n\n /*\n * access from the GSON file\n * Taken from lonelyTwitter lab code\n */\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Counter>>() {}.getType();\n counters = gson.fromJson(inRead, listType);\n\n } catch (FileNotFoundException e) {\n counters = new ArrayList<Counter>();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "void genIDFData(String vocabFile, String outFile) throws Exception {\n List<String> lines = FileUtils.readLines(new File(vocabFile), Charset.defaultCharset());\n BufferedWriter bw = new BufferedWriter(new FileWriter(outFile));\n int N = reader.numDocs();\n for (String line: lines) {\n String word = TrecDocIndexer.analyze(indexer.getAnalyzer(), line).trim();\n int df = reader.docFreq(new Term(TrecDocIndexer.FIELD_ANALYZED_CONTENT, word));\n bw.write(line.trim() + \"\\t\");\n bw.write(String.valueOf(Math.log(N/(double)df)));\n bw.newLine();\n }\n bw.close();\n }", "private void loadTsvFile()\n {\n try\n {\n BufferedReader input = new BufferedReader(new FileReader(inFile));\n try\n {\n String line = null;\n\n Integer lineNum = 0;\n\n while ((line = input.readLine()) != null)\n {\n\n lineNum++;\n if (line.matches(\"^\\\\s+$\"))\n {\n System.err.println(\"Skipping line \" + lineNum + \" as it contains no data\");\n // Weird bug with TSV generated by excel\n // This line.match skips some empty lines because the println runs\n // However, it doesn't match all empty lines as some get put into the \"data\"\n // ArrayList\n // Can see this when using the debugger\n // It's difficult to inspect because the Mac command line tools such as tail\n // and less\n // don't recognise /r as a newline break. They display as ^M.\n // However, the java readLine doesn't have a problem.\n // Easy quick work around was to go into Excel and delete the blank row of\n // cells\n // so that they are truly empty\n\n } else\n {\n\n ArrayList<String> dataLine = new ArrayList<String>();\n\n Scanner tokenize = new Scanner(line).useDelimiter(\"\\t\");\n while (tokenize.hasNext())\n {\n dataLine.add(tokenize.next());\n }\n if (lineNum == headRow)\n {\n header = dataLine;\n\n } else if (ignoreRow.contains(lineNum))\n {\n // do nothing\n } else\n {\n data.add(dataLine);\n }\n }\n\n }\n } finally\n {\n input.close();\n }\n } catch (IOException ex)\n {\n ex.printStackTrace();\n }\n }", "public static void DocumentFrequencies() throws FileNotFoundException {\n for (Entry<String, List<Integer>> entry : dictionary.entrySet()) {\n List<Integer> termfrequency = new ArrayList<>();\n\n termfrequency = entry.getValue();\t// getting each word's termfrequency list\n int i = 0;\n termfrequency.add(0); \t\t\t//maintaining documentfrequency at the 57th index\n Integer documentFrequency = termfrequency.get(totaldocument+1);\n while(i<56) { //iterate 0 to 55 all speeches term frequency\n if(termfrequency.get(i)>0) {\t\t//increment document frequency of that word if termfrequency is greater than 0.0\n documentFrequency++;\t\t\t//increment document frequency\n }\n i++;\t\t//increment index\n }\n termfrequency.set(57, documentFrequency);\t//re-set the documentfrequency and save the current maintained document frequency from 0 to calculated value\n dictionary.put(entry.getKey(), termfrequency);\t\t// place the incremented final value of that word back to the same list in dictionary hashmap\n }\n //save();\n }", "public static void printResultsFromCSV() {\n try (CSVReader reader = new CSVReader(new FileReader(\"results.csv\"), ',', '\"', 0)) {\n Map<String, Integer> results = new HashMap<>();\n String[] nextLine;\n while ((nextLine = reader.readNext()) != null) {\n if (nextLine[0].contains(\"http\")) {\n results.put(nextLine[0], Integer.valueOf(nextLine[1]));\n }\n }\n results.\n entrySet().\n stream().\n sorted(Map.Entry.<String, Integer>comparingByValue().reversed()).\n forEach(entry -> System.out.println(entry.getKey() + \", \" + entry.getValue()));\n } catch (IOException e) {\n System.err.println(\"Can't find results.csv\");\n }\n }", "java.lang.String getFrequency();", "public static void createHashTable(String inputFileName, String outputFileName){\n File inputFile = new File(inputFileName);\n File outputFile = new File(outputFileName);\n WordCounter h = new WordCounter();\n h.input(inputFile);\n h.output(outputFile);\n }", "public void charFrequencyCount(Scanner s) {\n\t\twhile (s.hasNextLine()) { /* keep scanning while there is info in the\n\t\t\t\t\t\t\t\t * file\n\t\t\t\t\t\t\t\t * */ \n\t\t\tchar[] curLine = s.nextLine().toCharArray();\n\t\t\tfileData.add(curLine); // save the data for later\n\n\t\t\t/*\n\t\t\t * Go through the line curRent line and count the characters\n\t\t\t */\n\t\t\tfor (int i = 0; i < curLine.length; i++) {\n\t\t\t\tfrequencyCount[curLine[i]]++;\n\t\t\t}\n\t\t\tfrequencyCount[10]++; // add a new line!\n\t\t}\n\t\t/*\n\t\t * There is always one extra newline so take one away to re-balance it.\n\t\t */\n\t\tfrequencyCount[10]--;\n\t}", "Auditorium(java.util.Scanner input, java.io.File file){\r\n\t\t\r\n\t\tString line = input.next(); // read in next line from file // or nextLine()\r\n\t\tboolean flag = true;\r\n\t\tcolumns = line.length();\r\n\t\twhile(line != \"\" && flag != false) {\r\n\t\t\trows++; // increment number of rows\r\n\t\t\tif (!input.hasNext())\r\n\t\t\t\tflag = false;\r\n\t\t\tparseLine(line, rows, columns); // send line, array, and rows to a parse function\r\n\t\t\tif(input.hasNext())\r\n\t\t\t\tline = input.next(); //read in next line\r\n\t\t}\r\n\t}", "public Map<String, Integer> buildBigramHistogramOf(final File filePath) {\n Map<String, Integer> bigramHistogramMap = new HashMap<>();\n\n processFileEntries(filePath, bigramHistogramMap);\n\n for (Map.Entry<String, Integer> entry : bigramHistogramMap.entrySet()) {\n System.out.println(entry.getKey() + \" -> \" + entry.getValue());\n }\n\n return bigramHistogramMap;\n }", "public HistogramDataSet getData();", "@Override\n\tpublic int load(File source) {\n\t\tif (source == null) {\n\t\t\treturn -1;\n\t\t}\n\t\t// Load data\n\t\tclear();\n\t\ttry {\n\t\t\tBufferedReader in = new BufferedReader(new FileReader(source));\n\t\t\tString line;\n\t\t\tMap<Side, AnnotationTerm> connection = new HashMap<Side, AnnotationTerm>();\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\tif (line.startsWith(COMMENT_MARKER)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tMatcher m = ANNOTATION_REG_EXP.matcher(line);\n\t\t\t\tif (m.find()) {\n\t\t\t\t\t// String hpoName = m.group(NAME_IDX);\n\t\t\t\t\tfinal String hpoId = this.taxonomy.getRealId(m\n\t\t\t\t\t\t\t.group(ID_IDX));\n\t\t\t\t\tString geneList = m.group(LIST_IDX);\n\t\t\t\t\tif (geneList != null) {\n\t\t\t\t\t\tfinal Matcher mi = GENE_REG_EXP.matcher(geneList);\n\t\t\t\t\t\twhile (mi.find()) {\n\t\t\t\t\t\t\tconnection.clear();\n\t\t\t\t\t\t\tconnection.put(GENE, new AnnotationTerm(mi\n\t\t\t\t\t\t\t\t\t.group(ID_IDX), mi.group(NAME_IDX)));\n\t\t\t\t\t\t\tconnection.put(TAXONOMY, new AnnotationTerm(hpoId));\n\t\t\t\t\t\t\tthis.addConnection(connection);\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\tin.close();\n\t\t\tpropagateTaxonomyAnnotations();\n\t\t} catch (NullPointerException ex) {\n\t\t\tex.printStackTrace();\n\t\t\tSystem.err.println(\"File does not exist\");\n\t\t} catch (FileNotFoundException ex) {\n\t\t\tex.printStackTrace();\n\t\t\tSystem.err.println(\"Could not locate source file: \"\n\t\t\t\t\t+ source.getAbsolutePath());\n\t\t} catch (IOException ex) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tex.printStackTrace();\n\t\t}\n\t\treturn size();\n\t}", "public static void readFile() {\n\t\tbufferedReader = null;\n\t\ttry {\n\t\t\tFileReader fileReader = new FileReader(\"/home/bridgeit/Desktop/number.txt\");\n\t\t\tbufferedReader = new BufferedReader(fileReader);\n\n\t\t\tString line;\n\t\t\twhile ((line = bufferedReader.readLine()) != null) {\n\t\t\t\tString[] strings = line.split(\" \");\n\t\t\t\tfor (String integers : strings) {\n\t\t\t\t\thl.add(Integer.parseInt(integers));\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"File Not Found...\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\tbufferedReader.close();\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 void read()\r\n\t{\r\n\t\tScanner input = null;\r\n\t\ttry\r\n\t\t{\r\n\t\t\tint i = 0;\r\n\r\n\t\t\tinput = new Scanner(new File(\"netflix.csv\")).useDelimiter(\"[,\\r\\n]\");\r\n\r\n\t\t\twhile (input.hasNext())\r\n\t\t\t{\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t\tString title = input.next();\r\n\r\n\t\t\t\tString rating = input.next();\r\n\r\n\t\t\t\tint year = Integer.parseInt(input.next());\r\n\r\n\t\t\t\tint score = Integer.parseInt(input.next());\r\n\t\t\t\tMovie a = new Movie(title, rating, year, score);\r\n\t\t\t\tdata[i] = a;\r\n\t\t\t\ti++;\r\n\t\t\t\tactualSize++;\r\n\r\n\t\t\t}\r\n\t\t\tinput.close();\r\n\r\n\t\t}\r\n\t\tcatch (FileNotFoundException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"File not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "public void loadFromCsv(String filePath) throws Exception {\n\tBufferedReader br=new BufferedReader(new FileReader(filePath));\n\tString line=\"\";\n\tint i=0;\n\n\tline=br.readLine();\n\tthis.gen=Integer.parseInt(line);\n\t\n\twhile((line=br.readLine()) != null) {\n\t this.setBna(i,line);\n\t i++;\n\t}\n\tbr.close();\n }", "public Hashtable getSampleTotHistStats(Object o);", "private void quadFunction(File file, ProbingHashTable quadProb) throws FileNotFoundException{\n\t\tScanner numbers = new Scanner(file);\n\t\tint intervalCount = 0;\n\t\tquadProb = new QuadraticProbingHashTable<Integer>(tableSize);\n\t\tprintTable(\"Quadratic\");\n\t\twhile(numbers.hasNextInt() && intervalCount < inputs){\n\t\t\tquadProb.insert(numbers.nextInt());\n\t\t\tif(++intervalCount % interval == 0)\n\t\t\t\tquadProb.print(intervalCount);\n\t\t}\n\t\tnumbers.close();\n\t}", "public static double[][] loadData() {\n double[][] data = null;;\n \n try {\n // create a path to the file\n File file = new File(\"data.csv\");\n \n // create a scanner to read the file\n Scanner inputFile = new Scanner(file);\n \n // count the number of entries in the file so we know how big\n // data needs to be.\n int index = 0;\n \n // count the rows in the file\n while(inputFile.hasNext()) {\n inputFile.nextLine();\n index++;\n }\n \n // declare the array.\n // first row is X, second row is Y\n data = new double[2][index];\n \n // create a new scanner so we can go back to the beginning of the file\n inputFile = new Scanner(file);\n \n // reset index to zero so we can assign array values properly\n index = 0;\n \n // a String to hold the lines as they are read from the file.\n String input = \"\";\n \n // the file should consist of a list of ordered pairs x,y\n // one ordered pair per line. assign these to the appropriate\n // places in the array\n while (inputFile.hasNext()) {\n // read the line\n input = inputFile.nextLine();\n \n // store the x value in the first array\n data[0][index] = Double.parseDouble(input.split(\",\")[0]);\n \n // store the y value in the second array\n data[1][index] = Double.parseDouble(input.split(\",\")[1]);\n \n // increment\n index++;\n }\n \n // done working with the file\n inputFile.close();\n } catch (FileNotFoundException ex) {\n System.out.println(\"File not found: \" + ex);\n } \n \n return data; \n }", "public void readCategoryFile(File file) {\n\ttry (BufferedReader br = new BufferedReader(new FileReader(file)))\n\t{\n\t\tString sCurrentLine;\n\t\tString [] lineElements;\n\t\t\n\t\tint row = 0;\n\t\twhile ((sCurrentLine = br.readLine()) != null) {\n\t\t\t//System.out.println(sCurrentLine);\n\t\t\t\n\t\t\tlineElements = sCurrentLine.split(\"\\\\s+\");\n\t\t\t//System.out.println(lineElements.length);\n\t\t\tfor (int column = 0; column < lineElements.length; column++) {\t\t\n\t\t\t\t//System.out.println(column);\n\t\t\t\tint category = Integer.parseInt(lineElements[column]);\n\t\t\t\t//System.out.println(vertices.size());\n\t\t\t\tPOI v1 = vertices.get(row);\n\t\t\t\tPOI v2 = vertices.get(column);\n\t\t\t\t\n\t\t\t\tArc arc = getArc(v1, v2);\n\t\t\t\tif (!distMtx) {\n\t\t\t\t\tdouble distance = v1.distanceTo(v2);\n\t\t\t\t\tif (data == Dataset.VERBEECK) {\n\t\t\t\t\t\tdistance = distance / 5.0;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tdistance = distance / 10.0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tarc.setLength(distance);\n\t\t\t\t}\n\t\t\t\tarc.setCategory(category);\n\t\t\t\tif (distConstraint) {\n\t\t\t\t\tarc.setSpeedTable(allOneSpeedTable);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tarc.setSpeedTable(speedTables.get(category));\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\trow ++;\n\t\t}\n\t} catch (IOException e) {\n\t\te.printStackTrace();\n\t}\n}", "public double[] histogram() {\n int[][] data = toArray();\n double[] ans = new double[256];\n int totalSize = data.length * data[0].length;\n\n for (int i = 0; i < data.length; i++) {\n for (int j = 0; j < data[i].length; j++) {\n ans[data[i][j]]++;\n }\n }\n for (int i = 0; i < ans.length; i++) {\n ans[i] = ans[i] / totalSize;\n }\n return ans;\n }", "private static BarChart readFile(String path) throws IOException {\r\n\t\tBufferedReader reader = new BufferedReader(new FileReader(path));\r\n\t\t\r\n\t\tString xLabel = reader.readLine();\r\n\t\tString yLabel = reader.readLine();\r\n\t\tString unparsedValues = reader.readLine();\r\n\t\tString minY = reader.readLine();\r\n\t\tString maxY = reader.readLine();\r\n\t\tString density = reader.readLine();\r\n\t\t\r\n\t\tunparsedValues.replace(\"\\\\s+\", \" \");\r\n\t\tString[] values = unparsedValues.split(\" \");\r\n\t\tList<XYValue> chartValues = new LinkedList<>();\r\n\t\t\r\n\t\tfor(String value : values) {\r\n\t\t\tif(value.contains(\"\\\\s+\")) {\r\n\t\t\t\treader.close();\r\n\t\t\t\tthrow new IllegalArgumentException(\"The value must be written in next format: x,y!\\n\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t + \"No spaces needed.\");\r\n\t\t\t}\r\n\t\t\tString[] xy = value.split(\",\");\r\n\t\t\ttry {\r\n\t\t\t\tchartValues.add(new XYValue(Integer.parseInt(xy[0]), Integer.parseInt(xy[1])));\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\tSystem.out.println(\"Format of the file is not good. For values is not provided\\n\"\r\n\t\t\t\t\t\t\t\t + \"value parsable to integer.\");\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treader.close();\r\n\t\treturn new BarChart(chartValues, xLabel, yLabel, Integer.parseInt(minY),\r\n\t\t\t\t\t\t\tInteger.parseInt(maxY), Integer.parseInt(density));\r\n\t}", "public int getFrequency(int height);", "public void readFile(){\r\n\t\tFileInputStream inputStream = null;\r\n\t\tScanner scan = null;\r\n\t\tString path = \"C:/Users/spandya/workspace/LatestPrice.csv\";\r\n\t\ttry {\r\n\t\t\tinputStream = new FileInputStream(path);\r\n\t\t\tscan = new Scanner(inputStream, \"UTF-8\");\r\n\t\t\twhile(scan.hasNext()){\r\n\t\t\t\tString line = scan.nextLine();\r\n\t\t\t\tString firstWord = line.split(\",\")[0];\r\n\t\t\t\tString latestPrice = line.substring(line.lastIndexOf(\",\")+1);\r\n\t\t\t\tSystem.out.println(firstWord+\":\"+latestPrice);\r\n\t\t\t}\r\n\t\t\tif(scan.ioException() != null){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthrow scan.ioException();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}finally{\r\n\t\t\tif(inputStream != null){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tinputStream.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(scan != null){\r\n\t\t\t\tscan.close();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void loadCoin(HashMap<Integer, Coin> Coin_HASH){\r\n \r\n try {\r\n Scanner scanner = new Scanner(new File(file_position+\"Coin.csv\"));\r\n Scanner dataScanner = null;\r\n int index = 0;\r\n \r\n while (scanner.hasNextLine()) {\r\n dataScanner = new Scanner(scanner.nextLine());\r\n \r\n if(Coin_HASH.size() == 0){\r\n dataScanner = new Scanner(scanner.nextLine());\r\n }\r\n \r\n dataScanner.useDelimiter(\",\");\r\n Coin coin = new Coin();\r\n \r\n while (dataScanner.hasNext()) {\r\n String data = dataScanner.next();\r\n if (index == 0) {\r\n coin.setId(Integer.parseInt(data));\r\n } else if (index == 1) {\r\n coin.setPlayerID(Integer.parseInt(data));\r\n } else {\r\n System.out.println(\"invalid data::\" + data);\r\n }\r\n index++;\r\n }\r\n \r\n Coin_HASH.put(coin.getId(), coin);\r\n index = 0;\r\n }\r\n \r\n scanner.close();\r\n \r\n } catch (FileNotFoundException ex) {\r\n System.out.println(\"Error: FileNotFound - loadCoin\");\r\n }\r\n }", "public void read () throws IOException, ClassNotFoundException {\n BufferedReader reader = FileManager.getReader\n (JerboaProperties.getString(\"KeyFeatureContainer.filename\"));\n double kThreshold = JerboaProperties.getDouble(\"KeyFeatureContainer.keyThreshold\",0.0);\n double fThreshold = JerboaProperties.getDouble(\"KeyFeatureContainer.featureThreshold\",0.0);\n\n String line;\n String[] tokens;\n double x;\n line = reader.readLine();\n tokens = line.split(\"\\\\t\");\n \n sf = Double.parseDouble(tokens[2]);\n\n while ((line = reader.readLine()) != null) {\n tokens = line.split(\"\\\\t\");\n if (tokens.length == 2) {\n if ((! filterKeys) || kTable.containsKey(tokens[0])) {\n x = Double.parseDouble(tokens[1]);\n if (x >= kThreshold)\n kTable.put(tokens[0],x);\n else if (filterKeys)\n kTable.remove(tokens[0]);\n }\n } else {\n x = Double.parseDouble(tokens[1]);\n if (x >= fThreshold) {\n kfTable.put(tokens[0],x);\n fTable.put(tokens[0],Double.parseDouble(tokens[2]));\n }\n }\n }\n }", "private void fijarDatos(BufferedReader bf ) throws IOException{\n int col = 0;\n int lin;\n String line;\n do {\n line = bf.readLine();\n if (line != null) {\n StringTokenizer tk2 = new StringTokenizer(line, \"\\t \", true);\n lin = 0;\n while (tk2.hasMoreTokens()) {\n String dato_fichero = tk2.nextToken();\n if (\"\\t\".equals(dato_fichero)) {\n datos[lin][col] = 0;\n lin++;\n } else {\n datos[lin][col] = Float.parseFloat(dato_fichero);\n //Si no estamos en la ultima columna\n if (tk2.hasMoreElements()) {\n //consuminos el \\t adicional\n tk2.nextToken();\n }\n lin++;\n }\n }\n col++;\n }\n } while (line != null);\n }", "private double createCumulativeResults(){\n File f = new File(this.cumulativeResultsFileName); \n Scanner sc; \n if(!f.exists()){\n return 0;\n }else{\n try{\n double s = 0; \n int n = 0; \n sc = new Scanner(new File(this.cumulativeResultsFileName));\n while(sc.hasNext()){\n String inputLine = sc.nextLine(); System.out.println(inputLine);\n String temp = inputLine.split(\",\")[1] ;\n s = s + Double.parseDouble(temp);\n n++;\n }\n return s/(double)n;\n }catch(Exception e){\n e.printStackTrace();\n return 0; \n }\n }\n }", "public static void main(String[] args) {\n Path path = Paths.get(\"src/lottery.csv\");\n Map<Integer, Integer> lotteryNumbers = new HashMap<>();\n\n mapingNumberFrequency(path, lotteryNumbers);\n System.out.println(\"The most common lottery numbers:\");\n for ( Integer number : mostFrequentNumbers(lotteryNumbers, 5)) {\n System.out.println(number + \" (\" + lotteryNumbers.get(number) + \" times) \");\n }\n }", "public static void main(String[] args) throws IOException, ClassNotFoundException {\n Path ruta = Paths.get(\"archivoDescargado.csv\");\n String texto_del_archivoCSV = Files.readString(ruta, StandardCharsets.UTF_8);\n \n // Dividir un archivo CSV en líneas\n String[] lineas_del_texto_del_archivoCSV = texto_del_archivoCSV.split(\"\\n\");\n\n // Generar una tabla de hash con el contenido dividido en lineas\n HashMap<String,String> tabla_de_hash = new HashMap<String, String>();\n int i = 0;\n for (String linea : lineas_del_texto_del_archivoCSV ){\n \tif (i != 0){ // Descarta la primera línea, ok? \n String[] columnas = linea.split(\",\");\n String nombre_y_apellido = columnas[1]+\" \"+columnas[0];\n String telefono = columnas[3];\n tabla_de_hash.put(nombre_y_apellido, telefono);\n }\n i++;\n }\n\n // Guardar una tabla de hash en un archivo\n FileOutputStream fos = new FileOutputStream(\"diccionario.txt\");\n ObjectOutputStream oos = new ObjectOutputStream(fos);\n oos.writeObject(tabla_de_hash);\n oos.close();\n fos.close();\n\n // Cargar una tabla de hash desde un archivo\n FileInputStream fis = new FileInputStream(\"diccionario.txt\");\n ObjectInputStream ois = new ObjectInputStream(fis);\n tabla_de_hash = (HashMap<String,String>) ois.readObject();\n ois.close();\n fis.close();\n\n // Imprimir una tabla de hash\n for ( String nombre_y_apellido : tabla_de_hash.keySet() ) \n System.out.println( nombre_y_apellido + \" \" + tabla_de_hash.get(nombre_y_apellido));\n }", "public CSVReader(String filename) {\r\n try {\r\n File inFile = new File(filename);\r\n Scanner scanner = new Scanner(inFile);\r\n boolean hasNumberOfCountries = false;\r\n boolean hasYearLabels = false;\r\n while (scanner.hasNextLine()) {\r\n String nextLine = scanner.nextLine();\r\n if (nextLine.startsWith(\"Number of countries\")) {\r\n int numberOfCountries = Integer.parseInt(nextLine.split(\",\")[1]);\r\n countryNames = new String[numberOfCountries];\r\n cellularDataTable = new double[numberOfCountries][];\r\n countryIndex = 0;\r\n hasNumberOfCountries = true;\r\n continue;\r\n }\r\n if (nextLine.startsWith(\"Country Name\")) {\r\n parseYearLabels(nextLine);\r\n hasYearLabels = true;\r\n continue;\r\n }\r\n if (hasNumberOfCountries && hasYearLabels) {\r\n // if both number of countries and year labels are found, proceed to parse data\r\n if (!nextLine.isEmpty()) {\r\n parseCountryData(nextLine);\r\n }\r\n }\r\n }\r\n if (!hasNumberOfCountries || !hasYearLabels) {\r\n System.out.println(\"Invalid file: missing Number of countries or Year labels, exiting program\");\r\n System.exit(0);\r\n }\r\n scanner.close();\r\n } catch (FileNotFoundException e) {\r\n System.out.println(\"File \" + filename + \" not found, exiting program\");\r\n System.exit(0);\r\n }\r\n }", "private void loadDocStatFromFile(String path) {\n docStat = new HashMap<String, Integer>();\n List<String> stats = fu.textFileToList(path);\n int totLength = 0;\n for (String stat : stats) {\n String docID = stat.split(\" \")[0];\n int docLen = Integer.parseInt(stat.split(\" \")[1]);\n totLength += docLen;\n docStat.put(docID, docLen);\n }\n avdl = totLength / N;\n }", "void clearStatistics() throws IOException;", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Enter filename: \");\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString filename = scanner.nextLine();\n\t\tBufferedReader fileReader = null;\n\t\tint[] counts = new int[10];\n\t\tint total = 0;\n\t\ttry {\n\t\t\tfileReader = new BufferedReader(new FileReader(filename));\n\t\t\tString line;\n\t\t\twhile ((line = fileReader.readLine()) != null) {\n\t\t\t\tif(line.length() > 0) {\n\t\t\t\t\tString[] parts = line.split(\" \");\n\t\t\t\t\tint num;\n\t\t\t\t\tif(parts.length > 0) {\n\t\t\t\t\t\tnum = Integer.parseInt(parts[parts.length - 1]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnum = Integer.parseInt(line); \n\t\t\t\t\t}\n\t\t\t\t\tint firstDigit = firstDigit(num);\n\t\t\t\t\tcounts[firstDigit]++;\n\t\t\t\t\ttotal++;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfor(int i = 1; i < counts.length; i++) {\n\t\t\tSystem.out.printf(\"%d : %d : %.2f%%\\n\", i, counts[i], counts[i] * 100. / total);\n\t\t}\n\t}", "public static int[] scanFile(String fileName){\n File file = new File(fileName);\n int[] freqNums = new int[94];\n //try catch in case the file doesn't exist\n try {\n Scanner scan = new Scanner(file);\n //loop to look at each word in the file\n while (scan.hasNext()) {\n String s = scan.next();\n //loop to look at each character in the word\n for(int i = 0; i < s.length(); i++){\n if((int)s.charAt(i)-32 <= 94)\n freqNums[(int)s.charAt(i)-32] = freqNums[(int)s.charAt(i)-32] + 1;\n }\n //accounts for all the spaces\n freqNums[0] = freqNums[0]+1;\n }\n scan.close();\n //gets rid of the imaginary last space\n freqNums[0] = freqNums[0]-1;\n }\n catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n return freqNums;\n }", "JFreeChart generateHist();", "private void getHamStatistics() throws IOException{\n System.out.println(\"Getting ham statistics\"); \n File hamFile = new File(HamPath);\n // Find all words from the ham emails\n for(File file: hamFile.listFiles()){\n try { \n BufferedReader b = new BufferedReader(new FileReader(file));\n Scanner scanner = null; \n String line = b.readLine(); \n while(line != null){\n scanner = new Scanner(line);\n while(scanner.hasNext()){\n String next = scanner.next(); \n if(WordCountHam.get(next) != null){\n WordCountHam.put(next, WordCountHam.get(next)+1); \n }\n }\n line = b.readLine(); \n }\n } catch (FileNotFoundException ex) {\n System.err.println(ex.toString());\n }\n }\n }", "private static void fileRead(String file) {\n\t\ttry {\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(file));\n\t\t\tString line = \"\";\n\t\t\twhile((line=br.readLine())!=null) {\n\t\t\t\tString data[] = line.split(\"\\\\t\");\n\t\t\t\tint id = Integer.parseInt(data[0]);\n\t\t\t\tint groundTruth = Integer.parseInt(data[1]);\n\t\t\t\tactualClusters.put(id, groundTruth);\n\t\t\t\tArrayList<Double> temp = new ArrayList<>();\n\t\t\t\tfor(int i=2;i<data.length;i++) {\n\t\t\t\t\ttemp.add(Double.parseDouble(data[i]));\n\t\t\t\t}\n\t\t\t\tcols = data.length-2;\n\t\t\t\tgeneAttributes.put(id, temp);\n\t\t\t\tallClusters.add(id+\"\");\n\t\t\t\ttotalGenes++;\n\t\t\t}\n\t\t\ttotalCluster = totalGenes;\n\t\t\tbr.close();\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\tpublic int showFrequency(String key) {\n\t\tint hashVal = hashFunc(key);\n\t\twhile (hashArray[hashVal] != null) {\n\t\t\tif (hashArray[hashVal].value.equals(key))\n\t\t\t\treturn hashArray[hashVal].frequency;\n\t\t\telse {\n\t\t\t\thashVal++;\n\t\t\t\thashVal = hashVal % size;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "Histogram() {\n type = name = \"\";\n feature_index = -1;\n histogram_features = null;\n histogram_proportions = null;\n histogram_counts = null;\n }", "private double[] computeHistrogram(ArrayList<Feature> freature, String keyID) {\r\n\r\n int nBins = (int) Math.ceil(hismax / binWidth);\r\n ArrayList<Double> values = FeatureOps.getSpecifiedFeatureNumericalPropertyAsArrayList(freature, keyID);\r\n double[] d1 = List2Prims.doubleFromDouble(values);\r\n\r\n double[] hist = new double[nBins];\r\n\r\n int bin;\r\n for (int i = 0; i < d1.length; i++) {\r\n bin = (int) Math.floor((double) nBins * (d1[i] / hismax));// \r\n bin = Math.min(nBins - 1, bin);\r\n hist[bin]++;\r\n }\r\n return hist;\r\n }", "public static void main(String[] args) throws MultipleHeadersFoundInInputDatabaseException, Exception {\n\t\tjava.util.Hashtable<String, String> readParameters = readParameters(args);\n\t\tif(!readParameters.containsKey(\"filename\")) {\n\t\t\tSystem.err.println(\"filename missing\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tif(!readParameters.containsKey(\"probtype\")) {\n\t\t\tSystem.err.println(\"probtype missing\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\tString filename = readParameters.get(\"filename\");\n\n\t\tInteger probabilityType = Integer.parseInt(readParameters.get(\"probtype\"));\n\t\tString output = null;\n\t\tInteger occurThresh = null;\n\t\tString csv = \"\";\n\t\tString fingerprinttype = \"\";\n\t\tString includeNonExplainedString = \"\";\n\t\tif(readParameters.containsKey(\"output\")) output = readParameters.get(\"output\");\n\t\tif(readParameters.containsKey(\"occurThresh\")) occurThresh = Integer.parseInt(readParameters.get(\"occurThresh\"));\n\t\tif(readParameters.containsKey(\"csv\")) csv = (String)readParameters.get(\"csv\");\n\t\tif(readParameters.containsKey(\"fingerprinttype\")) fingerprinttype = (String)readParameters.get(\"fingerprinttype\");\n\t\tif(readParameters.containsKey(\"includeNonExplained\")) includeNonExplainedString = (String)readParameters.get(\"includeNonExplained\");\n\t\t\n\t\tArrayList<Double> peakMassesSorted = new ArrayList<Double>();\n\t\tArrayList<String> fingerprintsSorted = new ArrayList<String>();\n\t\t\n\t\tStringBuilder nonExplainedPeaksString = new StringBuilder();\n\t\tArrayList<Double> nonExplainedPeaks = new ArrayList<Double>();\n\t\tArrayList<Integer> peakMassCounts = new ArrayList<Integer>();\n\t\t\n\t\tboolean includeNonExplained = true;\n\t\tif(includeNonExplainedString.equals(\"F\") || includeNonExplainedString.equals(\"f\")\n\t\t\t\t|| includeNonExplainedString.equals(\"False\") || includeNonExplainedString.equals(\"false\")\n\t\t\t\t|| includeNonExplainedString.equals(\"FALSE\"))\n\t\t\tincludeNonExplained = false;\n\t\t\n\t\tSettings settings = new Settings();\n\t\tsettings.set(VariableNames.LOCAL_DATABASE_PATH_NAME, filename);\n\t\tIDatabase db = null;\n\t\tif(csv == \"1\") db = new LocalCSVDatabase(settings);\n\t\telse if (csv.equals(\"auto\")) {\n\t\t\tif(filename.endsWith(\"psv\")) db = new LocalPSVDatabase(settings);\n\t\t\telse db = new LocalCSVDatabase(settings);\n\t\t}\n\t\telse db = new LocalPSVDatabase(settings);\n\t\tjava.util.ArrayList<String> ids = db.getCandidateIdentifiers();\n\t\tCandidateList candidateList = db.getCandidateByIdentifier(ids);\n\t\t//SmilesOfExplPeaks\n\t\tfor(int i = 0; i < candidateList.getNumberElements(); i++) {\n\t\t\tICandidate candidate = candidateList.getElement(i);\n\t\t\tString fingerprintsOfExplPeaks = (String)candidate.getProperty(\"FragmentFingerprintOfExplPeaks\" + fingerprinttype);\n\t\t\tif(fingerprintsOfExplPeaks.equals(\"NA\") || fingerprintsOfExplPeaks.length() == 0) continue;\n\t\t\tfingerprintsOfExplPeaks = fingerprintsOfExplPeaks.trim();\n\t\t\t\n\t\t\tString[] fingerprintPairs = fingerprintsOfExplPeaks.split(\";\");\n\t\t\t\n\t\t\tfor(int k = 0; k < fingerprintPairs.length; k++) {\n\t\t\t\tString[] tmp1 = fingerprintPairs[k].split(\":\");\n\t\t\t\tDouble peak1 = Double.parseDouble(tmp1[0]);\n\t\t\t\tString fingerprint = null;\n\t\t\t\ttry {\n\t\t\t\t\tfingerprint = tmp1[1];\n\t\t\t\t\taddSortedFeature(peak1, fingerprint, peakMassesSorted, fingerprintsSorted);\n\t\t\t\t}\n\t\t\t\tcatch(Exception e) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tString nonExplMasses = (String)candidate.getProperty(\"NonExplainedPeaks\");\n\t\t\tif(!nonExplMasses.equals(\"NA\")) {\n\t\t\t\tString[] tmp = nonExplMasses.split(\";\");\n\t\t\t\tfor(int k = 0; k < tmp.length; k++) {\n\t\t\t\t\tdouble mass = Double.parseDouble(tmp[k]);\n\t\t\t\t\tif(mass > 2) {\n\t\t\t\t\t\taddMassSorted(mass, peakMassCounts, nonExplainedPeaks);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(nonExplainedPeaks.size() == 0 || !includeNonExplained) nonExplainedPeaksString.append(\"NA\");\n\t\telse {\n\t\t\tnonExplainedPeaksString.append(nonExplainedPeaks.get(0));\n\t\t\tif(peakMassCounts.get(0) > 1) {\n\t\t\t\tnonExplainedPeaksString.append(\":\");\n\t\t\t\tnonExplainedPeaksString.append(peakMassCounts.get(0));\n\t\t\t}\n\t\t\tfor(int i = 1; i < nonExplainedPeaks.size(); i++) {\n\t\t\t\tnonExplainedPeaksString.append(\";\");\n\t\t\t\tnonExplainedPeaksString.append(nonExplainedPeaks.get(i));\n\t\t\t\tif(peakMassCounts.get(i) > 1) {\n\t\t\t\t\tnonExplainedPeaksString.append(\":\");\n\t\t\t\t\tnonExplainedPeaksString.append(peakMassCounts.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tMassToFingerprintGroupListCollection peakToFingerprintGroupListCollection = new MassToFingerprintGroupListCollection();\n\t\t//print(peakMassesSorted, fingerprintsSorted);\n\t\tSystem.out.println(peakMassesSorted.size() + \" peak fingerprint pairs\");\n\n\t\tInteger id = 0;\n\t\tHashtable<Integer, ArrayList<Double>> grouplistid_to_masses = new Hashtable<Integer, ArrayList<Double>>();\n\t\tfor(int i = 0; i < peakMassesSorted.size(); i++) {\n\t\t\tDouble currentPeak = peakMassesSorted.get(i);\n\t\t\t//MassToFingerprintGroupList peakToFingerprintGroupList = peakToFingerprintGroupListCollection.getElementByPeakInterval(currentPeak, mzppm, mzabs);\n\t\t\tMassToFingerprintGroupList peakToFingerprintGroupList = peakToFingerprintGroupListCollection.getElementByPeak(currentPeak);\n\t\t\tif(peakToFingerprintGroupList == null) {\n\t\t\t\tpeakToFingerprintGroupList = new MassToFingerprintGroupList(currentPeak);\n\t\t\t\tpeakToFingerprintGroupList.setId(id);\n\t\t\t\tFingerprintGroup obj = new FingerprintGroup(0.0, null, null, null);\n\t\t\t\tobj.setFingerprint(fingerprintsSorted.get(i));\n\t\t\t\tobj.incrementNumberObserved();\n\t\t\t\tpeakToFingerprintGroupList.addElement(obj);\n\t\t\t\tpeakToFingerprintGroupListCollection.addElementSorted(peakToFingerprintGroupList);\n\t\t\t\taddMass(grouplistid_to_masses, id, currentPeak);\n\t\t\t\tid++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tInteger current_id = peakToFingerprintGroupList.getId();\n\t\t\t\taddMass(grouplistid_to_masses, current_id, currentPeak);\n\t\t\t\tFingerprintGroup fingerprintGroup = peakToFingerprintGroupList.getElementByFingerprint(new FastBitArray(fingerprintsSorted.get(i)));\n\t\t\t\tif(fingerprintGroup != null) {\n\t\t\t\t\tfingerprintGroup.incrementNumberObserved();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfingerprintGroup = new FingerprintGroup(0.0, null, null, null);\n\t\t\t\t\tfingerprintGroup.setFingerprint(fingerprintsSorted.get(i));\n\t\t\t\t\tfingerprintGroup.incrementNumberObserved();\n\t\t\t\t\tpeakToFingerprintGroupList.addElement(fingerprintGroup);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"before filtering \" + peakToFingerprintGroupListCollection.getNumberElements());\n\t\t\n\t\t//peakToFingerprintGroupListCollection.updatePeakMass(mzppm, mzabs);\n\t\tpeakToFingerprintGroupListCollection.updatePeakMass(grouplistid_to_masses);\n\t\n\t\t// test filtering\n\t\tif(occurThresh != null) peakToFingerprintGroupListCollection.filterByOccurence(occurThresh);\n\t\t\n\t\tpeakToFingerprintGroupListCollection.annotateIds();\n\t\t//get absolute numbers of single substructure occurences\n\t\t//N^(s)\n\t\tint[] substrOccurences = peakToFingerprintGroupListCollection.calculateSubstructureAbsoluteProbabilities();\n\t\tint[] peakOccurences = peakToFingerprintGroupListCollection.calculatePeakAbsoluteProbabilities();\n\n\t\t//counts\n\t\tif(probabilityType == 0) {\n\t\t\t// calculate P ( s | p ) \n\t\t\tpeakToFingerprintGroupListCollection.updateConditionalProbabilities();\n\t\t\tpeakToFingerprintGroupListCollection.setProbabilityToNumberObserved();\n\t\t\tpeakToFingerprintGroupListCollection.sortElementsByProbability();\n\t\t}\n\t\t//P ( s | p ) \n\t\tif(probabilityType == 1) {\n\t\t\t// calculate P ( s | p ) \n\t\t\tpeakToFingerprintGroupListCollection.updateConditionalProbabilities();\n\t\t\tpeakToFingerprintGroupListCollection.setProbabilityToConditionalProbability_sp();\n\t\t\tpeakToFingerprintGroupListCollection.sortElementsByProbability();\n\t\t}\n\t\t//P ( p | s ) \n\t\tif(probabilityType == 2) {\n\t\t\tSystem.out.println(\"annotating IDs\");\n\t\t\t// calculate P ( p | s ) \n\t\t\tpeakToFingerprintGroupListCollection.updateProbabilities(substrOccurences);\n\t\t\t\n\t\t\tpeakToFingerprintGroupListCollection.setProbabilityToConditionalProbability_ps();\n\t\t\tpeakToFingerprintGroupListCollection.sortElementsByProbability();\n\t\t}\n\t\t\n\t\t//P ( p , s )_s \n\t\tif(probabilityType == 3) {\n\t\t\tSystem.out.println(\"annotating IDs\");\n\t\t\t// calculate P ( p , s ) \n\t\t\tpeakToFingerprintGroupListCollection.updateJointProbabilitiesWithSubstructures(substrOccurences);\n\t\t\t\n\t\t\tpeakToFingerprintGroupListCollection.setProbabilityToJointProbability();\n\t\t\tpeakToFingerprintGroupListCollection.sortElementsByProbability();\n\t\t}\n\n\t\t//P ( p , s )_p\n\t\tif(probabilityType == 4) {\n\t\t\tSystem.out.println(\"annotating IDs\");\n\t\t\t// calculate P ( p , s ) \n\t\t\tpeakToFingerprintGroupListCollection.updateJointProbabilitiesWithPeaks(peakOccurences);\n\t\t\t\n\t\t\tpeakToFingerprintGroupListCollection.setProbabilityToJointProbability();\n\t\t\tpeakToFingerprintGroupListCollection.sortElementsByProbability();\n\t\t}\n\t\t\n\t\t//P ( s | p ) P ( p | s ) P( s, p )_s\n\t\t//SUMMARY \"number of different pairs (f,m) matched\" \"sum of all occurrences of all (f,m)\" \"number of different pairs (_,m)\" \"number of all different pairs (f,m)\"\n\t\tif(probabilityType == 5) {\n\t\t\tSystem.out.println(\"annotating IDs\");\n\t\t\tpeakToFingerprintGroupListCollection.updateConditionalProbabilities();\n\t\t\tpeakToFingerprintGroupListCollection.updateProbabilities(substrOccurences);\n\t\t\tpeakToFingerprintGroupListCollection.updateJointProbabilitiesWithSubstructures(substrOccurences);\n\t\t\t\n\t\t\tpeakToFingerprintGroupListCollection.setProbabilityToConditionalProbability_sp();\n\t\t\tpeakToFingerprintGroupListCollection.sortElementsByProbability();\n\t\t\tif(output == null) peakToFingerprintGroupListCollection.print();\n\t\t\telse {\n\t\t\t\tBufferedWriter bwriter = new BufferedWriter(new FileWriter(new File(output + \"_1\")));\n\t\t\t\tbwriter.write(nonExplainedPeaksString.toString());\n\t\t\t\tbwriter.newLine();\n\t\t\t\tbwriter.write(peakToFingerprintGroupListCollection.toString());\n\t\t\t\tbwriter.write(\"SUMMARY \" + getNumberMatchedElements(peakToFingerprintGroupListCollection) + \" \" + getNumberOccurences(peakToFingerprintGroupListCollection) + \" \" + getNumberNonMatchedElements(peakToFingerprintGroupListCollection) + \" \" + getNumberElements(peakToFingerprintGroupListCollection));\n\t\t\t\tbwriter.newLine();\n\t\t\t\tbwriter.close();\n\t\t\t}\n\t\t\t\n\t\t\tpeakToFingerprintGroupListCollection.setProbabilityToConditionalProbability_ps();\n\t\t\tpeakToFingerprintGroupListCollection.sortElementsByProbability();\n\t\t\tif(output == null) peakToFingerprintGroupListCollection.print();\n\t\t\telse {\n\t\t\t\tBufferedWriter bwriter = new BufferedWriter(new FileWriter(new File(output + \"_2\")));\n\t\t\t\tbwriter.write(nonExplainedPeaksString.toString());\n\t\t\t\tbwriter.newLine();\n\t\t\t\tbwriter.write(peakToFingerprintGroupListCollection.toString());\n\t\t\t\tbwriter.write(\"SUMMARY \" + getNumberMatchedElements(peakToFingerprintGroupListCollection) + \" \" + getNumberOccurences(peakToFingerprintGroupListCollection) + \" \" + getNumberNonMatchedElements(peakToFingerprintGroupListCollection) + \" \" + getNumberElements(peakToFingerprintGroupListCollection));\n\t\t\t\tbwriter.newLine();\n\t\t\t\tbwriter.close();\n\t\t\t}\n\n\t\t\tpeakToFingerprintGroupListCollection.setProbabilityToJointProbability();\n\t\t\tpeakToFingerprintGroupListCollection.sortElementsByProbability();\n\t\t\tif(output == null) peakToFingerprintGroupListCollection.print();\n\t\t\telse {\n\t\t\t\tBufferedWriter bwriter = new BufferedWriter(new FileWriter(new File(output + \"_3\")));\n\t\t\t\tbwriter.write(nonExplainedPeaksString.toString());\n\t\t\t\tbwriter.newLine();\n\t\t\t\tbwriter.write(peakToFingerprintGroupListCollection.toString());\n\t\t\t\tbwriter.write(\"SUMMARY \" + getNumberMatchedElements(peakToFingerprintGroupListCollection) + \" \" + getNumberOccurences(peakToFingerprintGroupListCollection) + \" \" + getNumberNonMatchedElements(peakToFingerprintGroupListCollection) + \" \" + getNumberElements(peakToFingerprintGroupListCollection));\n\t\t\t\tbwriter.newLine();\n\t\t\t\tbwriter.close();\n\t\t\t}\n\t\t}\n\n\t\tif(probabilityType != 5) {\n\t\t\tif(output == null) peakToFingerprintGroupListCollection.print();\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"writing to output\");\n\t\t\t\tBufferedWriter bwriter = new BufferedWriter(new FileWriter(new File(output)));\n\t\t\t\tbwriter.write(nonExplainedPeaksString.toString());\n\t\t\t\tbwriter.newLine();\n\t\t\t\tbwriter.write(peakToFingerprintGroupListCollection.toString());\n\t\t\t\tbwriter.write(\"SUMMARY \" + getNumberMatchedElements(peakToFingerprintGroupListCollection) + \" \" + getNumberOccurences(peakToFingerprintGroupListCollection) + \" \" + getNumberNonMatchedElements(peakToFingerprintGroupListCollection) + \" \" + getNumberElements(peakToFingerprintGroupListCollection));\n\t\t\t\tbwriter.newLine();\n\t\t\t\tbwriter.close();\n\t\t\t}\n\t\t}\n\t}", "public double[] getFFTBinFrequencies()\n {\n \tdouble[] FFTBins = new double[frameLength];\n \tdouble interval = samplingRate / frameLength;\n \tfor(int i = 0; i < frameLength; i++)\n \t{\n \t\tFFTBins[i] = interval * i;\n \t}\n \t\n \treturn FFTBins;\n }", "public abstract double samplingFrequency();", "public static void main(String[] args) throws FileNotFoundException, IOException {\n\t\tString input = \"\";\r\n\r\n\t\t//읽어올 파일 경로\r\n\t\tString filePath = \"C:/Users/user/Desktop/data13_huffman.txt\";\r\n\r\n\t\t//파일에서 읽어옴\r\n\t\ttry(FileInputStream fStream = new FileInputStream(filePath);){\r\n\t\t\tbyte[] readByte = new byte[fStream.available()];\r\n\t\t\twhile(fStream.read(readByte) != -1);\r\n\t\t\tfStream.close();\r\n\t\t\tinput = new String(readByte);\r\n\t\t}\r\n\r\n\t\t//빈도수 측정 해시맵 생성\r\n\t\tHashMap<Character, Integer> frequency = new HashMap<>();\r\n\t\t//최소힙 생성\r\n\t\tList<Node> nodes = new ArrayList<>();\r\n\t\t//테이블 생성 해시맵\r\n\t\tHashMap<Character, String> table = new HashMap<>();\r\n\r\n\t\t//노드와 빈도수 측정\r\n\t\tfor(int i = 0; i < input.length(); i++) {\r\n\t\t\tif(frequency.containsKey(input.charAt(i))) {\r\n\t\t\t\t//이미 있는 값일 경우 빈도수를 1 증가\r\n\t\t\t\tchar currentChar = input.charAt(i);\r\n\t\t\t\tfrequency.put(currentChar, frequency.get(currentChar) + 1);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t//키를 생성해서 넣어줌\r\n\t\t\t\tfrequency.put(input.charAt(i), 1);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//최소 힙에 저장\r\n\t\tfor(Character key : frequency.keySet()) \r\n\t\t\tnodes.add(new Node(key, frequency.get(key), null, null));\r\n\t\t\t\t\r\n\t\t//최소힙으로 정렬\r\n\t\tbuildMinHeap(nodes);\r\n\r\n\t\t//huffman tree를 만드는 함수 실행\r\n\t\tNode resultNode = huffman(nodes);\r\n\r\n\t\t//파일에 씀 (table)\r\n\t\ttry(FileWriter fw = new FileWriter(\"201702034_table.txt\")){\r\n\t\t\tmakeTable(table, resultNode, \"\");\r\n\t\t\tfor(Character key : table.keySet()) {\r\n\t\t\t\t//System.out.println(key + \" : \" + table.get(key));\r\n\t\t\t\tfw.write(key + \" : \" + table.get(key) + \"\\n\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//파일에 씀 (encoded code)\r\n\t\ttry(FileWriter fw = new FileWriter(\"201702034_encoded.txt\")){\r\n\t\t\tString allString = \"\";\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < input.length(); i++)\r\n\t\t\t\tallString += table.get(input.charAt(i));\r\n\r\n\t\t\t//System.out.println(allString);\r\n\t\t\tfw.write(allString);\r\n\t\t}\r\n\t}", "public static HighScoresTable loadFromFile(File filename) {\n HighScoresTable newScoresTable = new HighScoresTable(4);\n ObjectInputStream inputStream = null;\n try {\n inputStream = new ObjectInputStream(new FileInputStream(filename));\n List<ScoreInfo> scoreFromFile = (List<ScoreInfo>) inputStream.readObject();\n if (scoreFromFile != null) {\n //scoreFromFile.clear();\n newScoresTable.scoreInfoList.addAll(scoreFromFile);\n }\n } catch (FileNotFoundException e) { // Can't find file to open\n System.err.println(\"Unable to find file: \" + filename);\n //return scoresTable;\n } catch (ClassNotFoundException e) { // The class in the stream is unknown to the JVM\n System.err.println(\"Unable to find class for object in file: \" + filename);\n //return scoresTable;\n } catch (IOException e) { // Some other problem\n System.err.println(\"Failed reading object\");\n e.printStackTrace(System.err);\n //return scoresTable;\n } finally {\n try {\n if (inputStream != null) {\n inputStream.close();\n }\n } catch (IOException e) {\n System.err.println(\"Failed closing file: \" + filename);\n }\n }\n return newScoresTable;\n\n\n }", "void readGraphFromFile();", "public List<Double> processFile() throws AggregateFileInitializationException {\n \t\t \n \t\tint maxTime = 0;\n \t\tHashMap<String, List<Double>> data = new HashMap<String,List<Double>>();\n \t\ttry {\n \t String record; \n \t String header;\n \t int recCount = 0;\n \t List<String> headerElements = new ArrayList<String>();\n \t FileInputStream fis = new FileInputStream(scenarioData); \n \t BufferedReader d = new BufferedReader(new InputStreamReader(fis));\n \t \n \t //\n \t // Read the file header\n \t //\n \t if ( (header=d.readLine()) != null ) { \n \t \t\n \t\t StringTokenizer st = new StringTokenizer(header );\n \t\t \n \t\t while (st.hasMoreTokens()) {\n \t\t \t String val = st.nextToken(\",\");\n \t\t \t headerElements.add(val.trim());\n \t\t }\n \t } // read the header\n \t /////////////////////\n \t \n \t // set up the empty lists\n \t int numColumns = headerElements.size();\n \t for (int i = 0; i < numColumns; i ++) {\n \t \tString key = headerElements.get(i);\n \t \t if(validate(key)) {\n \t \t\tdata.put(key, new ArrayList<Double>());\n \t\t }\n \t \t\n \t }\n \t \n \t // Here we check the type of the data file\n \t // by checking the header elements\n \t \n \t \n \t \n \t //////////////////////\n // Read the data\n //\n while ( (record=d.readLine()) != null ) { \n recCount++; \n \n StringTokenizer st = new StringTokenizer(record );\n int tcount = 0;\n \t\t\t\twhile (st.hasMoreTokens()) {\n \t\t\t\t\tString val = st.nextToken(\",\");\n \t\t\t\t\tString key = headerElements.get(tcount);\n \t\t\t\t\tif(validate(key)) {\n \t\t\t\t\t\tidSet.add(key);\n \t\t\t\t\t\tList<Double> dataList = data.get(key);\n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\tDouble dVal = new Double(val.trim());\n \t\t\t\t\t\t\tdataList.add(dVal);\n \t\t\t\t\t\t\tif (dataList.size() >= maxTime) maxTime = dataList.size();\n \t\t\t\t\t\t\tdata.put(key,dataList);\n \t\t\t\t\t\t} catch(NumberFormatException nfe) {\n \t\t\t\t\t\t\tdata.remove(key);\n \t\t\t\t\t\t\tidSet.remove(key);\n \t\t\t\t\t\t\tActivator.logInformation(\"Not a valid number (\"+val+\") ... Removing key \"+key, null);\n \t\t\t\t\t\t}\n \t\t\t\t\t}\t\t\t\n \t\t\t\t\ttcount ++;\n \t\t\t\t}\n \t\t\t} // while file has data\n } catch (IOException e) { \n // catch io errors from FileInputStream or readLine()\n \t Activator.logError(\" IOException error!\", e);\n \t throw new AggregateFileInitializationException(e);\n }\n \n List<Double> aggregate = new ArrayList<Double>();\n for (int i = 0; i < maxTime; i ++) {\n \t aggregate.add(i, new Double(0.0));\n }\n // loop over all location ids\n Iterator<String> iter = idSet.iterator();\n while((iter!=null)&&(iter.hasNext())) {\n \t String key = iter.next();\n \t List<Double> dataList = data.get(key);\n \t for (int i = 0; i < maxTime; i ++) {\n \t\t double val = aggregate.get(i).doubleValue();\n \t\t val += dataList.get(i).doubleValue();\n \t aggregate.set(i,new Double(val));\n }\n }\n \n return aggregate;\n \t }", "public void recalcHistogram();", "public int readSamples(float[] samples);", "void collectLeastFrequent(FrequencyTable fq);", "@SuppressWarnings(\"unchecked\")\n\tpublic static Hashtable<Integer, ScoreCount<Integer>> readHashtableObject(ObjectInputStream stream) {\n\t\tHashtable<Integer, ScoreCount<Integer>> result = null;\n\t\ttry {\n\t\t\tresult = (Hashtable<Integer, ScoreCount<Integer>>) stream.readObject();\n\t\t} catch(IOException|ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}", "private HashMap<String, double[]> readFeature(String featurePath, int currCount){\n HashMap<String, double[]> fList = new HashMap<>();\n try{\n FileReader fr = new FileReader(featurePath);\n BufferedReader br = new BufferedReader(fr);\n\n String line = br.readLine();\n while(line != null){\n\n String[] split = line.trim().split(\"\\t\");\n if (split.length < 2)\n continue;\n double[] fs = new double[split.length - 1];\n for (int i = 1; i < split.length; i ++){\n fs[i-1] = Double.valueOf(split[i]);\n }\n\n fList.put(split[0], fs);\n \n // Update ProgressBar\n SoundEffectDemo.s_progressBar.setValue(currCount);\n \t\tdouble currPercentage = ((double) currCount / ((double) s_numTrainingData * 4.0)) * 100.0;\n \t\tSoundEffectDemo.s_progressBar.setString(String.format(\"%.2f\", currPercentage) + \"%\");\n \t\tcurrCount++;\n \t\t\n line = br.readLine();\n }\n br.close();\n\n }catch (Exception e){\n e.printStackTrace();\n }\n\n return fList;\n }", "public void readScoresFromFile(File f) throws IOException, FileNotFoundException{\r\n\t\tBufferedReader br = null;\r\n\t\ttry{\r\n\t\t\tFileReader fr = new FileReader(f);\r\n\t\t\tbr = new BufferedReader(fr);\r\n\t\t\t\r\n\t\t\tString str = br.readLine();\r\n\t\t\t\r\n\t\t\tfor (int count = 0; count < scores.length; count++){\r\n\t\t\t\tscores[9-count] = new HighScore(str, SEPARATOR);\r\n\t\t\t\tstr = br.readLine();\r\n\t\t\t}\r\n\t\t} catch (Exception ex){\r\n\t\t\tSystem.err.println(\"Trouble with file: \"+ex.getMessage());\r\n\t\t} finally {\r\n\t\t\ttry{\r\n\t\t\t\tif (br != null){\r\n\t\t\t\t\tbr.close();\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception ex1){\r\n\t\t\t\tex1.printStackTrace();\r\n\t\t\t\tSystem.exit(-1);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void readCSV() throws IOException {\n\t\tBufferedReader br = new BufferedReader(new FileReader(f));\n\t\tString line;\n\t\tif((line = br.readLine()) != null) {\n\t\t\tsetCSVorder(line);\n\t\t}\n\t\t\n\t\twhile((line = br.readLine()) != null) {\n\t\t\tFlightState fs = getStateFromCSV(line);\n\t\t\tsendToKafka(fs);\n\t\t}\n\t\t\n\t\tbr.close();\n\t}", "com.google.protobuf.ByteString\n getFrequencyBytes();", "public static void readTable(String tableName, String filename) {\n\n\t\t// System.out.println(filename);\n\n\t\tBufferedReader in = null;\n\t\ttry {\n\t\t\tin = new BufferedReader(new FileReader(dataDir + filename));\n\n\t\t\twhile (true) {\n\n\t\t\t\tString line = in.readLine();\n\n\t\t\t\tif (line == null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// remove | at end for tokenization\n\t\t\t\tline = line.substring(0, line.length() - 1);\n\n\t\t\t\t// line into tokens\n\t\t\t\tString[] tokens = line.split(attributeDelimiter);\n\t\t\t\tint numAttributes = tokens.length;\n\n\t\t\t\tassert (tokens.length == tableNameToOrdredSchema.get(tableName)\n\t\t\t\t\t\t.size());\n\n\t\t\t\tObject[] arr = new Object[numAttributes];\n\n\t\t\t\tfor (int i = 0; i < tokens.length; i++) {\n\n\t\t\t\t\tClass<?> type = tableNameToOrdredSchema.get(tableName).get(\n\t\t\t\t\t\t\ti).getType().getCorrespondingJavaClass();\n\t\t\t\t\tObject val = null;\n\n\t\t\t\t\tif (type.isAssignableFrom(String.class)) {\n\t\t\t\t\t\tval = tokens[i];\n\t\t\t\t\t} else if (type.isAssignableFrom(java.util.Date.class)) {\n\t\t\t\t\t\tval = new java.util.Date(tokens[i]);\n\t\t\t\t\t} else if (type.isAssignableFrom(java.lang.Integer.class)) {\n\t\t\t\t\t\tval = Integer.parseInt(tokens[i]);\n\t\t\t\t\t} else if (type.isAssignableFrom(java.lang.Double.class)) {\n\t\t\t\t\t\tval = Double.parseDouble(tokens[i]);\n\t\t\t\t\t} else if (type.isAssignableFrom(java.lang.Long.class)) {\n\t\t\t\t\t\tval = Long.parseLong(tokens[i]);\n\t\t\t\t\t} else if (type.isAssignableFrom(java.lang.Float.class)) {\n\t\t\t\t\t\tval = Float.parseFloat(tokens[i]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new RuntimeException(\"Type problem\");\n\t\t\t\t\t}\n\n\t\t\t\t\tarr[i] = val;\n\n\t\t\t\t}\n\n\t\t\t\tSampleRow row = new SampleRow(tableNameToOrdredSchema\n\t\t\t\t\t\t.get(tableName), arr);\n\n\t\t\t\tmyDatabase.getQueryInterface().insertRow(tableName, row);\n\n\t\t\t}\n\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public static HashMap<String, ArrayList<String>> CSVHeadData(String path) {\r\n\t\t\r\n\t\t// get the rows of the file\r\n\t\tString[] rows = read(path).split(\"(\\n)+\");\r\n\t\r\n\t\t\r\n\t\t// Initialize the map\r\n\t\tHashMap<String, ArrayList<String>> map = new HashMap<String, ArrayList<String>>();\r\n\t\t\r\n\t\t// Initialize keys\r\n\t\tArrayList<String> keys = new ArrayList<String>();\r\n\t\t// get the keys from the first row\r\n\t\tfor (String i : rows[0].split(\",\")) {\r\n\t\t\t// get rid of first and last spaces\r\n\t\t\tString current = i.trim();\r\n\t\t\t// add the current string to the list\r\n\t\t\tkeys.add(current);\r\n\t\t\t// add the key to the map and initialize the corresponding list\r\n\t\t\tmap.put(current, new ArrayList<String>());\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// iterate over the rest of the rows \r\n\t\tfor (int i = 1; i < rows.length; i++) {\r\n\t\t\tint j = 0;\r\n\t\t\tString[] currentRowWords = rows[i].split(\",\");\r\n\t\t\t\r\n\t\t\t// check if the number of values is equal to the number of keys\r\n\t\t\tif (currentRowWords.length != keys.size()) {\r\n\t\t\t\tSystem.out.println(\"Invalid row n: \" + (i + 1) + \r\n\t\t\t\t\t\t\".\\nNumber of values does not match number of keys\");\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// get the words from the row and add them to the list of appropriate key\r\n\t\t\tfor (String k : currentRowWords) {\r\n\t\t\t\tString current = k.trim();\r\n\t\t\t\tmap.get(keys.get(j)).add(current);\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// That's all Folks!\r\n\t\treturn map;\r\n\t}" ]
[ "0.58359486", "0.5574478", "0.5522366", "0.53779227", "0.5355143", "0.53485155", "0.5340709", "0.5297256", "0.52102107", "0.51476604", "0.50812584", "0.5060723", "0.50390875", "0.5006523", "0.49642655", "0.49473557", "0.4911949", "0.48895633", "0.48680946", "0.4857957", "0.48569447", "0.48553374", "0.48360217", "0.48343098", "0.48301533", "0.48199004", "0.4814658", "0.48068658", "0.4782141", "0.47142938", "0.47048697", "0.46841875", "0.4683496", "0.46784616", "0.46756056", "0.4636435", "0.46294677", "0.45999798", "0.45956966", "0.45468292", "0.454584", "0.45447102", "0.4531359", "0.45289952", "0.45177013", "0.44975293", "0.4484224", "0.44841972", "0.44837844", "0.44823676", "0.44753858", "0.44682938", "0.44664234", "0.44661963", "0.4462431", "0.44572416", "0.44569746", "0.44533747", "0.44518238", "0.445174", "0.4450391", "0.44352537", "0.44309673", "0.44259462", "0.44203928", "0.44157362", "0.441356", "0.44122615", "0.44098762", "0.44083646", "0.44079518", "0.44068423", "0.4405003", "0.44046497", "0.4403655", "0.4397802", "0.43874538", "0.4386317", "0.4382658", "0.43815935", "0.43788546", "0.43774545", "0.43764505", "0.43758017", "0.43711117", "0.43710545", "0.43692628", "0.4367117", "0.43644422", "0.4346068", "0.4343755", "0.4338862", "0.4336581", "0.4329424", "0.43177786", "0.43125868", "0.43101346", "0.43089163", "0.4301963", "0.4300652" ]
0.7700458
0
int position = getAdapterPosition(); Log.d("position", String.valueOf(position)); Log.d("cusIDDD", String.valueOf(CusId)); Log.d("view", String.valueOf(View1)); Toast.makeText(getApplicationContext(),pos,Toast.LENGTH_LONG).show();
@Override public void onClick(View v) { Toast.makeText(getActivity(), String.valueOf(CusId),Toast.LENGTH_LONG).show(); //Intent edit = new Intent(getActivity(),CustomerEdit.class); //edit.putExtra("CUSID", String.valueOf(CusIds.get(getPosition()))); //Log.d("view11", String.valueOf(CusIds.get(getPosition()))); // startActivity(edit); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void onItemClick(AdapterView<?> parent, View view,\r\n int position, long id) {\n int itemPosition = position;\r\n\r\n // ListView Clicked item value\r\n String itemValue = (String) listView.getItemAtPosition(position);\r\n\r\n // Show Alert\r\n Toast.makeText(getApplicationContext(),\r\n \"Position :\"+itemPosition+\" ListItem : \" +itemValue , Toast.LENGTH_LONG)\r\n .show();\r\n }", "@Override\n public void onClick(View v) {\n Toast.makeText(RecycleTestActivity.this, pos + \"\", Toast.LENGTH_SHORT)\n .show();\n }", "@Override\r\n public void onItemClick(AdapterView<?> parent, View view,\r\n int position, long id) {\n int itemPosition = position;\r\n\r\n // ListView Clicked item value\r\n String itemValue = (String) listView.getItemAtPosition(position);\r\n\r\n // Show Alert\r\n Toast.makeText(getApplicationContext(),\r\n \"Position :\"+itemPosition+\" ListItem : \" +itemValue , Toast.LENGTH_LONG)\r\n .show();\r\n\r\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n int itemPosition = position;\n\n // ListView Clicked item value\n String itemValue = (String) listView.getItemAtPosition(position);\n\n // Show Alert\n Toast.makeText(getApplicationContext(), \"Position :\" + itemPosition + \" ListItem : \" + itemValue , Toast.LENGTH_LONG).show();\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n int itemPosition = position;\n\n // ListView Clicked item value\n String itemValue = (String) listView.getItemAtPosition(position);\n\n // Show Alert\n Toast.makeText(getApplicationContext(),\n \"Position :\" + itemPosition + \" ListItem : \" + itemValue, Toast.LENGTH_LONG)\n .show();\n\n }", "@Override\r\n public void onClick(View view) {\r\n Toast.makeText(context, \"satu\" +list_data.get(getAdapterPosition()), Toast.LENGTH_SHORT).show();\r\n\r\n }", "@Override\n public void onClick(View v) {\n Toast.makeText(getApplicationContext(), String.valueOf(CusIds.get(getPosition())), Toast.LENGTH_LONG).show();\n Intent edit = new Intent(getApplicationContext(),CustomerEdit.class);\n edit.putExtra(\"CUSID\", String.valueOf(CusIds.get(getPosition())));\n Log.d(\"view11\", String.valueOf(CusIds.get(getPosition())));\n\n startActivity(edit);\n\n\n }", "@Override\n public void onItemClick(View view, int position) {\n Toast.makeText(getContext(), \"You clicked \" + adapter.getItem(position) + \" on row number \" + position, Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onClick(View v) {\n\n listener.onClickPosition(getAdapterPosition());\n // Log.d(\"TAG\", \"Element \" + getAdapterPosition() + \" clicked. \");\n }", "@Override\n public int getItemViewType(int position) {\n if (position == 0) {\n System.out.println(\"NUMPOSITIOOOOOON: \" + position);\n return 0;\n } else {\n System.out.println(\"NUMPOSITIOOOOOON: \" + position);\n return 1;\n }\n }", "@Override\n public View getView(final int position, View convertView, ViewGroup parent) {\n Holder holder = new Holder();\n View rowView;\n\n rowView = inflater.inflate(R.layout.inventory_management_item, null);\n holder.os_text = (TextView) rowView.findViewById(R.id.inventory_brand_qty_tv);\n\n\n holder.os_text.setText(result[position]);\n\n\n rowView.setOnClickListener(new View.OnClickListener() {\n\n @Override\n public void onClick(View v) {\n // TODO Auto-generated method stub\n Toast.makeText(context, \"You Clicked \" + result[position], Toast.LENGTH_SHORT).show();\n }\n });\n\n return rowView;\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {\n Toast.makeText(getActivity(), \"You Clicked \"+position+\" item. Wait For Coming Functions\",\n Toast.LENGTH_LONG).show();\n }", "@Override\npublic View getView(int position, View convertView, ViewGroup parent) {\n\tView view = convertView;\n\tif (view ==null){\n\t\tLayoutInflater inflater = LayoutInflater.from(getContext());\n\t\tview = inflater.inflate(nguyenthitrucgiang.com.dafastfoodstore.R.layout.item_list_danhmuc, null);\n\t}\n\tDanhMuc dm = getItem(position);\n\tif(dm!=null){\n\t\tTextView txtTen = (TextView)view.findViewById(nguyenthitrucgiang.com.dafastfoodstore.R.id.tv_tend);\n\t\tTextView txtId = (TextView)view.findViewById(nguyenthitrucgiang.com.dafastfoodstore.R.id.tv_Idd);\n\t\ttxtTen.setText(dm.getmTenDM());\n\t\ttxtId.setText(String.valueOf(dm.getmMaDM()));\n\t\t\n\t}\n\treturn view;\n}", "public void onItemClick(View view, int position) {\n\n }", "@Override\n\t\t \t public void onItemClick(AdapterView<?> arg0, View arg1,int position, long arg3) {\n\t\t \t \n\t\t \t Toast.makeText(getApplicationContext(), \"Clicked at Position\"+position, Toast.LENGTH_SHORT).show();\n\t\t \t }", "@Override\n public Object getItem(int position) {\n return position;\n }", "@Override\n public Object getItem(int position) {\n return position;\n }", "@Override\n public Object getItem(int position) {\n return position;\n }", "@Override\n public Object getItem(int position) {\n return position;\n }", "@Override\n public Object getItem(int position) {\n return position;\n }", "@Override\n public Object getItem(int position) {\n return position;\n }", "@Override\n public Object getItem(int position) {\n return position;\n }", "@Override\n public Object getItem(int position) {\n return position;\n }", "@Override\n public Object getItem(int position) {\n return position;\n }", "@Override\n public Object getItem(int position) {\n return position;\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> parent,View view,int position,long id){\n\t\tint id1 = parent.getId();\n\t\tLog.v(\"AAA\", position + \"\");\n\t\tif(id1 == R.id.gridview){\n\t\t\tpageNum = 1;\n\t\t\tif(position == 0){\n\t\t\t\tqueryData(\"零食\", 1);\n\t\t\t}else if(position == 1){\n\t\t\t\tqueryData(\"面包\", 1);\n\t\t\t}else if(position == 2){\n\t\t\t\tqueryData(\"饮料\", 1);\n\t\t\t}else if(position == 3){\n\t\t\t\tqueryData(\"日常用品\", 1);\n\t\t\t}\n\t\t}\n\t}", "@Override\n public Object getItem(int position) {\n return position;\n }", "@Override\n public Object getItem(int position) {\n return position;\n }", "@Override\n public Object getItem(int position) {\n return position;\n }", "@Override\n public Object getItem(int position) {\n return position;\n }", "@Override\n public Object getItem(int position) {\n return position;\n }", "@Override\n public Object getItem(int position) {\n return position;\n }", "@Override\n public Object getItem(int position) {\n return position;\n }", "@Override\n public void onClick(View view) {\n RecyclerView.ViewHolder viewHolder = (RecyclerView.ViewHolder) view.getTag();\n position = viewHolder.getAdapterPosition();\n\n // viewHolder.getItemId();\n // viewHolder.getItemViewType();\n// viewHolder.itemView.;\n //Station thisItem = stations2.get(position);\n //Station currentStation = stations2.get(position);\n //SharedPreferences sharedPreferences = getSharedPreferences(\"MasterSave\", MODE_PRIVATE);\n SharedPreferences prefs = getSharedPreferences(\"keeper\", Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = prefs.edit();\n //editor.putString(\"name\",nameofStation);\n editor.putInt(\"selected\", position);\n editor.apply();\n Objects.requireNonNull(recyclerView.getAdapter()).notifyDataSetChanged();//? may NULL\n\n Toast.makeText(MainActivity.this, \"You Clicked: \" + position, Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onListItemClick(ListView l, View v, int position, long id) {\n super.onListItemClick(l, v, position, id);\n SkillModel md = (SkillModel) l.getAdapter().getItem(position);\n //SkillModel md = ((pro_adapter)getListAdapter()).getItem(position);\n String pos = Integer.toString(position);\n Log.d(\"click\", pos);\n com.itemSelected(md.id);\n\n\n\n }", "@Override\n public void onBindViewHolder(ViewHolder holder, int position) {\n c.moveToPosition(position);\n holder.tv1.setText(c.getInt(0)+\"\");\n holder.tv2.setText(c.getString(1));\n holder.tv3.setText(c.getString(2));\n }", "public Object getItem(int position)\r\n {\n return position;\r\n }", "@Override\n public void onClick(WearableListView.ViewHolder viewHolder) {\n\n Toast.makeText(getActivity(),\n \"Order Details\",\n Toast.LENGTH_SHORT).show();\n\n\n FragmentManager fragmentManager = getFragmentManager();\n FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();\n\n View v = viewHolder.itemView;\n TextView name = (TextView)v.findViewById(R.id.name);\n // TextView item2 = (TextView)v.findViewById(R.id.item3);\n\n String itemName = name.getText().toString();\n // String item3 = item2.getText().toString();\n\n\n fragmentTransaction.replace(mContainerId, OrderDetailFragment.newInstance(itemName,\"\")).addToBackStack(null).commit();\n\n\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n String SlectedCountry = countryNameTwo[+position];\n Toast.makeText(getApplicationContext(), SlectedCountry, Toast.LENGTH_SHORT).show();\n\n }", "@Override\n public long getItemId(int position) {\n return ((Integer)((View) getItem(position)).getTag()).longValue();\n }", "@Override\n public void onClick(View view, int pos) {\n String tag = (String) view.getTag();\n Toast.makeText(XCArcMenuViewDemo.this, tag, Toast.LENGTH_SHORT).show();\n }", "@Override\n\t\tpublic long getItemId(int position) {\n\t\t\tLog.v(TAG, \"joey onItemClick getItemId :\" + position);\n\t\t\treturn position;\n\t\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n String SlectedCountry = countryNameThree[+position];\n Toast.makeText(getApplicationContext(), SlectedCountry, Toast.LENGTH_SHORT).show();\n\n }", "@Override\n public void onBindViewHolder(ViewHolder viewHolder, final int position)\n {\n Log.d(TAG, \"Element \" + position + \" set.\");\n\n if(position==0)\n {\n posicion=1;\n }\n if(position==1)\n {\n posicion=2;\n }\n if(position==2)\n {\n posicion=3;\n }\n if(position==3)\n {\n posicion=4;\n }\n if(position==4)\n {\n posicion=5;\n }\n if(position==5)\n {\n posicion=6;\n }\n\n // Get element from your dataset at this position and replace the contents of the view\n // with that element\n viewHolder.getTextView().setText(mDataSet[position]);\n }", "public View getView(int position, View convertView, ViewGroup parent) {\n\t\tViewHolder holder;\n\t\tif (convertView == null) {\n\t\t\tconvertView = mInflater.inflate(R.layout.operbusno_item, null);\n\t\t\tholder = new ViewHolder();\n\t\t\tholder.bus_no = (TextView)convertView .findViewById(R.id.txtBusNo);\n\t\t\tholder.trip = (TextView)convertView .findViewById(R.id.txt_trip);\n\t\t\tholder.trip_date = (TextView)convertView .findViewById(R.id.txtTripDate);\n\t\t\tholder.time = (TextView)convertView .findViewById(R.id.txtTime);\n\t\t\tholder.total_tickets = (TextView)convertView .findViewById(R.id.txtTotalticket);\n\t\t\tholder.total = (TextView)convertView .findViewById(R.id.txtTotal);\n\t\t\tholder.viewDetails = (Button)convertView.findViewById(R.id.btnDetails);\n\t\t\tconvertView.setTag(holder);\n\t\t} else {\n\t\t\tholder = (ViewHolder) convertView.getTag();\n\t\t}\n\t\t\n\t\tholder.bus_no.getLayoutParams().width = (int) (DeviceUtil.getInstance(aty).getWidth()) / 6;\n\t\tholder.trip.getLayoutParams().width = (int) (DeviceUtil.getInstance(aty).getWidth()) / 6;\n\t\tholder.trip_date.getLayoutParams().width = (int) (DeviceUtil.getInstance(aty).getWidth()) / 6;\n\t\tholder.time.getLayoutParams().width = (int) (DeviceUtil.getInstance(aty).getWidth()) / 6;\n\t\tholder.total_tickets.getLayoutParams().width = (int) (DeviceUtil.getInstance(aty).getWidth()) / 6;\n\t\tholder.total.getLayoutParams().width = (int) (DeviceUtil.getInstance(aty).getWidth()) / 6;\n\t\tholder.bus_no.setText(OReportOne.get(position).getBus_no());\n\t\tholder.trip.setText(OReportOne.get(position).getFrom()+\" - \"+OReportOne.get(position).getTo());\n\t\tholder.trip_date.setText(changeDate(OReportOne.get(position).getDeparture_date()));\n\t\tholder.time.setText(OReportOne.get(position).getTime());\n\t\tholder.total_tickets.setText(OReportOne.get(position).getPurchased_total_seat()+\"/\"+OReportOne.get(position).getTotal_seat());\n\t\tholder.total.setText(OReportOne.get(position).getTotal_amout().toString());\n\t\tholder.viewDetails.setTag(OReportOne.get(position).getBus_id());\n\t\tholder.viewDetails.setOnClickListener(new OnClickListener() {\n\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tSharedPreferences sharedPreferences = aty.getApplicationContext().getSharedPreferences(\"SearchbyOperator\",Activity.MODE_PRIVATE);\n\t\t\t\tSharedPreferences.Editor editor = sharedPreferences.edit();\n\t\t\t\teditor.putString(\"bus_id\", v.getTag().toString());\n\t\t\t\teditor.commit();\n\t\t\t\tIntent next = new Intent(aty.getApplication(), SeatDetailsbyBusnoActivity.class);\n\t\t\t\taty.startActivity(next);\n\t\t\t}\n\t\t});\n\t\treturn convertView;\n\t}", "@Override\n public int getItemViewType(int position) {\n return position;\n }", "@Override\n public int getItemViewType(int position) {\n return position;\n }", "@Override\n public int getItemViewType(int position) {\n return position;\n }", "private void setItemData(ViewHolder holder, int position) {\n final int loc = position;\n holder.textView_xingming.setText(list.get(position).getItemHuanzheName());\n holder.textView_jiuzhenhao.setText(list.get(position).getItemHuanzheId());\n\n if(list.get(position).getItemGuangzhu()) {\n holder.textView_guangzhu.setText(\"取消关注\");\n holder.textView_guangzhu.setBackgroundColor(Color.RED);\n }\n else {\n holder.textView_guangzhu.setText(\"关 注\");\n holder.textView_guangzhu.setBackgroundColor(context.getResources().getColor(android.R.color.holo_blue_dark));\n }\n\n holder.textView_guangzhu.setOnClickListener(new View.OnClickListener() {\n\n @Override\n public void onClick(View v) {\n // TODO Auto-generated method stub\n if(handler!=null){\n Message msg = new Message();\n Bundle bundle = new Bundle();\n bundle.putInt(\"data\", loc);\n msg.what = CHOICE_CONTROL_1;\n msg.setData(bundle);\n handler.sendMessage(msg);\n }\n }\n });\n\n holder.imageView_chakan.setOnClickListener(new View.OnClickListener() {\n\n @Override\n public void onClick(View v) {\n // TODO Auto-generated method stub\n if(handler!=null){\n Message msg = new Message();\n Bundle bundle = new Bundle();\n bundle.putInt(\"data\", loc);\n msg.what = CHOICE_CONTROL_TAIL;\n msg.setData(bundle);\n handler.sendMessage(msg);\n }\n }\n });\n\n holder.linearLayout_head.setOnClickListener(new View.OnClickListener() {\n\n @Override\n public void onClick(View v) {\n // TODO Auto-generated method stub\n if(handler!=null){\n Message msg = new Message();\n Bundle bundle = new Bundle();\n bundle.putInt(\"data\", loc);\n msg.what = CHOICE_CONTROL_HEAD;\n msg.setData(bundle);\n handler.sendMessage(msg);\n }\n }\n });\n }", "@Override\n public void onClick(View view) {\n slctdExpndColpsPostn = position;\n notifyDataSetChanged();\n }", "@Override\n public View getView(final int position, View convertView, ViewGroup parent) {\n Holder holder=new Holder();\n View rowView;\n rowView = inflater.inflate(R.layout.category_listview, null);\n holder.nameTextView=(TextView) rowView.findViewById(R.id.categoryName);\n holder.imgView=(ImageView) rowView.findViewById(R.id.categoryImage);\n holder.nameTextView.setText(categoryNames[position]);\n holder.imgView.setImageResource(categoryImages[position]);\n rowView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n // TODO Auto-generated method stub\n lastSelectedSpotIndex=position;\n Toast.makeText(context, \"You Clicked \"+categoryNames[position], Toast.LENGTH_LONG).show();\n }\n });\n return rowView;\n }", "@Override\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\t\t ViewHolder viewholder = null;\n\n\t\t\t if(convertView == null)\n\t {\n\t\t\t\t viewholder = new ViewHolder();\n\t convertView = mInflater.inflate(R.layout.dialog_edit_bill_item, null);\n\t \n\t viewholder.textView1 = (TextView)convertView.findViewById(R.id.diaTextView1);\n\t \n\t convertView.setTag(viewholder);\n\t }else\n\t {\n\t \t viewholder = (ViewHolder)convertView.getTag();\n\t }\n\n\t\t\t viewholder.textView1.setText(data[position]);\n\t return convertView;\n\t\t}", "@Override\n public void onClick(View v) {\n Toast.makeText(mContext, \"You Clicked \" + position, Toast.LENGTH_LONG).show();\n }", "@Override\n public void onItemClick(View view, int position) {\n\n }", "public Object getItem(int position) {\n return position;\n }", "public Object getItem(int position) {\n return position;\n }", "@Override\n public int getItemViewType(int position) {\n if(dataset.get(position).getName().equals(MySmsMessage.TOTO)){\n return 0;\n }\n return 1;\n }", "public long getItemId(int position)\n {\n return position;\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String item = parent.getItemAtPosition(position).toString();\n\n //System.out.println(position);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n String SlectedCountry = countryName[+position];\n Toast.makeText(getApplicationContext(), SlectedCountry, Toast.LENGTH_SHORT).show();\n\n }", "@Override\n public void onBindViewHolder(ProductViewHolder holder, int position) {\n zikar product = zikarList.get(position);\n\n //binding the data with the viewholder views\n holder.textViewID1.setText((String.valueOf(product.getId())));\n holder.textViewTitle.setText(product.getZikarName());\n holder.textViewPrice.setText(String.valueOf(product.getCounter()));\n holder.textViewRemainingCount.setText(String.valueOf(product.getRemainingCounter()));\n\n\n\n }", "public void onItemClick(View view, int position);", "public Object getItem(int position) {\n return position;\n }", "public Object getItem(int position) {\n return position;\n }", "public Object getItem(int position) {\n return position;\n }", "public Object getItem(int position) {\n return position;\n }", "public Object getItem(int position) {\n return position;\n }", "@Override\n public long getItemId(int position){\n return position;\n }", "@Override\n public long getItemId(int position){\n return position;\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n listview = (ListView) findViewById(R.id.listview);\n ArrayList<PoolBean> poolAl=new ArrayList<PoolBean>();\n for(int i=0;i<10;i++)\n {\n \tPoolBean poolObj=new PoolBean();\n \t\n \tpoolObj.setPseats(\"seats\"+i);\n \tpoolObj.setPfrom(\"from\"+i);\n \tpoolObj.setPto(\"to\"+i);\n \tpoolObj.setPvia(\"via\"+i);\n \tpoolObj.setPdate(\"date\"+i);\n \tpoolObj.setPtime(\"time\"+i);\n \t\n \tpoolAl.add(poolObj);\n \t\n \t\n }\n \n YourAdapter yaObj = new YourAdapter(this, poolAl);\n listview.setAdapter(yaObj); \n \n \n listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n public void onItemClick(AdapterView<?> av, View view, int i, long l) {\n Toast.makeText(StackActivity.this, \"myPos \"+i, Toast.LENGTH_LONG).show();\n }\n });\n }", "public void handleItemClick(Integer position) {\n\n\n if(position>=mDataset.size() || position <0){\n //not valid\n }\n else {\n //go to study view for this flashcard set\n Intent intent = new Intent(this, FlashcardActivity.class);\n intent.putExtra(\"setId\", mDataset.get(position).getSetId());\n intent.putExtra(\"setName\", mDataset.get(position).getName());\n startActivity(intent);\n }\n\n\n }", "@Override\n public void onItemClick(AdapterView<?> a, View v, int position, long id) {\n Toast.makeText(getApplicationContext(), \"Selected :\" + \" \" + listData.get(position), Toast.LENGTH_LONG).show();\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {\n\t\tIntent intent;\n\t\tif (\"0\".equals(dpjDinDanAdapter.getData().get(position).getUnion_type())) {\n\t\t\tintent = new Intent(getActivity(), TuiKuanDinDanDetailActivity.class);\n\t\t\tintent.putExtra(\"order_id\", dpjDinDanAdapter.getData().get(position).getOrder_id());\n\t\t\tstartActivityForResult(intent, 100);\n\t\t}else if (\"3\".equals(dpjDinDanAdapter.getData().get(position).getUnion_type())) {\n\t\t\tintent = new Intent(getActivity(), CCQDinDanDetailActivity.class);\n\t\t\tintent.putExtra(\"order_id\", dpjDinDanAdapter.getData().get(position).getOrder_id());\n\t\t\tstartActivityForResult(intent, 200);\n\t\t}else if (\"2\".equals(dpjDinDanAdapter.getData().get(position).getUnion_type())) {\n\t\t\tintent = new Intent(getActivity(), XiaofeiMaidanDetailActivity.class);\n\t\t\tintent.putExtra(\"order_id\", dpjDinDanAdapter.getData().get(position).getOrder_id());\n\t\t\tstartActivityForResult(intent, 300);\n\t\t}\n\t}", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n ViewHolder holder = null;\n if (convertView == null) {\n holder = new ViewHolder();\n convertView = LayoutInflater.from(context).inflate(R.layout.item_loclist, null);\n\n holder.textView = (TextView) convertView.findViewById(R.id.item_loclist_address);\n holder.textAddress = (TextView) convertView.findViewById(R.id.item_loclist_addressDetail);\n// holder.imageLl = (ImageView) convertView.findViewById(R.id.image);\n convertView.setTag(holder);\n\n } else {\n holder = (ViewHolder) convertView.getTag();\n }\n Log.i(\"mybaidumap\", \"name地址是:\" + dataList.get(position).name);\n Log.i(\"mybaidumap\", \"address地址是:\" + dataList.get(position).address);\n\n holder.textView.setText(dataList.get(position).name);\n holder.textAddress.setText(dataList.get(position).address);\n if (checkPosition == position) {\n } else {\n }\n\n\n return convertView;\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1,\n\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\tif (sACTIVITY_POS == arg2) {\n\t\t\t\t\tsACTIVITY_POS = -1;\n\t\t\t\t} else\n\t\t\t\t\tsACTIVITY_POS = arg2;\n\t\t\t//\tsACTIVITY_POS = arg2;\n\t\t\t\tactivityAdapter.notifyDataSetChanged();\n\t\t\t\t\n\n\t\t\t}", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long rowId) {\n\n Log.d(\"ROWSELECT\", \"\" + rowId);\n //Toast.makeText(this,\"Elemento Clicado\" + position,Toast.LENGTH_SHORT).show();\n Intent intent= new Intent(getApplicationContext(),productDetailActivity.class);\n intent.putExtra(\"producto\",mAdapter.getItem(position).getProducto());\n intent.putExtra(\"precio\",String.valueOf(mAdapter.getItem(position).getPrecio()));\n startActivity(intent);\n }", "@Override\n public void onItemClick(int position) {\n String name = mContentRvAdapter.getData().get(position).getName();\n int categoryId = mContentRvAdapter.getData().get(position).getCategoryId();\n// CommodityDetailsActivity.startActivity(getActivity(), commodityId);\n BusinessListActivity2.startActivity(getActivity(),categoryId,name,0);\n }", "@Override\n public void onItemClick(View view, int position) {\n }", "@Override\n public void onItemClick(View view, int position) {\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View v, int position, long id) {\n switch(position){\n\n case 4:\n Intent intent = new Intent(MainActivity.this, CancionesRomanticas.class);\n startActivity(intent);\n break;\n case 0:\n Toast.makeText(MainActivity.this, \"Has pulsado Lista Vacía\", Toast.LENGTH_LONG).show();\n break;\n\n case 1:\n Toast.makeText(MainActivity.this, \"Has pulsado Música para dormir \", Toast.LENGTH_LONG).show();\n break;\n\n case 2:\n Toast.makeText(MainActivity.this, \"Has pulsado pop en español\", Toast.LENGTH_LONG).show();\n break;\n\n case 3:\n Intent intent2 = new Intent(MainActivity.this, CancionesFavoritas.class);\n startActivity(intent2);\n //Toast.makeText(MainActivity.this, \"Has pulsado Canciones favoritas\", Toast.LENGTH_LONG).show();\n break;\n }\n\n\n }", "@Override\n public void onItemClick(View view, int position){\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\t\tString text = listview.getItemAtPosition(position)+\"\";\n\t\t\n\t\tToast.makeText(context, \"position=\"+position+\" text=\"+text, Toast.LENGTH_SHORT).show();\n\t}", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {\n posicion_click = position;\n Intent intent = new Intent(getActivity(),select.class);\n startActivity(intent);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Log.w(TAG , \"POSITION : \" + position);\n\n itemClick(position);\n }", "@Override\n public long getItemId(int position)\n {\n return position;\n }", "@Override\n public long getItemId(int position)\n {\n return position;\n }", "@Override\n public long getItemId(int position)\n {\n return position;\n }", "@Override\n public void onClick(View v) {\n\n\n final String catID = v.getTag(R.id.relativeLayoutthumbnail).toString();\n File_Confix_Data.string_id_data = catID;\n // Toast.makeText(MainactivityMain_Healthy_S.this, File_Confix_Data.string_id_data, Toast.LENGTH_SHORT).show();\n\n\n for (int i = 0; i < File_Confix_Data.getOutput_List_Data.size(); i++) {\n\n if (File_Confix_Data.getOutput_List_Data.get(i).getHealthy_id().equals(File_Confix_Data.string_id_data)) {\n\n File_Confix_Data.position_id = i;\n }\n }\n //Toast.makeText(MainactivityMain_Healthy_S.this, File_Confix_Data.string_id_data+\" \"+File_Confix_Data.position_id, Toast.LENGTH_SHORT).show();\n\n Intent intent = new Intent(Mainactivity_Healthy.this, SuccessActivity_Healthy.class);\n startActivity(intent);\n }", "public long getItemId(int position)\n {\n return position;\n }", "@Override\n protected void onItemClickListener(int adapterPosition, int layoutPosition) {\n\n\n CondicaoPagamento condpgto = adaptercondpgto.getItems().get(adapterPosition);\n if (selecionandoCondPgto) {\n Intent data = new Intent();\n data.putExtra(\"condpgto_id\", condpgto.getIdcodicaopagamento());\n setResult(RESULT_OK, data);\n finish();\n } else {\n idcondpgto = condpgto.getIdcodicaopagamento();\n nomecondpgto = condpgto.getDescricao();\n\n }\n\n }", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tViewHodler viewHodler = ViewHodler.getViewHodler(mContext, convertView, parent,layoutId, position);\n\t\tTextView mTextView = viewHodler.getView(viewId);//根据viewID来查找view\n\t\t\n\t\treturn null;\n\t}", "@Override\r\n public Object getItem(int position) {\n return arraylist.get(position);//get position\r\n }", "@Override\r\n public void onClick(View v) {\n int selectedDoctorPosition = viewHolder.getAdapterPosition();\r\n enterDocterDetailsActivity(selectedDoctorPosition);\r\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n switch (position){\n case 0:\n Intent intentcaidatcoban = new Intent(getActivity(), CaidatconbanActivity.class);\n startActivity(intentcaidatcoban);\n break;\n case 1:\n Intent intentThucpham = new Intent(getActivity(), ThucphamActivity.class);\n startActivity(intentThucpham);\n break;\n }\n }", "public View getView(int position, View v, ViewGroup parent) {\n\t\t\tif (v == null) {\n\t\t\t\tv = inflater.inflate(\n\t\t\t\t\t\tR.layout.admission_info_menu_row, parent,\n\t\t\t\t\t\tfalse);\n\t\t\t}\n\n\t\t\tTextView tv_str1 = (TextView) v.findViewById(R.id.admission_info_row_Tv01);\n\t\t\tImageView lv_img1 = (ImageView)v.findViewById(R.id.admission_info_row_Iv01);\n\n\t\t\tmTitle = new TitleDTO();\n\t\t\tmTitle = arrTitle.get(position);\n\t\t\t\n\t\t\tif (mTitle != null) {\n\t\t\t\tlv_img1.setImageResource(R.drawable.telicon); \n\t\t\t\ttv_str1.setText(mTitle.title);\n\t\t\t\t\n\t\t\t\ttv_str1.setTag(position);\n\t\t\t\tlv_img1.setTag(position);\n\t\t\t\t\n\t\t\t\ttv_str1.setOnClickListener(new View.OnClickListener() {\n\t\t\t\t\t\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t// 홈페이지 이동\n\t\t\t\t\t\tmTitle = arrTitle.get((Integer)v.getTag());\n\t\t\t\t\t\tIntent i = new Intent(Intent.ACTION_VIEW, Uri.parse(mTitle.url));\n\t\t\t\t\t\tstartActivity(i);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tlv_img1.setOnClickListener(new View.OnClickListener() {\n\t\t\t\t\t\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t// 전화걸기\n\t\t\t\t\t\tmTitle = arrTitle.get((Integer)v.getTag());\n\t\t\t\t\t\tString tel = \"tel:\" + mTitle.tel;\n\t\t\t\t\t\tIntent call_phone = new Intent(Intent.ACTION_VIEW, Uri.parse(tel));\n\t\t\t\t\t startActivity(call_phone);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn v;\n\t\t}", "@Override \n \tpublic void onItemClick(AdapterView<?> parent, View v, int position, long id)\n \t{\n \t\tIntent intent = new Intent(GridLayoutActivity.this,ImageViewActivity.class);\n \t\tintent.putExtra(GridLayoutActivity.EXTRA_RES_ID,(int)id);\n// \t\tSystem.out.println(\"===============>\"+id);\n \t\tToast.makeText(getApplicationContext(), \"Displaying \"+carsName[position],\n \t\t\t\t Toast.LENGTH_LONG).show();//Showing toast in the bottom for the selected car\n \t\tstartActivity(intent);\n \t}", "@Override\n\t\t\t public void onItemClick(AdapterView<?> parent, View view,int position, long id) \n\t\t\t {\n\t\t\t\t int itemPosition = position;\n\t\t\t\t // ListView Clicked item value\n\t\t\t\t String itemValue = (String)lv.getItemAtPosition(position);\n\t\t\t\t int xyz= a2.getPosition(itemValue);\n\t\t\t\t //lv.setSelection(xyz);\n\t\t\t\t //lv.setSelected(true);\n\t\t\t\t // Show Alert \n\t\t\t\t Toast.makeText(getApplicationContext(),\n\t\t\t\t \"Position :\"+itemPosition+\" actual pos\"+xyz+\" ListItem : \" +itemValue , Toast.LENGTH_LONG).show();\n\t\t\t\t //lv.setSelection(xyz);\n\t\t\t\t \n\t\t\t\t list3=Mlist.get(xyz);\n\t\t\t\t Iterator<String> i = list3.iterator();\n\t\t\t\t String temp=\"\";\n\t\t\t\t \n\t\t\t\t do{\n\t\t\t\t\t String temp2 = i.next();\n\t\t\t\t\ttemp= temp+\" \"+temp2+\"-\";\n\t\t\t\t\tlist4.add(temp2);\n\t\t\t\t } while(i.hasNext());\n\t\t\t\n\t\t\t\t String itemtemp=itemValue+\" \"+temp;\n\t\t\t\t list1.add(itemtemp);\n\t\t\t\t lv1.getCheckedItemIds();\n\t\t\t\t lv1.setAdapter(adapter1);\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t \n\t\t\t }", "@Override\n public long getItemId(int position) {\n return position;\n }", "@Override\n public long getItemId(int position) {\n return position;\n }", "@Override\n public long getItemId(int position) {\n return position;\n }" ]
[ "0.6950924", "0.69398344", "0.6939531", "0.6932984", "0.6869816", "0.68682015", "0.6853899", "0.6666118", "0.6661697", "0.66440624", "0.6615418", "0.6592794", "0.65296894", "0.6527119", "0.6517183", "0.65034086", "0.65034086", "0.65034086", "0.65034086", "0.65034086", "0.65034086", "0.65034086", "0.65034086", "0.65034086", "0.65034086", "0.6495495", "0.6489274", "0.6489274", "0.6489274", "0.6489274", "0.6489274", "0.6489274", "0.6489274", "0.6467821", "0.64624214", "0.64604366", "0.6411687", "0.6387267", "0.6369802", "0.6364473", "0.6357666", "0.6357484", "0.63509357", "0.634728", "0.6345923", "0.6343919", "0.6343919", "0.6343421", "0.63401645", "0.6336448", "0.6323157", "0.63199717", "0.63124996", "0.63065934", "0.63052964", "0.63052964", "0.6290954", "0.6285129", "0.62844115", "0.6284069", "0.62828803", "0.6280328", "0.6278289", "0.6278289", "0.6278289", "0.6278289", "0.6278289", "0.627485", "0.627485", "0.6265831", "0.62606907", "0.6251776", "0.6242411", "0.62402856", "0.62372357", "0.62350434", "0.623429", "0.6216617", "0.6216617", "0.621228", "0.6209397", "0.61983687", "0.6198315", "0.61959237", "0.61912024", "0.61912024", "0.61912024", "0.6185276", "0.61841786", "0.61813754", "0.6180434", "0.6172035", "0.61708397", "0.6152468", "0.6150462", "0.6147654", "0.6137106", "0.61355186", "0.61355186", "0.61355186" ]
0.6957004
0
Gets integer property as Integer object and catches exceptions for wrongly formated numbers, returning null in those cases.
public Integer getPropertyAsInteger(String property) { try { return Integer.valueOf(properties.getProperty(property)); } catch (NumberFormatException e) { } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static Integer getIntegerProperty(Dictionary<?, ?> properties,\n String propertyName) {\n Integer value = null;\n try {\n String s = Tools.get(properties, propertyName);\n value = isNullOrEmpty(s) ? value : Integer.parseInt(s);\n } catch (NumberFormatException | ClassCastException e) {\n value = null;\n }\n return value;\n }", "public static Integer getInteger(String inKey) {\r\n Object o = getProperties().get(inKey);\r\n\r\n if (o == null) {\r\n if (LOG.isDebugEnabled()) {\r\n LOG.debug(\"getInteger: \" + inKey + \", result null\");\r\n }\r\n return null;\r\n }\r\n\r\n if (LOG.isDebugEnabled()) {\r\n LOG.debug(\"getInteger: \" + inKey + \", result \" + o);\r\n }\r\n if (o instanceof Integer) {\r\n return (Integer) o;\r\n }\r\n if (!(o instanceof String)) {\r\n throw new IllegalArgumentException(\"Config property: \" + inKey\r\n + \" is not an Integer or String: \" + o.getClass());\r\n }\r\n try {\r\n return new Integer((String) o);\r\n } catch (Exception e) {\r\n LOG.warn(\"Not an integer value: \" + o + \" for property \" + inKey);\r\n return null;\r\n }\r\n }", "public int getIntegerProperty(String key) {\n String val = getProperty(key);\n return (null == val ? 1 : Integer.parseInt(val));\n }", "public\n int getProperty_int(String key)\n {\n if (key == null)\n return 0;\n\n String val = getProperty(key);\n\n if (val == null)\n return 0;\n\n int ret_int = 0;\n try\n {\n Integer workint = new Integer(val);\n ret_int = workint.intValue();\n }\n catch(NumberFormatException e)\n {\n ret_int = 0;\n }\n\n return ret_int;\n }", "public static int getInt() throws Exception {\n return getInt(null);\n }", "protected synchronized int getIntegerValue(String tag) {\n int returnInt = 0;\n if (actualProperties != null) {\n returnInt = Integer.decode(actualProperties.getProperty(tag, \"0\"));\n }\n return returnInt;\n }", "private static int getIntegerProperty(String key) {\n String value = PROPERTIES.getProperty(key);\n // if the key is not found, Properties will return null and we should return a default value\n if (value == null) {\n return 0;\n }\n return Integer.parseInt(value);\n }", "public Integer getInt(String key) throws JsonException {\r\n\t\tObject object = get(key);\r\n\t\tInteger result = PrimitiveDataTypeConvertor.toInteger(object);\r\n\t\tif (result == null) {\r\n\t\t\tthrow PrimitiveDataTypeConvertor.exceptionType(key, object, \"Integer\");\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public int getInteger(String key) {\n\t\tint defaultValue = 0;\n\t\tif (getDefault(key) != null)\n\t\t\tdefaultValue = (Integer) getDefault(key);\n\t\tString sp = internal.getProperty(key);\n\t\tif (sp == null) {\n\t\t\treturn defaultValue;\n\t\t}\n\t\tint value;\n\t\ttry {\n\t\t\tvalue = Integer.parseInt(sp);\n\t\t} catch (NumberFormatException ex) {\n\t\t\tinternal.remove(key);\n\t\t\treturn defaultValue;\n\t\t}\n\t\treturn value;\n\t}", "public int getIntegerValue() {\n throw new OurBadException(\" Item '\" + this.serialize() + \"' is not an integer.\");\n }", "public final Integer _parseInteger(JsonParser jVar, DeserializationContext gVar) throws IOException {\n int m = jVar.mo29329m();\n if (m == 3) {\n return (Integer) _deserializeFromArray(jVar, gVar);\n }\n if (m == 11) {\n return (Integer) _coerceNullToken(gVar, this._primitive);\n }\n switch (m) {\n case 6:\n String trim = jVar.mo29334t().trim();\n int length = trim.length();\n if (length == 0) {\n return (Integer) _coerceEmptyString(gVar, this._primitive);\n }\n if (_hasTextualNull(trim)) {\n return (Integer) _coerceTextualNull(gVar, this._primitive);\n }\n _verifyStringForScalarCoercion(gVar, trim);\n if (length <= 9) {\n return Integer.valueOf(NumberInput.m23779a(trim));\n }\n try {\n long parseLong = Long.parseLong(trim);\n if (!_intOverflow(parseLong)) {\n return Integer.valueOf((int) parseLong);\n }\n return (Integer) gVar.mo31517b(this._valueClass, trim, String.format(\"Overflow: numeric value (%s) out of range of Integer (%d - %d)\", trim, Integer.MIN_VALUE, Integer.MAX_VALUE), new Object[0]);\n } catch (IllegalArgumentException unused) {\n return (Integer) gVar.mo31517b(this._valueClass, trim, \"not a valid Integer value\", new Object[0]);\n }\n case 7:\n return Integer.valueOf(jVar.mo29247C());\n case 8:\n if (!gVar.mo31509a(DeserializationFeature.ACCEPT_FLOAT_AS_INT)) {\n _failDoubleToIntCoercion(jVar, gVar, \"Integer\");\n }\n return Integer.valueOf(jVar.mo29296K());\n default:\n return (Integer) gVar.mo31493a(this._valueClass, jVar);\n }\n }", "public final int intValue() {\n /*\n r2 = this;\n java.lang.String r0 = r2.f4032 // Catch:{ NumberFormatException -> 0x0007 }\n int r0 = java.lang.Integer.parseInt(r0) // Catch:{ NumberFormatException -> 0x0007 }\n return r0\n L_0x0007:\n java.lang.String r0 = r2.f4032 // Catch:{ NumberFormatException -> 0x000f }\n long r0 = java.lang.Long.parseLong(r0) // Catch:{ NumberFormatException -> 0x000f }\n int r1 = (int) r0\n return r1\n L_0x000f:\n java.math.BigDecimal r0 = new java.math.BigDecimal\n java.lang.String r1 = r2.f4032\n r0.<init>(r1)\n int r0 = r0.intValue()\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: o.C0442.intValue():int\");\n }", "public int getIntegerProperty(String key) {\n\t\treturn Integer.parseInt(this.getProperty(key));\n\t}", "public Integer getInteger(String fieldname) {\n\t\tString value = getValue(fieldname);\n\t\tif (value == null) return null;\n\t\treturn new Integer(value);\n\t}", "public Integer getInteger(String key) {\n if (!jsonData.has(key))\n return null;\n try {\n return jsonData.getInt(key);\n } catch (Exception ex) {\n return null;\n }\n }", "protected final Integer getInt(final String key) {\n try {\n if (!jo.isNull(key)) {\n return jo.getInt(key);\n }\n } catch (JSONException e) {\n }\n return null;\n }", "public int getInt(String property)\n\tthrows PropertiesPlusException\n\t{\n\t\tString value = getProperty(property);\n\t\tif (value == null)\n\t\t\tthrow new PropertiesPlusException(property+\" is not defined.\");\n\t\ttry\n\t\t{\n\t\t\treturn Integer.valueOf(value);\n\t\t}\n\t\tcatch (NumberFormatException ex)\n\t\t{\n\t\t\tthrow new PropertiesPlusException(String.format(\n\t\t\t\t\t\"%s = %s cannot be converted to type int\", property, value));\n\t\t}\n\t}", "public static Integer toInteger(Object value) {\n if (value instanceof Integer)\n return (Integer)value;\n else if (value instanceof Long)\n return (int)(long)(Long)value;\n else if (value instanceof Double)\n return (int)(double)(Double)value;\n else if (value == null)\n return null;\n else\n throw new RuntimeException(\"Can't convert [\" + value + \"] to Integer\");\n }", "public static int toInt(java.lang.Object o)\n {\n if(o == null)\n {\n return 0;\n }\n else if(o.toString().equals(\"\"))\n {\n return 0;\n }\n else\n {\n return Integer.parseInt(o.toString());\n }\n }", "public Integer getInt(String name) {\n Object o = get(name);\n if (o instanceof Number) {\n return ((Number)o).intValue();\n }\n\n if (o != null) {\n try {\n String string = o.toString();\n if (string != null) {\n return Integer.parseInt(string);\n }\n }\n catch (NumberFormatException e) {}\n }\n return null;\n }", "public static int getInt() throws IOException {\n String s = getString();\n return Integer.parseInt(s);\n }", "public static Integer castInt(Object o) {\n\t\tif (o instanceof Number) {\n\t\t\treturn ((Number) o).intValue();\n\t\t}\n\n\t\treturn null;\n\t}", "public static int getIntProperty(String key) {\r\n\t\treturn getIntProperty(key, 0);\r\n\t}", "public static int getInt() throws IOException {\r\n String s = getString();\r\n return Integer.parseInt(s);\r\n }", "public Integer getInteger(final int index) {\n Object returnable = this.get(index);\n if (returnable == null) {\n return null;\n }\n if (returnable instanceof String) {\n /* A String can be used to construct a BigDecimal. */\n returnable = new BigDecimal((String) returnable);\n }\n return ((Number) returnable).intValue();\n }", "int getInt(int index) throws PropertyException {\n return this.getNumber(index).intValue();\n }", "public static int getPropertyInt(String prop) {\n int ret = 0;\n try{\n ret = Integer.valueOf(properties.getProperty(prop));\n } catch (NumberFormatException e){\n log.log(Level.SEVERE, \"Integer return could not be found for property: \" + prop + \" - Exception: \" + e, e);\n }\n return ret;\n }", "public int getValueAsIntegerValue() throws DataFieldException {\n\t\ttry {\n\t\t\treturn Integer.parseInt(this.value);\n\t\t} catch (NumberFormatException nfe) {\n\t\t\tthrow new DataFieldException(\n\t\t\t\t\t\"Couldn't parse value into an integer. Value: \"\n\t\t\t\t\t+ this.value, nfe);\n\t\t}\n\t}", "public int getInteger(String key) {\r\n try {\r\n return Integer.decode(getString(key)).intValue();\r\n }\r\n catch (Exception e) {\r\n return 0;\r\n }\r\n }", "private int getValueAsInteger(String valueToBeReturnAsInteger) {\n\t\t\n\t\tint defaultValue = 0;\n\t\t\n\t\ttry {\n\t\t\tif(null != valueToBeReturnAsInteger && StringUtils.isNotBlank(valueToBeReturnAsInteger)) {\n\t\t\t\tdefaultValue = Integer.parseInt(valueToBeReturnAsInteger);\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"Error in parsing the String value to Integer for[{}]\", valueToBeReturnAsInteger);\n\t\t}\n\t\t\n\t\treturn defaultValue;\n\t}", "public int getInt()\n\t{\n\t\tfinal String text = getText();\n\t\tif (text == null || text.length() == 0)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\treturn Integer.parseInt(text);\n\t}", "int toInteger(String value) {\n value = value.trim();\n if (\"9999\".equals(value)) value = \"\";\n return (!\"\".equals(value)\n ? new Integer(value).intValue()\n : Tables.INTNULL);\n }", "public Integer getInt(K key) throws ClassCastException;", "public int getInt(String key) {\n Object value = get(key);\n return ((value instanceof Long) ? ((Long)value).intValue() : 0);\n }", "public int intValue() {\n if (originalValue instanceof Integer) {\n return (Integer) originalValue;\n } else if (originalValue instanceof Number) {\n return ((Number) originalValue).intValue();\n } else if (originalValue instanceof String) {\n final String originalString = (String) this.originalValue;\n\n try {\n return Integer.parseInt(originalString);\n } catch (NumberFormatException e1) {\n try {\n return (int) Double.parseDouble(originalString);\n } catch (NumberFormatException e2) {\n // it will be more reasonable to throw an exception which\n // indicates that the conversion to int has failed\n e1.addSuppressed(e2);\n throw new CellValueCastException(e1);\n }\n }\n } else {\n throw new CellValueCastException();\n }\n }", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default int asInt() {\n \n return notSupportedCast(BasicTypeID.INT);\n }", "public int toInt(){\n\t\tString s = txt().trim();\n\t\tint i;\n\t\ttry{\n\t\t\ti = Integer.parseInt(s);\n\t\t}catch(NumberFormatException exp){\n\t\t\texp.printStackTrace();\n\t\t\treturn 0;\n\t\t}\n\t\treturn i;\t\n\t}", "public static Integer getIntegerFromString(String value) {\n\n if (value == null) {\n return null;\n }\n\n Integer intVal = null;\n\n try {\n intVal = Integer.parseInt(value);\n } catch (RuntimeException exc) {\n // could not parse into int, null will be returned\n }\n return intVal;\n }", "public Integer getInteger(JSONValue val , String key){\r\n\t\tif ( val==null||key==null || key.length()==0)\r\n\t\t\treturn null ; \r\n\t\tJSONObject obj=val.isObject() ; \r\n\t\tif ( obj==null )\r\n\t\t\treturn null ; \r\n\t\tif (!obj.containsKey(key))\r\n\t\t\treturn null; \r\n\t\tJSONValue actualVal = obj.get(key);\r\n\t\tif ( actualVal.isNull() !=null)\r\n\t\t\treturn null ; \r\n\t\tif ( actualVal.isNumber() !=null)\r\n\t\t\treturn ((Double)actualVal.isNumber().doubleValue()).intValue();\r\n\t\treturn null ; \r\n\t}", "public int parseInt()\r\n {\r\n String str = feed.findWithinHorizon( INTEGER_PATTERN, 0 );\r\n \r\n if( str == null )\r\n throw new NumberFormatException( \"[Line \" + lineNum + \"] Input did not match an integer\" );\r\n else if( str.length() == 0 )\r\n throw new NumberFormatException( \"Input did not match an integer\" );\r\n \r\n return Integer.parseInt( str );\r\n }", "Integer getValue();", "Integer getValue();", "public Integer getInt(String propertyName) {\n if (this.has(propertyName) && !this.propertyBag.isNull(propertyName)) {\n return Integer.valueOf(this.propertyBag.getInt(propertyName));\n } else {\n return null;\n }\n }", "public Integer getInt(String key)\n\t{\n\t\tLong l = getLong(key);\n\t\tif(l == null)\n\t\t\treturn null;\n\t\treturn l.intValue();\n\t}", "public static int getInt() throws IOException {\n\t\nString s = getString();\nreturn Integer.parseInt(s);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Returns the integer in the string as an Int.\n\t\n}", "public int getInt() {\n return integer;\n }", "@Override\n public Integer fromString(String value) {\n if (value == null) {\n return null;\n }\n\n // Take off the spaces\n value = value.trim();\n\n // If it's 0 (Was full of spaces) return 0\n if (value.length() < 1) {\n return null;\n }\n int valueConverted = 0;\n try {\n valueConverted = Integer.valueOf(value);\n } catch (NumberFormatException e) {\n System.err.println(\"[ERROR-INFO (IntegerString Converter)] - \" + e);\n }\n return valueConverted;\n }", "default int asInt() {\n\t\tthrow new EvaluatorException(\"Expecting an integer value\");\n\t}", "public int getInt() throws Exception\n {\n return 0;\n }", "public int getInt() {\r\n\t\treturn (value.getInt());\r\n\t}", "public Integer toInteger() {\n\t\treturn this.getValue().intValue();\n\t}", "public static int getInteger(JSONObject data, Object key, int errorValue) {\r\n Object value = data.get(key);\r\n if (value != null && value instanceof Number) {\r\n return ((Number)value).intValue();\r\n }\r\n return errorValue;\r\n }", "public int getInt(){\n return new BigInteger(this.value).intValue();\n }", "@Test\n public void testIntProperty() {\n try (ReleasableVariant procId = classObject.get(\"ProcessId\")) {\n Assertions.assertNotEquals(0, procId.intValue());\n }\n }", "public int intVal() {\r\n\t\t\tassert kind == Kind.INTEGER_LITERAL;\r\n\t\t\treturn Integer.valueOf(String.copyValueOf(chars, pos, length));\r\n\t\t}", "public static int readInt() {\n try {\n return scanner.nextInt();\n }\n catch (InputMismatchException e) {\n String token = scanner.next();\n throw new InputMismatchException(\"attempts to read an 'int' value from standard input, \"\n + \"but the next token is \\\"\" + token + \"\\\"\");\n }\n catch (NoSuchElementException e) {\n throw new NoSuchElementException(\"attemps to read an 'int' value from standard input, \"\n + \"but no more tokens are available\");\n }\n }", "private int getOptionalIntegerProperty(String property, int defaultValue) {\n\t\ttry {\n\t\t\tString value = testProperties.getProperty(property);\n\t\t\tif (value == null)\n\t\t\t\treturn defaultValue;\n\t\t\treturn Integer.parseInt(value);\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn defaultValue;\n\t\t}\n\t}", "public int intValue(Map<Prop, Object> map) {\n assert type == Integer.class;\n Object o = map.get(this);\n return this.<Integer>typeValue(o);\n }", "IntegerValue getValueObject();", "public static Integer toInteger(java.lang.Object o)\n {\n\t if(o == null)\n\t {\n\t return 0;\n\t }\n\t else if(o.toString().equals(\"\"))\n\t {\n\t return 0;\n\t }\n\telse\n\t{\n\t return Integer.valueOf(o.toString());\n\t}\n }", "int getIntValue();", "public int getInt() throws NoSuchElementException,\n\t NumberFormatException\n {\n\tString s = tokenizer.nextToken();\n\treturn Integer.parseInt(s);\n }", "public int getInt(String property, int defaultValue)\n\tthrows PropertiesPlusException\n\t{\n\t\tString value = getProperty(property);\n\t\t\n\t\tif (value == null)\n\t\t{\n\t\t\taddRequestedProperty(property, Integer.toString(defaultValue));\n\t\t\treturn defaultValue;\n\t\t}\n\t\t\n\t\ttry\n\t\t{\n\t\t\treturn Integer.valueOf(value);\n\t\t}\n\t\tcatch (NumberFormatException ex)\n\t\t{\n\t\t\tthrow new PropertiesPlusException(String.format(\n\t\t\t\t\t\"%s = %s cannot be converted to type int\", property, value));\n\t\t}\n\t}", "public static int getInt(String key) throws UnknownID, ArgumentNotValid {\n\t\tString value = get(key);\n\t\ttry {\n\t\t\treturn Integer.parseInt(value);\n\t\t} catch (NumberFormatException e) {\n\t\t\tString msg = \"Invalid setting. Value '\" + value + \"' for key '\" + key\n\t\t\t\t\t+ \"' could not be parsed as an integer.\";\n\t\t\tthrow new ArgumentNotValid(msg, e);\n\t\t}\n\t}", "public int getInt();", "public static Integer tryParseToInt(String str) {\n\t\ttry {\n\t\treturn Integer.parseInt(str);\t\n\t\t}\t\n\t\tcatch(NumberFormatException e) {\n\t\t\treturn null;\n\t\t}\n\t\t}", "public Integer getInteger() {\r\n\t\ttype(ConfigurationItemType.INTEGER);\r\n\t\treturn integerValue;\r\n\t}", "static Value<Integer> parseInteger(String value) {\n try {\n if (value == null || value.isEmpty()) return empty();\n return of(Integer.parseInt(value));\n } catch (NumberFormatException error) {\n return empty();\n }\n }", "String getInt();", "public int getIdAsInt(String key) {\n Object obj = ids.get(key);\n if (obj == null) {\n return 0;\n }\n if (obj instanceof Integer) {\n return (Integer) obj;\n }\n\n if (obj instanceof String) {\n try {\n return Integer.parseInt((String) obj);\n }\n catch (Exception e) {\n LOGGER.trace(\"could not parse int: {}\", e.getMessage());\n }\n }\n\n return 0;\n }", "public int castToIntegerValue() {\n throw new IteratorFlowException(\"Cannot call castToDouble on non numeric\");\n }", "public int parseInt() {\n\t\tboolean validInt = false;\n\t\tint num = -1;\n\t\twhile(!validInt) {\n\t\t\ttry {\n\t\t\t\tnum = scanner.nextInt();\n\t\t\t\tvalidInt = true;\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(ConsoleColors.RED +\"Invalid input. Please enter a number\" + ConsoleColors.RESET);\n\t\t\t\tscanner.next();\n\t\t\t}\n\t\t}\n\t\treturn num;\n\t}", "int getInt();", "int getInt();", "BigInteger getInteger() {\n\n\t\t\tif (this.type != DerParser.INTEGER) {\n\t\t\t\tthrow new IllegalStateException(String.format(\"Invalid DER: object (%d) is not integer.\", this.type));\n\t\t\t}\n\n\t\t\treturn new BigInteger(this.value);\n\t\t}", "public static int getValueInt()\n {\n return Util.valueInt;\n }", "public int getIntValue() {\n return (int)getValue();\n }", "public IntType asInt(){\n return TypeFactory.getIntType(this.toInt(this.getValue()));\n }", "protected static Integer getIntegerString(String string) {\n Integer i;\n try {\n i = Integer.parseInt(string);\n } catch(Exception e) {\n return null;\n }\n\n return i;\n }", "private int getIntValue(Element element, String tagName)\n {\n try\n {\n return Integer.parseInt(getValue(element,tagName));\n }\n catch (NumberFormatException exception)\n {\n return 0;\n }\n }", "public Integer getAsInt(final String name) {\r\n Integer returnValue = null;\r\n try {\r\n returnValue = Integer.parseInt(getProperty(name));\r\n }\r\n catch (final NumberFormatException e) {\r\n LOGGER.error(\"Error on parsing configuration property '\" + name + \"'. Property must be a integer!.\");\r\n if (LOGGER.isDebugEnabled()) {\r\n LOGGER.debug(\"Error on parsing configuration property '\" + name + \"'. Property must be a integer!\", e);\r\n }\r\n }\r\n return returnValue;\r\n }", "public final int getInt()\n {\n return intValue;\n }", "public int toInt(String entity) { return ent_2_i.get(entity); }", "private int getIntProperty(String propName) {\n return Integer.parseInt(Objects.requireNonNull(env.getProperty(propName)));\n }", "private int getInt(String next) {\n\t\ttry {\n\t\t\tint a = Integer.parseInt(next);\n\t\t\tif (a > 10) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn a;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn 0;\n\t\t}\n\t}", "private int getIntProperty(String p) {\n\t\tString propval=env.getProperty(p);\n\t\tint propvalint=Integer.parseInt(propval);\n\t\treturn propvalint;\n\t}", "public int getIntValue(){\n\t\treturn value.intValue();\n\t}", "private static int getIntFromJson(final JsonObject jsonObject,\n final String key, final int defaultValue) throws ClassCastException\n {\n if (jsonObject != null && jsonObject.get(key) != null\n && !jsonObject.get(key).isJsonNull())\n {\n return jsonObject.get(key).getAsInt();\n }\n return defaultValue;\n }", "public Integer tryIntParsing(String s) {\n try {\n int parsedInt = Integer.parseInt(s);\n return parsedInt;\n } catch (NumberFormatException e) {\n return 0;\n }\n }", "public int getIntegerValue()\n {\n// if (val != Math.round(val))\n// System.err.println(\"IntegerYoVariable: returning a different value than what it used to be.\");\n return val;\n }", "static Integer parseInteger(String s) {\n try {\n return Integer.parseInt(s);\n } catch (NumberFormatException e) {\n return null;\n }\n }", "public BigInteger getInteger() throws IOException {\n if ( type != DerParser.INTEGER ) {\n throw new IOException(\n BaseMessages.getString( MQTTPublisherMeta.PKG, \"MQTTClientSSL.Error.InvalidDERObjectIsNotAnInteger\" ) );\n }\n\n return new BigInteger( value );\n }", "public int getInt()\n {\n return intValue;\n }", "public int getInt()\n {\n return intValue;\n }", "public int getSpecialIntProperty(String key,\n Hashtable valueSet,\n String defaultValue) {\n if (this.ignoreCase) {\n key = key.toUpperCase();\n }\n\n String val = this.attributes.getProperty(key);\n Integer result;\n\n if (val == null) {\n val = defaultValue;\n }\n\n try {\n result = (Integer) (valueSet.get(val));\n } catch (ClassCastException e) {\n throw this.invalidValueSet(key);\n }\n\n if (result == null) {\n try {\n return Integer.parseInt(val);\n } catch (NumberFormatException e) {\n throw this.invalidValue(key, val, this.lineNr);\n }\n }\n\n return result.intValue();\n }", "public static int getIntProperty(OWLIndividual owlIndi, String property, OWLOntology onto, OWLDataFactory factory){\n\t\tint i = -5;\n\t\tOWLLiteral o = null;\n\t\ttry{\n\t\t\tOWLDataProperty p = factory.getOWLDataProperty(IRI.create(Settings.uri+property));\n\t\t\to = owlIndi.getDataPropertyValues(p, onto).iterator().next();\n\t\t\ti = Integer.parseInt(o.getLiteral());\n\t\t}catch(Exception e){}\t\n\t\tif (i!=-5){\n\t\t\treturn i;\n\t\t}else{\n\t\t\treturn 420;\n\t\t}\n\t}", "public static Integer parseInt(Object s) {\n\t\tif (s == null)\n\t\t\treturn 0;\n\t\tif (s != null && s.toString().isEmpty())\n\t\t\t;\n\t\treturn Integer.parseInt(s.toString());\n\t}", "public static Integer toInteger(String str){\r\n\t\tif(isEmpty(str)){\r\n\t\t\treturn null;\r\n\t\t}else{\r\n\t\t\ttry {\r\n\t\t\t\treturn Integer.valueOf(str.trim());\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static Integer getInteger(BufferedReader reader) throws IOException{\n Integer result=null;\n while(result==null) {\n try {\n result = Integer.parseInt(reader.readLine().trim());\n } catch (NumberFormatException e) {\n throw new NumberFormatException(\"You should feed integer for this input.\");\n }\n }\n return result;\n }", "public static int JsonToInteger(JsonObject jso, String param, int defaulx) {\n try {\n JsonElement res = securGetJSON(jso, param);\n if (res != null) {\n return res.getAsInt();\n } else {\n return defaulx;\n }\n } catch (Exception e) {\n return defaulx;\n }\n }" ]
[ "0.7405823", "0.71828204", "0.692619", "0.6909834", "0.69037324", "0.685548", "0.6829627", "0.6822753", "0.6792756", "0.66616833", "0.6651103", "0.66358256", "0.6612519", "0.6608694", "0.65711117", "0.6473693", "0.64533645", "0.6452891", "0.6409025", "0.64080465", "0.64055413", "0.64033383", "0.6389387", "0.6362433", "0.6359226", "0.6352865", "0.6352548", "0.6350929", "0.63296086", "0.63104635", "0.6237305", "0.6233011", "0.6228471", "0.6225885", "0.6216559", "0.61935294", "0.61819524", "0.61817557", "0.6170442", "0.6165923", "0.61615694", "0.61615694", "0.61580384", "0.61482483", "0.6144121", "0.6135167", "0.61336017", "0.6123695", "0.6118817", "0.6104775", "0.61013496", "0.60969716", "0.6095678", "0.60945725", "0.6090609", "0.60808265", "0.6079399", "0.6064775", "0.605804", "0.6048421", "0.6045907", "0.6033568", "0.6033247", "0.6030327", "0.60263556", "0.60227513", "0.6018942", "0.60154295", "0.60135853", "0.59946007", "0.5991324", "0.59841985", "0.5982258", "0.5982258", "0.59809893", "0.5976958", "0.5965748", "0.59567064", "0.5954661", "0.59544575", "0.5942104", "0.59338284", "0.59318244", "0.5928431", "0.5926334", "0.59234715", "0.59166974", "0.5904654", "0.58971435", "0.58878016", "0.5879028", "0.58687073", "0.5850292", "0.5850292", "0.5843351", "0.58406097", "0.5840488", "0.5838174", "0.5838054", "0.5829994" ]
0.69708097
2
Created by me_touch on 2017/8/2.
public interface IWord2Spell { String word2spell(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void func_104112_b() {\n \n }", "public final void mo51373a() {\n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\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}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n public void init() {\n }", "@Override\n void init() {\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "private void init() {\n\n\t}", "@Override\n protected void init() {\n }", "protected boolean func_70814_o() { return true; }", "@Override\n protected void initialize() \n {\n \n }", "public void mo38117a() {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n public void init() {}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\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}", "public void gored() {\n\t\t\n\t}", "@Override\n\tpublic void ligar() {\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\r\n\tpublic void init() {}", "@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\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 one() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "public void mo4359a() {\n }", "private void m50366E() {\n }", "private void kk12() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n public int describeContents() { return 0; }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tpublic void init() {\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n public void initialize() { \n }", "@Override\n public void memoria() {\n \n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "private void strin() {\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 afterInit() {\n\t\t\n\t}", "@Override\n\tpublic void afterInit() {\n\t\t\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "private void init() {\n\n\n\n }", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "public void mo6081a() {\n }", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n public void init() {\n }" ]
[ "0.6050303", "0.5885339", "0.57776123", "0.57600373", "0.5757375", "0.5701796", "0.5701796", "0.56162894", "0.5615672", "0.5603355", "0.5590888", "0.55883104", "0.55530584", "0.5548685", "0.5542608", "0.55417615", "0.5527871", "0.55253917", "0.55253917", "0.55253917", "0.55253917", "0.55253917", "0.5521972", "0.5514759", "0.5509076", "0.5507221", "0.5488428", "0.5481036", "0.54697496", "0.54697496", "0.54697496", "0.54697496", "0.54697496", "0.54697496", "0.54541546", "0.54406613", "0.5439131", "0.5435841", "0.5428362", "0.54278", "0.5425757", "0.5425757", "0.54248047", "0.54216534", "0.54199326", "0.54199326", "0.5413061", "0.5412567", "0.54098755", "0.54077804", "0.54077804", "0.5403301", "0.53970796", "0.5394079", "0.5394079", "0.5394079", "0.53904945", "0.5384498", "0.5384498", "0.5384498", "0.5379642", "0.5379642", "0.5379642", "0.5375661", "0.5372994", "0.5371086", "0.5352151", "0.5338409", "0.5335672", "0.5332577", "0.53285015", "0.5323023", "0.53193927", "0.5319246", "0.5319062", "0.53152055", "0.5299974", "0.5297713", "0.5290762", "0.5286254", "0.5282273", "0.52785397", "0.5276742", "0.5276742", "0.5276742", "0.5276742", "0.5276742", "0.5276742", "0.5276742", "0.52605134", "0.52605134", "0.5258468", "0.52564883", "0.52554154", "0.5234337", "0.52339375", "0.52242446", "0.52242446", "0.5219227", "0.5217779", "0.5216333" ]
0.0
-1
interface is a fully abstract class
interface Bank { void deposit(); abstract void withdraw(); void checkBalance(); // int code; // we cant declare like this, compilation error final static int code = 204050; // we have to declare variable value, by default it is final and static }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface AbstractC03680oI {\n}", "public interface AbstractC2502fH1 extends IInterface {\n}", "public interface AbstractC1953c50 {\n}", "@Override\n public boolean isInterface() { return false; }", "public interface zzo\n extends IInterface\n{\n\n public abstract void zze(AdRequestParcel adrequestparcel);\n}", "public interface a extends IInterface {\n}", "public interface AbstractC0386gl {\n}", "public Object _get_interface()\n {\n throw new NO_IMPLEMENT(reason);\n }", "public interface AbstractC2883ha {\n boolean a();\n}", "public interface MyAbstractElement extends EObject {\n}", "interface I {}", "public interface i {\n}", "public boolean isInterface();", "public interface Citizen {\n public abstract void sayHello();\n}", "public interface IFaci {\n}", "Interface getInterface();", "Interface getInterface();", "public interface AbstractC0273Ek {\n void e();\n}", "public interface AbstractC7729o0ooOoo {\n void OooO00o();\n}", "public interface PhrasingContent extends ContentInterface {\r\n\r\n}", "public boolean isAbstract()\n/* */ {\n/* 146 */ return false;\n/* */ }", "public interface AbstractC0211Dj0 {\n void a(int i);\n}", "public interface AbstractC14990nD {\n void ACi(View view);\n\n void ACk(View view);\n\n void ACo(View view);\n}", "@Override\r\n\tpublic Class<?> interfaceAdapted() {\n\t\treturn null;\r\n\t}", "public interface eit {\n}", "public interface a {\n }", "public interface ITeslaProduct extends IProduct {\n //@Override\n public abstract void makeProduct();\n}", "public interface AbstractC00591m {\n void A9X(C0495Jm jm);\n\n void AAI(List<RG> list);\n}", "interface InterfaceDemo {\n int age =0; //接口中变量都是公开静态常量\n String name =null;\n abstract void aa();\n\n public abstract void display(); //接口中方法都是抽象的\n}", "public interface AbstractC1008ba extends JQ {\n void AA9();\n}", "abstract interface I1 {\n public abstract void m1();\n}", "public interface Igual extends ComplexInstruction\n{\n}", "public interface IAgenda {\n /*\n Date date = new Date();\n String event = \"\";\n */\n\n abstract String getContent();\n\n }", "public interface Allele {\n}", "public interface AbstractC1509Ys0 extends Q31 {\n Object g(Callback callback);\n}", "public boolean isAbstract();", "public interface AbstractC61422t9 {\n void AJZ(C61072sS v);\n}", "@Override\n\tvoid methodAbstractAndSubclassIsAbstract() {\n\t\t\n\t}", "public interface e {\n}", "public interface Behaviour {\n/**abstract method of the Behaviour interface*/\n\tvoid sad();\n}", "private static interface Base {\n\n public void foo();\n }", "public interface Car {\n}", "public interface Car {\n\n}", "public interface a {\n void a();\n }", "public interface a {\n void a();\n }", "public interface IBaseModle {\n\n\n}", "public interface IClass extends IVisible, IMetaDataListHolder, INamableNode, IAsDocHolder, ICommentHolder\n{\n /**\n * @return\n */\n List< IAttribute > getAttributes();\n\n /**\n * @return\n */\n double getAverageCyclomaticComplexity();\n\n /**\n * @return\n */\n IParserNode getBlock();\n\n /**\n * @return\n */\n List< IConstant > getConstants();\n\n /**\n * @return\n */\n IFunction getConstructor();\n\n /**\n * @return\n */\n String getExtensionName();\n\n /**\n * @return\n */\n List< IFunction > getFunctions();\n\n /**\n * @return\n */\n List< IParserNode > getImplementations();\n\n /**\n * @return\n */\n boolean isBindable();\n\n /**\n * @return\n */\n boolean isFinal();\n}", "public interface BaseDataInterface {\r\n}", "public interface MDataType extends MClassifier\r\n{\r\n}", "interface Workshop{\n\tabstract public void work();\n}", "public interface Zrada\n{\n void accuse();\n}", "public interface LizaCow extends Cow {\n\n}", "public interface AbstractC3386kV0 {\n boolean b();\n\n void d();\n\n void dismiss();\n\n ListView f();\n}", "public interface ClientInterface {\r\n\r\n\t/**\r\n\t * Start.\r\n\t */\r\n\tpublic abstract void start();\r\n}", "public interface IBaseModel {\n}", "public interface BaseObject {\n}", "public interface Test {\n}", "public interface IMainView extends IBaseView{\n}", "public interface IHomeView extends IBaseView {\n\n\n}", "public interface Pasticcere {\r\n //No attributes\r\n public void accendiForno();\r\n}", "public interface EGImmediate extends EGNonRecurring {\r\n}", "public interface IDeneme {\n \n void dene();\n}", "public interface ITest {\n}", "public interface IArchitecture extends ISkill, IStatement {\n\n\tpublic abstract boolean init(IScope scope) throws GamaRuntimeException;\n\n\tpublic abstract void verifyBehaviors(ISpecies context);\n}", "public interface Structure {\n\n // Interface: \n // Methods are \"public abstract\"\n // Variables are \"public static final\"\n // e.e, public static final int x = 123;\n\n public abstract double totalWeight();\n boolean isBalanced();\n\n}", "interface Iface {\n void usedIface();\n}", "public interface IMainModel extends IBaseModel {\n}", "public interface AttributeTypeAttack extends EObject\n{\n}", "public interface Actions extends EObject\n{\n}", "public interface IInventoryObject extends IID\n{\n}", "public interface Ave {\n\n public void voar();\n\n}", "interface InWriter { // In interface class, all methods are abstract. (You can't specify the body)\n // public abstract void write(); By default all methods are public and abstract\n void write();\n}", "public interface zze\n extends IInterface\n{\n\n public abstract void zza(zzd zzd, GoogleSignInConfig googlesigninconfig);\n\n public abstract void zza(zzd zzd, SignInConfiguration signinconfiguration);\n\n public abstract void zzb(zzd zzd, GoogleSignInConfig googlesigninconfig);\n\n public abstract void zzb(zzd zzd, SignInConfiguration signinconfiguration);\n\n public abstract void zzc(zzd zzd, GoogleSignInConfig googlesigninconfig);\n}", "public interface IProvider extends BaseProvider{\n}", "public interface Lexeme {\n}", "public interface IDriedAquatic {\n}", "public interface IGraphElement extends IDotElement {\r\n}", "public interface IBaseInterface {\n public void onRefresh();\n public void onLoadMore();\n\n}", "public interface FlyBehavior {\n public abstract void fly();\n// public abstract void\n}", "public interface MediaLibrary extends MediaLibraryModel {\n}", "public interface AbstractC01264e {\n void ABn(AnonymousClass4X v, @Nullable AnonymousClass4A v2, AnonymousClass4A v3);\n\n void ABp(AnonymousClass4X v, @NonNull AnonymousClass4A v2, @Nullable AnonymousClass4A v3);\n\n void ABr(AnonymousClass4X v, @NonNull AnonymousClass4A v2, @NonNull AnonymousClass4A v3);\n\n void ADd(AnonymousClass4X v);\n}", "public interface IHead extends IDetail {\n}", "public interface AInterface {\n\n public void say();\n\n}", "public interface Animal {\n\n //Animal reproduce();\n\n}", "public interface C22486a {\n void bGQ();\n\n void cMy();\n }", "interface AccountInterface{\n\tabstract void deposit();\n\tvoid withdraw();\n\tvoid roi();\n}", "public interface BaseIView {\n}", "public interface AbstractC7617o0oOO {\n void OooO00o(View view);\n\n void OooO0O0(View view);\n\n void OooO0OO(View view);\n}", "public interface IOverride extends IMeasurement_descriptor{\n\n\tpublic IRI iri();\n\n}", "public interface BaseItem {\n}", "public interface Animal {\n\n public void eat();\n public void travel();\n}", "public interface Implementor {\n // 实现抽象部分需要的某些具体功能\n void operationImpl();\n}", "@Override\n\tpublic void implements_(JDefinedClass cls) {\n\n\t}", "public interface C21597a {\n }", "public interface bzt extends cdm {\n}", "public interface Pet {// interface is the blueprint for other class\r\n\r\n\tpublic String food();// method food abstract method no action \r\n\r\n\r\n}", "public interface Item {\n}", "public interface BaseState extends EventRegister {\n\n}", "public interface DisplayInterface {\n\t\n\t// Abstract Method\n\t\n\t// Runnable \n\t\n\tpublic void display ();\n\n\n}", "public interface OsSystemCycle extends EcucContainer {\n}", "public interface IAnswer extends IComment{\r\n\t\r\n\t\r\n}" ]
[ "0.7764724", "0.7627778", "0.7470661", "0.7408952", "0.72501355", "0.714235", "0.7134575", "0.71144074", "0.71096915", "0.7092002", "0.7046681", "0.7014276", "0.6989172", "0.6954114", "0.6947004", "0.6878335", "0.6878335", "0.68657947", "0.6861694", "0.68531835", "0.6834419", "0.68326306", "0.6820273", "0.6808944", "0.6801627", "0.67965853", "0.6791695", "0.678336", "0.67301565", "0.67281044", "0.67249256", "0.67119455", "0.66903055", "0.66900414", "0.66882527", "0.66618174", "0.66582185", "0.66385186", "0.66357946", "0.6631452", "0.6621497", "0.6616539", "0.66108006", "0.660603", "0.660603", "0.66060007", "0.65787804", "0.6569006", "0.6553667", "0.65510106", "0.654604", "0.654455", "0.6543768", "0.65270436", "0.65103114", "0.65051115", "0.64986044", "0.6484247", "0.6482624", "0.64801544", "0.64776146", "0.64772147", "0.6472659", "0.64646614", "0.6462221", "0.64616317", "0.64550424", "0.6454791", "0.645451", "0.64541894", "0.6450605", "0.64478546", "0.6442646", "0.644115", "0.64314383", "0.6429935", "0.64266527", "0.6425512", "0.6424703", "0.6422265", "0.64217144", "0.6417849", "0.6414053", "0.64109796", "0.6410716", "0.64097965", "0.6404176", "0.64016616", "0.6395706", "0.63931465", "0.63904905", "0.63896984", "0.6389375", "0.63861424", "0.63859534", "0.6379829", "0.6379808", "0.6378883", "0.63760555", "0.6370475", "0.6367724" ]
0.0
-1
end of UserLoginCredential functional interface : Java 1.8 version onwards
@FunctionalInterface interface SingleMethod { // functional interface cant have more than one abstract method void method(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CredentialValidationResult validate(UsernamePasswordCredential unpc){\r\n \r\n \r\n return null;\r\n}", "public Person authenticateAndGetUser(String numCc, String password) throws RemoteException;", "EmployeeMaster authenticateUser(int employeeId, String password);", "public abstract User login(User data);", "int authenticateUser(IDAOSession session, String userName, String password);", "List<String> authenticateUser(String userName, String password);", "public interface CredentialConnector {\n\n /**\n * Check whether the credential (e.g public key) associated with a stack (cluster) has present on Cloud provider.\n *\n * @param authenticatedContext the authenticated context which holds the client object\n * @return the status respone of method call\n */\n CloudCredentialStatus verify(@Nonnull AuthenticatedContext authenticatedContext);\n\n\n /**\n * Create the credential (e.g public key) associated with a stack (cluster) on Cloud provider.\n *\n * @param authenticatedContext the authenticated context which holds the client object\n * @return the status respone of method call\n */\n CloudCredentialStatus create(@Nonnull AuthenticatedContext authenticatedContext);\n\n\n /**\n * Interactive login for credential creation.\n *\n * @return parameters for interactive login\n */\n Map<String, String> interactiveLogin(CloudContext cloudContext, ExtendedCloudCredential extendedCloudCredential,\n CredentialNotifier credentialNotifier);\n\n /**\n * Delete the credential (e.g public key) associated with a stack (cluster) from Cloud provider.\n *\n * @param authenticatedContext the authenticated context which holds the client object\n * @return the status respone of method call\n */\n CloudCredentialStatus delete(@Nonnull AuthenticatedContext authenticatedContext);\n\n}", "public AuthenticationUserVO getAuthenticateVO()\n/* */ throws LoginInterruptedException\n/* */ {\n/* 383 */ AuthenticationUserVO userVO = new AuthenticationUserVO();\n/* 384 */ Map<String, String> extMap = new HashMap();\n/* 385 */ LfwView widget = getCurrentWidget();\n/* 386 */ TextComp userIdComp = (TextComp)widget.getViewComponents().getComponent(\"userid\");\n/* 387 */ TextComp randomImageComp = (TextComp)widget.getViewComponents().getComponent(\"randimg\");\n/* */ \n/* 389 */ ICpSysinitQry cpSysinitQry = PortalServiceUtil.getCpSysinitQry();\n/* 390 */ boolean enabledRandomImage = false;\n/* */ try {\n/* 392 */ String showRanImg = cpSysinitQry.getSysinitValueByCodeAndPkorg(\"randomimg\", null);\n/* 393 */ enabledRandomImage = UFBoolean.valueOf(showRanImg).booleanValue();\n/* */ } catch (CpbBusinessException e) {\n/* 395 */ PortalLogger.error(e.getMessage(), e);\n/* */ }\n/* 397 */ String userId = null;\n/* */ \n/* 399 */ AppLifeCycleContext pctx = AppLifeCycleContext.current();\n/* 400 */ HttpSession session = LfwRuntimeEnvironment.getWebContext().getRequest().getSession();\n/* 401 */ String signdata = pctx.getParameter(\"p_signdata\");\n/* 402 */ String sn = pctx.getParameter(\"p_sn\");\n/* 403 */ String tz = pctx.getParameter(\"p_tz\");\n/* 404 */ if (userIdComp != null) {\n/* 405 */ if (enabledRandomImage) {\n/* 406 */ String rand = null;\n/* 407 */ if (session != null) {\n/* 408 */ rand = (String)session.getAttribute(\"rand\");\n/* */ }\n/* 410 */ String ricv = randomImageComp.getValue();\n/* 411 */ if (!StringUtils.equals(rand, ricv)) {\n/* 412 */ throw new LoginInterruptedException(LfwResBundle.getInstance().getStrByID(\"pserver\", \"PortalLoginHandler-000006\"));\n/* */ }\n/* */ }\n/* 415 */ userId = userIdComp.getValue();\n/* 416 */ if ((userId == null) || (userId.equals(\"\"))) {\n/* 417 */ throw new LoginInterruptedException(LfwResBundle.getInstance().getStrByID(\"pserver\", \"PortalLoginHandler-000007\"));\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* 422 */ TextComp passComp = (TextComp)widget.getViewComponents().getComponent(\"password\");\n/* 423 */ String passValue = null;\n/* 424 */ if (passComp != null) {\n/* 425 */ passValue = passComp.getValue();\n/* 426 */ if (passValue == null) {\n/* 427 */ passValue = \"\";\n/* */ }\n/* */ }\n/* */ \n/* 431 */ ComboBoxComp multiLanguageCombo = (ComboBoxComp)widget.getViewComponents().getComponent(\"multiLanguageCombo\");\n/* 432 */ String language = multiLanguageCombo.getValue();\n/* */ \n/* 434 */ userVO.setUserID(userId);\n/* 435 */ userVO.setPassword(passValue);\n/* 436 */ extMap.put(\"p_language\", language);\n/* 437 */ extMap.put(\"p_maxwin\", \"N\");\n/* 438 */ extMap.put(\"p_signdata\", signdata);\n/* 439 */ extMap.put(\"p_sn\", sn);\n/* */ \n/* 441 */ extMap.put(\"p_tz\", tz);\n/* 442 */ String challlid = (String)session.getAttribute(\"challlid\");\n/* 443 */ extMap.put(\"challlid\", challlid);\n/* 444 */ userVO.setExtInfo(extMap);\n/* 445 */ return userVO;\n/* */ }", "String signIn(String userName, String password) throws UserNotFoundException;", "boolean userLogin(UserDTO user) throws UserException, Exception;", "LoggedUser authenticate(@Valid AccountCredentials credentials) throws IOException;", "Map<String, String> interactiveLogin(CloudContext cloudContext, ExtendedCloudCredential extendedCloudCredential,\n CredentialNotifier credentialNotifier);", "public com.sun.jna.PointerType login(Credentials c) throws RelationException;", "@Override\n\tpublic ResultMessage login(String user_name, String password) throws RemoteException{\n\t\treturn null;\n\t}", "@Override\n\tpublic void loginUser() {\n\t\t\n\t}", "@Override\n\t\t\t\t\tpublic boolean loginWithGoogle(String userName, String password) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}", "public String processLogin(Credential credential) {\n\t\tString result = null;\n \tSystem.out.println(\"input username is:\" + credential.getUname());\n \tSystem.out.println(\"input password is:\" + String.valueOf(credential.getPwd()));\n if (credential.getUname().equalsIgnoreCase(\"josephzelo\")){\n \tSystem.out.println(\"username is correct\");\n \tif(String.valueOf(credential.getPwd()).equalsIgnoreCase(\"asdasd\")){\n \t\tresult = \"customer\";\n \t} else {\n \t\tSystem.out.println(\"password is wrong\");\n \t}\n } else if (credential.getUname().equalsIgnoreCase(\"admin\")) {\n \tSystem.out.println(\"username is correct\");\n \tif(String.valueOf(credential.getPwd()).equalsIgnoreCase(\"admin\")){\n \t\tresult = \"admin\";\n \t} else {\n \t\tSystem.out.println(\"password is wrong\");\n \t}\n } else {\n \tSystem.out.println(\"username is wrong\");\n }\n\t\treturn result;\n\t}", "public abstract void login(String userName, String password) throws RemoteException;", "public void propagateCredentials( User user, String password );", "public User getUser(String userName, String password);", "boolean checkUserCorrispondenceLogin(String emailLogin, String passwordLogin);", "@Override\n\tpublic User getUserWithCredentials(String username, String password) {\n\t\tUser loginUser=mobileDao.getLoginUser(username);\n\t\t//System.out.println(\"password is -\"+loginBean.getPassword());\n\t\tif(loginUser!=null)\n\t\t{\t\n\t\t\tif(password.equals(loginUser.getPassword()))\n\t\t\t\treturn loginUser;\n\t\t}\n\t\treturn null;\n\t}", "boolean isValidCredential(String username, String password);", "public User logInUser(final String login, final String password);", "public Object getCredential()\n {\n return this.credential;\n }", "public Object getCredential()\n {\n return this.credential;\n }", "public Object getCredential()\n {\n return this.credential;\n }", "void login(String user, String password);", "User authenticate(String username, String password);", "@Override\n\tpublic synchronized String login(String username, String password) throws HFModuleException {\n\t\tLog.d(\"HFModuleManager\", \"login\");\n\t\t\n\t\tUserLoginPayload payload = new UserLoginPayload();\n\t\tpayload.setAccessKey(HFConfigration.accessKey);\n\t\tpayload.setUserName(username);\n\t\tpayload.setPassword(password);\n\t\tpayload.setMac(getMacAddress());\n\t\tpayload.setClientName(android.os.Build.MANUFACTURER);\n\t\t\n\t\tUserLoginRequest request = new UserLoginRequest();\n\t\trequest.setPayload(payload);\n\t\t\n\t\ttry {\n\t\t\tUserIdResponse response = cloudSecurityManager.login(request);\n\t\t\t\n\t\t\t\n\t\t\t//[should remove these code later]\n\t\t\tthis.setSid(response.getSessionId());\n\t\t\tHFLocalSaveHelper.getInstence().getMainUserInfoHelper()\n\t\t\t\t\t.setUserName(HFConfigration.cloudUserName);\n\t\t\tHFLocalSaveHelper.getInstence().getMainUserInfoHelper()\n\t\t\t\t\t.setPswd(HFConfigration.cloudPassword);\n\t\t\tHFLocalSaveHelper.getInstence().setAccesskey(\n\t\t\t\t\tHFConfigration.accessKey);\n\t\t\tHFLocalSaveHelper.getInstence().setIsregisted(true);\n\t\t\tManagerFactory.getManager(context, IHFSFManager.class).syncRemoteModuleInfo(\n\t\t\t\t\tnew SyncModuleEventListener() {\n\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onSyncSuccess() {\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\tnotifyLoginEvent(true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onSyncErr() {\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\tnotifyLoginEvent(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t//[should remove these code later] the end \n\t\t\t\n\t\t\tString sessionId = response.getSessionId();\n\t\t\tString userId = response.getPayload().getUserId();\n\t\t\t\n\t\t\tUserInfo userInfo;\n\t\t\twhile ((userInfo = userInfoDao.getActiveUserInfo()) != null) {\n\t\t\t\tuserInfo.setActive(false);\n\t\t\t\tuserInfoDao.saveUserInfo(userInfo);\n\t\t\t}\n\t\t\t\n\t\t\tuserInfo = userInfoDao.getUserInfo(userId);\n\t\t\tif (userInfo == null) {\n\t\t\t\tuserInfo = new UserInfo();\n\t\t\t\tuserInfo.setUserId(userId);\n\t\t\t}\n\t\t\tuserInfo.setUserName(username);\n\t\t\tuserInfo.setPassword(password);\n\t\t\tuserInfo.setToken(sessionId);\n\t\t\tuserInfo.setTokenExpiredTime(System.currentTimeMillis() + UserInfo.TOKEN_EXPIRED_TIME);\n\t\t\tuserInfo.setActive(true);\n\t\t\tuserInfo.setAccessKey(payload.getAccessKey());\n\t\t\tuserInfoDao.saveUserInfo(userInfo);\n\t\t\t\n\t\t\treturn sessionId;\n\t\t} catch (CloudException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t\tthrow new HFModuleException(e1.getErrorCode(), e1.getMessage());\n\t\t}\n\t}", "@Override\n\tpublic boolean login(Credentials cred) {\n\t\treturn true;\n\t}", "public User doAuthentication(String account, String password);", "public abstract boolean checkCredentials (String username, String password);", "@Override\r\n\tpublic void login() {\n\t\t\r\n\t}", "private void authenticate(String user, String pass) {\n }", "private UserLoginRes(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public Person login(String username, String password);", "@Override\n\tpublic User login(String user, String pass) {\n\t\treturn null;\n\t}", "public void authenticate(LoginCredentials credentials) throws LoginException;", "@Override\r\n\tpublic void login() {\n\r\n\t}", "void loginAttempt(String email, String password);", "private void login(String username,String password){\n\n }", "LoginContext login(String username, String password) throws LoginException;", "User login(String email, String password) throws AuthenticationException;", "AuthenticationToken authenticate(String username, CharSequence password) throws Exception;", "@Override\n public boolean login(String username, char[] password) throws RemoteException {\n //Determines whether or not user with a specific username exist\n if (fileExist(USER_DIR + username + \".xml\")) {\n try {\n //Make the password a string\n String strPassword = \"\";\n for (int i = 0; i < password.length; i++) {\n strPassword += String.valueOf(password[i]);\n }\n //Open the file with the user information\n inputStream = new FileInputStream(USER_DIR + username + \".xml\");\n inputStreamReader = new InputStreamReader(inputStream);\n reader = new BufferedReader(inputStreamReader);\n\n sb = new StringBuilder();\n\n while ((lineString = reader.readLine()) != null) {\n sb.append(lineString);\n }\n \n //After that the @param userInfo contain a whole information about the user\n String userInfo = new String(sb);\n \n //Validate user form with a regular expresions\n if (!Pattern\n .compile(\"<username>\" + username + \"</username>\")\n .matcher(userInfo)\n .find()) {\n return false;\n }\n\n if (!Pattern\n .compile(\"<password>\" + strPassword + \"</password>\")\n .matcher(userInfo)\n .find()) {\n return false;\n }\n //Get the user priviliges\n if (Pattern\n .compile(\"<privilige>ENCRYPT</privilige>\")\n .matcher(userInfo)\n .find()) {\n priviliges = User.Priviliges.ENCRYPT;\n } else if (Pattern\n .compile(\"<privilige>DECRYPT</privilige>\")\n .matcher(userInfo)\n .find()) {\n priviliges = User.Priviliges.DECRYPT;\n } else if (Pattern\n .compile(\"<privilige>ENCRYPT_AND_DECRYPT</privilige>\")\n .matcher(userInfo)\n .find()) {\n priviliges = User.Priviliges.ENCRYPT_AND_DECRYPT;\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n } finally {\n closeResources();\n }\n } else {\n return false;\n }\n return true;\n }", "@Override\n\tpublic boolean loginService(List<Object> paraments) {\n\t\t\n\t\t\n\t\tboolean flag = false;\n\t\t\n\t\tString sql = \"select * from user where user_id=? and password=?\";\n\t\ttry{\n\t\t\t\n\t\t\tmJdbcUtil.getConnetion();\n\t\t\tMap<String,Object> map= mJdbcUtil.findSimpleResult(sql, paraments);\n\t\t\tflag = map.isEmpty()?false:true;\n\t\t\tSystem.out.println(\"-flag-->>\" + flag);\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\tmJdbcUtil.releaseConn();\n\t\t}\n\t\t\n\t\t\n\t\treturn flag;\n\t}", "public User login(Credentials creds) throws InvalidCredentialsException, MultipleLoginException, UserInactiveException {\r\n//\t\tLogManager.getLogger().info( \"Current sessions: \" + irpSessionRepository.count() );\r\n//\t\tLogManager.getLogger().info( \"Current Locks: \" + irpLockRepository.count() );\r\n\r\n \tString md5password = passwordManager.hashMC( creds.getPassword() );\r\n\t\tString schema = dhh.getSchema();\r\n\r\n//\t\ttry {\r\n//\t\t\tInteger uc = getDataSource().queryForObject(\"select usercode from \" + schema + \".USERACCOUNT where username = ? and password = ?\", Integer.class, creds.getUsername(), md5password);\r\n//\t\t\tAppSession is = irpSessionRepository.find( uc );\r\n//\r\n//\t\t\tif ( is == null ) {\r\n//\t\t\t\tApplicationParameter ap = apr.findParam(ApplicationParameterType.GENERAL, 1, 6); // EVALUATOR param\r\n//\t\t\t\tUser u = userRepository.find( uc );\r\n//\r\n//\t\t\t\tif ( ap.getParameterValueInt() == 0 ) {\r\n//\t\t\t\t\tif ( u.getUserAccount().hasRole( 7 ) ) {\r\n//\t\t\t\t\t\t// Evaluators should not login!\r\n//\t\t\t\t\t\tLogManager.getLogger().warn(\"Evaluator Cannot login. Evaluator flow NOT enabled\");\r\n//\t\t\t\t\t\tthrow new UserInactiveException( creds );\r\n//\t\t\t\t\t}\r\n//\t\t\t\t\tif ( u.getPosition() > 0 &&\r\n//\t\t\t\t\t\t\t( u.getUserAccount().hasRole( 3 ) || u.getUserAccount().hasRole( 4 ) || u.getUserAccount().hasRole( 5 ) )) {\r\n//\t\t\t\t\t\tLogManager.getLogger().warn(\"Branch User Cannot login. Evaluator flow NOT enabled\");\r\n//\t\t\t\t\t\tthrow new UserInactiveException( creds );\r\n//\t\t\t\t\t}\r\n//\t\t\t\t} else {\r\n//\t\t\t\t\tif ( ap.getFailCode() != 1 ) {\r\n//\t\t\t\t\t\tif ( u.getPosition() > 0 &&\r\n//\t\t\t\t\t\t\t\t( u.getUserAccount().hasRole( 3 ) || u.getUserAccount().hasRole( 4 ) || u.getUserAccount().hasRole( 5 ) )) {\r\n//\t\t\t\t\t\t\tLogManager.getLogger().warn(\"Branch User Cannot login. Branches in Evaluator flow NOT enabled\");\r\n//\t\t\t\t\t\t\tthrow new UserInactiveException( creds );\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\tirpSessionRepository.create(creds.getFromIp(), uc);\r\n//\t\t\t\tu.getUserAccount().setLastlogin( new Date() );\r\n//\t\t\t\tuserAccountRepository.persist( u.getUserAccount() );\r\n//\t\t\t\tdhh.logLogin(creds.getUsername(), \"AUTHENTICATION_SUCCEEDED\", null, null, null, null);\r\n//\t\t\t\treturn u;\r\n//\t\t\t} else {\r\n//\t\t\t\tthrow new MultipleLoginException();\r\n//\t\t\t}\r\n//\t\t} catch (Exception e) {\r\n//\t\t\tif ( e instanceof UserInactiveException) {\r\n//\t\t\t\tdhh.logLogin(creds.getUsername(), \"USER_INACTIVE\", null, null, null, null);\r\n//\t\t\t\tthrow e;\r\n//\t\t\t}\r\n//\t\t\tif ( e instanceof MultipleLoginException) {\r\n//\t\t\t\tdhh.logLogin(creds.getUsername(), \"ALREADY_LOGGED_IN\", null, null, null, null);\r\n//\t\t\t\tthrow e;\r\n//\t\t\t}\r\n//\t\t\tdhh.logLogin(creds.getUsername(), \"AUTHENTICATION_FAILED\", null, null, null, null);\r\n//\t\t\tthrow new InvalidCredentialsException(creds);\r\n//\t\t}\r\n\t\treturn null;\r\n\t}", "@Service\npublic interface UserLoginUtil {\n\n public User getCurrentLogInUser();\n\n boolean userHaveRole(User currentUser, UserRole.Role admin);\n\n void addUserForClientWithRole(User user, UserRole.Role role) throws WrongInputDataException;\n\n void changePassForUser(User user, String password) throws WrongInputDataException;\n}", "public User login(String loginName, String password) throws UserBlockedException;", "private Login_C(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public void login(User user);", "public static User userSignin(String username, String password) {\n System.out.println(\"dbsETUP @ LINE 422\");\n ConnectionPool pool = ConnectionPool.getInstance();\n Connection connection = pool.getConnection();\n PreparedStatement ps = null;\n ResultSet rs = null;\n ///For test purposes only //System.out.println(\"dbsETUP @ LINE 168\");\n String query = \"SELECT * FROM users \"\n + \"WHERE uname = ? AND pWord = ?\";\n \n try {\n ps = connection.prepareStatement(query);\n ps.setString(1, username);\n ps.setString(2, password);\n rs = ps.executeQuery();\n User user = null;\n if (rs.next()) {\n user = new User();\n user.setUserID(rs.getInt(\"userID\"));\n user.setUsername(rs.getString(\"uname\"));\n user.setPassword(rs.getString(\"pWord\"));\n user.setFirstName(rs.getString(\"firstName\"));\n user.setLastName(rs.getString(\"lastName\"));\n user.setEmail(rs.getString(\"email\"));\n user.setAddr1(rs.getString(\"addr1\"));\n user.setAddr2(rs.getString(\"addr2\"));\n user.setCity(rs.getString(\"city\"));\n user.setStateRegion(rs.getString(\"state\"));\n user.setZipcode(rs.getInt(\"zip\"));\n user.setCountry(rs.getString(\"country\"));\n user.setRoleName(rs.getString(\"roleName\")); \n }\n ///For test purposes only ////System.out.println(user.getFirstName());\n return user;\n } catch (SQLException e) {\n System.out.println(e);\n return null;\n } finally {\n DBUtil.closeResultSet(rs);\n DBUtil.closePreparedStatement(ps);\n pool.freeConnection(connection);\n }\n \n }", "public abstract String getPassword() throws DataServiceException;", "private Object authenticate(Invocation invocation, HttpServletRequest request,\r\n HttpServletResponse response) throws IOException {\r\n\r\n Object[] args = invocation.getArgs();\r\n if (args.length != 2) {\r\n throw new RuntimeException(\"The authenticate call must have two arguments\");\r\n }\r\n\r\n String user = (String) args[0];\r\n String password = (String) args[1];\r\n\r\n //We can make the remote call\r\n Object result = invoke(invocation);\r\n\r\n //If the authentification failed we finish the execution\r\n if (result instanceof LoginContext) {\r\n LoginContext loginContext = (LoginContext) result;\r\n if (loginContext == null) {\r\n throw new RuntimeException(\"Login failed!!\");\r\n }\r\n \r\n HttpSession session = request.getSession(false);\r\n String sessionId = session.getId();\r\n response.addHeader(\"jsessionid\", sessionId);\r\n\r\n \r\n session.setAttribute(User.USER_KEY, loginContext.getUser());\r\n\r\n session.setAttribute(RhSessionContext.CLIENT_ID, loginContext.getClient_id());\r\n session.setAttribute(RhSessionContext.ORG_ID, loginContext.getOrg_id());\r\n session.setAttribute(RhSessionContext.DUTY_ID, loginContext.getDutyId());\r\n\r\n Map attrs = loginContext.getAttributes();\r\n Set<Map.Entry> entries = attrs.entrySet();\r\n for (Map.Entry entry : entries) {\r\n session.setAttribute((String) entry.getKey(), entry.getValue());\r\n }\r\n\r\n // 创建login session\r\n LoginSession loginSession = new LoginSession();\r\n loginSession.setLoginName(loginContext.getUser().getUsername());\r\n loginSession.setIp(request.getRemoteHost());\r\n loginSession.setLoginDate(new Date(session.getCreationTime()));\r\n loginSession.setSessionId(session.getId());\r\n loginSession.setLiving(true);\r\n\r\n //Session hibernateSession = RhinoCtx.instance().getHibernate().getSession();\r\n try {\r\n \r\n ServiceBase serviceBase = (ServiceBase) ServiceFactory.getService(ServiceBase.NAME);\r\n //ServiceBase serviceBase = (ServiceBase) RhinoCtx.getBean(\"serviceBase\");\r\n //hibernateSession.beginTransaction();\r\n serviceBase.save(loginSession);\r\n //hibernateSession.getTransaction().commit();\r\n session.setAttribute(\"loginSession\", loginSession);\r\n\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n //hibernateSession.getTransaction().rollback();\r\n } finally {\r\n //hibernateSession.close();\r\n }\r\n }\r\n return result;\r\n }", "public interface UserCredentialsService {\n Boolean validateUserCred(UserCredentials userCredentials);\n}", "@Override\n public boolean userLogin(String username, String password) \n {\n User tmpUser = null;\n tmpUser = getUser(username);\n if(tmpUser == null) return false;\n if(tmpUser.getPassword().equals(password)) return true;\n return false;\n }", "@ClassVersion(\"$Id: Authenticator.java 16154 2012-07-14 16:34:05Z colin $\")\r\npublic interface Authenticator\r\n{\r\n\r\n /**\r\n * Checks whether the given credentials can be used to initiate a\r\n * new session on behalf of the client with the given context.\r\n *\r\n * @param context The context.\r\n * @param user The user name.\r\n * @param password The password.\r\n *\r\n * @return True if the given credentials are acceptable.\r\n *\r\n * @throws I18NException Thrown if the authenticator encounters an\r\n * error while checking the credentials.\r\n */\r\n\r\n boolean shouldAllow\r\n (StatelessClientContext context,\r\n String user,\r\n char[] password)\r\n throws I18NException;\r\n}", "boolean doLogin(UserDTO loginUser);", "UserToken login(String username, String password) throws WorkspaceException;", "private boolean loginAndStore(boolean isNewUser)\r\n {\n \r\n List<Pair<String, String>> requestHeaderProperties = new ArrayList<>(1);\r\n String encoding = Base64.getEncoder().encodeToString((usernameField.getText() + \":\" + passwordField.getText()).getBytes());\r\n requestHeaderProperties.add(new Pair<>(\"Authorization\", \"Basic \" + encoding));\r\n \r\n JsonElement jsonDataPacket = new ArborJsonRetriever().getResponseJson(girderBaseURL + \"user/authentication\", \"GET\", requestHeaderProperties);\r\n \r\n //System.out.println(jsonDataPacket);\r\n \r\n if (jsonDataPacket == null)\r\n {\r\n if (isNewUser)\r\n new Alert(Alert.AlertType.ERROR, \"Exceptional error: New user registration completed successfully, but login with the new credentials failed.\", ButtonType.OK).showAndWait();\r\n else\r\n new Alert(Alert.AlertType.ERROR, \"Login failed.\", ButtonType.OK).showAndWait();\r\n \r\n return false;\r\n }\r\n \r\n JsonObject jsonDataPacketObj = jsonDataPacket.getAsJsonObject();\r\n \r\n userInfo = new ArborUserInfo(\r\n jsonDataPacketObj.get(\"user\").getAsJsonObject().get(\"_id\").getAsString(),\r\n jsonDataPacketObj.get(\"user\").getAsJsonObject().get(\"login\").getAsString(),\r\n jsonDataPacketObj.get(\"user\").getAsJsonObject().get(\"firstName\").getAsString(),\r\n jsonDataPacketObj.get(\"user\").getAsJsonObject().get(\"lastName\").getAsString(),\r\n jsonDataPacketObj.get(\"user\").getAsJsonObject().get(\"email\").getAsString(),\r\n jsonDataPacketObj.get(\"authToken\").getAsJsonObject().get(\"token\").getAsString(),\r\n jsonDataPacketObj.get(\"authToken\").getAsJsonObject().get(\"expires\").getAsString());\r\n \r\n if (isNewUser)\r\n new Alert(Alert.AlertType.CONFIRMATION, \"Account created! Welcome, \" + userInfo.getFirstName() + \"!\", ButtonType.OK).showAndWait();\r\n else\r\n new Alert(Alert.AlertType.CONFIRMATION, \"Login successful! Welcome, \" + userInfo.getFirstName() + \"!\", ButtonType.OK).showAndWait();\r\n \r\n return true;\r\n }", "User signIn(String login, String password);", "void login(String userName) throws IllegalArgumentException, IOException;", "private void logIn() {\n char[] password = jPasswordField1.getPassword();\n String userCode = jTextField1.getText();\n\n String txtpassword = \"\";\n for (char pw : password) {\n txtpassword += pw;\n }\n if (\"\".equals(txtpassword)) {\n JOptionPane.showMessageDialog(this, textBundle.getTextBundle().getString(\"enterPassword\"), \"No Password\", JOptionPane.WARNING_MESSAGE);\n } else if (txtpassword.equals(userData.get(0).toString())) {\n jPasswordField2.setEnabled(true);\n jPasswordField3.setEnabled(true);\n jPasswordField2.setEditable(true);\n jPasswordField3.setEditable(true);\n jPasswordField2.grabFocus();\n }\n }", "private Login_S(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public AuthToken loginUser(){\n return null;\n }", "public void authenticate(LoginRequest loginRequest) {\n\n }", "@Override\n\tpublic LoggedUser login(String userName, String password, ClientType clientType)\n\t\t\tthrows CustomValidationExepation, CustomLoginExeption {\n\n\t\tif (clientType != ClientType.CUSTOMER) {\n\t\t\tthrow new CustomValidationExepation(\"not a valid type\");\n\t\t}\n\t\tOptional<Customer> c = customerRipository.login(userName, password);\n\n\t\tif (!c.isPresent()) {\n\t\t\tthrow new CustomLoginExeption(\"User-Name - : \" + userName + \" or Password - \" + password + \" or Type - \" +clientType);\n\t\t}\n\n\t\treturn new LoggedUser(c.get().getId(),clientType,userName,password);\n\t}", "User login(String username, String password);", "boolean authenticate(String userName, String password);", "private LoginRes(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "RequestResult loginRequest() throws Exception;", "@Override\r\npublic User getUserByPassword(String password) throws ClassNotFoundException, IOException, SQLException\r\n{\r\n\tConnection conn = null;\r\n\tPreparedStatement stmt = null;\r\n\tResultSet rs = null;\r\n\tOracleConnection orcl = new OracleConnection();\r\n\r\n\t//Create List Object to return, and User Object to to store in list from database.\r\n\tList<User> userList = null;\r\n\tUser user = null;\r\n\r\n\tString fetchString = \"SELECT * FROM users WHERE password = ?\";//Since username is unique, only one user can be generated\r\n\ttry\r\n\t{\r\n\t\tconn = orcl.getConnection();\r\n\t\tstmt = conn.prepareStatement(fetchString);\r\n\t\tstmt.setString(1, password);\r\n\t\trs = stmt.executeQuery();\r\n\t\tuserList = new ArrayList<User>();\r\n\t\r\n\t\twhile(rs.next())\r\n\t\t{\r\n\t\t\tuser = new User(rs.getString(2), rs.getString(3), rs.getString(4));\r\n\t\t\tuser.setUserId(rs.getInt(1));\r\n\t\t\tuserList.add(user);\r\n\t\t}\r\n\t}\r\n\tcatch(SQLException e)\r\n\t{\r\n\t\tSystem.out.println(\"Error: \" + e.getMessage());\r\n\t}\r\n\tfinally\r\n\t{\r\n\t\tif (rs != null) \r\n\t\t{\r\n\t\t\trs.close();\r\n\t\t}\r\n\t\tif (stmt != null) \r\n\t\t{\r\n\t\t\tstmt.close();\r\n\t\t}\r\n\t\tif (conn != null) \r\n\t\t{\r\n\t\t\tconn.close();\r\n\t\t}\r\n\t}\r\n\treturn user;\r\n}", "void login(String email, String password) throws InvalidCredentialsException, IOException;", "public static interface Credentials extends Serializable {\n\t\tpublic String getUserName();\n\t\t/**\n\t\t* The password is encrypted.\n\t\t*/\n\t\tpublic String getPassword();\n\t}", "private boolean authenticate (HttpRequest request, HttpResponse response) throws UnsupportedEncodingException\n\t{\n\t\tString[] requestSplit=request.getPath().split(\"/\",3);\n\t\tif(requestSplit.length<2)\n\t\t\treturn false;\n\t\tString serviceName=requestSplit[1];\n\t\tfinal int BASIC_PREFIX_LENGTH=\"BASIC \".length();\n\t\tString userPass=\"\";\n\t\tString username=\"\";\n\t\tString password=\"\";\n\t\t\n\t\t//Check for authentication information in header\n\t\tif(request.hasHeaderField(AUTHENTICATION_FIELD)\n\t\t\t\t&&(request.getHeaderField(AUTHENTICATION_FIELD).length()>BASIC_PREFIX_LENGTH))\n\t\t{\n\t\t\tuserPass=request.getHeaderField(AUTHENTICATION_FIELD).substring(BASIC_PREFIX_LENGTH);\n\t\t\tuserPass=new String(Base64.decode(userPass), \"UTF-8\");\n\t\t\tint separatorPos=userPass.indexOf(':');\n\t\t\t//get username and password\n\t\t\tusername=userPass.substring(0,separatorPos);\n\t\t\tpassword=userPass.substring(separatorPos+1);\n\t\t\t\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t\n\t\t\t\tlong userId;\n\t\t\t\tAgent userAgent;\n\t\t\t\t\n\t\t\t\tif ( username.matches (\"-?[0-9].*\") ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tuserId = Long.valueOf(username);\n\t\t\t\t\t} catch ( NumberFormatException e ) {\n\t\t\t\t\t\tthrow new L2pSecurityException (\"The given user does not contain a valid agent id!\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tuserId = l2pNode.getAgentIdForLogin(username);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tuserAgent = l2pNode.getAgent(userId);\n\t\t\t\t\n\t\t\t\tif ( ! (userAgent instanceof PassphraseAgent ))\n\t\t\t\t\tthrow new L2pSecurityException (\"Agent is not passphrase protected!\");\n\t\t\t\t((PassphraseAgent)userAgent).unlockPrivateKey(password);\n\t\t\t\t_currentUserId=userId;\n\t\t\t\t\n\t\t\t\tif(!_userSessions.containsKey(userId))//if user not registered\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tMediator mediator = l2pNode.getOrRegisterLocalMediator(userAgent);\n\t\t\t\t\t_userSessions.put(userId, new UserSession(mediator));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t_userSessions.get(userId).updateServiceTime(serviceName,new Date().getTime());//update last access time for service\n\t\t\t\t\n\t\t\t\tconnector.logMessage(\"Login: \"+username);\n\t\t\t\tconnector.logMessage(\"Sessions: \"+Integer.toString(_userSessions.size()));\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}catch (AgentNotKnownException e) {\n\t\t\t\tsendUnauthorizedResponse(response, null, request.getRemoteAddress() + \": login denied for user \" + username);\n\t\t\t} catch (L2pSecurityException e) {\n\t\t\t\tsendUnauthorizedResponse( response, null, request.getRemoteAddress() + \": unauth access - prob. login problems\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t\n\t\t\t\tsendInternalErrorResponse(\n\t\t\t\t\t\tresponse, \n\t\t\t\t\t\t\"The server was unable to process your request because of an internal exception!\", \n\t\t\t\t\t\t\"Exception in processing create session request: \" + e);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresponse.setStatus ( HttpResponse.STATUS_BAD_REQUEST );\n\t\t\tresponse.setContentType( \"text/plain\" );\n\t\t\tresponse.print ( \"No authentication provided!\" );\n\t\t\tconnector.logError( \"No authentication provided!\" );\n\t\t}\n\t\treturn false;\n\t}", "public abstract String getUser() throws DataServiceException;", "@Override \n public void commandLogin(String userName, String password)\n {\n }", "public java.lang.String getAccessToken(java.lang.String userName, java.lang.String password) throws java.rmi.RemoteException;", "boolean isAuthenticate(String username, String password) throws UserDaoException;", "private Users buildLogin( ) {\n\t\t\r\n\t\t return LoginUtil.fillUserData(this.user, this);\r\n\t\t \r\n\t}", "java.lang.String getCred();", "public interface IUserLoginService\n{\n final long versionID = 100L;\n String login(String username, String passwd);\n}", "public login_1_argument() {\n }", "public boolean authenticate(Connection con, String userid, String password)\n throws SQLException, NoSuchAlgorithmException{\n PreparedStatement ps = null;\n ResultSet rs = null;\n try {\n boolean userExist = true;\n // INPUT VALIDATION\n if (userid==null||password==null){\n // TIME RESISTANT ATTACK\n // Computation time is equal to the time needed by a legitimate user\n userExist = false;\n userid=\"\";\n password=\"\";\n }\n\n ps = con.prepareStatement(\"select password, extra FROM login where User_ID = ?\");\n ps.setString(1, userid);\n rs = ps.executeQuery();\n String digest, extra;\n if (rs.next()) {\n digest = rs.getString(\"password\");\n extra = rs.getString(\"extra\");\n // DATABASE VALIDATION\n if (digest == null || extra == null) {\n throw new SQLException(\"Database inconsistant Salt or Digested Password altered\");\n }\n if (rs.next()) { // Should not append, because login is the primary key\n throw new SQLException(\"Database inconsistent two CREDENTIALS with the same LOGIN\");\n }\n } else { // TIME RESISTANT ATTACK (Even if the user does not exist the\n // Computation time is equal to the time needed for a legitimate user\n digest = \"000000000000000000000000000=\";\n extra = \"00000000000=\";\n userExist = false;\n }\n\n byte[] bDigest = base64ToByte(digest);\n byte[] bExtra = base64ToByte(extra);\n\n // Compute the new DIGEST\n byte[] proposedDigest = getHash(ITERATION_NUMBER, password, bExtra);\n\n return Arrays.equals(proposedDigest, bDigest) && userExist;\n } catch (IOException ex){\n throw new SQLException(\"Database inconsistant Salt or Digested Password altered\");\n }\n finally{\n close(rs);\n close(ps);\n }\n }", "Optional<User> findUserLoginAndPassword(String login, String password) throws LogicException;", "@Override\n protected void checkCredential(CredentialChecker checker) {\n checker.check(UserPasswordCredential.class, credential -> {\n return memberBhv.selectCount(cb -> arrangeLoginByCredential(cb, credential)) > 0;\n });\n }", "@Override\r\n\t\t\tprotected PasswordAuthentication getPasswordAuthentication() {\n\t\t\t\treturn new PasswordAuthentication(\"[email protected]\",\"scm#2021\");\r\n\t\t\t}", "@Override\r\n\t\t\tprotected PasswordAuthentication getPasswordAuthentication() {\n\t\t\t\treturn new PasswordAuthentication(\"[email protected]\",\"scm#2021\");\r\n\t\t\t}", "User findByCredential(Credential credential);", "@Override\n\tpublic boolean login(String username, String password) {\n\t\treturn userProviderService.login(username, password);\n\t}", "public void userNormalLogin(String username, String password, FutureCallback<Response<JsonObject>> callback)\n\t{\n\t}", "public interface UserAuthenticationService {\n\n AuthenticationResult authenticate(String userName, String passwordHash);\n}", "@Override\r\n\tpublic User login(User u) throws Exception {\n\t\treturn userRepository.login(u);\r\n\t}", "private UserLoginReq(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public boolean validateUserCredentials(String login, String password) throws SQLException;", "public static synchronized Credentials authenticate(String userName, String password){\n\t\t\tConnection connection;\n\t\t \tCredentials credentials=null;\n\t\t \t\n\t\t \tPreparedStatement statement=null;\n\t\t\tString preparedSQL = \"SELECT * FROM Credential WHERE Email = ? and Pass = ?\";\n\t\t\t\n\t\t try{\n\t\t \tconnection=DBConnector.getConnection();\n\t\t \tstatement = connection.prepareStatement(preparedSQL);\n\t\t \tstatement.setString(1, userName);\n\t\t \tstatement.setString(2, password);\n\t\t\t\tResultSet rs = statement.executeQuery();\n\t\t\t\tif(rs.next()){\n\t\t\t\t\tcredentials = new Credentials();\n\t\t\t\t\tcredentials.setCredID(rs.getInt(1));\n\t\t\t\t\tcredentials.setUserID(rs.getInt(2));\n\t\t\t\t\tcredentials.setEmail(rs.getString(3));\n\t\t\t\t\tcredentials.setPass(rs.getString(4));\n\t\t\t\t\tcredentials.setRole(rs.getString(5));\n\t\t\t\t\tcredentials.setValid(rs.getInt(6));\n\t\t\t\t\tcredentials.setRegKey(rs.getString(7));\n\t\t\t\t}\t\n\t\t\t\trs.close();\t\t\n\t\t\t\tstatement.close();\n\t\t\t\tconnection.close();\n\t\t\t\t\n\t\t\t}catch (SQLException ex){\n\t\t\t\t\tSystem.out.println(\"Error: \" + ex);\n\t\t\t\t\tSystem.out.println(\"Query: \" + statement.toString());\n\t\t\t\t\tcredentials = null;\n\t\t\t\t}\t\n\t\t\treturn credentials;\n\t}", "String getUserPassword();", "public interface LoginService {\n E3Result userLogin(String username, String password);\n}", "public Identity authenticate(String login, String pwd){\r\n\t\t\t\r\n\t\t\r\n\t\tSpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);\r\n\t\tSession session = sf.openSession();\r\n\t\tList<Identity> ids = new ArrayList<Identity>();\r\n\t\tTransaction t = session.beginTransaction();\r\n\t\tQuery query = session.createQuery(\"FROM Identity AS identity WHERE identity.displayName = :login\");\r\n\t\t//transaction - forces changes in cache to be updated to dbs\r\n\t\tquery.setParameter(\"login\", login);\r\n\t\tids = query.list();\r\n\t\tt.commit();\r\n\t\tsession.close();\r\n\t\t\r\n\t\tif(ids.isEmpty())\r\n\t\t\treturn null;\r\n\t\t\r\n\t\t//there should be only one identity to a single displayname!\r\n\t\tfor(Identity id : ids)\r\n\t\t{\r\n\t\t\tPasswordEndecryptor.getInst();\r\n\t\t\t// hashed password decryption and authentication\r\n\t\t\tif(PasswordEndecryptor.checkPwd(pwd, id.getPassword()))\r\n\t\t\t{\r\n\t\t\t\tLOGGER.debug(\"Authentication should be succesfull!\");\r\n\t\t\t\treturn id;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\tLOGGER.debug(\"Authentication should NOT be succesfull!\");\r\n\t\treturn null;\r\n\t}", "com.bingo.server.msg.REQ.LoginRequestOrBuilder getLoginOrBuilder();" ]
[ "0.67135626", "0.6519868", "0.62506396", "0.6233228", "0.62299496", "0.62119126", "0.6195133", "0.6194201", "0.61475897", "0.6143534", "0.6123887", "0.61093587", "0.60863066", "0.6083354", "0.60777307", "0.60694", "0.6055206", "0.6053409", "0.6017495", "0.6003819", "0.59871", "0.5985124", "0.59776473", "0.59662163", "0.5963089", "0.5963089", "0.5963089", "0.59593594", "0.5952779", "0.59379065", "0.59373546", "0.5923444", "0.59229946", "0.59126014", "0.59026235", "0.5889806", "0.5888601", "0.5881299", "0.588074", "0.58749753", "0.58577806", "0.58534133", "0.5848524", "0.5819409", "0.58126765", "0.58017594", "0.5796911", "0.5789763", "0.5789086", "0.5787216", "0.57843137", "0.5783889", "0.57808983", "0.5772064", "0.57585526", "0.57570904", "0.5755335", "0.57495373", "0.5747466", "0.5743225", "0.57395965", "0.5731264", "0.5730898", "0.5730355", "0.57269317", "0.5723872", "0.5716982", "0.57165456", "0.5709848", "0.56984836", "0.56951314", "0.56870085", "0.56832606", "0.56823874", "0.5678658", "0.56760323", "0.5675779", "0.5675346", "0.566969", "0.56659067", "0.56614435", "0.56587124", "0.5655513", "0.5655424", "0.5653247", "0.5652963", "0.5648614", "0.5646738", "0.5646738", "0.5643561", "0.56435114", "0.5643447", "0.56420743", "0.56390077", "0.5638708", "0.56373584", "0.56190777", "0.561303", "0.5607678", "0.56066585", "0.55997854" ]
0.0
-1
functional interface cant have more than one abstract method
void method();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@FunctionalInterface\r\ninterface SingleMethod { // functional interface cant have more than one abstract method\r\n\tvoid method();\r\n\t\r\n}", "@FunctionalInterface\npublic interface MyFunctionalInterface {\n\n // abstract method\n int addMethod(int val1, int val2);\n\n}", "public interface i\n{\n\n public abstract void a(long l, a a1);\n}", "@FunctionalInterface\npublic interface MyFunctional01 {\n\tvoid method();\n\t// Error:(7, 1) java: Unexpected @FunctionalInterface annotation\n\t// ru.demi.java_examples.java_8.MyFunctional01 is not a functional interface\n\t// multiple non-overriding abstract methods found in interface ru.demi.java_examples.java_8.MyFunctional01\n\t// void method02();\n}", "public interface U {\n void f1();\n void f2();\n void f3();\n}", "@FunctionalInterface\ninterface Foo {\n //TODO try to comment the next line\n void method(String string);\n\n //TODO try to create another abstract method\n// void method2(String string);\n //TODO try to create a default method\n default void method3(String string)\n {\n System.out.println(string);\n }\n //TODO create another functional interface and try to extend this one\n\n //TODO create an empty interface and extend this one\n}", "public interface AbstractC2883ha {\n boolean a();\n}", "public interface se {\n void a(List<POI> list);\n\n boolean a();\n\n void b();\n\n boolean c();\n\n List<POI> d();\n\n POI e();\n\n POI f();\n}", "@FunctionalInterface\npublic interface Line {\n\n int line(int m, int x, int c);\n\n default void eq() {\n\n }\n}", "interface U {\n public void A() ;\n public void B() ;\n public void C() ;\n}", "public interface zzo\n extends IInterface\n{\n\n public abstract void zze(AdRequestParcel adrequestparcel);\n}", "public interface AbstractC1509Ys0 extends Q31 {\n Object g(Callback callback);\n}", "abstract interface I1 {\n public abstract void m1();\n}", "public interface AbstractC3386kV0 {\n boolean b();\n\n void d();\n\n void dismiss();\n\n ListView f();\n}", "public interface AbstractC14990nD {\n void ACi(View view);\n\n void ACk(View view);\n\n void ACo(View view);\n}", "interface MyFirstVoidFunctionalInterface {\n\n public void methodOne();\n\n}", "public interface AbstractC1815a {\n void onFail();\n\n void onSuccess();\n }", "public interface AbstractC2930hp1 {\n void a(String str, boolean z);\n\n void b(String str, long j);\n\n void c(String str, int i, int i2, int i3, int i4);\n\n void d(String str, int i);\n\n void e(String str, int i, int i2, int i3, int i4);\n}", "interface A {\n int summ(int x, int y);\n}", "public interface aqi {\n void a(int i, int i2, PhoneFavoriteSquareTileView phoneFavoriteSquareTileView);\n\n void b(int i, int i2, PhoneFavoriteSquareTileView phoneFavoriteSquareTileView);\n\n void q();\n\n void r();\n}", "public interface FlyBehavior {\n public abstract void fly();\n// public abstract void\n}", "abstract void method();", "@FunctionalInterface // or we can call it SAM\r\n interface ShowMe{\r\n\t\r\n\t void showOk();\r\n\t \r\n\tpublic default void one()\r\n\t {\r\n\t System.out.println(\"method one \");\r\n };\r\n \r\n public static void one1()\r\n {\r\n System.out.println(\"method one 1 \");\r\n };\r\n \r\n public default void one2()\r\n \t {\r\n \t System.out.println(\"method one2 \");\r\n };\r\n \r\n }", "public interface AbstractC00591m {\n void A9X(C0495Jm jm);\n\n void AAI(List<RG> list);\n}", "public interface AbstractC7729o0ooOoo {\n void OooO00o();\n}", "public interface afj {\n afh a();\n\n afi b();\n}", "public interface A {\n void a();\n void b();\n void c();\n void d();\n void e();\n void f();\n void g();\n}", "public interface AbstractC0273Ek {\n void e();\n}", "public interface ab {\n void beA();\n\n void beB();\n\n boolean beC();\n\n void bey();\n\n void bez();\n\n void dispose();\n\n void fK(boolean z);\n}", "@FunctionalInterface\ninterface Payment{\n\tvoid pay(int amount);\n}", "public interface i {\n int a();\n\n boolean b();\n\n void c();\n}", "public static interface _cls9\n{\n\n public abstract void onEbayError(List list);\n\n public abstract void onRemindersError();\n\n public abstract void updateMsgRemindersCounts(UserActivitySummary useractivitysummary);\n}", "public interface g {\n void a(int i, String str, boolean z);\n\n boolean a();\n\n void b();\n}", "public abstract void abstractone();", "public interface AbstractC0211Dj0 {\n void a(int i);\n}", "public interface AbstractC2726a {\n /* renamed from: a */\n void mo36480a(int i, int i2, ImageView imageView, Uri uri);\n\n /* renamed from: a */\n void mo36481a(int i, ImageView imageView, Uri uri);\n\n /* renamed from: a */\n void mo36482a(ImageView imageView, Uri uri);\n\n /* renamed from: b */\n void mo36483b(int i, ImageView imageView, Uri uri);\n}", "interface Workshop{\n\tabstract public void work();\n}", "@OOPMultipleInterface\npublic interface I7D {\n @OOPMultipleMethod\n default String f(Object p1, Object p2, Object p3) throws OOPMultipleException {return \"\";}\n @OOPMultipleMethod\n default String f(Integer p1, Object p2, E p3) throws OOPMultipleException {return \"\";}\n}", "public interface AbstractC01264e {\n void ABn(AnonymousClass4X v, @Nullable AnonymousClass4A v2, AnonymousClass4A v3);\n\n void ABp(AnonymousClass4X v, @NonNull AnonymousClass4A v2, @Nullable AnonymousClass4A v3);\n\n void ABr(AnonymousClass4X v, @NonNull AnonymousClass4A v2, @NonNull AnonymousClass4A v3);\n\n void ADd(AnonymousClass4X v);\n}", "public interface ad\n{\n\n public abstract void a(cs cs);\n\n public abstract void a(ds ds);\n}", "public interface y\n extends Iterable\n{\n\n public abstract u a(String s, String s1);\n\n public abstract u b(String s);\n\n public abstract u c(String s);\n\n public abstract Iterator iterator();\n}", "public interface Citizen {\n public abstract void sayHello();\n}", "public interface a {\n void a();\n }", "public interface a {\n void a();\n }", "public abstract void afvuren();", "public interface zze\n extends IInterface\n{\n\n public abstract void zza(zzd zzd, GoogleSignInConfig googlesigninconfig);\n\n public abstract void zza(zzd zzd, SignInConfiguration signinconfiguration);\n\n public abstract void zzb(zzd zzd, GoogleSignInConfig googlesigninconfig);\n\n public abstract void zzb(zzd zzd, SignInConfiguration signinconfiguration);\n\n public abstract void zzc(zzd zzd, GoogleSignInConfig googlesigninconfig);\n}", "public interface IFlyAminal {\n void fly();\n}", "@FunctionalInterface\npublic interface DogQuerier {\n public boolean test(Dog dog);\n}", "public interface A {\n void f();\n}", "public interface C22486a {\n void bGQ();\n\n void cMy();\n }", "public interface f {\n void a();\n}", "public interface IFunctionService extends IBaseService<Function, Long> {\r\n\r\n\r\n}", "public interface Functie {\n public int add(int a, int b);\n}", "@FunctionalInterface\npublic interface ReaderInterface {\n //void read(Book b);\n\n //default void unread(Book b) {}\n\n void unread(Book b);\n default void read(Book b) {}\n\n}", "public interface m {\n void a(boolean z);\n}", "public interface SampleA {\n void operation1();\n void operation2();\n}", "public interface FlyBehevour {\n void fly();\n}", "public abstract void operation();", "public abstract void abstractMethodToImplement();", "public interface Interface3 {\n void operation4();\n void operation5();\n}", "interface IFly {\n void fly();\n}", "@FunctionalInterface\r\npublic interface Command {\r\n\tpublic void execute();\r\n}", "public interface AbstractC7617o0oOO {\n void OooO00o(View view);\n\n void OooO0O0(View view);\n\n void OooO0OO(View view);\n}", "@FunctionalInterface\npublic interface Functional_Interface {\n\t\n\tpublic void printMessage(String message);\n\t\n\tdefault void printDefaultMessage(String defaultMessage)\n\t{\n\t\tSystem.out.println(\"This is default message\"+\" \"+defaultMessage);\n\t}\n\t\n\tstatic void printStaticMessage(String staticMessage)\n\t{\n\t\tSystem.out.println(\"This is static message\"+\" \"+staticMessage);\n\t}\n\t\n\n}", "public interface ch\n{\n\n public abstract void a(bv bv, p p, h h, long l, int i, int j, \n IMediaItem imediaitem);\n}", "public interface IFaci {\n}", "public interface Animal {\n\n public void eat();\n public void travel();\n}", "public interface b {\n void a(long j);\n\n void a(boolean z);\n\n void e();\n }", "public interface Two {\n void execute();\n}", "public interface AnInterface {\n void f();\n\n void g();\n\n void h();\n}", "public interface b {\n void a();\n }", "public interface b {\n void a();\n }", "public interface IAlgorithm {\n void go();\n}", "abstract void m1();", "public interface Implementor {\n // 实现抽象部分需要的某些具体功能\n void operationImpl();\n}", "public interface AbstractC0647Pn {\n void A9C(AbstractC0645Pl pl);\n\n void A9Y(Exception exc);\n}", "private interface IPsi {\n public double f(int n);\n }", "public interface AbstractC1008ba extends JQ {\n void AA9();\n}", "interface a {\n int aadd();\n int sub();\n}", "@FunctionalInterface\n public interface PReturn {\n\n //functional interfaces: one abstract method, as many instance or static methods as you'd like.\n public int returnInt(int x);\n //public abstract int returnInt2(String x);\n\n //new to java 8: default methods (cannot be used with @FunctionalInterfaces\n //public default int returnInt(int x) { return x; }\n\n //new to java 8: static methods now in interfaces\n public static boolean isIReturn(Object obj) { return obj instanceof IReturn; }\n}", "public interface Operation {\n int operate(int args1, int args2);\n}", "public interface ITeslaProduct extends IProduct {\n //@Override\n public abstract void makeProduct();\n}", "interface A {\n void a();\n}", "public interface l\n{\n\n public abstract String a();\n\n public abstract String b();\n\n public abstract String c();\n\n public abstract String d();\n\n public abstract int e();\n\n public abstract String f();\n\n public abstract int g();\n\n public abstract int h();\n\n public abstract String i();\n\n public abstract String j();\n\n public abstract String k();\n\n public abstract et l();\n\n public abstract eq m();\n}", "public interface IFunction {\r\n void setFunctions(String tag);\r\n}", "public interface lanjut {\r\n public abstract double luasPersegi(double a1);//a1*a1\r\n public abstract double luasSegitiga(double a1, double a2);//(a1*a2)/2\r\n public abstract double luasPersegi (double a1, double a2);//a1*a2\r\n public abstract double luasLingkaran (double a1);//phi*(a1*a1)\r\n public abstract double luasJajaranGenjang(double a1, double a2);//a1*a2\r\n}", "@FunctionalInterface\ninterface FuncInterface {\n\n\tabstract void printName(String name);\n\n\tdefault void printCity(String city) {\n\t\tSystem.out.println(city);\n\t}\n\n\tstatic void printAge(int age) {\n\t\tSystem.out.println(age);\n\t}\n}", "public interface Calculate {\n int add(int a, int b);\n}", "public interface Zrada\n{\n void accuse();\n}", "interface A9 {\r\n void test(int i, String s1); //test method is taking some argument\r\n}", "public void implementFunctionalInterface1() {\n\t\tSystem.out.println(\"\\n\\n************Implement Functional Interfaces - 1**********\");\n\t\tMyFunctionalInterface lambda = () -> System.out.println(\"Executing...\");\n\t\tlambda.execute();\n\t}", "public interface MyFunc {\n int func(int n);\n}", "public interface AbstractC61422t9 {\n void AJZ(C61072sS v);\n}", "public interface MyInterface {\n public void m1();\n public void m2();\n public void m3();\n public void m4();\n\n}", "public static interface .cart.interfaces.a.k\n extends b\n{\n\n public abstract void a();\n\n public abstract void a(CartProductShippingModeDetails cartproductshippingmodedetails);\n\n public abstract void a(k k);\n\n public abstract void b();\n}", "public interface FitnessCalc1 {\n public double utilityFunction(Individual X);\n public double function(double x, Individual X);\n}", "public interface IBiz{\n\tpublic void BizCallBack(Action action);//biz层接口\n}", "public interface OperatorInterface {\n public Object call(Engine engine, List<?> args);\n}", "public interface Strategy {\n\n\n\tpublic void operation();\n\n}", "public static interface _cls9\n{\n\n public abstract void userCancelledSignIn();\n\n public abstract void userSuccessfullySignedIn();\n}", "interface cm\n{\n\n public abstract void f(com.google.android.gms.internal.d.a a);\n\n public abstract cj lS();\n\n public abstract cj lT();\n\n public abstract ck lU();\n\n public abstract ck lV();\n\n public abstract ck lW();\n\n public abstract ck lX();\n}" ]
[ "0.77757823", "0.7169262", "0.6957053", "0.69532543", "0.6952169", "0.69508076", "0.6847242", "0.6782638", "0.67695516", "0.6759991", "0.67522514", "0.6723087", "0.66877294", "0.6685124", "0.66725135", "0.66695106", "0.66395044", "0.6634122", "0.66227245", "0.66222167", "0.66210145", "0.66166705", "0.6609394", "0.6593529", "0.65932584", "0.6562902", "0.6561775", "0.6553755", "0.65479594", "0.654366", "0.65334344", "0.6531107", "0.65227425", "0.65211195", "0.650254", "0.64978606", "0.64927334", "0.648797", "0.64847857", "0.6478894", "0.6474848", "0.64748394", "0.64704937", "0.64704937", "0.6467764", "0.6467486", "0.64646", "0.6456831", "0.64488924", "0.64485687", "0.64372635", "0.6436747", "0.6426938", "0.64015627", "0.6401421", "0.63945395", "0.6385342", "0.63847816", "0.63802403", "0.6374541", "0.6365459", "0.6363172", "0.6361599", "0.6357283", "0.6354081", "0.6351211", "0.634401", "0.6332617", "0.6324219", "0.63136643", "0.6311063", "0.6311063", "0.6295426", "0.6287576", "0.62867075", "0.62786627", "0.6274199", "0.6272536", "0.6268285", "0.62643117", "0.6258174", "0.62579924", "0.6250077", "0.62446225", "0.62442636", "0.62418514", "0.6239687", "0.62279564", "0.62259144", "0.62249815", "0.6218419", "0.621077", "0.62081265", "0.6207737", "0.62060475", "0.6205383", "0.6203985", "0.6202743", "0.6197305", "0.6189073", "0.6186815" ]
0.0
-1
end of SingleMethod Java 1.8 new feature > default method in interface
interface DefaultMethod extends SingleMethod { default public void myMethod() { System.out.println("from Java 1.8 version can have method with a body"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "interface Sample {\n\tvoid method(String a);\n\t// New in Java 1.8 - default interface methods\n\tdefault void method_default() {\n\t System.out.println(\"Hello from default method!\");\n\t}\n }", "public interface A {\n default void oi(){\n System.out.println(\"Dentro do oi de A\");\n }\n}", "interface A {\n default void m() {\n System.out.println(\"I am default method\");\n }\n}", "default void defaultMethod() {\n System.out.println(\"from InterfaceA, default method...\");\n }", "interface I{\n\n public void m1();\n public void m2();\n default void m3(){\n System.out.println(\"Default methods in interface\");\n }\n}", "@Override\n public void defaultMethod() {\n I4.super.defaultMethod();\n }", "public default void defaultMethod(){\r\n System.out.println(\"This is a method from Other Interface and can be overriden.\");\r\n }", "public interface MyInterface2 {\n default void hello(){\n System.out.println(\"hello again\");\n }\n}", "public interface IMy extends IA, IB{\n int a = 10;\n int []b = {1,2,3,4,5,6,7};\n\n void m();\n static void sm(){\n System.out.println(\"hi from static method\");\n }\n default void dm(){\n System.out.println(\"hi from default method\");\n }\n}", "public interface Defaultable {\n default void notRequired(){\n System.out.println(\"default method\");\n }\n static void staticMethod(){\n System.out.println(\"static method\");\n }\n static Defaultable create(Supplier<Defaultable> supplier){\n return supplier.get();\n }\n}", "public interface MyInterface {\n\n String returnString(String string);\n\n default int returnInt() {\n return 105;\n }\n}", "interface TestInterface1\n{\n // default method\n default void show()\n {\n System.out.println(\"Default TestInterface1\");\n }\n \n public static void show2()\n {\n System.out.println(\"Default TestInterface2\");\n }\n}", "public interface J {\n\n void f();\n\n default void g() {\n System.out.println(\"This is the default method of J\");\n }\n\n public static void h() {\n System.out.println(\"This is the static method of J\");\n }\n}", "public interface HasFins{\n // default Methods: Pueden ser implementados en una interface\n // y siguen las mismas reglas sobre overriding\n public default int getNumberOfFins(){\n return 4;\n }\n\n public default double getLongestFinLength(){\n return 20.0;\n }\n\n public default boolean doFinsHaveScales(){\n return true;\n }\n\n //public default boolean doThat(); // Tiene que ser implementado si tiene el modificador default\n\n}", "public interface InterfaceA {\n\n default String message() {\n return \"Message from Interface A\";\n }\n\n}", "default void printMyName(){ // interfaces can have only 1 method type with body and have default prefix as a keyword\n System.out.println(\"My name is bla bla\");\n }", "default void helloDefault() {\n\t\tSystem.out.println(\"Hello from default method definitions from Java8 within interfaces\");\n\t}", "interface I4 {\n public default void m1() { // <- Modifier 'public' is redundant for interface methods\n System.out.println(\"I4.m1()\");\n } // public is redundant\n\n /**\n * it is public, but NOT abstract (error: Illegal combination of modifiers: 'abstract' and 'default')\n */\n default void m2() {\n System.out.println(\"I4.m2()\");\n }\n}", "public interface IUserService {\n\n static void test(){\n System.out.println(123);\n }\n\n default void teset1(String name){\n System.out.println(name);\n }\n\n int a = 0;\n\n}", "interface Interface1 {\n\n\tdefault void add() {\n\t\tSystem.out.println(\"Interface1 add method\");\n\t}\n\n\tdefault void display() {\n\t\tSystem.out.println(\"Interface1 display\");\n\t}\n\n\t//static methods can be invoked only using InterfaceName.methodName\n\tstatic void print() {\n\t\tSystem.out.println(\"Interface1 print\");\n\t}\n\n\tstatic void printV2() {\n\t\tSystem.out.println(\"Interface1 printV2\");\n\t}\n}", "default void display1(){\n\t\tSystem.out.println(\"Default Method inside interface\");\n\t}", "public interface InterfaceA {\n\n\tpublic void methodFromInterfaceA();\n\n\t// Before Java 8, the interface only contains method signatures. \n\t// With Java 8 new feature Default Methods or Defender Methods, \n\t// you can include method body within the interface.\n\tdefault void defaultMethod() {\n System.out.println(\"from InterfaceA, default method...\");\n }\n\t\n\tstatic void someStaticMethod() {\n System.out.println(\"from InterfaceA static method...\");\n }\n\t\n\t/*\n\t * Why do we need to implement a method within the interface?\n\t * \n * Let's say you have an interface which has multiple methods, \n * and multiple classes are implementing this interface. One \n * of the method implementations can be common across the classes, \n * we can make that method as a default method, so that the \n * implementation is common for all classes.\n *\n * How to work with existing interfaces?\n * \n\t * Second scenario where you have already existing application, \n\t * for a new requirement we have to add a method to the existing \n\t * interface. If we add new method then we need to implement it \n\t * through out the implementation classes. By using the Java 8 \n\t * default method we can add a default implementation of that \n\t * method which resolves the problem.\n\t */\n}", "public interface def2 {\n default void go(){\n System.out.println(\"def2\");\n }\n}", "@FunctionalInterface\ninterface Foo {\n //TODO try to comment the next line\n void method(String string);\n\n //TODO try to create another abstract method\n// void method2(String string);\n //TODO try to create a default method\n default void method3(String string)\n {\n System.out.println(string);\n }\n //TODO create another functional interface and try to extend this one\n\n //TODO create an empty interface and extend this one\n}", "public interface FlyingAnimal extends Animal {\n @Override\n default String identifyMyself(){\n return \"I am an animal and I can fly\";\n }\n}", "public interface Work {\n default void doWork() {\n }\n}", "@FunctionalInterface\npublic interface ReaderInterface {\n //void read(Book b);\n\n //default void unread(Book b) {}\n\n void unread(Book b);\n default void read(Book b) {}\n\n}", "public interface Walk {\n\n public default void status() {\n System.out.println(\"Walking\");\n }\n}", "interface in12 \n{ \n\tfinal int a = 10; \n\tdefault void display() \n\t{ \n\t\tSystem.out.println(\"hello\"); \n\t} \n\tdefault void display1() \n\t{\t\n\t\tSystem.out.println(\"hello displa1\"); \n\t}\n}", "interface TakesScreenshot{\n\tString $FILE_EXTENSION=\".png\"; //COMPILER ADDs 'public static final' automatically \t\n\tvoid takesScreenshot();\n\t//added from jdk 1.8\nstatic void takeSelfie() {\n\t\tSystem.out.println(\"I am defined static method of TakesScreenshot interface\");\n\t}\ndefault void takePictures() {\n\t\tSystem.out.println(\"I am default defined method of TakesScreenshot interface\");\n\t}\n}", "@OOPMultipleInterface\npublic interface I7D {\n @OOPMultipleMethod\n default String f(Object p1, Object p2, Object p3) throws OOPMultipleException {return \"\";}\n @OOPMultipleMethod\n default String f(Integer p1, Object p2, E p3) throws OOPMultipleException {return \"\";}\n}", "default void method_default() {\n\t System.out.println(\"Hello from default method!\");\n\t}", "@FunctionalInterface // or we can call it SAM\r\n interface ShowMe{\r\n\t\r\n\t void showOk();\r\n\t \r\n\tpublic default void one()\r\n\t {\r\n\t System.out.println(\"method one \");\r\n };\r\n \r\n public static void one1()\r\n {\r\n System.out.println(\"method one 1 \");\r\n };\r\n \r\n public default void one2()\r\n \t {\r\n \t System.out.println(\"method one2 \");\r\n };\r\n \r\n }", "interface Left {\n default void m1() {\n System.out.println(\"Left\");\n }\n}", "interface InterfaceForDisplaying {\n default void displayDefault() {\n System.out.println(\"I'm a default method defined in an interface\");\n }\n\n static void displayStatic() {\n System.out.println(\"I'm a static method defined in an interface\");\n }\n\n void displayAbstract();\n}", "interface InterfaceChild extends InterfaceParent {\n default String introduce() {\n return \"InterfaceChild\";\n }\n}", "public interface ITestInterface {\n\t\tdefault public void sayHello() {\n\t\t\tSystem.out.println(\"Hi World!\");\n\t\t}\n\t}", "public interface SimpleInterface {\n String interfaceMethod(Integer value);\n}", "public interface SimpleInterface {\n void f();\n}", "public void returnDefault();", "public interface axk\r\n/* */ {\r\n/* */ @Nullable\r\n/* */ bji f(el paramel);\r\n/* */ \r\n/* */ blc a_(el paramel);\r\n/* */ \r\n/* */ byw b(el paramel);\r\n/* */ \r\n/* */ default int K() {\r\n/* 27 */ return 15;\r\n/* */ }\r\n/* */ }", "public interface a {\n void a();\n }", "public interface a {\n void a();\n }", "public interface C1061nc extends IInterface {\n /* renamed from: a */\n String mo2800a();\n\n /* renamed from: a */\n String mo2801a(String str);\n\n /* renamed from: a */\n void mo2802a(String str, boolean z);\n\n /* renamed from: a */\n boolean mo2803a(boolean z);\n}", "abstract public E addDefault();", "interface A {\n void a();\n}", "public interface DefaultStat extends SwitchOptionStatSequence\n{\n}", "@VTID(12)\n @DefaultMethod\n @UseDefaultValues(paramIndexMapping = {4}, optParamIndex = {0, 1, 2, 3}, javaType = {java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, int.class}, nativeType = {NativeType.VARIANT, NativeType.VARIANT, NativeType.VARIANT, NativeType.Int32}, variantType = {Variant.Type.VT_ERROR, Variant.Type.VT_ERROR, Variant.Type.VT_ERROR, Variant.Type.VT_I4}, literal = {\"80020004\", \"80020004\", \"80020004\", \"1033\"})\n @ReturnValue(index=4)\n com.exceljava.com4j.excel.Name _Default();", "public interface ICamera {\r\n void takePhoto(); // abstract method\r\n void changeAperture();\r\n\r\n default void takeHdrPhoto() {\r\n System.out.println(\"take 3 photos with different exposures and combine them together\");\r\n }\r\n\r\n default void shootVideo() {\r\n System.out.println(\"shooting a video\");\r\n }\r\n}", "public interface InterTest {\n\n default void test(){\n System.out.println(\"哈哈\");\n }\n}", "interface I1 {\n long NOW = TestInterfaceSetOne.writableStaticField = getTime();\n DefaultInterfaceMethodWithStaticInitializer C = RECORDER.register(I1.class);\n\n default int defaultM1() {\n return 1;\n }\n }", "default void msg()\n {\n System.out.println(\"Default method...\");\n }", "private static interface Base {\n\n public void foo();\n }", "public interface A {\n void f();\n}", "public void method_1()\n {\n System.out.println(\"Interface method.\");\n }", "@FunctionalInterface\r\ninterface SingleMethod { // functional interface cant have more than one abstract method\r\n\tvoid method();\r\n\t\r\n}", "default String notRequired() {\n return \"Default implementation\";\n }", "interface Test4{\r\n\tpublic void m1();\r\n}", "public interface i {\n int a();\n\n boolean b();\n\n void c();\n}", "public interface PersonWrapper<T extends PersonEntity> extends Wrapper<T> {\n\n default PersonName getName() {\n return getWrapped().getNameInfo();\n }\n\n default String getFirstName() {\n return getName().getFirstName();\n }\n\n default String getLastName() {\n return getName().getLastName();\n }\n\n default String getMiddleName() {\n return getName().getMiddleName();\n }\n\n default String getSuffix() {\n return getName().getSuffix();\n }\n}", "interface I2 {\n long NOW = TestInterfaceSetOne.writableStaticField = getTime();\n DefaultInterfaceMethodWithStaticInitializer D = RECORDER.register(I2.class);\n\n default int defaultM2() {\n return 10;\n }\n }", "public interface test {\n void test();\n}", "@Override\n\tpublic void buildDefaultMethods(JDefinedClass cls) {\n\n\t}", "public interface AgreementService {\n default void sign() {\n System.out.println(\"Agreement has been signed\");\n }\n}", "public abstract Method createDefaultCaseMethod(IClassDefinition cdef);", "@VTID(12)\n @DefaultMethod\n @UseDefaultValues(paramIndexMapping = {0, 1, 4}, optParamIndex = {2, 3}, javaType = {java.lang.Object.class, int.class}, nativeType = {NativeType.VARIANT, NativeType.Int32}, variantType = {Variant.Type.VT_ERROR, Variant.Type.VT_I4}, literal = {\"80020004\", \"1033\"})\n @ReturnValue(index=4)\n com.exceljava.com4j.excel.Name _Default(\n @Optional @MarshalAs(NativeType.VARIANT) java.lang.Object index,\n @Optional @MarshalAs(NativeType.VARIANT) java.lang.Object indexLocal);", "public interface d {\n void a();\n}", "public interface Interface {\n void doSomething();\n void somethingElse(String arg);\n}", "public void interfaceMethod() {\n\t\tSystem.out.println(\"overriden method from interface\");\t\t\r\n\t}", "@FunctionalInterface\npublic interface FISample {\n\n void toLowerCase(String v);\n\n default String toUpperCase(String value) {\n return value.toUpperCase();\n }\n}", "public interface AbstractC0211Dj0 {\n void a(int i);\n}", "public interface b {\n int a();\n }", "interface C34503a {\n void bMl();\n }", "@FunctionalInterface\npublic interface Functional_Interface {\n\t\n\tpublic void printMessage(String message);\n\t\n\tdefault void printDefaultMessage(String defaultMessage)\n\t{\n\t\tSystem.out.println(\"This is default message\"+\" \"+defaultMessage);\n\t}\n\t\n\tstatic void printStaticMessage(String staticMessage)\n\t{\n\t\tSystem.out.println(\"This is static message\"+\" \"+staticMessage);\n\t}\n\t\n\n}", "public interface SRSTet extends Tetromino {\r\n @Override\r\n default String getName() {\r\n return \"SRS \" + getType();\r\n }\r\n}", "@VTID(12)\n @DefaultMethod\n @UseDefaultValues(paramIndexMapping = {0, 1, 2, 4}, optParamIndex = {3}, javaType = {int.class}, nativeType = {NativeType.Int32}, variantType = {Variant.Type.VT_I4}, literal = {\"1033\"})\n @ReturnValue(index=4)\n com.exceljava.com4j.excel.Name _Default(\n @Optional @MarshalAs(NativeType.VARIANT) java.lang.Object index,\n @Optional @MarshalAs(NativeType.VARIANT) java.lang.Object indexLocal,\n @Optional @MarshalAs(NativeType.VARIANT) java.lang.Object refersTo);", "public interface m {\n void a(boolean z);\n}", "public interface AbstractC2883ha {\n boolean a();\n}", "@VTID(12)\n @DefaultMethod\n @UseDefaultValues(paramIndexMapping = {0, 4}, optParamIndex = {1, 2, 3}, javaType = {java.lang.Object.class, java.lang.Object.class, int.class}, nativeType = {NativeType.VARIANT, NativeType.VARIANT, NativeType.Int32}, variantType = {Variant.Type.VT_ERROR, Variant.Type.VT_ERROR, Variant.Type.VT_I4}, literal = {\"80020004\", \"80020004\", \"1033\"})\n @ReturnValue(index=4)\n com.exceljava.com4j.excel.Name _Default(\n @Optional @MarshalAs(NativeType.VARIANT) java.lang.Object index);", "interface InterfaceOuting {\n abstract String movingActivity();\n abstract String climbingActivity();\n\n default void restingActivity(){\n String rest = \"Napping\";\n displayOuting(rest);\n }\n\n static void displayOuting(String activity){\n System.out.println(\"This outing will involve \" + activity);\n }\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C22486a {\n void bGQ();\n\n void cMy();\n }", "interface MyFunctionalInterface {\n\tpublic void execute();\n\n\tpublic default void print(String text) {\n\t\tSystem.out.println(text);\n\t}\n\n\tpublic static void print(String text, PrintWriter writer) throws IOException {\n\t\twriter.write(text);\n\t}\n}", "interface Interface1 {\n\tpublic void getA();\n\n\tpublic void printA();\n}", "public interface b {\n void a();\n }", "public interface b {\n void a();\n }", "public interface f {\n void a();\n}", "public interface zze\n extends IInterface\n{\n\n public abstract void zza(zzd zzd, GoogleSignInConfig googlesigninconfig);\n\n public abstract void zza(zzd zzd, SignInConfiguration signinconfiguration);\n\n public abstract void zzb(zzd zzd, GoogleSignInConfig googlesigninconfig);\n\n public abstract void zzb(zzd zzd, SignInConfiguration signinconfiguration);\n\n public abstract void zzc(zzd zzd, GoogleSignInConfig googlesigninconfig);\n}", "public interface AbstractC2726a {\n /* renamed from: a */\n void mo36480a(int i, int i2, ImageView imageView, Uri uri);\n\n /* renamed from: a */\n void mo36481a(int i, ImageView imageView, Uri uri);\n\n /* renamed from: a */\n void mo36482a(ImageView imageView, Uri uri);\n\n /* renamed from: b */\n void mo36483b(int i, ImageView imageView, Uri uri);\n}", "public interface SampleA {\n void operation1();\n void operation2();\n}", "public interface Gun {\n\n boolean fire();\n\n default void reload(int bullets) {\n\n }\n}", "public interface C11922a {\n void bvR();\n }", "@DISPID(203)\r\n public boolean defaultVerbInvoked() {\r\n throw new UnsupportedOperationException();\r\n }", "@FunctionalInterface\npublic interface Line {\n\n int line(int m, int x, int c);\n\n default void eq() {\n\n }\n}", "public interface g {\n void a(int i, String str, boolean z);\n\n boolean a();\n\n void b();\n}", "public interface C11859a {\n void bvs();\n }", "@FunctionalInterface\n public interface PReturn {\n\n //functional interfaces: one abstract method, as many instance or static methods as you'd like.\n public int returnInt(int x);\n //public abstract int returnInt2(String x);\n\n //new to java 8: default methods (cannot be used with @FunctionalInterfaces\n //public default int returnInt(int x) { return x; }\n\n //new to java 8: static methods now in interfaces\n public static boolean isIReturn(Object obj) { return obj instanceof IReturn; }\n}", "@SuppressWarnings(\"null\")\n private ServiceInterface3 getDefaultImplFromReference() throws InvalidSyntaxException {\n Collection<ServiceReference<ServiceInterface3>> references = bundleContext.getServiceReferences(ServiceInterface3.class, \"(!(prop1=abc))\");\n ServiceInterface3 service = bundleContext.getService(references.iterator().next());\n return ((ServiceInterface3ImplSelfReferencing)service).getDefaultImplementation();\n }", "public interface AnInterface {\n void f();\n\n void g();\n\n void h();\n}", "interface A9 {\r\n void test(int i, String s1); //test method is taking some argument\r\n}" ]
[ "0.7988087", "0.7818289", "0.7738305", "0.7734584", "0.770305", "0.7646692", "0.7607255", "0.75260717", "0.75056565", "0.7378305", "0.7358213", "0.7352611", "0.72911125", "0.7225844", "0.72007847", "0.7198496", "0.71805596", "0.7134743", "0.7116114", "0.71027976", "0.7065319", "0.7051837", "0.7029664", "0.70005673", "0.6861982", "0.6819456", "0.6783595", "0.6777643", "0.677108", "0.6716901", "0.66598886", "0.6637809", "0.66334766", "0.66307783", "0.6619878", "0.660967", "0.65521526", "0.65011984", "0.64284116", "0.6396718", "0.6370565", "0.6351541", "0.6351541", "0.63494873", "0.63403404", "0.6318691", "0.6272672", "0.6259466", "0.62430805", "0.62314653", "0.6210699", "0.6170563", "0.6169775", "0.61674714", "0.6163664", "0.61632085", "0.61402094", "0.6127864", "0.61230713", "0.6098018", "0.60850817", "0.60812974", "0.60736716", "0.6061576", "0.60608685", "0.60323286", "0.6031292", "0.60220623", "0.6018775", "0.60110617", "0.6007349", "0.6000622", "0.5995978", "0.59908825", "0.5985406", "0.5984675", "0.5983533", "0.5981245", "0.59805816", "0.59744394", "0.59743404", "0.5961085", "0.5957396", "0.59486574", "0.59463507", "0.59463507", "0.5945746", "0.5944232", "0.5933635", "0.5925933", "0.59241545", "0.5902811", "0.59003675", "0.5891939", "0.58848935", "0.58835906", "0.58825195", "0.58793914", "0.58793825", "0.58780617" ]
0.7874619
1
TODO Autogenerated method stub
@Override public void deposit() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void withdraw() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void checkBalance() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO 4. Save data and notify changes
public void setData(List<Business> list) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void updateData() {\n\t\t\r\n\t}", "public void updateData() {}", "private void saveData() {\n }", "public void dataChanged() {\n\t\tif (wijzigInfo)\n\t\t\twijzigInfo();\n\n\t\tsetChanged();\n\t\tnotifyObservers(\"dataChanged\");\n\t}", "@Override\n protected void onDataChanged() {\n }", "@Override\n public void onDataChanged() {\n\n }", "public void saveData ( ) {\n\t\tinvokeSafe ( \"saveData\" );\n\t}", "public void saveData() {\n\t\t//place to save notes e.g to file\n\t}", "void updateData();", "@Override\n public void onDataChanged() {\n }", "@Override\n public void onDataChanged() {\n }", "public void onDataChanged();", "void onDataChanged();", "public void notifyState() {\n\t\tList<T> alldata = new ArrayList<T>(this.dataMap.values());\t\r\n\t\t// call them with the current data\r\n\t\t// for each observer call them\r\n\t\tfor( ModelEvents<T> observer : this.ObserverList){\r\n\t\t\tobserver.dataState(alldata);\r\n\t\t}\r\n\r\n\t}", "public void willbeUpdated() {\n\t\t\n\t}", "public void onDataChanged(){}", "public void save() {\n DataBuffer.saveDataLocally();\n\n //TODO save to db must be done properly\n DataBuffer.save(session);\n\n //TODO recording saved confirmation\n }", "void notifyPrisonerDataChanged();", "private void saveData() {\n\t\tthis.dh = new DataHelper(this);\n\t\tthis.dh.updateData(String.valueOf(mData.getText()), i.getId());\n\t\tthis.dh.close();\n\t\tToast\n\t\t\t\t.makeText(ctx, \"Changes saved successfully...\",\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\n\t\tIntent myIntent = new Intent(EditActivity.this, StartActivity.class);\n\t\tEditActivity.this.startActivity(myIntent);\n\t\tfinish();\n\t}", "private synchronized void syncData() {\n try {\n // pulling data from server\n pullData();\n\n // pushing local changes to server\n// recordStatus=2\n pushData();\n// recordStatus=1\n// pushData1();\n } catch (Throwable throwable) {\n Log.d(TAG, \"doWork: \" + throwable.getMessage());\n }\n // Toast.makeText(getApplicationContext(), \".\", Toast.LENGTH_SHORT).show();\n }", "@Override\n public void save() {\n \n }", "private void verificaData() {\n\t\t\n\t}", "@Override\n public void onSave(MessageContainer messages) {\n }", "private void saveData() {\n\t\tdataSaver.save(data);\n\t}", "@Override\n public void save()\n {\n \n }", "@Override\n public void DataIsInserted() {\n }", "public void onDataChanged(IData data) {\r\n setData(data);\r\n }", "public void notifyChangementJoueurs();", "private void saveData() {\n readViews();\n final BookEntry bookEntry = new BookEntry(mNameString, mQuantityString, mPriceString, mSupplier, mPhoneString);\n AppExecutors.getInstance().diskIO().execute(new Runnable() {\n @Override\n public void run() {\n // Insert the book only if mBookId matches DEFAULT_BOOK_ID\n // Otherwise update it\n // call finish in any case\n if (mBookId == DEFAULT_BOOK_ID) {\n mDb.bookDao().insertBook(bookEntry);\n } else {\n //update book\n bookEntry.setId(mBookId);\n mDb.bookDao().updateBook(bookEntry);\n }\n finish();\n }\n });\n }", "@Override\n\tpublic void save() {\n\t\t\n\t}", "@Override\n\tpublic void save() {\n\t\t\n\t}", "@Override\n\tpublic void saveNotifications() {\n\t}", "@Override\n\tprotected void getDataRefresh() {\n\t\t\n\t}", "public void updatePersistence() {\n\t\tFile file = new File(\"data.txt\");\n\t\tserializeToFile(file);\n\t\tupdatePersistentSettings();\n\t}", "@Override\n public void saveValues() {\n \n }", "protected void saveValues() {\n dataModel.persist();\n }", "public void saveData() {\n throw new UnsupportedOperationException(\"Not yet supported\");\n }", "public void store() {\r\n\t\tdata = busExt.get();\r\n\t}", "@Override\r\n\tpublic void save() {\n\r\n\t}", "@Override\r\n\tpublic void save() {\n\r\n\t}", "private void save() {\n // Get the current measurement\n final LiveData<Measurement> ldm = mViewModel.getMeasurementById(mMeasurementId);\n ldm.observe(getViewLifecycleOwner(), new Observer<Measurement>() {\n @Override\n public void onChanged(final Measurement measurement) {\n ldm.removeObserver(this);\n updateMeasurement(measurement);\n snackBar(\"Measurement updated!\");\n }\n });\n }", "@Override\n\tpublic void getData() {\n\t\t\n\t}", "@Override\n public void save() {\n\n }", "protected boolean isDataChanged() {\n\n\t\treturn true;\n\t}", "public void saveData(){\r\n file.executeAction(modelStore);\r\n }", "@Override\r\n\t\t\tprotected void saveContext() {\n\t\t\t\t\r\n\t\t\t}", "public void dataWasSet();", "public static void doSavechanges ( RunData data)\n\t{\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());\n\t\tParameterParser params = data.getParameters ();\n\n\t\tString flow = params.getString(\"flow\").trim();\n\n\t\tif(flow == null || \"cancel\".equals(flow))\n\t\t{\n\t\t\tdoCancel(data);\n\t\t\treturn;\n\t\t}\n\n\t\t// get values from form and update STATE_STACK_EDIT_ITEM attribute in state\n\t\tcaptureValues(state, params);\n\n\t\tMap current_stack_frame = peekAtStack(state);\n\n\t\tEditItem item = (EditItem) current_stack_frame.get(STATE_STACK_EDIT_ITEM);\n\n\t\tif(flow.equals(\"showMetadata\"))\n\t\t{\n\t\t\tdoShow_metadata(data);\n\t\t\treturn;\n\t\t}\n\t\telse if(flow.equals(\"hideMetadata\"))\n\t\t{\n\t\t\tdoHide_metadata(data);\n\t\t\treturn;\n\t\t}\n\t\telse if(flow.equals(\"intentChanged\"))\n\t\t{\n\t\t\tdoToggle_intent(data);\n\t\t\treturn;\n\t\t}\n\t\telse if(flow.equals(\"addInstance\"))\n\t\t{\n\t\t\tString field = params.getString(\"field\");\n\t\t\taddInstance(field, item.getProperties());\n\t\t\tResourcesMetadata form = item.getForm();\n\t\t\tList flatList = form.getFlatList();\n\t\t\titem.setProperties(flatList);\n\t\t\treturn;\n\t\t}\n\t\telse if(flow.equals(\"linkResource\"))\n\t\t{\n\t\t\t// captureMultipleValues(state, params, false);\n\t\t\tcreateLink(data, state);\n\t\t\t//Map new_stack_frame = pushOnStack(state);\n\t\t\t//new_stack_frame.put(ResourcesAction.STATE_RESOURCES_HELPER_MODE, ResourcesAction.MODE_ATTACHMENT_SELECT);\n\t\t\tstate.setAttribute(ResourcesAction.STATE_RESOURCES_HELPER_MODE, ResourcesAction.MODE_ATTACHMENT_SELECT);\n\n\t\t\treturn;\n\t\t}\n\n\n\t\tSet alerts = (Set) state.getAttribute(STATE_EDIT_ALERTS);\n\n//\t\tif(item.isStructuredArtifact())\n//\t\t{\n//\t\t\tSchemaBean bean = (SchemaBean) current_stack_frame.get(STATE_STACK_STRUCT_OBJ_SCHEMA);\n//\t\t\tSaveArtifactAttempt attempt = new SaveArtifactAttempt(item, bean.getSchema());\n//\t\t\tvalidateStructuredArtifact(attempt);\n//\n//\t\t\tIterator errorIt = attempt.getErrors().iterator();\n//\t\t\twhile(errorIt.hasNext())\n//\t\t\t{\n//\t\t\t\tValidationError error = (ValidationError) errorIt.next();\n//\t\t\t\talerts.add(error.getDefaultMessage());\n//\t\t\t}\n//\t\t}\n\n\t\tif(alerts.isEmpty())\n\t\t{\n\t\t\t// populate the property list\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// get an edit\n\t\t\t\tContentCollectionEdit cedit = null;\n\t\t\t\tContentResourceEdit redit = null;\n\t\t\t\tGroupAwareEdit gedit = null;\n\t\t\t\tResourcePropertiesEdit pedit = null;\n\n\t\t\t\tif(item.isFolder())\n\t\t\t\t{\n\t\t\t\t\tcedit = ContentHostingService.editCollection(item.getId());\n\t\t\t\t\tgedit = cedit;\n\t\t\t\t\tpedit = cedit.getPropertiesEdit();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tredit = ContentHostingService.editResource(item.getId());\n\t\t\t\t\tgedit = redit;\n\t\t\t\t\tpedit = redit.getPropertiesEdit();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tBoolean preventPublicDisplay = (Boolean) state.getAttribute(STATE_PREVENT_PUBLIC_DISPLAY);\n\t\t\t\t\tif(preventPublicDisplay == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tpreventPublicDisplay = Boolean.FALSE;\n\t\t\t\t\t\tstate.setAttribute(STATE_PREVENT_PUBLIC_DISPLAY, preventPublicDisplay);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(! preventPublicDisplay.booleanValue())\n\t\t\t\t\t{\n\t\t\t\t\t\tContentHostingService.setPubView(gedit.getId(), item.isPubview());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(! AccessMode.GROUPED.toString().equals(item.getAccess()) && AccessMode.GROUPED == gedit.getAccess())\n\t\t\t\t\t{\n\t\t\t\t\t\tgedit.clearGroupAccess();\n\t\t\t\t\t}\n\t\t\t\t\telse if(AccessMode.GROUPED.toString().equals(item.getAccess()) && ! item.getEntityGroupRefs().isEmpty())\n\t\t\t\t\t{\n\t\t\t\t\t\tgedit.setGroupAccess(item.getEntityGroupRefs());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tgedit.clearGroupAccess();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(InconsistentException e)\n\t\t\t\t{\n\t\t\t\t\t// TODO: Should this be reported to user??\n\t\t\t\t\tlogger.debug(\"ResourcesAction.doSavechanges ***** InconsistentException changing groups ***** \" + e.getMessage());\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(ContentHostingService.isAvailabilityEnabled())\n\t\t\t\t{\n\t\t\t\t\tTime releaseDate = null;\n\t\t\t\t\tTime retractDate = null;\n\t\t\t\t\t\n\t\t\t\t\tboolean hidden = item.isHidden();\n\t\t\t\t\t\n\t\t\t\t\tif(item.useReleaseDate())\n\t\t\t\t\t{\n\t\t\t\t\t\treleaseDate = item.getReleaseDate();\n\t\t\t\t\t}\n\t\t\t\t\tif(item.useRetractDate())\n\t\t\t\t\t{\n\t\t\t\t\t\tretractDate = item.getRetractDate();\n\t\t\t\t\t}\n\t\t\t\t\tgedit.setAvailability(hidden, releaseDate, retractDate);\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\tif(item.isFolder())\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(item.isUrl())\n\t\t\t\t\t{\n\t\t\t\t\t\tredit.setContent(item.getFilename().getBytes());\n\t\t\t\t\t}\n\t\t\t\t\telse if(item.isStructuredArtifact())\n\t\t\t\t\t{\n\t\t\t\t\t\tredit.setContentType(item.getMimeType());\n\t\t\t\t\t\tredit.setContent(item.getContent());\n\t\t\t\t\t}\n\t\t\t\t\telse if(item.contentHasChanged())\n\t\t\t\t\t{\n\t\t\t\t\t\tredit.setContentType(item.getMimeType());\n\t\t\t\t\t\tredit.setContent(item.getContent());\n\t\t\t\t\t}\n\t\t\t\t\telse if(item.contentTypeHasChanged())\n\t\t\t\t\t{\n\t\t\t\t\t\tredit.setContentType(item.getMimeType());\n\t\t\t\t\t}\n\n\t\t\t\t\tBasicRightsAssignment rightsObj = item.getRights();\n\t\t\t\t\trightsObj.addResourceProperties(pedit);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tString copyright = StringUtil.trimToNull(params.getString (\"copyright\"));\n\t\t\t\t\tString newcopyright = StringUtil.trimToNull(params.getCleanString (NEW_COPYRIGHT));\n\t\t\t\t\tString copyrightAlert = StringUtil.trimToNull(params.getString(\"copyrightAlert\"));\n\t\t\t\t\tif (copyright != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (state.getAttribute(COPYRIGHT_NEW_COPYRIGHT) != null && copyright.equals(state.getAttribute(COPYRIGHT_NEW_COPYRIGHT)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (newcopyright != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpedit.addProperty (ResourceProperties.PROP_COPYRIGHT, newcopyright);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\talerts.add(rb.getString(\"specifycp2\"));\n\t\t\t\t\t\t\t\t// addAlert(state, rb.getString(\"specifycp2\"));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (state.getAttribute(COPYRIGHT_SELF_COPYRIGHT) != null && copyright.equals (state.getAttribute(COPYRIGHT_SELF_COPYRIGHT)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tString mycopyright = (String) state.getAttribute (STATE_MY_COPYRIGHT);\n\t\t\t\t\t\t\tpedit.addProperty (ResourceProperties.PROP_COPYRIGHT, mycopyright);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpedit.addProperty(ResourceProperties.PROP_COPYRIGHT_CHOICE, copyright);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (copyrightAlert != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tpedit.addProperty (ResourceProperties.PROP_COPYRIGHT_ALERT, copyrightAlert);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tpedit.removeProperty (ResourceProperties.PROP_COPYRIGHT_ALERT);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!(item.isFolder() && (item.getId().equals ((String) state.getAttribute (STATE_HOME_COLLECTION_ID)))))\n\t\t\t\t{\n\t\t\t\t\tpedit.addProperty (ResourceProperties.PROP_DISPLAY_NAME, item.getName());\n\t\t\t\t}\t// the home collection's title is not modificable\n\n\t\t\t\tpedit.addProperty (ResourceProperties.PROP_DESCRIPTION, item.getDescription());\n\t\t\t\t// deal with quota (collections only)\n\t\t\t\tif ((cedit != null) && item.canSetQuota())\n\t\t\t\t{\n\t\t\t\t\tif (item.hasQuota())\n\t\t\t\t\t{\n\t\t\t\t\t\t// set the quota\n\t\t\t\t\t\tpedit.addProperty(ResourceProperties.PROP_COLLECTION_BODY_QUOTA, item.getQuota());\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// clear the quota\n\t\t\t\t\t\tpedit.removeProperty(ResourceProperties.PROP_COLLECTION_BODY_QUOTA);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tList metadataGroups = (List) state.getAttribute(STATE_METADATA_GROUPS);\n\n\t\t\t\tstate.setAttribute(STATE_EDIT_ALERTS, alerts);\n\t\t\t\tsaveMetadata(pedit, metadataGroups, item);\n\t\t\t\talerts = (Set) state.getAttribute(STATE_EDIT_ALERTS);\n\n\t\t\t\t// commit the change\n\t\t\t\tif (cedit != null)\n\t\t\t\t{\n\t\t\t\t\tContentHostingService.commitCollection(cedit);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tContentHostingService.commitResource(redit, item.getNotification());\n\t\t\t\t}\n\n\t\t\t\tcurrent_stack_frame.put(STATE_STACK_EDIT_INTENT, INTENT_REVISE_FILE);\n\n\t\t\t\tBoolean preventPublicDisplay = (Boolean) state.getAttribute(STATE_PREVENT_PUBLIC_DISPLAY);\n\t\t\t\tif(preventPublicDisplay == null)\n\t\t\t\t{\n\t\t\t\t\tpreventPublicDisplay = Boolean.FALSE;\n\t\t\t\t\tstate.setAttribute(STATE_PREVENT_PUBLIC_DISPLAY, preventPublicDisplay);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (TypeException e)\n\t\t\t{\n\t\t\t\talerts.add(rb.getString(\"typeex\") + \" \" + item.getId());\n\t\t\t\t// addAlert(state,\" \" + rb.getString(\"typeex\") + \" \" + item.getId());\n\t\t\t}\n\t\t\tcatch (IdUnusedException e)\n\t\t\t{\n\t\t\t\talerts.add(RESOURCE_NOT_EXIST_STRING);\n\t\t\t\t// addAlert(state,RESOURCE_NOT_EXIST_STRING);\n\t\t\t}\n\t\t\tcatch (PermissionException e)\n\t\t\t{\n\t\t\t\talerts.add(rb.getString(\"notpermis10\") + \" \" + item.getId());\n\t\t\t\t// addAlert(state, rb.getString(\"notpermis10\") + \" \" + item.getId() + \". \" );\n\t\t\t}\n\t\t\tcatch (InUseException e)\n\t\t\t{\n\t\t\t\talerts.add(rb.getString(\"someone\") + \" \" + item.getId());\n\t\t\t\t// addAlert(state, rb.getString(\"someone\") + \" \" + item.getId() + \". \");\n\t\t\t}\n\t\t\tcatch (ServerOverloadException e)\n\t\t\t{\n\t\t\t\talerts.add(rb.getString(\"failed\"));\n\t\t\t}\n\t\t\tcatch (OverQuotaException e)\n\t\t\t{\n\t\t\t\talerts.add(rb.getString(\"changing1\") + \" \" + item.getId() + \" \" + rb.getString(\"changing2\"));\n\t\t\t\t// addAlert(state, rb.getString(\"changing1\") + \" \" + item.getId() + \" \" + rb.getString(\"changing2\"));\n\t\t\t}\n\t\t\tcatch(RuntimeException e)\n\t\t\t{\n\t\t\t\tlogger.debug(\"ResourcesAction.doSavechanges ***** Unknown Exception ***** \" + e.getMessage());\n\t\t\t\tlogger.debug(\"ResourcesAction.doSavechanges ***** Unknown Exception ***** \", e);\n\t\t\t\talerts.add(rb.getString(\"failed\"));\n\t\t\t}\n\t\t}\t// if - else\n\n\t\tif(alerts.isEmpty())\n\t\t{\n\t\t\t// modify properties sucessful\n\t\t\tString mode = (String) state.getAttribute(STATE_MODE);\n\t\t\tpopFromStack(state);\n\t\t\tresetCurrentMode(state);\n\t\t}\t//if-else\n\t\telse\n\t\t{\n\t\t\tIterator alertIt = alerts.iterator();\n\t\t\twhile(alertIt.hasNext())\n\t\t\t{\n\t\t\t\tString alert = (String) alertIt.next();\n\t\t\t\taddAlert(state, alert);\n\t\t\t}\n\t\t\talerts.clear();\n\t\t\tstate.setAttribute(STATE_EDIT_ALERTS, alerts);\n\t\t\t// state.setAttribute(STATE_CREATE_MISSING_ITEM, missing);\n\t\t}\n\n\t}", "@Override\n\tpublic void save() {\n\t\tSystem.out.println(\"save method\");\n\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\n public void Save() {\n\t \n }", "@PostPersist\n\t@PostUpdate\n\tprivate void storeChangesToDw() {\n\t}", "public boolean wasDataUpdated() {\n\t\treturn true;\n\t}", "@Override\r\n\tprotected void setData(Object data) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void operations() {\n\t\tSystem.out.println(\"update self!\"); \r\n notifyObservers(); \r\n\r\n\t}", "@Override\n public void refreshDataEntries() {\n }", "@Override\n\tpublic void update(Observable observable, Object data) {\n\n\t}", "protected void storeCurrentValues() {\n }", "public void updateDataComp() {\n\t\tdataEntryDao.updateDataComp();\n\t}", "@Override\n public void notify(String newFileContent) {\n Repository.getRepositoryInstance().updateStockOrders(newFileContent);\n//end of modifiable zone..................E/a170c128-ca49-4fc4-abdd-43b714481007\n }", "private void saveData() {\n // Save data to ReminderData class\n reminderData.setMinutes(timePicker.getMinute());\n reminderData.setDataHours(timePicker.getHour());\n reminderData.setNotificationText(reminderText.getText().toString());\n reminderData.saveDataToSharedPreferences();\n }", "public void saveData(){\n SerializableManager.saveSerializable(this,user,\"userInfo.data\");\n SerializableManager.saveSerializable(this,todayCollectedID,\"todayCollectedCoinID.data\");\n SerializableManager.saveSerializable(this,CollectedCoins,\"collectedCoin.data\");\n uploadUserData uploadUserData = new uploadUserData(this);\n uploadUserData.execute(this.Uid);\n System.out.println(Uid);\n\n }", "@Override\n\tpublic void saveData()\n\t{\n ssaMain.d1.pin = ssaMain.tmp_pin1;\n ssaMain.d1.balance = ssaMain.tmp_balance1;\n System.out.println(\"Your account has been established successfully.\");\n\t}", "@Override\n public void saveData() {\n System.out.println(\"GateWay\");\n }", "@Override\r\n\tpublic void notifyObservers() {\n\t\t\r\n\t}", "public void dataChanged() {\n // get latest data\n runs = getLatestRuns();\n wickets = getLatestWickets();\n overs = getLatestOvers();\n\n currentScoreDisplay.update(runs, wickets, overs);\n averageScoreDisplay.update(runs, wickets, overs);\n }", "public void Data(){\n\t\t\t\t\t\t\n\t\t\t\t\t}", "private void remplirUtiliseData() {\n\t}", "public void onDataChanged(IData data) {\r\n\t this.data = data;\r\n\t repaint();\r\n\t}", "public void notifyChange()\r\n {\r\n setChanged();\r\n notifyObservers();\r\n }", "private void setDirty() {\n\t}", "@Override\n public void sync(){\n }", "public void updateData(Trick completedTrick);", "public void operationSave() {\n\r\n\t\tstatusFeldSave();\r\n\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "void setData (Object newData) { /* package access */ \n\t\tdata = newData;\n\t}", "public ChangeData()\r\n\t\t{\r\n\t\t}", "private void saveData() {\n // Actualiza la información\n client.setName(nameTextField.getText());\n client.setLastName(lastNameTextField.getText());\n client.setDni(dniTextField.getText());\n client.setAddress(addressTextField.getText());\n client.setTelephone(telephoneTextField.getText());\n\n // Guarda la información\n DBManager.getInstance().saveData(client);\n }", "public synchronized void updateData() {\n updateDataFields(this::defaultFetcher);\n }", "public void save() {\t\n\t\n\t\n\t}", "private void fireContentModelModified(final String id, final String xmlData) throws SystemException {\r\n for (final ResourceListener contentModelListener : this.contentModelListeners) {\r\n contentModelListener.resourceModified(id, xmlData);\r\n }\r\n }", "public void saveExtraData() {}", "public synchronized void save() {\n/* 86 */ this.component.saveToDB();\n/* */ }", "private void setData() {\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 }", "void updateInformation();", "protected void doSave() {\n GWT.log(\"Please override\");\n }", "@Override\n\tpublic void save(DataKey arg0) {\n\t\t\n\t}", "Object getCurrentData();", "public void commitChanges()\n {\n }", "@Override\r\n\tpublic void save() {\n\r\n\t\ts.save();\r\n\r\n\t}", "public void notifyModelUpdated()\n {}", "void saveNotifyDataToTable(HashSet<String> data)\n\t\t{\n\t\t\tsaveFIXDataSet(data);\n\t\t\t/*Iterator<String> itr=data.iterator();\n\t\t\twhile (itr.hasNext())\n\t\t\t{\n\t\t\t\tString fixLine=itr.next();\n\t\t\t\tint ix9=fixLine.indexOf(\"|120=\");\n\t\t\t\tif (ix9 < 0) ix9=fixLine.length()-1;\n\t\t\t\t\n\t\t\t\t//aAg.saveFIXData(fixLine.substring(0, ix9+1), this);\n\t\t\t}*/\n\t\t\t\n\t\t\treturn;\n\t\t}", "void scno(String type, Object data) {\r\n\t\tnotifications.put(type, data);\r\n\t\tsetChanged();\r\n\t\tnotifyObservers(type);\r\n\t\t\r\n\t}", "void saveData() throws SerializerException;", "@Override\n public void notifyObservers() {\n for (Observer observer : observers){\n // observers will pull the data from the observer when notified\n observer.update(this, null);\n }\n }", "void notifyWrite();", "public void doSomeChanges() {\n\n eventBus.publish(\"our.event.coming.from.model\", \"some data passed\");\n }", "@Override\n\tpublic void saveTestingData() {\n\t\t\n\t}" ]
[ "0.72992986", "0.7294048", "0.7285933", "0.704767", "0.6997504", "0.685868", "0.67846656", "0.67799526", "0.6742461", "0.67014974", "0.67014974", "0.6642028", "0.661001", "0.6605579", "0.6584993", "0.6559935", "0.6535524", "0.6491773", "0.6457893", "0.6447575", "0.64356023", "0.6434308", "0.643181", "0.6420551", "0.6418009", "0.63973945", "0.63934547", "0.6333041", "0.63273966", "0.6327075", "0.6327075", "0.6324765", "0.63166314", "0.6272109", "0.62673026", "0.6264628", "0.62635434", "0.62604415", "0.62546945", "0.62546945", "0.6245527", "0.6240868", "0.6230258", "0.62288105", "0.62235886", "0.6218677", "0.6215034", "0.6196938", "0.61895", "0.61846083", "0.6176861", "0.6176803", "0.61584955", "0.6128935", "0.6126584", "0.6113413", "0.6106735", "0.60987425", "0.6092719", "0.6087197", "0.6086177", "0.6076262", "0.6066564", "0.606131", "0.6061059", "0.60563254", "0.6041897", "0.6041041", "0.6040227", "0.6021974", "0.6020277", "0.60185856", "0.6015353", "0.60150915", "0.60131365", "0.60131365", "0.60131365", "0.6010196", "0.60001254", "0.59991324", "0.5979855", "0.5971325", "0.59674215", "0.5966957", "0.595973", "0.5958897", "0.59547675", "0.59490854", "0.5946509", "0.5941194", "0.59285396", "0.59280246", "0.59218436", "0.5902113", "0.590039", "0.5896601", "0.58948123", "0.5894561", "0.5892408", "0.58763856", "0.5876365" ]
0.0
-1
TODO 2. Inflate the list item view TODO 3. Initial ViewHolder
@Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n ListItem item = this.getItem(position);\n if (convertView == null) {\n \tif (item.type == TYPE_ITEM){\n \t\tconvertView = mInflater.inflate(R.layout.search_item, null);\n \t} else {\n \t\tconvertView = mInflater.inflate(R.layout.search_separator, null);\n \t}\n //holder = new ViewHolder();\n //holder.textView = (TextView)convertView.findViewById(R.id.text);\n //convertView.setTag(holder);\n } else {\n //holder = (ViewHolder)convertView.getTag();\n }\n //holder.textView.setText(this.getItem(position));\n \tif (item.type == TYPE_ITEM) {\n \t\tMangaItem item1 = mData.get(position).item;\n \t\t((TextView)convertView.findViewById(R.id.text)).setText(item1.name);\n \t\t\n \t\tImageView view = (ImageView)convertView.findViewById(R.id.favorites);\n \t\tconvertView.setTag(item1); //just in order simpler access\n \t\tif (MangaUtils.isItemFavorited(SearchActivity.this.getApplicationContext(),item1)) {\n \t\t\tview.setImageResource(R.drawable.favorited);\n \t\t} else {\n \t\t\tview.setImageResource(R.drawable.unfavorited);\n \t\t}\n \t\tview.setTag(item1);\n \t\t//MangaUtils.setPreviewImage((ImageView)convertView.findViewById(R.id.preview),item1.thumnail_url, this);\n \t\tif (item1.thumnail_url!=null) {\n \t\t\timageloader.displayImage(item1.thumnail_url, (ImageView)convertView.findViewById(R.id.preview));\n \t\t} else {\n \t\t((ImageView)convertView.findViewById(R.id.preview)).setImageResource(R.drawable.mangaloading);\n \t}\n \t\t//view.setI\n \t\t\n \t\t\n \t\tview.setOnClickListener(new OnClickListener(){\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\tMangaItem item1 = (MangaItem)arg0.getTag();\n\t\t\t\t\t\tImageView iv = (ImageView) arg0;\n\t\t\t\t\t\tif (MangaUtils.isItemFavorited(SearchActivity.this.getApplicationContext(),item1)){\n\t\t\t\t\t\t\tMangaUtils.removeFavorite(SearchActivity.this.getApplicationContext(),item1);\n\t\t\t\t\t\t\tiv.setImageResource(R.drawable.unfavorited);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tMangaUtils.addFavorite(SearchActivity.this.getApplicationContext(),item1);\n\t\t\t\t\t\t\tiv.setImageResource(R.drawable.favorited);\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n \t\t});\n \t} else {\n ((TextView)convertView.findViewById(R.id.text)).setText(item.name); \t\t\n ((TextView)convertView.findViewById(R.id.lang)).setText(item.lang); \t\t\n \t}\n return convertView;\n }", "@Override\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\t\tView view = LayoutInflater.from(getActivity()).inflate(R.layout.discovery_fragment_listitem, null);\n\t\t\tImageView icon = (ImageView)view.findViewById(R.id.itemIcon);\n\t\t\tTextView textView = (TextView)view.findViewById(R.id.itemTv);\n\t\t\tImageView inImageView = (ImageView)view.findViewById(R.id.itemInImg);\n\t\t\t\n\t\t\ticon.setImageResource(imgs[position]);\n\t\t\ttextView.setText(names[position]);\n\t\t\tinImageView.setImageResource(R.drawable.in);\n\t\t\treturn view;\n\t\t}", "public ViewHolder(View itemView) {\n super(itemView);\n\n listName = (TextView) itemView.findViewById(R.id.listName);\n remainingItems = (TextView) itemView.findViewById(R.id.remainingItems);\n listButtonLayout = (LinearLayout) itemView.findViewById(R.id.listButtonLayout);\n btnView = (Button) listButtonLayout.findViewById(R.id.btnEditList);\n btnDeleteList = (Button) listButtonLayout.findViewById(R.id.btnDeleteList);\n\n\n }", "@Override\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\n\t\t\tif (convertView == null) {\n\n\t\t\t\tholder = new ViewHolder();\n\n\t\t\t\t// FitmiFoodDAO object = resultList.get(position);\n\n\t\t\t\t// if(!object.isCustomButton()){\n\n\t\t\t\t// LayoutInflater inflater = (LayoutInflater)\n\t\t\t\t// getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n\t\t\t\tLayoutInflater inflater = (LayoutInflater) context\n\t\t\t\t\t\t.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n\t\t\t\tconvertView = inflater.inflate(R.layout.autocomplete_layout,\n\t\t\t\t\t\tnull);\n\n\t\t\t}\n\n\t\t\t// holder.txtName.setText(object.getItemName());\n\t\t\t// holder.txtCalGm =\n\t\t\t// (TextView)convertView.findViewById(R.id.txtCalGm);\n\t\t\t// // holder.txtDesc =\n\t\t\t// (TextView)convertView.findViewById(R.id.txtDesc);\n\t\t\t// holder.txtCal = (TextView)convertView.findViewById(R.id.txtCal);\n\n\t\t\t/*\n\t\t\t * float calory = Float.parseFloat(object.getNfCalories());\n\t\t\t * \n\t\t\t * if(!object.getNfServingWeightGrams().equalsIgnoreCase(\"null\")) {\n\t\t\t * \n\t\t\t * String number = object.getNfServingWeightGrams();\n\t\t\t * \n\t\t\t * nfgram = Float.parseFloat(number); nfgram = calory/nfgram;\n\t\t\t * holder.txtCalGm.setText(nfgram+\" cal/gm\"); }else{\n\t\t\t * holder.txtCalGm.setText(\"\"); }\n\t\t\t *//*\n\t\t\t\t * if(!object.getItemDescription().equalsIgnoreCase(\"null\"))\n\t\t\t\t * holder.txtDesc.setText(object.getItemDescription());\n\t\t\t\t * \n\t\t\t\t * if(!object.getItemName().equalsIgnoreCase(\"null\"))\n\t\t\t\t * holder.txtName\n\t\t\t\t * .setText(object.getItemName()+\", \"+object.getBrandName());\n\t\t\t\t * else holder.txtName.setText(object.getBrandName());\n\t\t\t\t * holder.txtCal.setText(object.getNfCalories()+\" cal\");\n\t\t\t\t */\n\t\t\t// }else{\n\n\t\t\t/*\n\t\t\t * LayoutInflater inflater = (LayoutInflater)\n\t\t\t * context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n\t\t\t * convertView = inflater.inflate(R.layout.custom_meal, null);\n\t\t\t * \n\t\t\t * holder.customMeal =\n\t\t\t * (Button)convertView.findViewById(R.id.add_customMeal);\n\t\t\t */\n\t\t\t// }\n\n\t\t\tLog.e(\"counting view\", \"Count \" + position);\n\t\t\t// convertView.setTag(holder);\n\n\t\t\t// }else{\n\t\t\t\n\t/*\t\tresultList.add(predsJsonArray.getJSONObject(i).getString(\n\t\t\t\t\tBaseActivity.exercise)\n\t\t\t\t\t+ \" \"\n\t\t\t\t\t+ predsJsonArray.getJSONObject(i).getString(\n\t\t\t\t\t\t\tBaseActivity.cals_per_hour) + \" calories\");*/\n\t\t\ttry {\n\t\t\t\tHashMap<String, String> object = searchList.get(position);\n\t\t\t\t// holder = (ViewHolder) convertView.getTag();\n\t\t\t\tholder.txtName = (TextView) convertView\n\t\t\t\t\t\t.findViewById(R.id.txtName);\n\t\t\t\t\n\t\t\t\tholder.txtName.setText(object.get(\n\t\t\t\t\t\tBaseActivity.exercise_name)\n\t\t\t\t\t\t+ \" \"\n\t\t\t\t\t\t+ object.get(\n\t\t\t\t\t\t\t\tBaseActivity.cals_per_hour) + \" calories\");\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t// }\n\n\t\t\treturn convertView;\n\t\t}", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n View listItem = convertView;\n int pos = position;\n\n if(listItem == null){\n listItem = layoutInflater.inflate(R.layout.item_list, null);\n }\n\n //Colocando na tela os elementos da busca\n ImageView iv = (ImageView) listItem.findViewById(R.id.thumb);\n TextView tvTitle = (TextView) listItem.findViewById(R.id.title);\n TextView tvDate = (TextView) listItem.findViewById(R.id.date);\n\n //aplicando as views no form_contato\n imageLoader.DisplayImage(feed.getItem(pos).getImage(), iv);\n tvTitle.setText(feed.getItem(pos).getTitle());\n tvDate.setText(feed.getItem(pos).getDate());\n\n return listItem;\n }", "@Override\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\t\tif (convertView == null) {\n\t\t\t\tconvertView = LayoutInflater.from(ListActivity.this).inflate(R.layout.item_list, null);\n\t\t\t}\n\t\t\tfinal TextView item = (TextView) convertView.findViewById(R.id.tv_item_list);\n\t\t\titem.setText(BaseData.list.get(position)[1]);\n\t\t\titem.startAnimation(AnimationUtils.loadAnimation(ListActivity.this, R.anim.push_left_in));\n\n\t\t\treturn convertView;\n\t\t}", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n ViewHolder holder;\n if (convertView == null) {\n holder = new ViewHolder();\n convertView = LayoutInflater.from(context).inflate(R.layout.list_row_huanzhezhongxin, null);\n holder.textView_xingming = (TextView) convertView.findViewById(R.id.textView_xingming);\n holder.textView_jiuzhenhao = (TextView) convertView.findViewById(R.id.textView_jiuzhenhao);\n holder.textView_guangzhu = (TextView) convertView.findViewById(R.id.textView_guangzhu);\n holder.imageView_chakan = (ImageView) convertView.findViewById(R.id.imageView_chakan);\n\n holder.linearLayout_head = (LinearLayout) convertView.findViewById(R.id.linearLayout_head);\n\n convertView.setTag(holder);\n } else {\n holder = (ViewHolder) convertView.getTag();\n }\n setItemData(holder,position);\n return convertView;\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n final EgitimKatilimci dItem = (EgitimKatilimci) this.faaliyet_detay_tablo_list.get(position);\n final EgitimKatilimciAdapter.DetayBilgiOzetItemHolder drawerHolder;\n view = convertView;\n\n\n if (view == null) {\n LayoutInflater inflater = ((Activity) context).getLayoutInflater();\n drawerHolder = new EgitimKatilimciAdapter.DetayBilgiOzetItemHolder();\n\n view = inflater.inflate(layoutResID, parent, false);\n drawerHolder.birinci_item = (TextView) view.findViewById(R.id.birinci_item);\n drawerHolder.ikinci_item = (TextView) view.findViewById(R.id.ikinci_item);\n drawerHolder.ucuncu_item = (TextView) view.findViewById(R.id.ucuncu_item);\n \n view.setTag(drawerHolder);\n\n } else {\n drawerHolder = (EgitimKatilimciAdapter.DetayBilgiOzetItemHolder) view.getTag();\n }\n\n\n if (dItem.getBirimAdi() != null)\n drawerHolder.birinci_item.setText(dItem.getBirimAdi().toString());\n else\n drawerHolder.birinci_item.setText(\"\");\n\n\n if (dItem.getEgitimTanim() != null)\n drawerHolder.ikinci_item.setText(dItem.getEgitimTanim().toString());\n else\n drawerHolder.ikinci_item.setText(\"\");\n\n\n if (dItem.getKatilimciAdi() != null)\n drawerHolder.ucuncu_item.setText(dItem.getKatilimciAdi().toString());\n else\n drawerHolder.ucuncu_item.setText(\"\");\n\n\n\n return view;\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n LayoutInflater inflater = getLayoutInflater();\n View newView;\n newView = inflater.inflate(R.layout.recipe_list, parent, false);\n TextView info = newView.findViewById(R.id.recipeInfo);\n String title = (String) getItem(position);\n info.setText(title);\n return newView;\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n Contact item = getItem(position);\n // Check if an existing view is being reused, otherwise inflate the view\n\n ViewHolder viewHolder; // view lookup cache stored in tag\n if (convertView == null) {\n // If there's no view to re-use, inflate a brand new view for row\n viewHolder = new ViewHolder();\n LayoutInflater inflater = LayoutInflater.from(getContext());\n convertView = inflater.inflate(R.layout.list_item, parent, false);\n viewHolder.nameTv = (TextView) convertView.findViewById(R.id.list_item_name);\n viewHolder.numberTv = (TextView) convertView.findViewById(R.id.list_item_number);\n viewHolder.photoIV = (ImageView) convertView.findViewById(R.id.list_item_picture);\n // Cache the viewHolder object inside the fresh view\n convertView.setTag(viewHolder);\n\n } else {\n // View is being recycled, retrieve the viewHolder object from tag\n viewHolder = (ViewHolder) convertView.getTag();\n }\n\n viewHolder.nameTv.setText(item.getName());\n\n if(item.getPhones().size() >0) {\n viewHolder.numberTv.setText(item.getPhones().get(0).getValue());\n }\n else{\n viewHolder.numberTv.setVisibility(View.GONE);\n }\n\n Uri photoUri = item.getPhotoUri();\n if(photoUri != null) {\n viewHolder.photoIV.setImageURI(item.getPhotoUri());\n }\n else{\n viewHolder.photoIV.setImageDrawable(getContext().getResources().getDrawable(R.drawable.ic_placeholder));\n }\n\n return convertView;\n }", "@Override\n public listAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n\n\n\n View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.listitemamentitylayout, parent, false);\n\n listAdapter.ViewHolder vh = new listAdapter.ViewHolder(v);\n\n\n\n return vh;\n\n\n\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n String dataModel = getItem(position);\n // Check if an existing view is being reused, otherwise inflate the view\n ViewHolder viewHolder; // view lookup cache stored in tag\n\n final View result;\n\n if (convertView == null) {\n\n viewHolder = new ViewHolder();\n LayoutInflater inflater = LayoutInflater.from(getContext());\n convertView = inflater.inflate(R.layout.listviewcontent, parent, false);\n viewHolder.txtLabel = (TextView) convertView.findViewById(R.id.label);\n\n result=convertView;\n\n convertView.setTag(viewHolder);\n } else {\n viewHolder = (ViewHolder) convertView.getTag();\n result=convertView;\n }\n viewHolder.txtLabel.setText(dataModel);\n return convertView;\n }", "@Override\n\tpublic View getView(final int position, View convertView, ViewGroup parent) {\n\t\tfinal HolderView holder;\n\t\tif (convertView == null) {\n\t\t\tholder = new HolderView();\n\t\t\t// convertView = mInflater.inflate(R.layout.layout_item_history,\n\t\t\t// null);\n\t\t\t// holder.lblResNameHistory = (TextView)\n\t\t\t// convertView.findViewById(R.id.lblResName_History);\n\t\t\t// convertView = mInflater.inflate(R.layout.row_list_item, null);\n\t\t\tconvertView = mInflater.inflate(R.layout.row_list_item_vs_order,\n\t\t\t\t\tnull);\n\t\t\tholder.layInCart = (LinearLayout) convertView\n\t\t\t\t\t.findViewById(R.id.layInCart);\n\t\t\tholder.btnDelete = (ImageView) convertView\n\t\t\t\t\t.findViewById(R.id.btnDelete);\n\t\t\tholder.btnAddTopping = (TextView) convertView\n\t\t\t\t\t.findViewById(R.id.btnAddTopping);\n\t\t\tholder.lblToppingPrice = (TextView) convertView\n\t\t\t\t\t.findViewById(R.id.lblToppingPrice);\n\t\t\tholder.btnAddIntroduction = (TextView) convertView\n\t\t\t\t\t.findViewById(R.id.btnAddIntroduction);\n\t\t\tholder.lblAddQuantity = (TextView) convertView\n\t\t\t\t\t.findViewById(R.id.lblAddQuantity);\n\n\t\t\tholder.imgFood = (ImageView) convertView.findViewById(R.id.imgFood);\n\t\t\tholder.progess = (ProgressBar) convertView\n\t\t\t\t\t.findViewById(R.id.progess);\n\t\t\tholder.lblFoodName = (TextView) convertView\n\t\t\t\t\t.findViewById(R.id.lblFoodName);\n\t\t\tholder.lblCategoryName = (TextView) convertView\n\t\t\t\t\t.findViewById(R.id.lblCategory);\n\t\t\tholder.lblCookMethod = (TextView) convertView\n\t\t\t\t\t.findViewById(R.id.lblCookMethod);\n\t\t\tholder.lblPrice = (TextView) convertView\n\t\t\t\t\t.findViewById(R.id.lblPrice);\n\t\t\tholder.btnAddItem = (TextView) convertView\n\t\t\t\t\t.findViewById(R.id.btnAddItem);\n\n\t\t\tconvertView.setTag(holder);\n\t\t} else {\n\t\t\tholder = (HolderView) convertView.getTag();\n\t\t}\n\t\tfinal Item item = arrItems.get(position);\n\t\tif (item != null) {\n\t\t\tboolean inCart = false;\n\t\t\tItemCart itemcart = new ItemCart();\n\t\t\tfor (ItemCart btem : arrCart) {\n\t\t\t\tif (btem.getItem().getId().equals(item.getId())) {\n\t\t\t\t\titemcart = btem;\n\t\t\t\t\tinCart = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tholder.btnAddItem.setVisibility(View.VISIBLE);\n\t\t\tholder.layInCart.setVisibility(View.GONE);\n\t\t\tholder.lblPrice.setText(\"$ \" + item.getPrice());\n\t\t\tholder.btnDelete.setVisibility(View.GONE);\n\t\t\tholder.lblCookMethod.setVisibility(View.GONE);\n\t\t\t// Add new\n\t\t\t// if (inCart) {\n\t\t\t// // holder.btnDelete.setVisibility(View.VISIBLE);\n\t\t\t// // holder.btnAddItem.setVisibility(View.GONE);\n\t\t\t// // holder.layInCart.setVisibility(View.VISIBLE);\n\t\t\t// holder.lblPrice.setText(\"$ \" + item.getPrice() + \" (+$ \"\n\t\t\t// + itemcart.getPriceTopping() + \")\");\n\t\t\t// String temp = \"\";\n\t\t\t// for (Relish relishItem : itemcart.getArrRelish()) {\n\t\t\t// if (!relishItem.getSelectedOption().getName()\n\t\t\t// .equals(Constant.NONE)) {\n\t\t\t// temp += relishItem.getName().trim()\n\t\t\t// + \":\"\n\t\t\t// + relishItem.getSelectedOption().getName()\n\t\t\t// .trim() + \",\";\n\t\t\t// }\n\t\t\t// }\n\t\t\t// if (temp.length() > 1) {\n\t\t\t// temp = temp.substring(0, temp.length() - 1);\n\t\t\t// holder.lblToppingPrice.setText(temp);\n\t\t\t// holder.lblToppingPrice.setSelected(true);\n\t\t\t// } else {\n\t\t\t// holder.lblToppingPrice.setText(\"\");\n\t\t\t// }\n\t\t\t// holder.lblAddQuantity.setText(itemcart.getQuantities() + \"\");\n\t\t\t// } else {\n\t\t\t// holder.lblPrice.setText(\"$ \" + item.getPrice());\n\t\t\t// // holder.btnDelete.setVisibility(View.GONE);\n\t\t\t// // holder.btnAddItem.setVisibility(View.VISIBLE);\n\t\t\t// // holder.layInCart.setVisibility(View.GONE);\n\t\t\t// }\n\n\t\t\t// Start Remove by Cuongpm\n\t\t\t// if (item.getSelectedCookMethod() != null) {\n\t\t\t// holder.lblCookMethod.setText(item.getSelectedCookMethod()\n\t\t\t// .getName());\n\t\t\t// holder.lblCookMethod.setVisibility(View.VISIBLE);\n\t\t\t// } else {\n\t\t\t// holder.lblCookMethod.setVisibility(View.GONE);\n\t\t\t// }\n\t\t\t// End Remove by Cuongpm\n\n\t\t\tAQuery aq = lstAq.recycle(convertView);\n\t\t\tholder.lblFoodName.setText(item.getName());\n\t\t\tholder.lblCategoryName.setText(item.getCategory().getName());\n\t\t\taq.id(holder.imgFood)\n\t\t\t\t\t.progress(holder.progess)\n\t\t\t\t\t.image(item.getThumb(), true, true, 0, R.drawable.no_image,\n\t\t\t\t\t\t\tnew BitmapAjaxCallback() {\n\t\t\t\t\t\t\t\t@SuppressLint(\"NewApi\")\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void callback(String url, ImageView iv,\n\t\t\t\t\t\t\t\t\t\tBitmap bm, AjaxStatus status) {\n\t\t\t\t\t\t\t\t\tif (bm != null) {\n\t\t\t\t\t\t\t\t\t\tDrawable d = new BitmapDrawable(context\n\t\t\t\t\t\t\t\t\t\t\t\t.getResources(), bm);\n\t\t\t\t\t\t\t\t\t\tholder.imgFood.setBackgroundDrawable(d);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tholder.imgFood\n\t\t\t\t\t\t\t\t\t\t\t\t.setBackgroundResource(R.drawable.no_image);\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\n\t\t\tholder.btnAddTopping.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\tint tempPosition = 0;\n\t\t\t\t\tfor (ItemCart btem : arrCart) {\n\t\t\t\t\t\tif (btem.getItem().getId().equals(item.getId())) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttempPosition++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlistener.clickAddTopping(tempPosition,\n\t\t\t\t\t\t\tarrCart.get(tempPosition));\n\t\t\t\t}\n\t\t\t});\n\t\t\tholder.btnAddIntroduction.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\tint tempPosition = 0;\n\t\t\t\t\tfor (ItemCart btem : arrCart) {\n\t\t\t\t\t\tif (btem.getItem().getId().equals(item.getId())) {\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttempPosition++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlistener.clickAddIntroduction(tempPosition,\n\t\t\t\t\t\t\tarrCart.get(tempPosition));\n\t\t\t\t}\n\t\t\t});\n\t\t\tholder.btnDelete.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\tint tempPosition = 0;\n\t\t\t\t\tfor (ItemCart btem : arrCart) {\n\t\t\t\t\t\tif (btem.getItem().getId().equals(item.getId())) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttempPosition++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlistener.clickDelete(tempPosition);\n\t\t\t\t}\n\t\t\t});\n\t\t\tholder.lblAddQuantity.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\tint tempPosition = 0;\n\t\t\t\t\tfor (ItemCart btem : arrCart) {\n\t\t\t\t\t\tif (btem.getItem().getId().equals(item.getId())) {\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttempPosition++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlistener.clickAddQuantities(tempPosition,\n\t\t\t\t\t\t\tarrCart.get(tempPosition));\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tholder.btnAddItem.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tint tempPosition = 0;\n\t\t\t\tfor (ItemCart btem : arrCart) {\n\t\t\t\t\tif (btem.getItem().getId().equals(item.getId())) {\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttempPosition++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlistener.clickAddButton(tempPosition, item);\n\t\t\t}\n\t\t});\n\n\t\tholder.lblCookMethod.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tlistener.clickDisplaylistMethod(position, item.getCategory()\n\t\t\t\t\t\t.getArrCookMethods());\n\t\t\t}\n\t\t});\n\n\t\treturn convertView;\n\t}", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tViewHolder viewHolder = null;\n\t\tif(convertView == null){\n\t\t\tviewHolder = new ViewHolder();\n\t\t\tLayoutInflater inflater = LayoutInflater.from(activity);\n\t\t\tconvertView = inflater.inflate(R.layout.nrc_review_litigant_item, null);\n\t\t\tviewHolder.litigantName = (TextView) convertView.findViewById(R.id.litigant_name);\n\t\t\tviewHolder.litigantType = (TextView) convertView.findViewById(R.id.litigant_type);\n\t\t\tviewHolder.litigantDetail = (TextView) convertView.findViewById(R.id.litigant_detail);\n\t\t\tviewHolder.litigantCardInfo = (LinearLayout) convertView.findViewById(R.id.litigant_card_info);\n\t\t\tviewHolder.litigantCard = (TextView) convertView.findViewById(R.id.litigant_card);\n\t\t\tviewHolder.litigantBrithdayInfo = (LinearLayout) convertView.findViewById(R.id.litigant_brithday_info);\n\t\t\tviewHolder.litigantBrithday = (TextView) convertView.findViewById(R.id.litigant_brithday);\n\t\t\tviewHolder.litigantPhoneInfo = (LinearLayout) convertView.findViewById(R.id.litigant_phone_info);\n\t\t\tviewHolder.litigantPhone = (TextView) convertView.findViewById(R.id.litigant_phone);\n\t\t\tviewHolder.litigantAddressInfo = (LinearLayout) convertView.findViewById(R.id.litigant_address_info);\n\t\t\tviewHolder.litigantAddress = (TextView) convertView.findViewById(R.id.litigant_address);\n\t\t\tviewHolder.representativeInfo = (LinearLayout) convertView.findViewById(R.id.representative_info);\n\t\t\tviewHolder.representativeName = (TextView) convertView.findViewById(R.id.representative_name);\n\t\t\tviewHolder.representativePhoneInfo = (LinearLayout) convertView.findViewById(R.id.representative_phone_info);\n\t\t\tviewHolder.representativePhone = (TextView) convertView.findViewById(R.id.representative_phone);\n\t\t\tconvertView.setTag(viewHolder);\n\t\t\t\n\t\t}else{\n\t\t\tviewHolder = (ViewHolder)convertView.getTag();\n\t\t}\n\t\tTLayyDsr litigant = litigantList.get(position);\n\t\tint nType = litigant.getNType();\n\t\tif(nType ==NrcConstants.DSR_TYPE_NORMAL){\n\t\t\tint nXb = litigant.getNXb();\n\t\t\tInteger nAge = litigant.getNAge();\n\t\t\tString cAge = \"\";\n\t\t\tif (nAge == null || Integer.valueOf(0).equals(nAge)) {\n\t\t\t\tcAge = \"\";\n\t\t\t} else {\n\t\t\t\tcAge = String.valueOf(nAge) + \"岁\";\n\t\t\t}\n\t\t\tviewHolder.litigantDetail.setText(NrcUtils.getGenderNameByCode(nXb)+\" \"+ cAge);\n\t\t\tString cIdcard = litigant.getCIdcard();\n\t\t\tint nIdcardType = litigant.getNIdcardType();\n\t\t\tString cAddress = litigant.getCAddress();//北京市-北京市西城区-2\n\t\t\tviewHolder.litigantAddress.setText(cAddress);\n\t\t\tif(cIdcard.equals(\"\")){\n\t\t\t\tviewHolder.litigantCardInfo.setVisibility(View.GONE);\n\t\t\t}else{\n\t\t\t\tviewHolder.litigantCard.setText(NrcUtils.getCertificateNameByCode(nIdcardType)+\":\"+cIdcard);\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\tString dCsrq = litigant.getDCsrq();\n\t\t\tif(dCsrq == null){\n\t\t\t\tviewHolder.litigantBrithdayInfo.setVisibility(View.GONE);\n\t\t\t}else{\n\t\t\t\tviewHolder.litigantBrithday.setText(NrcUtils.getFormatDate(dCsrq));\t\t\t\t\t\n\t\t\t}\n\t\t\tString cSjhm = litigant.getCSjhm();\n\t\t\tif(cSjhm.equals(\"\")){\n\t\t\t\tviewHolder.litigantPhoneInfo.setVisibility(View.GONE);\n\t\t\t}else{\n\t\t\t\tviewHolder.litigantPhone.setText(cSjhm);\t\t\t\t\t\n\t\t\t}\n\t\t\tviewHolder.representativeInfo.setVisibility(View.GONE);\n\t\t}else{\n\t\t\tviewHolder.litigantDetail.setVisibility(View.GONE);\n\t\t\tviewHolder.litigantCardInfo.setVisibility(View.GONE);\n\t\t\tviewHolder.litigantBrithdayInfo.setVisibility(View.GONE);\n\t\t\tString cCompanyAddress = litigant.getCDwdz();//北京市-北京市西城区-2\n\t\t\tviewHolder.litigantAddress.setText(cCompanyAddress);\n\t\t\tString cLxdh = litigant.getCLxdh();\n\t\t\tif(cLxdh.equals(\"\")){\n\t\t\t\tviewHolder.litigantPhoneInfo.setVisibility(View.GONE);\n\t\t\t}else{\t\t\t\t\n\t\t\t\tviewHolder.litigantPhone.setText(cLxdh);\n\t\t\t}\n\t\t\tString cFddbr = litigant.getCFddbr();\n\t\t\tif(cFddbr.equals(\"\")){\n\t\t\t\tviewHolder.representativeName.setVisibility(View.GONE);\n\t\t\t}else{\n\t\t\t\tString representativeType = (nType == NrcConstants.DSR_TYPE_CORPORATION?\"法定人代表:\":\"负责人代表:\") + cFddbr;\n\t\t\t\tviewHolder.representativeName.setText(representativeType);\n\t\t\t\tString cFddbrSjhm = litigant.getCFddbrSjhm();\n\t\t\t\tif(cFddbrSjhm.equals(\"\")){\n\t\t\t\t\tviewHolder.representativePhoneInfo.setVisibility(View.GONE);\n\t\t\t\t}else{\t\t\t\t\t\n\t\t\t\t\tviewHolder.representativePhone.setText(cFddbrSjhm);\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tString cName = litigant.getCName();\n\t\tviewHolder.litigantName.setText(cName);\n\t\tviewHolder.litigantType.setText(NrcUtils.getLitigantTypeNameByCode(nType));\n\t\treturn convertView;\n\t}", "@Override\n\tpublic View getView(int position, View view, ViewGroup arg2) {\n\t\tViewHolder holder;\n\t\tif (view == null) {\n\t\t\tview = LayoutInflater.from(mContext).inflate(\n\t\t\t\t\tR.layout.list_fwxxbyid, null);\n\t\t\tholder = new ViewHolder();\n\t\t\tholder.tv_fwxxbyid_title = (TextView) view\n\t\t\t\t\t.findViewById(R.id.tv_fwxxbyid_title);\n\t\t\tholder.tv_fwxxbyid_fwlx = (TextView) view\n\t\t\t\t\t.findViewById(R.id.tv_fwxxbyid_fwlx);\n\t\t\tholder.tv_fwxxbyid_shi = (TextView) view\n\t\t\t\t\t.findViewById(R.id.tv_fwxxbyid_shi);\n\t\t\tholder.tv_fwxxbyid_ting = (TextView) view\n\t\t\t\t\t.findViewById(R.id.tv_fwxxbyid_ting);\n\t\t\tholder.tv_fwxxbyid_zj = (TextView) view\n\t\t\t\t\t.findViewById(R.id.tv_fwxxbyid_zj);\n\t\t\tholder.tv_fwxxbyid_qx = (TextView) view\n\t\t\t\t\t.findViewById(R.id.tv_fwxxbyid_qx);\n\t\t\tholder.tv_fwxxbyid_jd = (TextView) view\n\t\t\t\t\t.findViewById(R.id.tv_fwxxbyid_jd);\n\t\t\tholder.tv_fwxxbyid_date = (TextView) view\n\t\t\t\t\t.findViewById(R.id.tv_fwxxbyid_date);\n\t\t\tholder.tv_fwxxbyid_fwxx = (TextView) view\n\t\t\t\t\t.findViewById(R.id.tv_fwxxbyid_fwxx);\n\t\t\tholder.tv_fwxxbyid_lxr = (TextView) view\n\t\t\t\t\t.findViewById(R.id.tv_fwxxbyid_lxr);\n\t\t\tholder.tv_fwxxbyid_telephone = (TextView) view\n\t\t\t\t\t.findViewById(R.id.tv_fwxxbyid_telephone);\n\t\t\tholder.iv_fwxxbyid_phone = (ImageView) view\n\t\t\t\t\t.findViewById(R.id.iv_fwxxbyid_phone);\n\t\t\tholder.iv_fwxxbyid_message = (ImageView) view\n\t\t\t\t\t.findViewById(R.id.iv_fwxxbyid_message);\n\t\t\tview.setTag(holder);\n\t\t} else {\n\t\t\tholder = (ViewHolder) view.getTag();\n\t\t}\n\n\t\tFwxxById fwxxById = this.mFwxxByID;\n\n\t\tholder.tv_fwxxbyid_title.setText(fwxxById.getTitle().toString());\n\t\tholder.tv_fwxxbyid_fwlx.setText(fwxxById.getFwlx().toString());\n\t\tholder.tv_fwxxbyid_shi.setText(fwxxById.getShi().toString());\n\t\tholder.tv_fwxxbyid_ting.setText(fwxxById.getTing().toString());\n\t\tholder.tv_fwxxbyid_zj.setText(fwxxById.getZj().toString());\n\t\tholder.tv_fwxxbyid_qx.setText(fwxxById.getQx().toString());\n\t\tholder.tv_fwxxbyid_jd.setText(fwxxById.getJd().toString());\n\t\tholder.tv_fwxxbyid_date.setText(fwxxById.getDate().toString());\n\t\tholder.tv_fwxxbyid_fwxx.setText(fwxxById.getFwxx().toString());\n\t\tholder.tv_fwxxbyid_lxr.setText(fwxxById.getLxr().toString());\n\t\tholder.tv_fwxxbyid_telephone\n\t\t\t\t.setText(fwxxById.getTelephone().toString());\n\n\t\t// 保存电话号码\n\t\tphoneCode = holder.tv_fwxxbyid_telephone.getText().toString();\n\n\t\t// 打电话监听\n\t\tholder.iv_fwxxbyid_phone.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tIntent intent = new Intent(Intent.ACTION_CALL, Uri.parse(\"tel:\"\n\t\t\t\t\t\t+ phoneCode));\n\t\t\t\tmContext.startActivity(intent);\n\t\t\t}\n\t\t});\n\t\t\n\t\t// 发短信\n\t\tholder.iv_fwxxbyid_message.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tDialog dialog = new MyDialogSms(mContext,R.style.MyDialog_style_NoTitle);\n\t\t\t\tdialog.show();\n\t\t\t}\n\t\t});\n\t\treturn view;\n\t}", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n Item item = getItem(position);\n // Check if an existing view is being reused, otherwise inflate the view\n if (convertView == null) {\n convertView = LayoutInflater.from(getContext()).inflate(R.layout.list_layout, parent, false);\n }\n\n // Lookup view for data population\n TextView tvName = convertView.findViewById(R.id.item_textview);\n TextView tvNum = convertView.findViewById(R.id.num_textview);\n\n // TODO\n // Set the text used by tvName and tvNum using the data object\n // This will need to updated once the entity model has been updated\n tvName.setText(item.getName());\n tvNum.setText(item.getNum());\n\n // Return the completed view to render on screen\n return convertView;\n }", "@Override\n\tpublic View getView(int arg0, View arg1, ViewGroup arg2) {\n\t\tListItem item=list.get(arg0);\n\t\tViewHolder holder=null;\n\t\tif(arg1==null){\n\t\t\tholder=new ViewHolder();\n\t\t\n\t\t\targ1=LayoutInflater.from(context).inflate(R.layout.layout_item, null);\t\n\t\t\tholder.ll=(LinearLayout)arg1;\n\t\t\targ1.setTag(holder);\n\t\t}else{\n\t\t\tholder=(ViewHolder)arg1.getTag();\n\t\t}\n\t\tList<Stories> stories=item.getList();\n\t\tTextView date=(TextView)holder.ll.findViewById(R.id.textView);\n\t\tLinearLayout l=(LinearLayout)holder.ll.findViewById(R.id.container);\n\t\tdate.setText(item.getDate());\n\t\tl.removeAllViews();\n\n\t\tfor(int i=0;i<stories.size();i++){\n\t\t\tfinal Stories s=stories.get(i);\n\t\t\tView v=LayoutInflater.from(context).inflate(R.layout.news_layout, null);\n\t\t\tv.setOnClickListener(new OnClickListener() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\tIntent intent=new Intent(context,TextActivity.class);\n\t\t\t\t\tintent.putExtra(\"ID\", s.getId());\n\t\t\t\t\tcontext.startActivity(intent);\n\t\t\t\t}\n\t\t\t});\n\t\t\tTextView tv=(TextView)v.findViewById(R.id.tvTitle);\n\t\t\ttv.setText(s.getTitle());\n\t\t\tImageView iv=(ImageView)v.findViewById(R.id.ivTitle);\n\t\t\tString url = s.getImages().replace(\"\\\\\", \"\");\n\t\t\t\n\t\t\tImageLoaderUtil.display(url, iv);\n\t\t\tl.addView(v);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\treturn arg1;\n\t}", "@Override\n public View getView(final int position, View convertView, ViewGroup parent) {\n final PastItem productItem=parkingList.get(position);\n\n ViewHolder holder = null;\n final LayoutInflater inflater = (LayoutInflater) activity\n .getSystemService(Activity.LAYOUT_INFLATER_SERVICE);\n // If holder not exist then locate all view from UI file.\n if (convertView == null) {\n\n // inflate UI from XML file\n convertView = inflater.inflate(R.layout.past_list_item, parent, false);\n // get all UI view\n holder = new ViewHolder(convertView);\n // set tag for holder\n convertView.setTag(holder);\n\n\n\n\n } else {\n // if holder created, get tag from view\n holder = (ViewHolder) convertView.getTag();\n }\n holder.doctorName.setText(\"Your Appointment with \"+productItem.getDoctorName());\n holder.doctorName.setTypeface(Typeface.createFromAsset(getContext().getAssets(), \"fonts/Roboto-Regular.ttf\"));\n\n holder.address.setText(productItem.getClinicName()+\" | \"+productItem.getAddress());\n holder.address.setTypeface(Typeface.createFromAsset(getContext().getAssets(), \"fonts/Roboto-Light.ttf\"));\n // holder.actualPrice.setPaintFlags(holder.actualPrice.getPaintFlags()| Paint.STRIKE_THRU_TEXT_FLAG);\n\n holder.dateTime.setText(\"scheduled on \"+productItem.getDate()+\" & \"+productItem.getTime());\n holder.dateTime.setTypeface(Typeface.createFromAsset(getContext().getAssets(), \"fonts/Roboto-Light.ttf\"));\n\n holder.status.setText(productItem.getStatus());\n holder.status.setTypeface(Typeface.createFromAsset(getContext().getAssets(), \"fonts/Roboto-Light.ttf\"));\n\n\n Picasso.with(getContext()).load(productItem.getDoctorImage()).placeholder(R.drawable.ic_action_placeholder).into(holder.imageView);\n\nif (productItem.getStatus().equals(\"rejected\")){\n\n holder.noteLayout.setVisibility(View.GONE);\n}else {\n holder.noteLayout.setVisibility(View.VISIBLE);\n}\n\n return convertView;\n }", "@Override\n\tpublic View getView( final int position, View convertView, ViewGroup parent) {\n\n\t\tHolderMyPlaylist holder=new HolderMyPlaylist(); // view lookup cache stored\n\t\tconvertView=inflater.inflate(R.layout.customview_music_myplaylist, null); // inflate the layout\n\n\n\t\t// get the TextView and then set the text (item name) and tag (item ID) values\n\t\tholder.txt_name=(TextView) convertView.findViewById(R.id.tv_name);\n\t\tholder.txt_aname=(TextView) convertView.findViewById(R.id.tv_song);\n\t\tholder.btn=(Button)convertView.findViewById(R.id.btn);\n\t\tholder.img=(ImageView) convertView.findViewById(R.id.img);\n\t\tholder.linear=(LinearLayout)convertView.findViewById(R.id.linear);\n\t\tholder.linr=(LinearLayout)convertView.findViewById(R.id.linr);\n\n\t\t// object item based on the position\n\t\t// Populate the data from the data object via the viewHolder object\n\t\t// into the template view.\n\n\t\tholder.txt_name.setText(al_myplaylist.get(position).getName());\n\t\tholder.txt_aname.setText(al_myplaylist.get(position).getNofs());\n\n\t\tif (NetworkConnection.isConnectedToInternet(context)) {\n\n\n\t\t\tnew Json_shareapp(context).execute();\n\n\n\n\t\t}\n\t\telse {\n\t\t\tToast.makeText(context,\"Please Check your internet connection\", Toast.LENGTH_SHORT).show();\n\n\n\t\t}\n\n\t\t\tholder.linear.setOnClickListener(new View.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\n\n\t\t\t\tpid=al_myplaylist.get(position).getId();\n\t\t\t\tlistname=al_myplaylist.get(position).getName();\n\n\n\t\t\t\tFragment_PlaylistDetailUser fragment_detail = new Fragment_PlaylistDetailUser();\n\t\t\t\tFragmentManager fragmentManager3 = ((Activity) context).getFragmentManager();\n\t\t\t\tfragmentManager3.beginTransaction().replace(R.id.activity_main_content_fragment, fragment_detail).commit();\n\t\t\t\tMainActivity1.Drawer.closeDrawer(Gravity.LEFT);\n\n\n\t\t\t}\n\t\t});\n\n\t\tholder.linr.setOnClickListener(new View.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\n\t\t\t\tdialog = new Dialog(context, android.R.style.Theme_Translucent){\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean onTouchEvent(MotionEvent event) {\n\t\t\t\t\t\t// Tap anywhere to close dialog.\n\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tdialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\t\t\tdialog.setCancelable(true);\n\t\t\t\tdialog.setContentView(R.layout.dialog_addplaylist5);\n\n \t\t\tTextView tv_cncl=(TextView)dialog.findViewById(R.id.tv_cncl);\n\t\t\t\t\t\tRelativeLayout remove_list=(RelativeLayout)dialog.findViewById(R.id.relativeLayout11);\n\t\t\t\tRelativeLayout rename_list=(RelativeLayout)dialog.findViewById(R.id.relativeLayout113);\n\t\t\t\tRelativeLayout share = (RelativeLayout) dialog.findViewById(R.id.relativeLayout3);\n\n\t\t\t\tremove_list.setOnClickListener(new View.OnClickListener() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tdialog.dismiss();\n\n\n\t\t\t\t\t\tif (NetworkConnection.isConnectedToInternet(context)) {\n\n\n\t\t\t\t\t\t\tnew Json_removeplaylist(context).execute(Fragment_Home1.user_id,al_myplaylist.get(position).getId());\n\n\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tToast.makeText(context,\"Please Check your internet connection\", Toast.LENGTH_SHORT).show();\n\n\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tshare.setOnClickListener(new View.OnClickListener() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tdialog.dismiss();\n\n\t\t\t\t\t\tshareIt();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\trename_list.setOnClickListener(new View.OnClickListener() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tdialog.dismiss();\n\n\n\t\t\t\t\t\tdialog_listname1(position);\n\n\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\ttv_cncl.setOnClickListener(new View.OnClickListener() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\tdialog.show();\n\n\t\t\t}\n\t\t});\n\n\n\t\treturn convertView;\n\n\t}", "@Override\r\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tViewHolder holder = null;\r\n\t\tif (null == convertView) {\r\n\t\t\tholder = new ViewHolder();\r\n\t\t\tconvertView = View.inflate(context,\r\n\t\t\t\t\tR.layout.list_popwindow_babyinfo_list_item, null);\r\n\r\n\t\t\tholder.tv_list_zxdp_js_template_item_content = (TextView) convertView\r\n\t\t\t\t\t.findViewById(R.id.tv_list_zxdp_js_template_item_content);\r\n\r\n\t\t\tconvertView.setTag(holder);\r\n\t\t} else {\r\n\t\t\tholder = (ViewHolder) convertView.getTag();\r\n\t\t}\r\n\r\n\t\tBabyInfo babyInfo = listItems.get(position);\r\n\r\n\t\tif (null != babyInfo.getName()\r\n\t\t\t\t&& !babyInfo.getName().equals(\"\")) {\r\n\t\t\tholder.tv_list_zxdp_js_template_item_content.setText(babyInfo\r\n\t\t\t\t\t.getName());\r\n\t\t} else {\r\n\t\t\tholder.tv_list_zxdp_js_template_item_content.setText(\"\");\r\n\t\t}\r\n\r\n\t\treturn convertView;\r\n\t}", "@Override\n\t\t\tpublic ViewHolder onCreateViewHolder(View itemView) {\n\t\t\t\treturn new MylisViewHoder(itemView);\n\t\t\t}", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n ViewHolder vh;\n if (convertView == null) {\n vh = new ViewHolder();\n convertView = LayoutInflater.from(context).inflate(\n R.layout.mywallet_listview_item, null);\n vh.pick_item_remark = (TextView) convertView.findViewById(R.id.pick_item_remark);\n vh.pick_item_val = (TextView) convertView.findViewById(R.id.pick_item_val);\n vh.pick_item_addtime = (TextView) convertView.findViewById(R.id.pick_item_addtime);\n vh.pick_item_status = (TextView) convertView.findViewById(R.id.pick_item_status);\n vh.myWallet_item_layout = (RelativeLayout) convertView.findViewById(R.id.myWallet_item_layout);\n vh.pick_item_layout = (RelativeLayout) convertView.findViewById(R.id.pick_item_layout);\n convertView.setTag(vh);\n } else {\n vh = (ViewHolder) convertView.getTag();\n }\n vh.pick_item_layout.setVisibility(View.VISIBLE);\n vh.myWallet_item_layout.setVisibility(View.GONE);\n vh.pick_item_addtime.setText(getStringTime(list.get(position).getAddtime()));\n vh.pick_item_remark.setText(list.get(position).getBankname()+\"(\"+list.get(position).getCardnumber()+\")(\"+list.get(position).getOwners()+\")\");\n vh.pick_item_val.setText(list.get(position).getPickfee());\n if (\"1\".equals(list.get(position).getStatus())) {\n vh.pick_item_status.setText(\"已打款\");\n }else if (\"2\".equals(list.get(position).getStatus())){\n vh.pick_item_status.setText(\"正在进行中\");\n }\n return convertView;\n }", "@Override\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\t\tif(null == convertView){\n\t\t\t\t// Our view has not been recycled, let's create a new one!\n\t\t\t\tconvertView = getLayoutInflater().inflate(R.layout.item_list_image, null);\n\t\t\t}\n\t\t\t// Update recycled or old view\n\t\t\tTextView label = (TextView) convertView.findViewById(R.id.text);\n\t\t\tlabel.setText(activities[position].getSimpleName());\n\t\t\t\n\t\t\treturn convertView;\n\t\t}", "@Override\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\n\t\t\tViewHolder viewHolder;\n\t\t\tAVTravelDiary avTravelDiary = diaries.get(position);\n\t\t\tif(null == convertView) {\n\t\t\t\tviewHolder = new ViewHolder();\n\t\t\t\tconvertView = LayoutInflater.from(parentAct).inflate(R.layout.item_diary_list,null);\n\t\t\t\tviewHolder.coverImageView = (ImageView) convertView.findViewById(R.id.diary_cover_imageview);\n\t\t\t\tviewHolder.baseInfoTextView = (TextView) convertView.findViewById(R.id.diary_base_info_tv);\n\t\t\t\tviewHolder.headlineTextView = (TextView) convertView.findViewById(R.id.diary_headline_tv);\n\t\t\t\tviewHolder.praiseTimesTextView = (TextView) convertView.findViewById(R.id.praise_times_tv);\n\t\t\t\tviewHolder.userNicknameTextView = (TextView) convertView.findViewById(R.id.user_nickname_tv);\n\t\t\t\tconvertView.setTag(viewHolder);\n\t\t\t}\n\n\t\t\tviewHolder = (ViewHolder) convertView.getTag();\n\t\t\tviewHolder = (ViewHolder) convertView.getTag();\n\t\t\tviewHolder.headlineTextView.setText(avTravelDiary.getHeadline());\n\t\t\tviewHolder.baseInfoTextView.setText(getDiaryBaseInfo(avTravelDiary));\n\t\t\tviewHolder.praiseTimesTextView.setText(avTravelDiary.getPraiseTimes()+\"\");\n\t\t\tcom.nostra13.universalimageloader.core.ImageLoader.getInstance().displayImage(avTravelDiary.getCover().getUrl(), viewHolder.coverImageView, ImageLoaderOptionsSetting.getConstantImageLoaderDefaultOptions());\n\t\t\tAVBaseUserInfo avBaseUserInfo = avTravelDiary.getAuthorBaseInfo();\n\t\t\tif(null != avBaseUserInfo)\n\t\t\t\tviewHolder.userNicknameTextView.setText(avBaseUserInfo.getNickname());\n\t\t\treturn convertView;\n\t\t}", "@Override\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\t\tViewHolder holder = null;\n\t\t\tif(convertView == null){\n\t\t\t\tconvertView = View.inflate(mContext, R.layout.view_textplan_item, null);\n\t\t\t\tholder = new ViewHolder();\n\t\t\t\tTextView name = (TextView) convertView.findViewById(R.id.list_item_name);\n\t\t\t\tholder.name = name;\n\t\t\t\tImageView image = (ImageView) convertView.findViewById(R.id.list_item_img);\n\t\t\t\tholder.image = image;\n\t\t\t\tconvertView.setTag(holder);\n\t\t\t}\n\t\t\tString name = (String) getItem(position);\n\t\t\tholder = (ViewHolder) convertView.getTag();\n\t\t\tholder.name.setText(name);\n\t\t\tif(position == 0){\n\t\t\t\tholder.image.setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.icon_list_item_start));\n\t\t\t\tholder.name.setTextColor(mContext.getResources().getColor(R.color.text_bule));\n\t\t\t\tholder.name.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);\n\t\t\t}\n\t\t\telse if(position == mDatas.size()-1){\n\t\t\t\tholder.image.setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.icon_list_item_end));\n\t\t\t\tholder.name.setTextColor(mContext.getResources().getColor(R.color.text_planend));\n\t\t\t\tholder.name.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tholder.image.setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.icon_list_item_img));\n\t\t\t\tholder.name.setTextColor(mContext.getResources().getColor(R.color.text_darkgrey));\n\t\t\t\tholder.name.setTextSize(TypedValue.COMPLEX_UNIT_SP, 13);\n\t\t\t}\n\t\t\t\t\n\t\t\treturn convertView;\n\t\t}", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tfinal ViewHolder holder;\n\t\tif (convertView == null) {\n\t\t\tconvertView = mInflater.inflate(R.layout.list_single, null);\n\t\t\tholder = new ViewHolder();\n\t\t\t\n\t\t\tholder.tv_Title = (TextView) convertView.findViewById(R.id.txt);\n\t\t\tholder.imgvw_pic = (ImageView) convertView.findViewById(R.id.img);\n\t\t\t//ad=new AvatarDownloader(mContext);\n\t\t\tmImageLoader=new ImageLoader(mContext);\n\t\t\tmImageLoader.DisplayImage(ArrayList.get(position).GetThumbURL(), ArrayList.get(position).GetTitle(), null, holder.imgvw_pic);\n\t\t\t\n\t\t\tconvertView.setTag(holder);\n\t\t} else {\n\t\t\tholder = (ViewHolder) convertView.getTag();\n\t\t}\n\t\t\n\t\tholder.tv_Title.setText(ArrayList.get(position).GetTitle());\n\t\t\n\t\t\n\t\t\t \t\t\t\t\n\t\treturn convertView;\n\t}", "@Override\r\n public View getView(final int position, View convertView, ViewGroup parent) {\n if (convertView == null) {\r\n convertView = LayoutInflater.from(context).inflate(R.layout.layout_item_for_common, parent, false);\r\n convertView.setTag(new ViewHolder(convertView));\r\n }\r\n ViewHolder vh = (ViewHolder) convertView.getTag();\r\n\r\n vh.item_name.setText(list.get(position).getName());\r\n vh.page_left.setImageDrawable(list.get(position).getPageLeft());\r\n vh.item_setting.setText(list.get(position).getItemName());\r\n vh.page_right.setImageDrawable(list.get(position).getPageRight());\r\n return convertView;\r\n }", "@Override\n public View getView(final int position, View convertView, ViewGroup parent)\n {\n ServResrouce resource = mItemList.get(position);\n ViewHolder holder = null;\n LayoutInflater inflater = LayoutInflater.from(mContext);\n if (convertView == null)\n {\n convertView = inflater.inflate(R.layout.order_service_listitem, null);\n holder = new ViewHolder();\n holder.service_logo = (ImageView)convertView.findViewById(R.id.service_logo);\n holder.service_name = (TextView)convertView.findViewById(R.id.service_name);\n convertView.setTag(holder);\n }\n else\n {\n holder = (ViewHolder)convertView.getTag();\n }\n holder.service_logo.setImageResource(R.drawable.flag_date);\n holder.service_name.setText(resource.getName());\n return convertView;\n }", "@Override\n public View getView(final int position, View convertView, ViewGroup parent) {\n final Holder holder=new Holder();\n\n\n\n AuctionBean users = list.get(position);\n convertView = inflater.inflate(R.layout.customelayout, null);\n\n holder.imgThumbnail = (ImageView) convertView.findViewById(R.id.imageview);\n holder.top_sr_no = (TextView) convertView.findViewById(R.id.textsrno);\n holder.bottom_sr_no = (TextView) convertView.findViewById(R.id.textbottom_srno);\n\n return convertView;\n }", "@Override\r\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tViewHolder viewHolder;\r\n\t\tif (convertView == null) {\r\n\t\t\tviewHolder = new ViewHolder();\r\n\t\t\tconvertView = InjectProcessor.injectListViewHolder(viewHolder);\r\n\t\t\tconvertView.setTag(viewHolder);\r\n\t\t} else {\r\n\t\t\tviewHolder = (ViewHolder) convertView.getTag();\r\n\t\t}\r\n\t\tminfo = models.get(position);\r\n\t\tviewHolder.image.setImageUrl(minfo.getImagesrc(),\r\n\t\t\t\tHttpRequest.getInstance().imageLoader);\r\n\t\tviewHolder.name.setText(minfo.getTitle());\r\n\t\treturn convertView;\r\n\t}", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tInboxItemHolder drawerHolder;\n\t\tView view = convertView;\n\n\t\tif (view == null) {\n\t\t\tLayoutInflater inflater = ((Activity) context).getLayoutInflater();\n\t\t\tdrawerHolder = new InboxItemHolder();\n\n\t\t\tview = inflater.inflate(layoutResID, parent, false);\n\t\t\tdrawerHolder.TxtSubject = (TextView) view\n\t\t\t\t\t.findViewById(R.id.txt_subject);\n\t\t\tdrawerHolder.TxtFrom = (TextView) view.findViewById(R.id.txt_from);\n\t\t\tdrawerHolder.TxtDate = (TextView)view.findViewById(R.id.txt_date);\n\t\t\tdrawerHolder.icon = (ImageView) view.findViewById(R.id.email_ava_list);\n\n\t\t\tview.setTag(drawerHolder);\n\t\t} else {\n\t\t\tdrawerHolder = (InboxItemHolder) view.getTag();\n\t\t}\n\n\t\tInboxEntity dItem = (InboxEntity) this.drawerItemList.get(position);\n\t\t\n\t\tdrawerHolder.TxtSubject.setText(dItem.getSubject());\n\t\tdrawerHolder.TxtFrom.setText(dItem.getFrom());\n\t\tdrawerHolder.TxtDate.setText(dItem.getDate());\n\t\t\n\t\tColorGenerator generator = ColorGenerator.MATERIAL;\n\t\tint color = generator.getColor(dItem.getFrom());\n\t\tTextDrawable.IBuilder builder = TextDrawable.builder().round();\n\t\tString icon = (dItem.getFrom().matches(\"^[a-zA-Z].*$\"))?dItem.getFrom().substring(0, 1):dItem.getFrom().substring(1, 2);\n\t\ticon = (icon.matches(\"^[a-zA-Z].*$\")?icon:dItem.getFrom().substring(2,3));\n\t\tTextDrawable td = builder.build(icon.toUpperCase(), color);\n\t\tdrawerHolder.icon.setImageDrawable(td);\n\t\treturn view;\n\t}", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.item_list, container, false);\r\n\r\n final ArrayList<Item> items = new ArrayList<>();\r\n items.add(new Item(R.drawable.lake_myvatn, getString(R.string.lakemyvatntitle), getString(R.string.lakemyvatn)));\r\n items.add(new Item(R.drawable.godafoss_image, getString(R.string.godafosstitle), getString(R.string.godafoss)));\r\n items.add(new Item(R.drawable.dimmuborgir_image, getString(R.string.dimmuborgirtitle), getString(R.string.dimmuborgir)));\r\n items.add(new Item(R.drawable.laufas_image, getString(R.string.laufastitle), getString(R.string.laufas)));\r\n items.add(new Item(R.drawable.hrisey_island, getString(R.string.hriseytitle), getString(R.string.hrisey)));\r\n items.add(new Item(R.drawable.krafla, getString(R.string.kraflatitle), getString(R.string.krafla)));\r\n\r\n ItemAdapter adapter = new ItemAdapter(getActivity(), items);\r\n\r\n ListView listView = (ListView) rootView.findViewById(R.id.list);\r\n\r\n listView.setAdapter(adapter);\r\n\r\n //set click listener so the user can view more details if they click on an item\r\n listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {\r\n @Override\r\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\r\n //get the position of the current list item\r\n Item item = items.get(position);\r\n\r\n //create a bundle object and add data to present in the details activity\r\n Bundle extras = new Bundle();\r\n extras.putInt(\"image\", item.getImageResourceId());\r\n extras.putString(\"title\", item.getTitleResourceId());\r\n extras.putString(\"text\", item.getTextResourceId());\r\n\r\n //create and initialise the intent\r\n Intent detailsIntent = new Intent(getActivity(), DetailsActivity.class);\r\n\r\n //attach the bundle to the intent object\r\n detailsIntent.putExtras(extras);\r\n\r\n //start the activity\r\n startActivity(detailsIntent);\r\n\r\n }\r\n });\r\n\r\n return rootView;\r\n }", "@Override\r\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\t View layout= getLayoutInflater().inflate(R.layout.item_listview_age, null);\r\n\t\t TextView textView= (TextView) layout.findViewById(R.id.tv_listview_age);\r\n\t\t textView.setText(mAgeLists[position]);\r\n\t\t \r\n\t\t\treturn layout;\r\n\t\t}", "public ViewHolder(View itemView) {\n super(itemView);\n\n tvMessageLeft = (TextView) itemView.findViewById(R.id.tvMessageLeft);\n tvMessageRight = (TextView) itemView.findViewById(R.id.tvMessageRight);\n ivUserIcon = (ImageView) itemView.findViewById(R.id.ivProfPicMessageList);\n // tvTime_stamp = (TextView) itemView.findViewById(R.id.tvTime);\n\n\n //llItemListTop = (LinearLayout) itemView.findViewById(R.id.llListItemTop);\n //llItemListMiddle = (LinearLayout) itemView.findViewById(R.id.llListItemMiddle);\n //llItemListBottom = (LinearLayout) itemView.findViewById(R.id.llListItemTop);\n\n\n }", "@Override\r\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\t\tSearch_contact_listview_View search_contact_listview_view;\r\n\t\t\tif(convertView == null){\r\n\t\t\t\tconvertView = getLayoutInflater().inflate(R.layout.search_contact_item, null);\r\n\t\t\t\tsearch_contact_listview_view = new Search_contact_listview_View();\r\n\t\t\t\tsearch_contact_listview_view.suoyin = (TextView) convertView.findViewById(R.id.search_contact_item_suoyin);\r\n\t\t\t\tsearch_contact_listview_view.photo = (ImageView) convertView.findViewById(R.id.search_contact_item_photo);\r\n\t\t\t\tsearch_contact_listview_view.name = (TextView) convertView.findViewById(R.id.search_contact_item_name);\r\n\t\t\t\tsearch_contact_listview_view.phone = (TextView) convertView.findViewById(R.id.search_contact_item_phone);\r\n\t\t\t\tconvertView.setTag(search_contact_listview_view);\r\n\t\t\t}else{\r\n\t\t\t\tsearch_contact_listview_view = (Search_contact_listview_View) convertView.getTag();\r\n\t\t\t}\r\n\t\t\tSearch_contact_listview_item item = listItems.get(position);\r\n\t\t\tif(position > 0 && item.getSuoyin().equals(listItems.get(position -1).getSuoyin())){\r\n\t\t\t\tsearch_contact_listview_view.suoyin.setVisibility(View.GONE);\r\n\t\t\t\tsearch_contact_listview_view.photo.setImageBitmap(item.getPhoto());\r\n\t\t\t\tsearch_contact_listview_view.name.setText(item.getName());\r\n\t\t\t\tsearch_contact_listview_view.phone.setText(item.getPhone());\r\n\t\t\t}else{\r\n\t\t\t\tsearch_contact_listview_view.suoyin.setVisibility(View.VISIBLE);\r\n\t\t\t\tsearch_contact_listview_view.suoyin.setText(item.getSuoyin());\r\n\t\t\t\tsearch_contact_listview_view.photo.setImageBitmap(item.getPhoto());\r\n\t\t\t\tsearch_contact_listview_view.name.setText(item.getName());\r\n\t\t\t\tsearch_contact_listview_view.phone.setText(item.getPhone());\r\n\t\t\t}\r\n\t\t\treturn convertView;\r\n\t\t}", "@Override\n public ListsAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int position) {\n View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.singleview, parent, false);\n ViewHolder vh = new ViewHolder(view);\n context = view.getContext();\n return vh;\n }", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tviewholderss vh=null;\n\t\tif(convertView==null){\n\t\t\tvh=new viewholderss();\n\t\t\tLayoutInflater inflater=(LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE);\n\t\t\tconvertView=inflater.inflate(R.layout.tuikuanshouhou_listview_item,null);\n\t\t\tvh.im=(ImageView) convertView.findViewById(R.id.th_goodsimage);\n\t\t\tvh.title=(TextView) convertView.findViewById(R.id.th_goodname);\n\t\t\tvh.chicun=(TextView) convertView.findViewById(R.id.th_goodschicun);\n\t\t\tvh.yanse=(TextView) convertView.findViewById(R.id.th_goodsyanse);\n\t\t\tvh.zhuangtai=(TextView) convertView.findViewById(R.id.th_zhuangtai);\n\t\t\tvh.jiaoyijin=(TextView) convertView.findViewById(R.id.th_goodsjiaoyijine);\n\t\t\tvh.tuikuanjin=(TextView) convertView.findViewById(R.id.th_tuikuanjine);\n\t\t\tvh.xiangqing=(TextView) convertView.findViewById(R.id.th_xiangqing);\n\t\t\tconvertView.setTag(vh);\n\t\t}else{\n\t\t\tvh=(viewholderss) convertView.getTag();\n\t\t\t\n\t\t}\n\t\t\n\t\tif(list.get(position).getRefund_type().equals(\"1\")){\n\t\t\tvh.zhuangtai.setText(\"退款\");\n\t\t}else if(list.get(position).getRefund_status().equals(\"2\")){\n\t\t\tvh.zhuangtai.setText(\"退货\");\n\t\t}\n\t\tvh.title.setText(list.get(position).getGoods_name());\n\t\tvh.jiaoyijin.setText(list.get(position).getRefund_price());\n\t\tvh.tuikuanjin.setText(list.get(position).getRefund_price());\n//\t\tvh.chicun.setText(list.get(position).getSpec_id());\n\t\tgetdataspec(vh.chicun,vh.yanse,list.get(position).getSpec_id());\n//\t\tvh.yanse.setText(list.get(position).getSpec_id());\n\t\tBitmapUtils b=new BitmapUtils(context);\n\t\tb.display(vh.im,list.get(position).getGoods_image());\n\t\tfinal TextView tv=vh.xiangqing;\n\t\ttv.setOnClickListener(new OnClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\treturn convertView;\n\t}", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\ttry {\n\t\t\tHolder holder;\n\t\t\tif(convertView==null){\n\t\t\t\tconvertView=mInflater.inflate(R.layout.view_blend_dialog_list_item, null);\n\t\t\t\tholder=new Holder();\n\t\t\t\tholder.tvDialogListItem=(TextView) convertView.findViewById(R.id.tv_blend_dialog_list_item);\n\t\t\t\tconvertView.setTag(holder);\n\t\t\t}else{\n\t\t\t\tholder=(Holder) convertView.getTag();\n\t\t\t}\n\t\t\tholder.tvDialogListItem.setText(mData.get(position).get(\"target_phone\"));\n\t\t} catch (Exception e) {\n\t\t\tFileUtils.addErrorLog(e);\n\t\t}\n\t\treturn convertView;\n\t}", "@Override\n public View getView(final int position, View convertView, ViewGroup parent) {\n final ViewHolder holder;\n if (convertView == null) {\n holder = new ViewHolder();\n convertView = LayoutInflater.from(MyLoveActivity.this).inflate(R.layout.custom_home_listview, null);\n holder.iv_restaurant = (ImageView) convertView.findViewById(R.id.iv_restaurant);\n holder.tv_restaurant = (TextView) convertView.findViewById(R.id.tv_restaurant_name);\n holder.tv_Foodprices = (TextView) convertView.findViewById(R.id.tv_food_prices);\n holder.tv_Foodprices1 = (TextView) convertView.findViewById(R.id.tv_food_prices1);\n holder.btn_addto_love = (Button) convertView.findViewById(R.id.btn_restaurant_love);\n convertView.setTag(holder);\n } else {\n holder = (ViewHolder) convertView.getTag();\n }\n\n //先定义一个加载图片的option\n DisplayImageOptions options = new DisplayImageOptions.Builder().showImageOnLoading(R.mipmap.loadingpic)\n .showImageOnFail(R.mipmap.loadingfailed).cacheInMemory(true).cacheOnDisk(true).build();\n //加载餐厅或者食物照片\n ImageLoader.getInstance().displayImage((String) list.get(position).get(\"url\"), holder.iv_restaurant,\n options);\n //设置餐厅名字或者食物名字\n holder.tv_restaurant.setText((String) list.get(position).get(\"name\"));\n //判断有没有价格,有就设置进去\n if (list.get(position).get(\"price\") == null) {\n holder.tv_Foodprices1.setVisibility(View.GONE);\n holder.tv_Foodprices.setVisibility(View.GONE);\n } else {\n holder.tv_Foodprices1.setVisibility(View.VISIBLE);\n holder.tv_Foodprices.setVisibility(View.VISIBLE);\n holder.tv_Foodprices.setText((String) list.get(position).get(\"price\"));\n }\n\n //判断有没有加入收藏\n if (list.get(position).get(\"isCollect\").toString().equals(\"true\")) {\n holder.btn_addto_love.setSelected(true);\n } else {\n holder.btn_addto_love.setSelected(false);\n }\n //收藏按钮的监听\n holder.btn_addto_love.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if (holder.btn_addto_love.isSelected()) {\n holder.btn_addto_love.setSelected(false);\n //取消收藏\n //加密数据\n String string = \"deleteFavorite@\"+loginName+\"@\" + list.get(position).get(\"type\")+\"@\"+list.get(position).get(\"id\").toString().trim();\n String md5String = MySecurityUtil.string2MD5(string);;\n mySecurityAddtoLoveBean.setUserId(loginName);\n mySecurityAddtoLoveBean.setSign(md5String);\n mySecurityAddtoLoveBean.setType(list.get(position).get(\"type\").toString());\n mySecurityAddtoLoveBean.setTypeId(list.get(position).get(\"id\").toString());\n String json = gson.toJson(mySecurityAddtoLoveBean);\n //encrypt加密\n String encryptJson = MySecurityUtil.encrypt(json);\n //加密后在String2Base64\n String encryptJsonToBase64 = MySecurityUtil.String2Base64(encryptJson);\n String path = \"http://202.171.212.154:8080/hh/deleteFavorite.action?json=\" + encryptJsonToBase64;\n //开始访问得到返回数据\n Request request = new Request.Builder()\n .url(path)\n .build();\n okHttpClient.newCall(request).enqueue(new Callback() {\n @Override\n public void onFailure(Request request, IOException e) {\n Log.e(\"aaaaaaa\", \"onFailure\");\n }\n\n @Override\n public void onResponse(Response response) throws IOException {\n //NOT UI Thread\n if (response.isSuccessful()) {\n// //将所得到的list传回回去\n// Message message = Message.obtain();\n// message.obj = response.body().string();\n// message.what = FINISH;\n// mhandler.sendMessage(message);\n Log.e(\"AAAAAAAA\", \"取消收藏成功\");\n list.get(position).put(\"isCollect\", \"false\");\n }\n }\n });\n } else {\n if(list.get(position).get(\"isCollect\").equals(\"true\")){\n Log.e(\"AAAAAAAA\", \"已经收藏过,切勿重复收藏\");\n }else {\n holder.btn_addto_love.setSelected(true);\n //添加收藏\n //加密数据\n String string = \"saveFavorite@\"+loginName+\"@\" + list.get(position).get(\"type\") + \"@\" + list.get(position).get(\"id\").toString().trim();\n String md5String = MySecurityUtil.string2MD5(string);\n mySecurityAddtoLoveBean.setUserId(loginName);\n mySecurityAddtoLoveBean.setSign(md5String);\n mySecurityAddtoLoveBean.setType(list.get(position).get(\"type\").toString());\n mySecurityAddtoLoveBean.setTypeId(list.get(position).get(\"id\").toString());\n String json = gson.toJson(mySecurityAddtoLoveBean);\n //encrypt加密\n String encryptJson = MySecurityUtil.encrypt(json);\n //加密后在String2Base64\n String encryptJsonToBase64 = MySecurityUtil.String2Base64(encryptJson);\n String path = \"http://202.171.212.154:8080/hh/saveFavorite.action?json=\" + encryptJsonToBase64;\n //开始访问得到返回数据\n Request request = new Request.Builder()\n .url(path)\n .build();\n okHttpClient.newCall(request).enqueue(new Callback() {\n @Override\n public void onFailure(Request request, IOException e) {\n Log.e(\"aaaaaaa\", \"onFailure\");\n }\n\n @Override\n public void onResponse(Response response) throws IOException {\n //NOT UI Thread\n if (response.isSuccessful()) {\n// //将所得到的list传回回去\n// Message message = Message.obtain();\n// message.obj = response.body().string();\n// message.what = FINISH;\n// mhandler.sendMessage(message);\n list.get(position).put(\"isCollect\", \"true\");\n Log.e(\"AAAAAAAA\", \"收藏成功\");\n }\n }\n });\n }\n }\n }\n });\n return convertView;\n }", "@Override\n\tpublic View getView(final int position, View convertView, ViewGroup parent) {\n\t\tconvertView=LayoutInflater.from(con).inflate(R.layout.lawyerlist, null);\n\t\t\nTextView li=(TextView) convertView.findViewById(R.id.t1);\n\t\t\n\t\tTextView li1=(TextView) convertView.findViewById(R.id.t2);\n\t\tTextView li2=(TextView) convertView.findViewById(R.id.t3);\n\n\t\tTextView li3=(TextView) convertView.findViewById(R.id.t4);\n\t\tTextView li4=(TextView) convertView.findViewById(R.id.t5);\n\n\t\tli.setText(items4.get(position));\n\t\tli1.setText(items5.get(position));\n\t\tli2.setText(items1.get(position));\n\t\tli3.setText(items2.get(position));\n\t\tli4.setText(items3.get(position));\n\n\t\tImageView call = (ImageView) convertView.findViewById(R.id.call);\n\t\tcall.setOnClickListener(new View.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View view) {\n\t\t\t\tString number = items3.get(position);\n\t\t\t\tIntent callIntent = new Intent(Intent.ACTION_CALL);\n\t\t\t\tcallIntent.setData(Uri.parse(\"tel:\" + number));\n\t\t\t\tif (ActivityCompat.checkSelfPermission(con, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {\n\t\t\t\t\t// TODO: Consider calling\n\t\t\t\t\t// ActivityCompat#requestPermissions\n\t\t\t\t\t// here to request the missing permissions, and then overriding\n\t\t\t\t\t// public void onRequestPermissionsResult(int requestCode, String[] permissions,\n\t\t\t\t\t// int[] grantResults)\n\t\t\t\t\t// to handle the case where the user grants the permission. See the documentation\n\t\t\t\t\t// for ActivityCompat#requestPermissions for more details.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcon.startActivity(callIntent);\n\t\t\t}\n\t\t});\n\t\tTextView vm5=(TextView) convertView.findViewById(R.id.vm5);\n\t\t//TextView vm1=(TextView) convertView.findViewById(R.id.vm1);\n\t\t/*TextView vm5=(TextView) convertView.findViewById(R.id.vm5);\n\t\t//TextView vm2=(TextView) convertView.findViewById(R.id.vm2);\n\t\t vm3=(LinearLayout) convertView.findViewById(R.id.vm3);\n\t\tTextView vm4=(TextView) convertView.findViewById(R.id.vm4);\n\t\t vm=(TextView) convertView.findViewById(R.id.vm);\n\t\tvm.setOnClickListener(new View.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View view) {\n\t\t\t\t// Toast.makeText(getActivity(), \"clickz....\", Toast.LENGTH_LONG).show();\n\t\t\t\tViewGroup.LayoutParams params = vm3.getLayoutParams();\n\t\t\t\tparams.height = ViewGroup.LayoutParams.WRAP_CONTENT;\n\t\t\t\tvm3.setLayoutParams(params);\n\n\n\t\t\t\tvm.setVisibility(View.INVISIBLE);\n\t\t\t}\n\t\t});\n\t\tvm4.setOnClickListener(new View.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View view) {\n\t\t\t\t// Toast.makeText(getActivity(), \"clickz....\", Toast.LENGTH_LONG).show();\n\t\t\t\tViewGroup.LayoutParams params = vm3.getLayoutParams();\n\t\t\t\tparams.height = 0;\n\t\t\t\tvm3.setLayoutParams(params);\n\n\t\t\t\tvm.setVisibility(View.VISIBLE);\n\t\t\t}\n\t\t});*/\n\t\tvm5.setOnClickListener(new View.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View view) {\n\n\t\t\t\t dialog = new Dialog(con);\n\t\t\t\tdialog.setContentView(R.layout.casedetail);\n\t\t\t\tdialog.setTitle(\"Case Details\");\n\t\t\t\tdialog.show();\n\n\t\t\t\tsp = PreferenceManager.getDefaultSharedPreferences(con);\n\t\t\t\ted = sp.edit();\n\n\n\n\n\n\t\t\t\tTitle=(EditText) dialog.findViewById(R.id.input_name) ;\n\t\t\t\tradioGroup = (RadioGroup)dialog. findViewById(R.id.radioGender);\n\t\t\t\tradioButton = (RadioButton) dialog.findViewById(R.id.radioMale);\n\t\t\t\tNumber=(EditText) dialog.findViewById(R.id.input_name1) ;\n\t\t\t\tDescription=(EditText)dialog. findViewById(R.id.input_address);\n\n\t\t\t\tsignupButton=(Button) dialog.findViewById(R.id.btn_signup) ;\n\n\n\n\t\t\t\tsignupButton.setOnClickListener(new View.OnClickListener() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t// Finish the registration screen and return to the Login activity\n\n\n\n\t\t\t\t\t\ttit1 = Title.getText().toString();\n\t\t\t\t\t\tnum1 = Number.getText().toString();\n\t\t\t\t\t\tdesc1 = Description.getText().toString();\n\n\t\t\t\t\t\tint selectedId = radioGroup.getCheckedRadioButtonId();\n\t\t\t\t\t\tif(selectedId == radioButton.getId())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//yo stirng database ma store gara hai ani sabai huncha\n\n\t\t\t\t\t\t\tgender = \"civil\";\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\tgender = \"criminal\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// find the radiobutton by returned id\n\t\t\t\t\t\t// radioButton = (RadioButton) findViewById(selectedId);\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\ttit = URLEncoder.encode(tit1, \"UTF-8\");\n\t\t\t\t\t\t\tnum = URLEncoder.encode(num1, \"UTF-8\");\n\t\t\t\t\t\t\tdesc = URLEncoder.encode(desc1, \"UTF-8\");\n\n\n\n\t\t\t\t\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Toast.makeText(con ,\"clickz....\"+items6.get(position), Toast.LENGTH_LONG).show();\n\t\t\t\t\t\tuserid=sp.getString(\"user_id\",\"\");\n\t\t\t\t\t\tlawid=items6.get(position);\n\t\t\t\t\t\tnew AsyncHttpTask().execute(\"http://\"+sp.getString(\"ipaddrress\",\"\")+\"/LawSource/clientwebservice/caserequest.jsp?userid=\"+userid+\"&lawid=\"+lawid+\"&tit=\"+tit+\"&type=\"+gender+\"&num=\"+num+\"&desc=\"+desc);\n\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t}\n\t\t});\n\n\t\treturn convertView;\n\t}", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\n\t\tViewHolder holder;\n\t\t// Recycle existing view if passed as parameter\n\t\t// This will save memory and time on Android\n\t\t// This only works if the base layout for all classes are the same\n\t\tView rowView = convertView;\n\t\tif (rowView == null) {\n\t\t\tLayoutInflater inflater = context.getLayoutInflater();\n\t\t\trowView = inflater.inflate(R.layout.about_screen_item, null, true);\n\t\t\tholder = new ViewHolder();\n\t\t\t\n\t\t\tholder.image = (ImageView) rowView.findViewById(R.id.AS_item_image);\n\t\t\tholder.label = (TextView) rowView.findViewById(R.id.AS_item_label);\n\t\t\tholder.subtext = (TextView) rowView.findViewById(R.id.AS_item_subtext);\n\t\t\t\n\t\t\trowView.setTag(holder);\n\t\t} else {\n\t\t\tholder = (ViewHolder) rowView.getTag();\n\t\t}\n\n\n\t\tif (items.get(position).getType().equals(\"email\")){\n\t\t\tholder.image.setImageDrawable(context.getResources().getDrawable(R.drawable.email));\n\t\t}\n\t\telse if (items.get(position).getType().equals(\"link\")){\n\t\t\tholder.image.setImageDrawable(context.getResources().getDrawable(R.drawable.link));\n\t\t}\n\t\t\n\t\tholder.label.setText(items.get(position).getLabel());\n\t\tholder.subtext.setText(items.get(position).getSubtext());\n\t\t\n\t\treturn rowView;\n\t}", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n View listItemView = convertView;\n if (listItemView == null) {\n listItemView = LayoutInflater.from(getContext()).inflate(\n R.layout.item_layout, parent, false);\n }\n // get the current object located at position\n ItemObject currentObject = getItem(position);\n // Find the TextView in the list_item.xml layout with the ID version_name\n TextView nameTextView = listItemView.findViewById(R.id.item_name);\n nameTextView.setText(currentObject.getPlanetName());\n ImageView itemImage = listItemView.findViewById(R.id.item_img);\n itemImage.setImageResource(currentObject.getImageID());\n return listItemView;\n }", "private void inflateViewForItem(Item item) {\n\n //Inflate Layout\n ItemCardBinding binding = ItemCardBinding.inflate(getLayoutInflater());\n\n //Bind Data\n binding.imageView.setImageBitmap(item.bitmap);\n binding.title.setText(item.label);\n binding.title.setBackgroundColor(item.color);\n\n //Add it to the list\n b.list.addView(binding.getRoot());\n }", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tViewHolder holder=null;\n\t\tNewsItem item=newsList.get(position);\n\t\tif(convertView==null){\n\t\t\tholder=new ViewHolder();\n\t\t\t//将layout.xml转换为View\n\t\t\tswitch(item.getStyle()){\n\t\t\tcase 0:\n\t\t\t\t\n\t\t\t\tconvertView=LayoutInflater.from(mActivity).inflate(R.layout.news_item1, null);\n\t\t\t\tholder.ivImg1=(ImageView)convertView.findViewById(R.id.ivNewsImg);\n\t\t\t\tholder.ivImg1.setLayoutParams(new RelativeLayout.LayoutParams(100, 100));\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tconvertView=LayoutInflater.from(mActivity).inflate(R.layout.news_item2, null);\n\t\t\t\tholder.ivImg1=(ImageView)convertView.findViewById(R.id.ivImg1);\n\t\t\t\tholder.ivImg2=(ImageView)convertView.findViewById(R.id.ivImg2);\n\t\t\t\tholder.ivImg3=(ImageView)convertView.findViewById(R.id.ivImg3);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t\n\t\t\t\tconvertView=LayoutInflater.from(mActivity).inflate(R.layout.news_item1, null);\n\t\t\t\tholder.ivImg1=(ImageView)convertView.findViewById(R.id.ivNewsImg);\n\t\t\t\tholder.ivImg1.setLayoutParams(new RelativeLayout.LayoutParams(100, 100));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tholder.tvTilte=(TextView)convertView.findViewById(R.id.tvTitle);\t\n\t\t\tconvertView.setTag(holder);//记录个标识\n\t\t}else{\n\t\t\tholder=(ViewHolder)convertView.getTag();\n\t\t}\n\t\t//向ui元素绑定数据\n\t\tholder.tvTilte.setText(item.getTitle());\n\t\t\n\t\t\n\t\tswitch(item.getStyle()){\n\t\tcase 0:\n\t\t\timageLoader.get(item.getImgUrl()[0], ImageLoader.getImageListener(holder.ivImg1,\n\t\t\t\t\tR.drawable.default_big, R.drawable.default_big));//加载图片,先从内存中加载,内存没有再从网络加载\n\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\timageLoader.get(item.getImgUrl()[1], ImageLoader.getImageListener(holder.ivImg2,\n\t\t\t\t\t\tR.drawable.default_big, R.drawable.default_big));//加载图片,先从内存中加载,内存没有再从网络加载\n\t\t\t\timageLoader.get(item.getImgUrl()[2], ImageLoader.getImageListener(holder.ivImg3,\n\t\t\t\t\t\tR.drawable.default_big, R.drawable.default_big));//加载图片,先从内存中加载,内存没有再从网络加载\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tString imgStr = item.getImgUrl()[0];\n\t\t\t\tbyte[] picByte = Base64.decode(imgStr, Base64.DEFAULT);\n\t\t\t\tBitmap bmp = BitmapFactory.decodeByteArray(picByte, 0, picByte.length);\n\t\t\t\tholder.ivImg1.setImageBitmap(bmp);\n\t\t\t\tbreak;\n\t\t}\n\t\tLog.d(\"jereh\",\"getView()\");\n\t\treturn convertView;\n\t}", "@Override\n public View newView(Context context, Cursor cursor, ViewGroup parent) {\n View view = LayoutInflater.from(parent.getContext())\n .inflate(R.layout.main_list_item, parent, false);\n ViewHolder viewHolder = new ViewHolder(view);\n view.setTag(viewHolder);\n return view;\n }", "@Override\r\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tViewHolder holder;\r\n\t\tif (null == convertView) {\r\n\t\t\tconvertView = mInflater.inflate(R.layout.item_article_layout, null);\r\n\t\t\tholder = new ViewHolder();\r\n\t\t\tholder.icon = (ImageView) convertView.findViewById(R.id.item_icon);\r\n\t\t\tholder.title = (TextView) convertView.findViewById(R.id.item_title);\r\n\t\t\tholder.name = (TextView) convertView\r\n\t\t\t\t\t.findViewById(R.id.item_user_name);\r\n\t\t\tholder.time = (TextView) convertView.findViewById(R.id.item_time);\r\n\t\t\tholder.count = (TextView) convertView.findViewById(R.id.item_count);\r\n\t\t\tholder.line = (TextView) convertView.findViewById(R.id.item_line);\r\n\t\t\tconvertView.setTag(holder);\r\n\t\t} else {\r\n\t\t\tholder = (ViewHolder) convertView.getTag();\r\n\t\t}\r\n\t\tArticleItem item = list.get(position);\r\n\t\tholder.title.setText(item.getTitle());\r\n\t\tString name = item.getU_name();\r\n\t\tholder.name.setText(name);\r\n\t\tlong time = Long.parseLong(item.getTime());\r\n\t\tholder.time.setText(getTimeFormat(time));\r\n\t\tholder.count.setText(String.valueOf(item.getReply_count()));\r\n\t\tif (isNewPublish(time)) {\r\n\t\t\tholder.line.setBackgroundResource(R.drawable.article_divider_new);\r\n\t\t} else {\r\n\t\t\tholder.line.setBackgroundResource(R.drawable.article_divider_1);\r\n\t\t}\r\n\t\t//使用头像加载器显示头像\r\n\t\tLoadIconManager.getInstance().showHeadIcon(mContext, holder.icon, name,\r\n\t\t\t\titem.getU_photo(), onLoadIconListener);\r\n\t\treturn convertView;\r\n\t}", "@Override\r\n\tpublic View getView(int arg0, View arg1, ViewGroup arg2) {\n\t\tif (arg1==null) {\r\n\t\t\tmHolder=new ViewHolder();\r\n\t\t\targ1=mInflater.inflate(R.layout.pj_item, null);\r\n\t\t\tmHolder.pj_content=(TextView) arg1.findViewById(R.id.pj_content);\r\n\t\t\tmHolder.pj_username=(TextView) arg1.findViewById(R.id.pj_username);\r\n\t\t\tmHolder.pj_time=(TextView) arg1.findViewById(R.id.pj_time);\r\n\t\t\targ1.setTag(mHolder);\r\n\t\t}else {\r\n\t\t\tmHolder=(ViewHolder) arg1.getTag();\r\n\t\t}\r\n\t\tmHolder.pj_content.setText(listab.get(arg0).getText());\r\n\t\tmHolder.pj_username.setText(listab.get(arg0).getU_id()+\"\");\r\n\t\tmHolder.pj_time.setText(listab.get(arg0).getTime()+\"\");\r\n\t\t\r\n\t\treturn arg1;\r\n\t}", "@Override\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\t\tViewHolder holder;\n\t\t\tif (convertView == null) {\n\t\t\t\tconvertView = View.inflate(MainActivity.this, \n\t\t\t\t\t\tR.layout.demo_list_item, null);\n\t\t\t\tholder = new ViewHolder();\n\t\t\t\tholder.tvLable = (TextView)convertView.findViewById(R.id.label);\n\t\t\t\tholder.tvDesc = (TextView)convertView.findViewById(R.id.desc);\n\t\t\t\tconvertView.setTag(holder);\n\t\t\t} else {\n\t\t\t\tholder = (ViewHolder)convertView.getTag();\n\t\t\t}\n\n\t\t\tholder.tvLable.setText(demos[position].lable);\n\t\t\tholder.tvDesc.setText(demos[position].desc);\n\n\t\t\treturn convertView;\n\t\t}", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n Patient r = getItem(position);\n // Check if an existing view is being reused, otherwise inflate the view\n if (convertView == null) {\n convertView = LayoutInflater.from(getContext()).inflate(R.layout.item_room, parent, false);\n }\n // Lookup view for data population\n TextView nr = (TextView) convertView.findViewById(R.id.item_room_number);\n // Populate the data into the template view using the data object\n nr.setText(r.getName());\n // Return the completed view to render on screen\n return convertView;\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n final ViewHolder holder;\n\n if (convertView == null) {\n convertView = inflater.inflate(R.layout.driver_food_list_confirmation, null);\n holder = new ViewHolder();\n\n holder.tv_item_name = (TextView) convertView.findViewById(R.id.tv_item_name);\n holder.tv_item_qty = (TextView) convertView.findViewById(R.id.tv_item_qty);\n holder.tv_item_price = (TextView) convertView.findViewById(R.id.tv_item_price);\n\n convertView.setTag(holder);\n } else {\n holder = (ViewHolder) convertView.getTag();\n }\n\n try {\n holder.tv_item_name.setText(\"\" + jArrayDesc.get(position));\n holder.tv_item_qty.setText(\"\" + jArrayQty.get(position));\n holder.tv_item_price.setText(\"\" + jArrayPrice.get(position));\n } catch (JSONException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n return convertView;\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n ViewHolder viewHolder = new ViewHolder();\n if (convertView == null) {\n convertView = inflate.inflate(R.layout.adapter_audititems_item, null, true);\n }\n\n viewHolder.title_category = (TextView) convertView.findViewById(R.id.title_category);\n viewHolder.txt_rightarrow = (TextView) convertView.findViewById(R.id.txt_rightarrow);\n viewHolder.txt_rightarrow.setText(R.string.rightarrow);\n Helper.getTypeFace(context, context.getString(R.string.contentfontname), viewHolder.title_category);\n Helper.getTypeFace(context, context.getString(R.string.fontawsome), viewHolder.txt_rightarrow);\n\n AuditItems productCnsts = (AuditItems) catCnstsArrayList.get(position);\n viewHolder.title_category.setText(productCnsts.getLoc_name());\n\n\n return convertView;\n }", "@Override\n public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n View listItem = layoutInflater.inflate(R.layout.row_member_list, parent, false);\n ViewHolder vh = new ViewHolder(listItem);\n vh.ivSelectedIcon.setVisibility(showSelected ? View.VISIBLE : View.GONE);\n return vh;\n }", "@Override\n public View getView(LayoutInflater inflater, View convertView) {\n return getViewItem(inflater, convertView);\n }", "@Override\npublic View getView(int position, View convertView, ViewGroup parent) {\n\tView view = convertView;\n\tif (view ==null){\n\t\tLayoutInflater inflater = LayoutInflater.from(getContext());\n\t\tview = inflater.inflate(nguyenthitrucgiang.com.dafastfoodstore.R.layout.item_list_danhmuc, null);\n\t}\n\tDanhMuc dm = getItem(position);\n\tif(dm!=null){\n\t\tTextView txtTen = (TextView)view.findViewById(nguyenthitrucgiang.com.dafastfoodstore.R.id.tv_tend);\n\t\tTextView txtId = (TextView)view.findViewById(nguyenthitrucgiang.com.dafastfoodstore.R.id.tv_Idd);\n\t\ttxtTen.setText(dm.getmTenDM());\n\t\ttxtId.setText(String.valueOf(dm.getmMaDM()));\n\t\t\n\t}\n\treturn view;\n}", "@Override\n public View getView (int position, View convertView, ViewGroup parent) {\n\n appManager = AppManager.getInstance();\n\n\n //challengeParticipation challengeParticipation = (ChallengeParticipation) getItem(position);\n if (convertView == null)\n convertView = LayoutInflater.from(getContext()).inflate(R.layout.activity_challenges_available_custom_item,\n parent, false);\n\n //handlers to the elements in activity .xml\n TextView list_item_challenge_available_title = (TextView) convertView.findViewById(R.id.challenge_title_available);\n //TextView list_item_challenge_days_to_end_ = (TextView) convertView.findViewById(R.id.challenge_days_to_end_value);\n\n list_item_challenge_available_title.setText(\"Famous People Challenge\");\n //list_item_challenge_days_to_end_.setText(\"\" +appManager.getCurrentUser().getChallengesParticipations().get(position).getGems());\n return convertView;\n }", "@Override\r\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\r\n\t\t\r\n\t\t// 常见的优化ViewHolder\r\n ViewHolder viewHolder = null;\r\n if (null == convertView) {\r\n convertView = mLayoutInflater.inflate(R.layout.listview_item, null);\r\n \r\n viewHolder = new ViewHolder();\r\n viewHolder.content = (TextView) convertView.findViewById(R.id.content);\r\n viewHolder.contentIcon = (ImageView) convertView.findViewById(R.id.content_icon);\r\n \r\n convertView.setTag(viewHolder);\r\n } else {\r\n viewHolder = (ViewHolder) convertView.getTag();\r\n }\r\n\r\n // 获取数据\r\n viewHolder.content.setText( mArrayList.get(position) );\r\n viewHolder.contentIcon.setImageResource(R.drawable.ic_launcher);\r\n\r\n return convertView;\r\n\t}", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tViewHolder viewHolder = null;\n\t\tNew news = list.get(position);\n\t\tif(convertView!=null&&convertView.getId()==R.id.pull_refresh_list)\n\t\t{\n\t\t\tviewHolder=(ViewHolder)convertView.getTag();\n\t\t}\n\t\telse {\n\t\t\tviewHolder = new ViewHolder();\n\t\t\tconvertView=mInflater.inflate(R.layout.blog_list_item, null);\n\t\t\tviewHolder.text_title=(TextView) convertView.findViewById(R.id.textview_title);\n\t\t\tviewHolder.text_id=(TextView) convertView.findViewById(R.id.textview_id);\n\t\t\tviewHolder.text_summary=(TextView) convertView.findViewById(R.id.textview_summary);\n\t\t\tviewHolder.text_comments=(TextView) convertView.findViewById(R.id.textview_comments);\n\t\t\tviewHolder.text_diggs=(TextView) convertView.findViewById(R.id.textview_diggs);\n\t\t\tviewHolder.text_views=(TextView) convertView.findViewById(R.id.textview_views);\n\t\t\tviewHolder.text_published=(TextView) convertView.findViewById(R.id.textview_published);\n\t\t viewHolder.imageIcon=(ImageView) convertView.findViewById(R.id.imageview_user_avatar);\n\n\t\t\t\n\t\t}\n\t\t\n\t\tviewHolder.text_comments.setText(String.valueOf(news.getComments()));\n\t\tviewHolder.text_diggs.setText(String.valueOf(news.getDiggs()));\n\t\tviewHolder.text_published.setText(TimeUtils.getTime(news.getPublished().getTime(), TimeUtils.DATE_FORMAT_DATE));\n\t\tviewHolder.text_summary.setText(news.getSummary());\n\t\tviewHolder.text_title.setText(news.getTitle());\n\t\tviewHolder.text_id.setText(String.valueOf(news.getId()));\n\t\tviewHolder.text_views.setText(String.valueOf(news.getViews()));\n\t\tviewHolder.imageIcon.setVisibility(View.GONE);\n\t\t//viewHolder.imageIcon.setImageDrawable(ImageUtils.getDrawableFromUrl(\"http://pic.cnblogs.com/face/79603/20150318151528.png\", 3000));\n\t\tconvertView.setTag(viewHolder);\n\t\treturn convertView;\n\t}", "@Override\n\tpublic View getView( final int position, View convertView, ViewGroup parent) {\n\n\t\tHolderfeat holder=new Holderfeat(); // view lookup cache stored\n\t\tconvertView=inflater.inflate(R.layout.customview_albums_browse, null); // inflate the layout\n\n\t\t// get the TextView and then set the text (item name) and tag (item ID) values\n\t\tholder.txt_name=(TextView) convertView.findViewById(R.id.name);\n\t\tholder.img=(ImageView) convertView.findViewById(R.id.img);\n\n\n\t\t// object item based on the position\n\t\t// Populate the data from the data object via the viewHolder object\n\t\t// into the template view.\n\t\tholder.txt_name.setText(m.getAl_homeplaylist().get(position).getAlbumname());\n\t\t\tPicasso.with(context).load(m.getAl_homeplaylist().get(position).getAlbumimage()).into(holder.img);\n\n//\n\t\tholder.img.setOnClickListener(new View.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tpid=m.getAl_homeplaylist().get(position).getId();\n\n\t\t\t\tFragment_PlaylistDetail fragment_detail = new Fragment_PlaylistDetail();\n\t\t\t\tFragmentManager fragmentManager3 = ((Activity) context).getFragmentManager();\n\t\t\t\tfragmentManager3.beginTransaction().replace(R.id.activity_main_content_fragment, fragment_detail).addToBackStack(null).commit();\n\t\t\t\tMainActivity1.Drawer.closeDrawer(Gravity.LEFT);\n\n\n\n\n\t\t\t}\n\t\t});\n\n\t\t// Return the completed view to render on screen\n\t\treturn convertView;\n\n\t}", "@Override\n\t\t\t\t\t\tpublic View getView(int position, View convertView,\n\t\t\t\t\t\t\t\tViewGroup parent) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tViewHolder holder;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (convertView == null) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tconvertView = mInflater.inflate(R.layout.listview_history, null);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t holder = new ViewHolder();\n\n\t\t\t\t\t\t\t\t /*得到各个控件的对象*/ \n\t\t\t\t\t\t\t\t holder.title = (TextView)convertView.findViewById(R.id.title);\n\t\t\t\t\t\t\t\t holder.info = (TextView)convertView.findViewById(R.id.info);\n\t\t\t\t\t\t\t\t holder.number = (TextView)convertView.findViewById(R.id.number);\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t//绑定ViewHolder对象\n\t\t\t\t\t\t\t\t convertView.setTag(holder);\n\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//取出ViewHolder对象 \n\t\t\t\t\t\t\t\t\tholder = (ViewHolder)convertView.getTag();\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tholder.title.setText(getDate().get(position).get(\"title\").toString());\n\t\t\t\t\t\t\t\t\tholder.info.setText(getDate().get(position).get(\"info\").toString());\n\t\t\t\t\t\t\t\t\tholder.number.setText(getDate().get(position).get(\"number\").toString());\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\treturn convertView;\n\t\t\t\t\t\t}", "@Override\n public View getView(final int position, View convertView, ViewGroup parent) {\n final MoneyTrackerItem productItem=parkingList.get(position);\n\n ViewHolder holder = null;\n LayoutInflater inflater = (LayoutInflater) activity\n .getSystemService(Activity.LAYOUT_INFLATER_SERVICE);\n // If holder not exist then locate all view from UI file.\n if (convertView == null) {\n\n // inflate UI from XML file\n convertView = inflater.inflate(R.layout.money_tracker_list_item, parent, false);\n // get all UI view\n holder = new ViewHolder(convertView);\n // set tag for holder\n convertView.setTag(holder);\n\n\n } else {\n // if holder created, get tag from view\n holder = (ViewHolder) convertView.getTag();\n }\n\n /* productItem = parkingList.get(position);\n Log.e(\"book\",\"\"+book);*/\n\n holder.clinicName.setText(productItem.getClinicName());\n Log.e(\"packageName\",\"\"+productItem.getClinicName());\n holder.clinicName.setTypeface(Typeface.createFromAsset(getContext().getAssets(),\"Fonts/Roboto-Regular.ttf\"));\n\n holder.totalAmount.setText(\"Total Amount : \"+productItem.getAmount()+\" Rs/-\");\n //holder.actulPrice.setPaintFlags(holder.actulPrice.getPaintFlags()| Paint.STRIKE_THRU_TEXT_FLAG);\n holder.totalAmount.setTypeface(Typeface.createFromAsset(getContext().getAssets(),\"Fonts/Roboto-Light.ttf\"));\n\n holder.online.setText(productItem.getOnline());\n holder.online.setTypeface(Typeface.createFromAsset(getContext().getAssets(),\"Fonts/Roboto-Light.ttf\"));\n\n holder.offline.setText(productItem.getOffline());\n holder.offline.setTypeface(Typeface.createFromAsset(getContext().getAssets(),\"Fonts/Roboto-Light.ttf\"));\n\n holder.patients.setText(productItem.getPatients());\n holder.patients.setTypeface(Typeface.createFromAsset(getContext().getAssets(),\"Fonts/Roboto-Light.ttf\"));\n\n\n return convertView;\n }", "@Override\r\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tViewHolder viewHolder = null;\r\n\t\tWUserItem ptEntity = yzEntities.get(position);\r\n\t\tif (convertView != null) {\r\n\t\t\tif (convertView.getTag() != null) {\r\n\t\t\t\tviewHolder = (ViewHolder) convertView.getTag();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tLinearLayout layout = (LinearLayout) inflater.inflate(\r\n\t\t\t\t\tR.layout.w_user_search_item, null);\r\n\t\t\tTextView tv_yhbm = (TextView) layout\r\n\t\t\t\t\t.findViewById(R.id.tv_yhbm);\r\n\t\t\tTextView tv_xm = (TextView) layout\r\n\t\t\t\t\t.findViewById(R.id.tv_xm);\r\n\t\t\tTextView tv_dh = (TextView) layout.findViewById(R.id.tv_dh);\r\n\t\t\t\r\n\t\t\tTextView tv_dz = (TextView) layout.findViewById(R.id.tv_dz);\r\n\t\t\tTextView tv_syzd = (TextView) layout.findViewById(R.id.tv_syzd);\r\n\t\t\tTextView tv_byzd = (TextView) layout.findViewById(R.id.tv_byzd);\r\n\t\t\tTextView tv_sl = (TextView) layout.findViewById(R.id.tv_sl);\r\n\t\t\t\r\n\t\t\tviewHolder = new ViewHolder();\r\n\t\t\tviewHolder.setTv_byzd(tv_byzd);\r\n\t\t\tviewHolder.setTv_dh(tv_dh);\r\n\t\t\tviewHolder.setTv_dz(tv_dz);\r\n\t\t\tviewHolder.setTv_sl(tv_sl);\r\n\t\t\tviewHolder.setTv_syzd(tv_syzd);\r\n\t\t\tviewHolder.setTv_xm(tv_xm);\r\n\t\t\tviewHolder.setTv_yhbm(tv_yhbm);\r\n\t\t\tconvertView = layout;\r\n\t\t\tconvertView.setTag(viewHolder);\r\n\t\t}\r\n\t\tviewHolder.getTv_byzd().setText(String.valueOf(ptEntity.getByzd()));\r\n\t\tviewHolder.getTv_dh().setText(ptEntity.getDh());\r\n\t\tviewHolder.getTv_dz().setText(ptEntity.getDz());\r\n\t\tviewHolder.getTv_sl().setText(String.valueOf(ptEntity.getSl()));\r\n\t\tviewHolder.getTv_syzd().setText(String.valueOf(ptEntity.getSyzd()));\r\n\t\tviewHolder.getTv_xm().setText(ptEntity.getXm());\r\n\t\tviewHolder.getTv_yhbm().setText(ptEntity.getYhbm());\r\n\t\t\r\n\t\treturn convertView;\r\n\t}", "@Override\n\tpublic View getView(int arg0, View arg1, ViewGroup arg2) {\n\t\tViewHolder holder;\n\t\tif(arg1==null){\n\t\t\tholder=new ViewHolder();\n\t\t\t\n\t\targ1=mInflater.inflate(R.layout.list_item, null);\n\t\tholder.textView1=(TextView) arg1.findViewById(R.id.id);\n\t\tholder.textView2=(TextView) arg1.findViewById(R.id.id2);\n arg1.setTag(holder);\n\t\t}\n\t\telse{\n\t\t\tholder=(ViewHolder) arg1.getTag();\n\t\t}\n\t\tholder.textView1.setText(arrayList.get(arg0).getId());\n\t\tholder.textView2.setText(arrayList.get(arg0).getName());\n\t\t\n\t\treturn arg1;\n\t}", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n Room r = getItem(position);\n // Check if an existing view is being reused, otherwise inflate the view\n if (convertView == null) {\n convertView = LayoutInflater.from(getContext()).inflate(R.layout.item_room, parent, false);\n }\n // Lookup view for data population\n TextView nr = (TextView) convertView.findViewById(R.id.item_room_number);\n // Populate the data into the template view using the data object\n nr.setText(r.getId()+\"\");\n // Return the completed view to render on screen\n return convertView;\n }", "@Override\n\tpublic View getView(final int position, View convertView, ViewGroup parent) {\n\t\tViewHolder holder = null;\n\t\tif (convertView == null) {\n\t\t\tholder = new ViewHolder();\n\t\t\tconvertView = inflater.inflate(R.layout.contacts_nearby_item_layout,null);\n\t\t\tholder.item = (CustomListItemView) convertView\n\t\t\t\t\t.findViewById(R.id.item);\n\t\t\tconvertView.setTag(holder);\n\t\t} else {\n\t\t\tholder = (ViewHolder) convertView.getTag();\n\t\t}\n\t\tT_Relationships bean = datas.get(position);\n\t\tholder.item.setFixDouble_title(bean.getRela_name());\n\t\tholder.item.setFixDouble_content(bean.getRela_rank());\n\t\tImageLoader.getInstance().displayImage(bean.getRela_head(),\n\t\t\t\tholder.item.getFixIcon(),loadOptions);\n\t\tholder.item.setCallBack(new listItemCallBack() {\n\t\t\t@Override\n\t\t\tpublic void checkbox_select_callBack(boolean ifCheck) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tsuper.checkbox_select_callBack(ifCheck);\n\t\t\t\titemCallBack.call_select(ifCheck,position);\n\t\t\t}\n\t\t});\n\t\tif(bean.isItem_select()){\n\t\t\tholder.item.setCheckSelect(true);\n\t\t\titemCallBack.call_select(true,position);\n\t\t}else {\n\t\t\tholder.item.setCheckSelect(false);\n\t\t\titemCallBack.call_select(false,position);\n\t\t}\n\t\treturn convertView;\n\t}", "public ViewHolder(View itemView) {\n super(itemView);\n tvNature = (TextView)itemView.findViewById(R.id.item_name);\n tvAmountNature = (TextView)itemView.findViewById(R.id.item_amount);\n }", "@NonNull\n @Override\n public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {\n View v = convertView;\n if (v == null){\n v = LayoutInflater.from(getContext()).inflate(R.layout.list_view_item_tag, null);\n }\n\n// Pegando o item que será carregado\n Tag tag = getItem(position);\n\n// finds dos elementos do layout inflado\n TextView lbl_tag_nome = v.findViewById(R.id.lbl_tag_item);\n\n// setando os valores de cada elemento\n lbl_tag_nome.setText(tag.getNomeTag());\n\n return v;\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n Mood mood = getItem(position);\n // Check if an existing view is being reused, otherwise inflate the view\n if (convertView == null) {\n convertView = LayoutInflater.from(getContext()).inflate(R.layout.mood_list, parent, false);\n }\n\n // Lookup view for data population\n TextView userName = (TextView) convertView.findViewById(R.id.moodUserName);\n TextView emoticon = (TextView) convertView.findViewById(R.id.moodEmoticon);\n TextView group = (TextView) convertView.findViewById(R.id.moodGroup);\n TextView emotion = (TextView) convertView.findViewById(R.id.moodEmotion);\n TextView details = (TextView) convertView.findViewById(R.id.moodDetails);\n TextView date = (TextView) convertView.findViewById(R.id.moodDate);\n ImageView image = (ImageView) convertView.findViewById(R.id.moodImageView);\n LinearLayout item = (LinearLayout) convertView.findViewById(R.id.moodListItem);\n\n\n // Populate the data into the template view using the data object\n userName.setText(mood.getUserName());\n emoticon.setText(mood.getEmotion().getEmoticon());\n group.setText(mood.getSocialSituation());\n emotion.setText(mood.getEmotion().getEmotion());\n details.setText(mood.getMessage());\n date.setText(mood.getDateForView());\n image.setImageBitmap(mood.getImage());\n if(mood.getImage() == null){\n// Log.i(\"no image\",Integer.toString(position));\n image.setMaxHeight(0);\n }else{\n// Log.i(\"has image\",Integer.toString(position));\n image.setMaxHeight(720);\n// Log.i(\"image height\",Integer.toString(mood.getImage().getHeight()));\n }\n// Log.i(\"view height\",Integer.toString(image.getHeight()));\n item.setBackgroundColor(mood.getEmotion().getColour());\n\n\n\n\n // Return the completed view to render on screen\n return convertView;\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n if (list != null) {\n return list.get(position);\n }\n return null;\n }", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tView layout3_item = inflater.inflate(R.layout.layout4_lvitem,null);\n\t\treturn layout3_item;\n\t}", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tListItemView listItemView = new ListItemView();\n\t\tif (convertView == null || position < lists.size()) {\n\t\t\tconvertView = LayoutInflater.from(mContext).inflate(\n\t\t\t\t\tR.layout.st_sug_list, null);\n\t\t\tlistItemView.KeyIndex = (TextView) convertView\n\t\t\t\t\t.findViewById(R.id.num_index);\n\t\t\tlistItemView.KeyName = (TextView) convertView\n\t\t\t\t\t.findViewById(R.id.KeyName);\n\t\t\tlistItemView.keyCity = (TextView) convertView\n\t\t\t\t\t.findViewById(R.id.KeyCity);\n\t\t\tconvertView.setTag(listItemView);\n\n\t\t} else {\n\t\t\tlistItemView = (ListItemView) convertView.getTag();\n\t\t}\n//\t\tif (height != 0) {\n//\t\t\tlistItemView.KeyName\n//\t\t\t\t\t.setTextSize(CommonUtil.getTextSizes(height, 5));\n//\t\t\tlistItemView.KeyIndex\n//\t\t\t.setTextSize(CommonUtil.getTextSizes(height, 5));\n//\t\n//\t\t}\n\t\tlistItemView.KeyIndex.setText(String.valueOf(position + 1));\n\t\tlistItemView.KeyName.setText(lists.get(position).getKeyName());\n\n\t\t// convertView.setTag(R.id.tagItemCchoose, lists.get(position));\n\n\t\t// listItemView.loc_city.setText(lists.get(position).getCityName());\n\t\t// if(position ==0){\n\t\t// convertView.setBackgroundResource(R.color.grayblackish_green);\n\t\t// }\n\t\treturn convertView;\n\t}", "public View getView(int postion, View convertView, ViewGroup parent){\n\n //View custom=contextA.getLayoutInflater().inflate(resource, null);\n View custom = LayoutInflater.from(context).inflate(R.layout.item, parent, false );\n TextView txtIdLop=custom.findViewById(R.id.txtID);\n TextView txtTenLop=custom.findViewById(R.id.txtTenLop);\n TextView txtNganh=custom.findViewById(R.id.txtTenNganh);\n\n Lop lop=lopList.get(postion);\n txtIdLop.setText(String.valueOf(lop.getIdlop()));\n txtTenLop.setText(lop.getTenLop());\n txtNganh.setText(lop.getNganh());\n\n return custom;\n }", "TaskukirjaListAdapter(Context context) { mInflater = LayoutInflater.from(context); }", "@Override\n\tpublic View getView(int position, View itemView, ViewGroup parent) {\n\t\tViewHolder holder = null;\n\n\t\tif (itemView == null)\n\t\t{\n\t\t\titemView = layoutInflater.inflate(R.layout.homeblock_item, parent, false);\n\n\t\t\tholder = new ViewHolder();\n\t\t\t//\tholder.imgProductImage = (ImageView) itemView.findViewById(R.id.imgProductImage);\n\n\t\t\tholder.imgProductImage = (NetworkImageView) itemView.findViewById(R.id.imgProductImage);\n\t\t\tholder.txtProductName=(TextView)itemView.findViewById(R.id.txtProductTitle);\n\t\t\tholder.txtDescreption=(TextView)itemView.findViewById(R.id.txtProductdescrebption);\n\t\t\tholder.txtShopNow=(TextView)itemView.findViewById(R.id.txtshopnow);\n\n\t\t\tint\tindividualItemHeight=(IOUtils.getHieghtOfScreen(mContext)/2)+(80*(int)mContext.getResources().getDisplayMetrics().density);\n\t\t\tAbsListView.LayoutParams param = new AbsListView.LayoutParams(\n\t\t\t\t\tandroid.view.ViewGroup.LayoutParams.MATCH_PARENT, individualItemHeight);\n\t\t\titemView.setLayoutParams(param);\n\n\t\t\titemView.setTag(holder);\n\t\t}\n\n\t\tholder = (ViewHolder) itemView.getTag();\n\t\tIOUtils.setImageToNetworkImageView(holder.imgProductImage, modelWishlist.get(position).getImageUrl());\n\n\t\tholder.txtProductName.setText(\"\"+modelWishlist.get(position).getTitle());\n\t\tholder.txtDescreption.setText(\"\"+modelWishlist.get(position).getType());\n\n\t\treturn itemView;\n\t}", "@Override\n //METODO CLAVE QUE MEZCLA TODO\n //coge cada elemento y se dibuja\n public View getView(int position, View convertView, ViewGroup parent) {\n ViewHolder holder;\n// si es null (q nunca ha salido en la app lo carga y lo guarda en holder.nameTextView)\n if(convertView== null){\n\n //inflamos la vista personalizada que nos ha llegado\n\n //IMPORTANTE aqui es donde el adaptador infla el layout que hemos hecho antes (list_item) que nos servirá\n // de plantilla para rellenar de datos.\n LayoutInflater layoutInflater = LayoutInflater.from(this.context);\n convertView=layoutInflater.inflate(R.layout.list_item, null);\n\n holder = new ViewHolder();\n //hacemos el findView de la view que hemos inflado\n holder.nameTextView =convertView.findViewById(R.id.textView);\n convertView.setTag(holder);\n\n }else{\n holder = (ViewHolder) convertView.getTag();\n }\n\n //ya esta inflado y ahora lo rellenamos connuestros datos dependiendo de la posicion\n String currentName = nombres.get(position);\n\n //ahora cargamos a ese textView el texto\n holder.nameTextView.setText(currentName);\n\n //devolvemos la vista inflada y modificada con nuetsros datos\n return convertView;\n\n }", "public View getView(final int position, View view, ViewGroup parent) {\n final ViewHolder holder;\n\n //LayoutInflater inflator = activity.getLayoutInflater();\n\n if (view == null) {\n holder = new ViewHolder();\n view = inflater.inflate(R.layout.drawer_list_item, null);//gridview_row //fra_browse_gridview_item\n holder.txtName = (CustomTextView) view.findViewById(R.id.txt_item_name);\n holder.imgIcon = (ImageView) view.findViewById(R.id.icon);\n\n\n view.setTag(holder);\n } else {\n //holder = (ViewHolder) view.getTag();\n holder = (ViewHolder) view.getTag();\n }\n\n holder.txtName.setText(listName[position]);\n\n\n if (mstr_lang.equals(org.undp_iwomen.iwomen.utils.Utils.ENG_LANG)) {\n holder.txtName.setTypeface(MyTypeFace.get(mContext, MyTypeFace.NORMAL));\n\n } else if (mstr_lang.equals(org.undp_iwomen.iwomen.utils.Utils.MM_LANG)) {\n holder.txtName.setTypeface(MyTypeFace.get(mContext, MyTypeFace.ZAWGYI));\n\n }\n\n\n holder.imgIcon.setImageResource(listicon[position]);\n\n return view;\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n String status = getItem(position);\n // Check if an existing view is being reused, otherwise inflate the view\n // Lookup view for data population\n // Populate the data into the template view using the data object\n\n //if (!wodata.status.equals(null))\n\n // Return the completed view to render on screen\n return convertView;\n }", "public View getView(int position, View convertView, ViewGroup parent) {\n\n\t\tLayoutInflater mInflater = LayoutInflater.from(parent.getContext());\n\n\t\tif (convertView == null) {\n\n\t\t\tconvertView = mInflater.inflate(\n\t\t\t\t\tR.layout.my_items_list_layout_linear, null);\n\n\t\t\tholder = new ViewHolder();\n\t\t\tholder.position = position;\n\t\t\tholder.name = (TextView) convertView\n\t\t\t\t\t.findViewById(R.id.tvMyItemName);\n\t\t\tholder.name.setTypeface(Typeface.createFromAsset(\n\t\t\t\t\tmContext.getAssets(), \"fonts/dungeon.ttf\"));\n\t\t\tholder.charges = (TextView) convertView\n\t\t\t\t\t.findViewById(R.id.tvCharges);\n\t\t\tholder.charges.setTypeface(Typeface.createFromAsset(\n\t\t\t\t\tmContext.getAssets(), \"fonts/dungeon.ttf\"));\n\t\t\tholder.bFire = (Button) convertView.findViewById(R.id.bFire);\n\t\t\tholder.bFire.setOnClickListener(MyItemAdapter.this);\n\t\t\tholder.bFire.setTag(position);\n\t\t\tholder.bDelete = (Button) convertView.findViewById(R.id.bDelete);\n\t\t\tholder.bFire.setOnClickListener(MyItemAdapter.this);\n\t\t\tholder.bDelete.setTag(position);\n\n\t\t\tconvertView.setTag(holder);\n\n\t\t} else {\n\n\t\t\tholder = (ViewHolder) convertView.getTag();\n\n\t\t}\n\t\tholder.bFire = (Button) convertView.findViewById(R.id.bFire);\n\t\tholder.bFire.setOnClickListener(MyItemAdapter.this);\n\t\tholder.bFire.setTag(position);\n\t\tMyItem row = MyItemAdapter.rows.get(position);\n\t\tholder.name.setText(row.getName());\n\t\tholder.name.setTypeface(Typeface.createFromAsset(mContext.getAssets(),\n\t\t\t\t\"fonts/dungeon.ttf\"));\n\t\tholder.charges.setTypeface(Typeface.createFromAsset(\n\t\t\t\tmContext.getAssets(), \"fonts/dungeon.ttf\"));\n\t\tholder.charges.setText(CHARGES_MESSAGE + row.getItemCharges());\n\t\tholder.bDelete = (Button) convertView.findViewById(R.id.bDelete);\n\t\tholder.bDelete.setOnClickListener(MyItemAdapter.this);\n\t\tholder.bDelete.setTag(position);\n\n\t\treturn convertView;\n\n\t}", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n view = convertView;\n //Log.e(\"getView \", \"getView\");\n\n if (convertView == null) {\n holder = new ViewHolder();\n\n view = mInflater.inflate(R.layout.chat_list_item, null,\n false);\n holder.textViewChatItemHeading = (TextView) view\n .findViewById(R.id.chatlist_heading);\n holder.textViewChatText = (TextView) view\n .findViewById(R.id.chatlist_updated_text);\n\n holder.txtviewChatCount = (TextView) view\n .findViewById(R.id.chatlist_updated_count);\n\n holder.txtViewChatTime = (TextView) view\n .findViewById(R.id.chatlist_time);\n\n holder.imageViewCar = (ImageView) view\n .findViewById(R.id.chatlist_car_image);\n\n holder.txtViewName = (TextView) view\n .findViewById(R.id.chatlist_Name);\n view.setTag(holder);\n } else {\n holder = (ViewHolder) view.getTag();\n }\n if (mChatListItems.get(position).getChat_with().equals(\"dealer\")) {\n DealerChatListItem mItem = (DealerChatListItem) mChatListItems.get(position);\n holder.textViewChatItemHeading.setText(mItem.getVariantId());\n holder.textViewChatText.setText(mItem.getLastchatmsg()/*\"i will go to wonderland hurray or awwwwwww\"*/);\n if (mItem.getTimestamp() != null)\n holder.txtViewChatTime.setText(/*mItem.getLastchattime()*/sdf.format(new Date(Long.parseLong(mItem.getTimestamp()))));\n else\n holder.txtViewChatTime.setText(mItem.getLastchattime());\n\n holder.txtViewName.setText(mItem.getName()/*\"10:00 pm\"*/);\n if (mChatListItems.get(position).getid() != null) {\n if (mMaxId < Integer.parseInt(mChatListItems.get(position).getid())) {\n mMaxId = Integer.parseInt(mChatListItems.get(position).getid());\n }\n }\n holder.txtviewChatCount.setVisibility(View.GONE);\n holder.textViewChatText.setTextColor(Color.BLACK);\n holder.textViewChatText.setTypeface(Typeface.DEFAULT);\n if (mItem.getUnreadmsgcount() != null && !mItem.getUnreadmsgcount().isEmpty() && Integer.parseInt(mItem.getUnreadmsgcount()) > 0 && mItem.getLastchatmsg().length() != 0) {\n holder.txtviewChatCount.setVisibility(View.VISIBLE);\n holder.txtviewChatCount.setText(mItem.getUnreadmsgcount());\n //holder.textViewChatText.setTextColor(Color.GREEN);\n holder.textViewChatText.setTypeface(Typeface.DEFAULT_BOLD);\n }\n imageLoader.displayImage(mItem.getImageurl(), holder.imageViewCar, options);\n Log.e(\"setDataInList \", \"mItem.getName() \" + mItem.getName());\n\n } else if (mChatListItems.get(position).getChat_with().equals(\"suppportuser\")) {\n ExpertChatListItem mItem = (ExpertChatListItem) mChatListItems.get(position);\n holder.textViewChatItemHeading.setText(mItem.getSupportroomname());\n holder.textViewChatText.setText(mItem.getLastchatmsg());\n holder.txtViewChatTime.setText(mItem.getLastchattime());\n if (mItem.getUnreadmsgcount() != null && !mItem.getUnreadmsgcount().isEmpty() && Integer.parseInt(mItem.getUnreadmsgcount()) > 0) {\n holder.txtviewChatCount.setVisibility(View.VISIBLE);\n holder.txtviewChatCount.setText(mItem.getUnreadmsgcount());\n }\n }\n return view;\n }", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tViewHolder holder1 = null;\n\t\tViewHolder holder2 = null;\n\t\tint type = getItemViewType(position);\n\t\tif (convertView == null) {\n\t\t\tswitch (type) {\n\t\t\tcase (TYPE_1): {\n\t\t\t\tconvertView = mInflater.inflate(\n\t\t\t\t\t\tR.layout.other_setting_item_list, null);\n\t\t\t\tholder1 = new ViewHolder();\n\t\t\t\tholder1.itemName = (TextView) convertView\n\t\t\t\t\t\t.findViewById(R.id.item_name);\n\t\t\t\tholder1.itemSetting = (EditText) convertView\n\t\t\t\t\t\t.findViewById(R.id.item_setting);\n\t\t\t\tholder1.pageLeft = (ImageView) convertView\n\t\t\t\t\t\t.findViewById(R.id.page_left);\n\t\t\t\tholder1.pageRight = (ImageView) convertView\n\t\t\t\t\t\t.findViewById(R.id.page_right);\n\n\t\t\t\tconvertView.setTag(holder1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase (TYPE_2): {\n\t\t\t\tconvertView = mInflater.inflate(R.layout.activity_common_list2,\n\t\t\t\t\t\tnull);\n\t\t\t\tholder2 = new ViewHolder();\n\t\t\t\tholder2.itemName = (TextView) convertView\n\t\t\t\t\t\t.findViewById(R.id.item_name);\n\t\t\t\tholder2.pageRight = (ImageView) convertView\n\t\t\t\t\t\t.findViewById(R.id.page_right);\n\t\t\t\tconvertView.setTag(holder2);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tswitch (type) {\n\t\t\tcase TYPE_1: {\n\t\t\t\tholder1 = (ViewHolder) convertView.getTag();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase TYPE_2: {\n\t\t\t\tholder2 = (ViewHolder) convertView.getTag();\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tswitch (type) {\n\t\tcase (TYPE_1): {\n\t\t\tif (null != mCommonItemList.get(position).getItemName()) {\n\t\t\t\tholder1.itemName.setText(mCommonItemList.get(position)\n\t\t\t\t\t\t.getItemName());\n\n\t\t\t}\n\t\t\tif (null != mCommonItemList.get(position).getPageLeft()) {\n\t\t\t\tholder1.pageLeft.setImageDrawable(mCommonItemList.get(position)\n\t\t\t\t\t\t.getPageLeft());\n\t\t\t\tholder1.pageLeft.setVisibility(View.VISIBLE);\n\t\t\t\tholder1.itemSetting.setVisibility(View.VISIBLE);\n\n\t\t\t} else {\n\t\t\t\tholder1.pageLeft.setImageDrawable(null);\n\t\t\t\tholder1.pageLeft.setVisibility(View.GONE);\n\t\t\t}\n\t\t\tif (null != mCommonItemList.get(position).getItemSetting()) {\n\t\t\t\t// TODO\n\t\t\t\tholder1.itemSetting.setText(mCommonItemList.get(position)\n\t\t\t\t\t\t.getItemSetting());\n\t\t\t\tholder1.itemSetting.setVisibility(View.VISIBLE);\n\t\t\t} else {\n\t\t\t\tholder1.itemSetting.setText(null);\n\t\t\t\tholder1.itemSetting.setVisibility(View.GONE);\n\t\t\t}\n\t\t\tif (null != mCommonItemList.get(position).getPageRight()) {\n\t\t\t\tholder1.pageRight.setImageDrawable(mCommonItemList\n\t\t\t\t\t\t.get(position).getPageRight());\n\t\t\t\tholder1.pageRight.setVisibility(View.VISIBLE);\n\t\t\t} else {\n\t\t\t\tholder1.pageRight.setImageDrawable(null);\n\t\t\t\tholder1.pageRight.setVisibility(View.GONE);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t\tcase (TYPE_2): {\n\t\t\tif (null != mCommonItemList.get(position).getItemName()) {\n\t\t\t\tholder2.itemName.setText(mCommonItemList.get(position)\n\t\t\t\t\t\t.getItemName());\n\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t}\n\n\t\treturn convertView;\n\t}", "@Override\r\n public View getView(int position, View convertView,ViewGroup parent) {\n Place items = getItem(position);\r\n // Check if an existing view is being reused, otherwise inflate the view\r\n if (convertView == null) {\r\n convertView = LayoutInflater.from(getContext()).inflate(R.layout.place_listview_layout, parent, false);\r\n }\r\n\r\n TextView location_name = convertView.findViewById(R.id.location_name);\r\n TextView date = convertView.findViewById(R.id.date);\r\n TextView num_visitor = convertView.findViewById(R.id.num_visitor);\r\n\r\n location_name.setText(items.getLocation());\r\n\r\n String[] updatedTime = items.getDate().split(\"-\");\r\n date.setText(updatedTime[1]);\r\n\r\n int total = Integer.parseInt(items.getNum_female()) + Integer.parseInt(items.getNum_male());\r\n num_visitor.setText(String.valueOf(total));\r\n\r\n return convertView;\r\n }", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tfinal BiSMoShow mShow = (BiSMoShow)getItem(position);\n\t\t\n\t\tView rowView = convertView;\n\t\tfinal ViewHolder holder;\n\t\t/*if (null == convertView)*/ \n\t\t{\n\t\t\trowView = mInflater.inflate(R.layout.showlistadapter, null);\n\t\t\tholder = new ViewHolder();\n\t\t\tholder.showTitle = (TextView)rowView.findViewById(R.id.showTitle);\n\t\t\tholder.showTotalVotes = (TextView)rowView.findViewById(R.id.totalVotes);\n\t\t\tholder.showDetails = (TextView)rowView.findViewById(R.id.showDetail);\n\t\t} \n\t\t\n\t\tholder.showTitle.setText(mShow.getShowTitle());\n\t\tholder.showDetails.setText(mShow.getShowParam());\n\t\tholder.showTotalVotes.setText(\"\"+mShow.getTotalVotes());\n\t\t\n\t\tif (position == BismoHelper.LAST_SELECTED_SHOW_INDEX) {\n\t\t\tAnimation animation = AnimationUtils.loadAnimation(mContext, R.anim.hyperspace_jump);\n\t\t\trowView.startAnimation(animation);\n\t\t\tBismoHelper.LAST_SELECTED_SHOW_INDEX = -1;\n//\t\t\tRelativeLayout layout = (RelativeLayout) rowView.findViewById(R.id.adapter_layout);\n//\t\t\tlayout.setBackgroundResource(R.drawable.translate);\n//\t\t\t\n//\t\t\tTransitionDrawable transition = (TransitionDrawable) layout.getBackground();\n//\t\t\ttransition.startTransition(500);\n//\t\t\ttransition.reverseTransition(500);\n\n\t\t}\n\t\t\n\t\treturn rowView;\n\t}", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tViewHolder vh;\n\t\tMyGeoFenceCont fence = (MyGeoFenceCont) getItem(position);\n\n if (convertView == null) {\n \tvh = new ViewHolder();\n \tif(Base.OBDApp.landScapeMode == 1)\n\t \tconvertView = LayoutInflater.from(baseAct).inflate(\n\t\t\t\t\t\tR.layout.gfence_item, null);\n \telse\n\t \tconvertView = LayoutInflater.from(baseAct).inflate(\n\t\t\t\t\t\tR.layout.gfence_item_p, null); \t\n\n \tvh.fenceName = (TextView) convertView.findViewById(R.id.gfence_name);\n \tvh.fenceAddr = (TextView) convertView.findViewById(R.id.gfence_addr);\n \tvh.fenceImgv = (ImageView) convertView.findViewById(R.id.gfence_head);\n \tvh.detail = convertView.findViewById(R.id.gfence_detail);\n \tvh.detail.setTag(fence);\n \tconvertView.setTag(vh); \t\n }\n else{\n \tvh = (ViewHolder) convertView.getTag();\n }\n convertView.setOnTouchListener(new OnTouchListener(){\n\n\t\t\t@Override\n\t\t\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif(event.getAction() == MotionEvent.ACTION_DOWN){\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(event.getAction() == MotionEvent.ACTION_MOVE)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(event.getAction() == MotionEvent.ACTION_UP)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t});\n vh.fenceName.setText(fence.name); \n vh.fenceAddr.setText(fence.address);\n\n \n\t\treturn convertView;\n\t}", "@Override\n\t\tpublic View getView(final int position, View convertView, ViewGroup parent) {\n\t\t\tListItemView listItemView = new ListItemView();\n\t\t\tif (convertView == null) {\n\t\t\t\tconvertView = listContainer.inflate(R.layout.book_download_item, null);\n\t\t\t\tlistItemView.cover = (ImageView) convertView.findViewById(R.id.cover_iv);\n\t\t\t\tlistItemView.nameTv = (TextView) convertView.findViewById(R.id.name_tv);\n\t\t\t\tlistItemView.downNumberTv = (TextView) convertView.findViewById(R.id.down_number_tv);\n\t\t\t\tlistItemView.descTv = (TextView) convertView.findViewById(R.id.desc_tv);\n\t\t\t\tlistItemView.statusTv = (TextView) convertView.findViewById(R.id.status_tv);\n\t\t\t\tlistItemView.bar = (ProgressBar) convertView.findViewById(R.id.progress_bar);\n\t\t\t\tlistItemView.deleteTv = (TextView) convertView.findViewById(R.id.delete_tv);\n\t\t\t\tconvertView.setTag(listItemView);\n\t\t\t} else {\n\t\t\t\tlistItemView = (ListItemView) convertView.getTag();\n\t\t\t}\n\t\t\tMyLog.d(\"bookAdapter\", books.get(position).getName()+\"\");\n//\t\t\tDrawable drawable = Tool.getBitmapByWidth(vector.get(position).getCover(),\n//\t\t\t\t\t Tool.getwindowWidth(context)/3-20, \n//\t\t\t\t\t (Tool.getwindowWidth(context)/3-20)*4/3, 0);\n\t\t\t//listItemView.cover.setImageDrawable(drawable);\n\t\t\tlistItemView.cover.setImageBitmap(Tool.getImageThumbnail(books.get(position).getCover(),\n\t\t\t\t\tTool.getwindowWidth(context)/3-20,(Tool.getwindowWidth(context)/3-20)*4/3));\n\t\t\t\n\t\t\tlistItemView.nameTv.setText(books.get(position).getName());\n\t\t\t\n\t\t\tlistItemView.downNumberTv.setText(books.get(position).getDownNumber() + \"人下载\");\n//\t\t\tlistItemView.SizeTv.setText(getFileSize(books.get(position).get()));\n\t\t\tlistItemView.descTv.setText(books.get(position).getDescription());\n\t\t\tif (!books.get(position).isIsdownload()) {\n\t\t\t\tif (code.equals(books.get(position).getCode())) {\n\t\t\t\t\tDrawable rightImg = getResources().getDrawable(R.drawable.downloading);\n\t\t\t\t\t// 调用setCompoundDrawables时,必须调用Drawable.setBounds()方法,否则图片不显示\n\t\t\t\t\trightImg.setBounds(0, 0, rightImg.getMinimumWidth(), rightImg.getMinimumHeight());\n\t\t\t\t\tlistItemView.statusTv.setCompoundDrawables(null, rightImg, null, null);\n\t\t\t\t\tlistItemView.statusTv.setText(getString(R.string.downloading));\n\t\t\t\t\tlistItemView.bar.setMax(100);\n\t\t\t\t\tlistItemView.bar.setProgress(bookCurrent);\n\t\t\t\t\tlistItemView.bar.setSecondaryProgress(fileCurrent);\n\t\t\t\t} else {\n\t\t\t\t\tDrawable rightImg = getResources().getDrawable(R.drawable.wait_download);\n\t\t\t\t\t// 调用setCompoundDrawables时,必须调用Drawable.setBounds()方法,否则图片不显示\n\t\t\t\t\trightImg.setBounds(0, 0, rightImg.getMinimumWidth(), rightImg.getMinimumHeight());\n\t\t\t\t\tlistItemView.statusTv.setCompoundDrawables(null, rightImg, null, null);\n\t\t\t\t\tlistItemView.statusTv.setText(getString(R.string.wait_downloading));\n\t\t\t\t\tlistItemView.bar.setMax(100);\n\t\t\t\t\tlistItemView.bar.setProgress(0);\n\t\t\t\t\tlistItemView.bar.setSecondaryProgress(0);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tDrawable rightImg = getResources().getDrawable(R.drawable.wait_download);\n\t\t\t\t// 调用setCompoundDrawables时,必须调用Drawable.setBounds()方法,否则图片不显示\n\t\t\t\trightImg.setBounds(0, 0, rightImg.getMinimumWidth(), rightImg.getMinimumHeight());\n\t\t\t\tlistItemView.statusTv.setCompoundDrawables(null, rightImg, null, null);\n\t\t\t\tlistItemView.statusTv.setText(getString(R.string.download_fail));\n\t\t\t\tlistItemView.bar.setMax(100);\n\t\t\t\tlistItemView.bar.setProgress(0);\n\t\t\t\tlistItemView.bar.setSecondaryProgress(0);\n\t\t\t\t\n\t\t\t}\n\t\t\tif (candelete == position) {\n\t\t\t\tlistItemView.deleteTv.setVisibility(View.VISIBLE);\n\t\t\t\tlistItemView.statusTv.setVisibility(View.GONE);\n\t\t\t} else {\n\t\t\t\tlistItemView.deleteTv.setVisibility(View.GONE);\n\t\t\t\tlistItemView.statusTv.setVisibility(View.VISIBLE);\n\t\t\t}\n\t\t\tconvertView.setOnClickListener(new OnClickListener() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\tif (!app.isDownLoading) {\n\t\t\t\t\t\tcandelete = position;\n\t\t\t\t\t\tnotifyDataSetChanged();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tshowToast(\"下载中无法进行操作\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tlistItemView.deleteTv.setOnClickListener(new OnClickListener() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\tdeleteBook(position);\n\t\t\t\t\tcandelete =-1;\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn convertView;\n\t\t}", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent)\n\t{\n\t\tView row = convertView;\n\t\t// a static holder. From what I gather this makes things more efficient. Other tutorials didn't use it\n\t\tVideoItemHolder holder = null;\n\t\tif(row == null)\n\t\t{\n\t\t\tLayoutInflater inflater = ((Activity)context).getLayoutInflater();\n\t\t\trow = inflater.inflate(layoutResourceId, parent, false);\n\t\t\t\n\t\t\tholder = new VideoItemHolder();\n\t\t\tholder.txtTitle = (TextView)row.findViewById(R.id.txtTitle);\n\t\t\trow.setTag(holder);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tholder = (VideoItemHolder)row.getTag();\n\t\t}\n\t\t\n\t\tVideoItem videoItem = data[position];\n\t\tholder.txtTitle.setText(videoItem.Title);\n\t\t\n\t\treturn row;\n\t\n\t}", "@Override\n public View getView(final int i, View view, ViewGroup viewGroup) {\n ViewHolder holder;\n LayoutInflater inflator = LayoutInflater.from(context);\n if(view == null) {\n view = inflator.inflate(R.layout.myitem, null);//解出Layout 解壓器,消耗資源\n holder = new ViewHolder();\n holder.name = (TextView)view.findViewById(R.id.textView);\n holder.statement = (TextView)view.findViewById(R.id.textView2);\n holder.img =(ImageView)view.findViewById(R.id.imageView);\n view.setTag(holder);//要加,不然listview滑動會當掉\n holder.name.setText(zooInfo[i].E_Name);\n holder.statement.setText(zooInfo[i].E_Info);\n Picasso.with(context).load(zooInfo[i].E_Pic_URL).into(holder.img);\n } else {\n holder = (ViewHolder) view.getTag();\n }\n return view;\n\n }", "@Override\n\t\tpublic View getView(final int position, View convertView, ViewGroup parent) {\n\t\t\t// A ViewHolder keeps references to children views to avoid\n\t\t\t// unneccessary calls to findViewById() on each row.\n\t\t\tViewHolder holder;\n\t\t\tIconListBean bean = beans.get(position);\n\n\t\t\t// When convertView is not null, we can reuse it directly, there is no need to reinflate it.\n\t\t\t// We only inflate a new View when the convertView supplied by ListView is null.\n\t\t\tif (convertView == null) {\n\t\t\t\tconvertView = mInflater.inflate(idHolder.getListRowLayoutId(), null);\n\n\t\t\t\t// Creates a ViewHolder and store references to the two children\n\t\t\t\t// views we want to bind data to.\n\t\t\t\tholder = new ViewHolder();\n\t\t\t\tholder.lineHead = (TextView) convertView.findViewById(idHolder.getLineHeadId());\n\t\t\t\tholder.lineBody = (TextView) convertView.findViewById(idHolder.getLineBodyId());\n\t\t\t\tif (idHolder.getLineIconId() > 0) {\n\t\t\t\t\tholder.lineIcon = (ImageView) convertView.findViewById(idHolder.getLineIconId());\n\t\t\t\t}\n\t\t\t\tint icon2Id1 = idHolder.getIntExtra(IconListIdHolder.KEY_ADDITIONAL_ICON1, -1);\n\t\t\t\tif (icon2Id1 > 0) {\n\t\t\t\t\tholder.additionalIcon1 = (ImageView) convertView.findViewById(icon2Id1);\n\t\t\t\t}\n\t\t\t\tint icon2Id2 = idHolder.getIntExtra(IconListIdHolder.KEY_ADDITIONAL_ICON2, -1);\n\t\t\t\tif (icon2Id2 > 0) {\n\t\t\t\t\tholder.additionalIcon2 = (ImageView) convertView.findViewById(icon2Id2);\n\t\t\t\t}\n\t\t\t\tconvertView.setTag(holder);\n\t\t\t} else {\n\t\t\t\t// Get the ViewHolder back to get fast access to the TextView\n\t\t\t\t// and the ImageView.\n\t\t\t\tholder = (ViewHolder) convertView.getTag();\n\t\t\t}\n\n\t\t\t// Bind the data efficiently with the holder\n\t\t\tholder.lineHead.setText(bean.getHead());\n\t\t\tholder.lineBody.setText(bean.getBody());\n\t\t\tint iconId = bean.getIconId();\n\t\t\tif (idHolder.getLineIconId() > 0 && iconId > 0) {\n\t\t\t\tholder.lineIcon.setImageResource(iconId);\n\t\t\t} else {\n\t\t\t\tholder.lineIcon.setImageResource(0);\n\t\t\t}\n\t\t\tint icon2 = bean.getIntExtra(IconListBean.KEY_ADDITIONAL_ICON1, -1);\n\t\t\tif (holder.additionalIcon1 != null) {\n\t\t\t\tif (icon2 > 0) {\n\t\t\t\t\tholder.additionalIcon1.setImageResource(icon2);\n\t\t\t\t} else {\n\t\t\t\t\tholder.additionalIcon1.setImageResource(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tint icon3 = bean.getIntExtra(IconListBean.KEY_ADDITIONAL_ICON2, -1);\n\t\t\tif (holder.additionalIcon2 != null) {\n\t\t\t\tif (icon3 > 0) {\n\t\t\t\t\tholder.additionalIcon2.setImageResource(icon3);\n\t\t\t\t} else {\n\t\t\t\t\tholder.additionalIcon2.setImageResource(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn convertView;\n\t\t}", "@Override\r\n public View getView(int position, View convertView, ViewGroup parent) {\n String name = getItem(position).getName();\r\n String price = getItem(position).getPrice();\r\n\r\n\r\n //Create the person object with the information\r\n Product person = new Product(name,price);\r\n\r\n //create the view result for showing the animation\r\n final View result;\r\n\r\n //ViewHolder object\r\n ViewHolder holder;\r\n\r\n\r\n if(convertView == null){\r\n LayoutInflater inflater = LayoutInflater.from(mContext);\r\n convertView = inflater.inflate(mResource, parent, false);\r\n holder= new ViewHolder();\r\n holder.name = (TextView) convertView.findViewById(R.id.textView1);\r\n holder.price = (TextView) convertView.findViewById(R.id.textView2);\r\n\r\n\r\n result = convertView;\r\n\r\n convertView.setTag(holder);\r\n }\r\n else{\r\n holder = (ViewHolder) convertView.getTag();\r\n result = convertView;\r\n }\r\n\r\n\r\n\r\n holder.name.setText(person.getName());\r\n holder.price.setText(person.getPrice());\r\n\r\n\r\n\r\n return convertView;\r\n }", "@Override\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\t\tHCHCDevice device = mList.get(position);\n\t\t\tViewHolder holder = null;\n\t\t\tif(convertView == null){\n\t\t\t\tconvertView = LayoutInflater.from(DeviceListActivity.this).inflate(R.layout.list_item_device, null);\n\t\t\t\tholder = new ViewHolder();\n\t\t\t\tholder.tv_name = (TextView) convertView.findViewById(R.id.tv_name);\n\t\t\t\tholder.tv_ip = (TextView) convertView.findViewById(R.id.tv_ip);\n\t\t\t\tconvertView.setTag(holder);\n\t\t\t}else{\n\t\t\t\tholder = (ViewHolder) convertView.getTag();\n\t\t\t}\n\t\t\tholder.tv_name.setText(device.getName());\n\t\t\tholder.tv_ip.setText(device.getIP());\n\t\t\treturn convertView;\n\t\t}", "@Override\n public View getView(final int i, View convertView, ViewGroup parent) {\n\n if (convertView == null) {\n li = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n convertView = li.inflate(R.layout.row_speaker, null);\n h = new ViewHolder(convertView);\n convertView.setTag(h);\n\n } else {\n h = (ViewHolder) convertView.getTag();\n }\n\n\n //___________________set data___________________\n h.sl.setText(list.get(i).sl+\". \");\n h.name.setText( list.get(i).name);\n h.topic.setText(list.get(i).topicExtra);\n\n\n /* h.theme.setText(list.get(i).themeExtra);\n h.country.setText(list.get(i).countryExtra);\n h.digit.setText(list.get(i).digitExtra);*/\n\n // hideBlankTextView();\n\n\n h.cardView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n A.setPerson(list.get(i));\n DialogFragment dialog = new InfoDialog();\n dialog.show(((AppCompatActivity) context).getSupportFragmentManager(), \"dialog\");\n }\n });\n return convertView;\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n View listItemView = convertView;\n if (listItemView == null) {\n listItemView = LayoutInflater.from(getContext()).inflate(\n R.layout.list_item, parent, false);\n }\n\n // Get the Description object located at this position in the list\n Description currentDescription = getItem(position);\n\n // Find the TextView in the list_item.xml layout with the ID description\n TextView descriptionTextView = (TextView) listItemView.findViewById(R.id.description);\n // Get the Description from the currentDescription object and set this text on\n // the descriptionTextView\n descriptionTextView.setText(currentDescription.getDescription());\n\n\n // Find the ImageView in the list_item.xml layout with the ID ic_link\n ImageView imageView1 = (ImageView) listItemView.findViewById(R.id.ic_link);\n imageView1.setImageResource(currentDescription.getImage1());\n // Find the ImageView in the list_item.xml layout with the ID image\n ImageView imageView2 = (ImageView) listItemView.findViewById(R.id.image);\n imageView2.setImageResource(currentDescription.getImage2());\n\n // Return the whole list item layout (containing 2 ImageViews and 1 TextView) so that it can be shown in\n // the ListView.\n return listItemView;\n }", "@Override\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\t\t ViewHolder viewholder = null;\n\n\t\t\t if(convertView == null)\n\t {\n\t\t\t\t viewholder = new ViewHolder();\n\t convertView = mInflater.inflate(R.layout.dialog_edit_bill_item, null);\n\t \n\t viewholder.textView1 = (TextView)convertView.findViewById(R.id.diaTextView1);\n\t \n\t convertView.setTag(viewholder);\n\t }else\n\t {\n\t \t viewholder = (ViewHolder)convertView.getTag();\n\t }\n\n\t\t\t viewholder.textView1.setText(data[position]);\n\t return convertView;\n\t\t}", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n View listItem = convertView;\n if (listItem == null) {\n listItem = layoutInflater.inflate(R.layout.listview_articoli_circolari, null);\n }\n\n LayoutObjs_listview_articoli_circolari_xml LAYOUT_OBJs;\n LAYOUT_OBJs = new LayoutObjs_listview_articoli_circolari_xml(listItem);\n // Initialize the views in the layout\n ImageView iv = LAYOUT_OBJs.image;\n TextView textView_info_circolare = LAYOUT_OBJs.textView_info_circolare;\n TextView textView_oggetto = LAYOUT_OBJs.textView_oggetto;\n TextView textView_tag = LAYOUT_OBJs.textView_tag;\n\n final ArticoloSdo<ArticoloDetailsCircolare> c = this.articoliCircolari.articoli.get(position);\n final ArticoloDetailsCircolare circolare = c.getDetails();\n\n textView_info_circolare.setText(\"Circolare n.\" + circolare.numeroCircolare + \" del \" + C_DateUtil.toDDMMYYY(circolare.dataCircolare));\n textView_oggetto.setText(circolare.oggetto);\n\n StringBuilder sb = new StringBuilder();\n for (ArticoloTagDetails tag : c.getDetails().getTags()) {\n sb.append(\" \").append(tag.getTag());\n }\n textView_tag.setText(sb.toString().trim());\n\n return listItem;\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n TweetItemFragment tweetView = (TweetItemFragment) convertView;\n if (tweetView == null) {\n tweetView = TweetItemFragment.inflate(parent);\n }\n tweetView.setItem(getItem(position));\n return tweetView;\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n\n DrawerItemHolder drawerHolder;\n View view = convertView;\n\n if (view == null) {\n LayoutInflater inflater = ((Activity) context).getLayoutInflater();\n drawerHolder = new DrawerItemHolder();\n\n view = inflater.inflate(layoutResID, parent, false);\n drawerHolder.ItemName = (TextView) view\n .findViewById(R.id.itemText);\n drawerHolder.selected = view\n .findViewById(R.id.selected);\n drawerHolder.background = (RelativeLayout) view\n .findViewById(R.id.background);\n //drawerHolder.icon = (ImageView) view.findViewById(R.id.drawer_icon);\n\n view.setTag(drawerHolder);\n\n } else {\n drawerHolder = (DrawerItemHolder) view.getTag();\n\n }\n\n DrawerItem dItem = (DrawerItem) this.drawerItemList.get(position);\n\n if(dItem.getSelected()) {\n drawerHolder.selected.setVisibility(View.VISIBLE);\n drawerHolder.background.setBackgroundColor(UIUtils.getColorWrapper(context,R.color.backgroundColor));\n }else {\n drawerHolder.selected.setVisibility(View.INVISIBLE);\n drawerHolder.background.setBackgroundColor(UIUtils.getColorWrapper(context,R.color.backgroundColor1));\n }\n /*drawerHolder.icon.setImageDrawable(view.getResources().getDrawable(\n dItem.getImgResID()));*/\n drawerHolder.ItemName.setText(dItem.getItemName());\n\n return view;\n }", "@NonNull\n @Override\n public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {\n // return super.getView(position, convertView, parent);\n\n // Grab the current item in the list\n NavType item = getItem(position);\n\n // check if it has a view\n // if it does not, then give it one\n if (convertView == null) {\n convertView = LayoutInflater.\n from(getContext()).\n inflate(R.layout.listview_template, parent, false);\n }\n\n TextView name = convertView.findViewById(R.id.homeNavText);\n ImageView image = convertView.findViewById(R.id.homeNavIcon);\n name.setText(item.getName());\n image.setImageResource(item.getImage());\n\n return convertView;\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n if (convertView == null) {\n convertView = ListAdapterInflater.createLayout(resourceLayout, mContext, parent);\n }\n\n setupItemView(convertView, getItem(position));\n\n return convertView;\n }", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n View v = View.inflate(mContext, R.layout.item_category_list, null);\n\n TextView categoryName = (TextView)v.findViewById(R.id.category_name);\n categoryName.setText(categories.get(position).getName());\n\n v.setTag(categories.get(position).getId());\n return v;\n }", "@Override\n\t\t\tpublic View getView(int position,View convertView,ViewGroup parent){\n\t\t\t\tconvertView = getLayoutInflater().inflate(R.layout.main_griditem_home, null);\n\t\t\t\tView view = convertView.findViewById(R.id.item);\n\t\t\t\t// TextView txt_notice = (TextView)\n\t\t\t\t// convertView.findViewById(R.id.txt_notice);\n\t\t\t\tif((position + 1) <= menus.size()){\n\t\t\t\t\tMenuItem menuItem = menus.get(position);\n\t\t\t\t\tint Id = getResources().getIdentifier(menuItem.getIcon(), \"drawable\", mContext.getPackageName());// 这个是图片id\n\t\t\t\t\tif(Id == 0){\n\t\t\t\t\t\tview.setBackgroundResource(R.color.white);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tview.setBackgroundDrawable(getResources().getDrawable(Id));\n\t\t\t\t\t}\n\t\t\t\t\tTextView txt_notice = (TextView) convertView.findViewById(R.id.txt_notice);\n\t\t\t\t\ttxt_notice.setText(menuItem.getName());\n\t\t\t\t\ttxt_notice.setVisibility(0);\n\t\t\t\t\t// updateNum(menuItem, txt_notice);\n\t\t\t\t}else{\n\t\t\t\t\tview.setBackgroundResource(R.drawable.kongbai);\n\t\t\t\t}\n\t\t\t\tAbsListView.LayoutParams layoutParams = new AbsListView.LayoutParams(LayoutParams.MATCH_PARENT, (int) (app.getScreenHeight() * 0.15));\n\t\t\t\tconvertView.setLayoutParams(layoutParams);\n\t\t\t\treturn convertView;\n\t\t\t}", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n Purchase purchase = getItem(position);\n // Check if an existing view is being reused, otherwise inflate the view\n ViewHolder viewHolder; // view lookup cache stored in tag\n\n final View result;\n\n if (convertView == null) {\n\n viewHolder = new ViewHolder();\n LayoutInflater inflater = LayoutInflater.from(getContext());\n convertView = inflater.inflate(R.layout.history_purchase, parent, false);\n viewHolder.purchaseID = (TextView) convertView.findViewById(R.id.purchase_id);\n viewHolder.purchaseDate = (TextView) convertView.findViewById(R.id.purchase_date);\n viewHolder.totalPrice = (TextView) convertView.findViewById(R.id.purchase_price);\n viewHolder.paidPrice = (TextView) convertView.findViewById(R.id.purchase_paid_price);\n viewHolder.purchaseProducts = (LinearLayout) convertView.findViewById(R.id.purchase_prdsucts);\n viewHolder.item = (LinearLayout) convertView.findViewById(R.id.item);\n\n result=convertView;\n\n convertView.setTag(viewHolder);\n } else {\n viewHolder = (ViewHolder) convertView.getTag();\n result=convertView;\n }\n\n viewHolder.purchaseID.setText(purchase.getUuid().toString().substring(0, 6));\n viewHolder.purchaseDate.setText(purchase.getDateString());\n viewHolder.totalPrice.setText(String.format (\"%.2f\", purchase.getTotalPrice()) +\"€\");\n viewHolder.paidPrice.setText(String.format (\"%.2f\", purchase.getPaidPrice()) +\"€\");\n viewHolder.purchaseProducts.removeAllViews();\n\n for(int i = 0; i < purchase.getProducts().size(); i++){\n TextView textView = new TextView(this.mContext);\n textView.setText(purchase.getProducts().get(i).getName() + \" - \" + String.format (\"%.2f\", purchase.getProducts().get(i).getPrice())+\"€\");\n textView.setTextSize((float) 17);\n textView.setTextColor(Color.parseColor(\"#003845\"));\n Typeface font = Typeface.createFromAsset(mContext.getAssets(), \"raleway.ttf\");\n textView.setTypeface(font);\n\n LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);\n params.setMargins(0,0,0,10);\n textView.setLayoutParams(params);\n\n viewHolder.purchaseProducts.addView(textView);\n }\n\n //EXTRA FEATURE\n viewHolder.item.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n LinearLayout itemView = (LinearLayout) v;\n TextView objectID = (TextView) itemView.findViewById(R.id.purchase_id);\n\n Toast.makeText(mContext, \"ID: \" + objectID.getText(), Toast.LENGTH_SHORT).show();\n\n Preferences preferences = new Preferences(mContext);\n ArrayList<Purchase> history = new ArrayList<>();\n try {\n history = preferences.getPurchases();\n } catch (JSONException e) {\n e.printStackTrace();\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n ArrayList<Product> newProducts = new ArrayList<>();\n for(int i=0; i<history.size(); i++){\n String id = history.get(i).getUuid().toString().substring(0, 6);\n if(objectID.getText().equals(id)){\n newProducts = history.get(i).getProducts();\n break;\n }\n }\n\n try {\n ArrayList<Product> basketP = null;\n basketP = preferences.getBasket();\n\n if (basketP.size() + newProducts.size() <= 10) {\n for (int i = 0; i < newProducts.size(); i++) {\n basketP.add(newProducts.get(i));\n }\n\n preferences.saveBasket(basketP);\n Toast.makeText(mContext, \"Products added to your basket with success.\", Toast.LENGTH_SHORT).show();\n }\n else{\n Toast.makeText(mContext, \"You can only have 10 items in basket.\", Toast.LENGTH_SHORT).show();\n }\n\n } catch (JSONException e) {\n Toast.makeText(mContext, \"There was a problem adding products to basket, please try again.\", Toast.LENGTH_LONG).show();\n }\n }\n });\n\n return convertView;\n }", "@Override\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\t\tLayoutInflater inflater=(LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);\n\t\t\tView v=inflater.inflate(R.layout.custom, null);\n\t\t\t\n\t\t\ttv1=(TextView)v.findViewById(R.id.text1);\n\t\t\ttv1.setText(names[position]);\n\t\t\t\n\t\t\t\n\t\t\ttv2=(TextView)v.findViewById(R.id.text2);\n\t\t\ttv2.setText(phones[position]);\n\t\t\t\n\t\t\t\n\t\t\treturn v;\n\t\t}", "@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n\n View viewProduct;\n if (convertView == null) {\n viewProduct = View.inflate(parent.getContext(), R.layout.item_row, null);\n } else viewProduct = convertView;\n\n ItemInfo itemInfo = (ItemInfo) getItem(position);\n ((TextView) viewProduct.findViewById(R.id.txt_title)).setText( itemInfo.title);\n ((TextView) viewProduct.findViewById(R.id.txt_desc)).setText(itemInfo.description);\n Picasso.with(G.context).load(itemInfo.imageUrl).into((ImageView) viewProduct.findViewById(R.id.img_Icon));\n\n\n return viewProduct;\n }" ]
[ "0.75785655", "0.75785077", "0.74813646", "0.7470819", "0.7460745", "0.74201554", "0.7415927", "0.7409042", "0.74084246", "0.73955524", "0.73616743", "0.73597765", "0.7350081", "0.73461086", "0.7315082", "0.73087686", "0.7289063", "0.7288447", "0.7280073", "0.726727", "0.72591347", "0.7252288", "0.7245674", "0.72410136", "0.72409785", "0.72321546", "0.7230638", "0.72223675", "0.7215536", "0.72038734", "0.7196886", "0.7194738", "0.71920294", "0.7187858", "0.71835077", "0.7157062", "0.71502656", "0.7145558", "0.7144465", "0.71442413", "0.71435344", "0.71347594", "0.71306014", "0.7127037", "0.7118552", "0.7115016", "0.7107374", "0.7091921", "0.70741546", "0.7073107", "0.70723253", "0.706861", "0.7061507", "0.7059176", "0.70522743", "0.7050566", "0.705039", "0.70500624", "0.7035795", "0.7031899", "0.70232576", "0.7020432", "0.70184034", "0.7017791", "0.70134425", "0.7012935", "0.7010721", "0.7001681", "0.6998986", "0.699763", "0.69895256", "0.69812864", "0.6978492", "0.6977153", "0.6976482", "0.6974981", "0.6972475", "0.69720316", "0.69719994", "0.69715434", "0.69661736", "0.69658095", "0.6962681", "0.6956498", "0.6955365", "0.6949011", "0.69450724", "0.69449896", "0.6943701", "0.6939216", "0.6934303", "0.69324046", "0.69316727", "0.69303375", "0.69282", "0.6927462", "0.69267774", "0.6926569", "0.6924857", "0.692104", "0.69160146" ]
0.0
-1
TODO 6. Setup data into view holder
@Override public void onBindViewHolder(ViewHolder holder, int position) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract void fillData(View itemView, T data);", "@Override\n public void bindView(View view, Context context, Cursor cursor) {\n // Find fields to populate in inflated template\n\n TextView name = (TextView) view.findViewById(R.id.label3nazwa);\n TextView date = (TextView) view.findViewById(R.id.label1data);\n TextView type = (TextView) view.findViewById(R.id.label2typ);\n TextView value = (TextView) view.findViewById(R.id.label4wartosc);\n // Extract properties from cursor\n String nazwa = cursor.getString(cursor.getColumnIndexOrThrow(\"nazwa\"));\n String typ_id = cursor.getString(cursor.getColumnIndexOrThrow(\"typ_id\"));\n String data = cursor.getString(cursor.getColumnIndexOrThrow(\"data\"));\n String wartosc = cursor.getString(cursor.getColumnIndexOrThrow(\"wartosc\"));\n // Populate fields with extracted properties\n name.setText(nazwa);\n date.setText(data);\n type.setText(typ_id);\n value.setText(wartosc);\n }", "@Override\n public void bindView(ViewHolder viewHolder, List payloads) {\n //call super so the selection is already handled for you\n super.bindView(viewHolder, payloads);\n\n //bind our data\n //set the text for the name\n //viewHolder.name.setText(name);\n //set the text for the description or hide\n //viewHolder.description.setText(description);\n Picasso.get().load(getUserProfile()).into(viewHolder.userProfile);\n viewHolder.userName.setText(getUserName());\n viewHolder.userLocation.setText(getUserlocation());\n viewHolder.userNumber.setText(getUserNumber());\n viewHolder.userBType.setText(getUserBloodType());\n\n\n }", "public ViewHolder(View itemView) {\n super(itemView);\n tvNature = (TextView)itemView.findViewById(R.id.item_name);\n tvAmountNature = (TextView)itemView.findViewById(R.id.item_amount);\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n /* designation_txt = (TextView) itemView.findViewById(R.id.designation_txt);\n name_txt = (TextView) itemView.findViewById(R.id.name_txt);\n number_txt = (TextView) itemView.findViewById(R.id.number_txt);*/\n\n }", "@Override\n public void prepareView() {\n }", "public ViewHolder(View view) {\n super(view);\n mView = view;\n mIdView = (TextView) view.findViewById(R.id.item_number);\n mContentView = (TextView) view.findViewById(R.id.content);\n }", "@Override\n protected void fillData(GoodsAdapter.ViewHolder holder, GoodsPageModel model) {\n holder.tvTitle.setText(model.getGoodsName());\n }", "@Override\n public void bindView(View view, Context context, Cursor cursor) {\n //Find fields to populate in inflated template\n TextView sportClubFirstName = (TextView)view.findViewById(R.id.firstNameTextView);\n TextView sportClubLastName = (TextView)view.findViewById(R.id.lastNameTextView);\n TextView sportClubSport = (TextView)view.findViewById(R.id.sportTextView);\n //Extract properties from cursor\n String firstName = cursor.getString(cursor.getColumnIndexOrThrow(MemberEntry.COLUMN_FIRST_NAME));\n String lastName = cursor.getString(cursor.getColumnIndexOrThrow(MemberEntry.COLUMN_LAST_NAME));\n String sportName = cursor.getString(cursor.getColumnIndexOrThrow(MemberEntry.COLUMN_SPORT));\n //Populate fields with extracted properties\n sportClubFirstName.setText(firstName);\n sportClubLastName.setText(lastName);\n sportClubSport.setText(sportName);\n }", "public ViewHolder (View view){\n super(view);\n jView = view;\n //tvJoin = (TextView) view.findViewById(R.id.tvGroup);\n tvGroupTitle = view.findViewById(R.id.tvGroupTitle);\n }", "private void setupItemView(View view, NewCollectedItem item) {\n if (item != null) {\n TextView nameText = view.findViewById(R.id.collected_name);\n TextView heightText = view.findViewById(R.id.collected_height);\n TextView pointsText = view.findViewById(R.id.collected_points);\n TextView positionText = view.findViewById(R.id.collected_position);\n TextView dateText = view.findViewById(R.id.collected_date);\n\n nameText.setText(item.getName());\n heightText.setText(mContext.getResources().getString(R.string.height_display,\n UIUtils.IntegerConvert(item.getHeight())));\n positionText.setText(mContext.getResources().getString(R.string.position_display,\n item.getLongitude(), item.getLatitude()));\n pointsText.setText(mContext.getResources().getString(R.string.points_display,\n UIUtils.IntegerConvert(item.getPoints())));\n dateText.setText(mContext.getResources().getString(R.string.date_display,\n item.getDate()));\n\n if (item.isTopInCountry()) {\n view.findViewById(R.id.collected_trophy).setVisibility(View.VISIBLE);\n }\n else {\n view.findViewById(R.id.collected_trophy).setVisibility(View.INVISIBLE);\n }\n\n positionText.setVisibility(View.GONE);\n dateText.setVisibility(View.GONE);\n setCountryFlag(view, item.getCountry());\n }\n }", "protected void onBindData(Context context, int position, T item, int itemLayoutId, ViewHelper2 helper){\n\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n nameTextView = (TextView) itemView.findViewById(R.id.user_name);\n startTextView = (TextView) itemView.findViewById(R.id.start_date);\n }", "@Override\n public void bindView(View view, Context context, Cursor cursor) {\n // Find fields to populate in inflated template\n TextView textViewListName = view.findViewById(R.id.textView_list_name);\n TextView textViewListNumber = view.findViewById(R.id.textView_list_Number);\n TextView textViewListDescription = view.findViewById(R.id.textView_sub_name);\n\n // Extract properties from cursor\n int getID = cursor.getInt(cursor.getColumnIndexOrThrow(\"food_calories\"));\n String getName = cursor.getString(cursor.getColumnIndexOrThrow(\"food_name\"));\n String getDescription = cursor.getString(cursor.getColumnIndexOrThrow(\"food_description\"));\n\n // Populate fields with extracted properties\n textViewListName.setText(getName);\n textViewListNumber.setText(String.valueOf(getID));\n textViewListDescription.setText(String.valueOf(getDescription));\n }", "private void initData(View view) {\n /*\n * the array of item which need to show in gridview\n * it contains string and a picture\n * */\n ArrayList<HashMap<String, Object>> mList = new ArrayList<HashMap<String, Object>>();\n\n\n /**\n * download info from local database\n * */\n ContentResolver contentResolver = mContext.getContentResolver();\n Uri uri = Uri.parse(\"content://com.example.root.libapp_v1.SQLiteModule.Bookpage.BookpageProvider/bookpage\");\n Cursor cursor = contentResolver.query(uri, null, null, null, null);\n if (cursor != null) {\n while (cursor.moveToNext()) {\n HashMap<String, Object> map = new HashMap<String, Object>();\n String bookname = cursor.getString(cursor.getColumnIndex(\"name\"));\n map.put(\"image\", mImgUrl+\"bookimg_\"+bookname+\".png\");\n map.put(\"text\", bookname);\n mList.add(map);\n }\n /**\n * use the new data to show in gridview\n * */\n initGridView(view, mList);\n }\n cursor.close();\n }", "public ViewHolder(View view) {\n super(view);\n mView = view;\n mTextviewTeamNumber = (TextView) view.findViewById(R.id.textviewTeamNumber);\n mImageViewTeamLogo = (ImageView) view.findViewById(R.id.imageViewTeamLogo);\n mTextViewTeamName = (TextView) view.findViewById(R.id.textViewTeamName);\n mTextViewPlayedGameNumber = (TextView) view.findViewById(R.id.textViewPlayedGameNumber);\n mTextViewTotalPoint = (TextView) view.findViewById(R.id.textViewTotalPoint);\n }", "public ViewHolder(View itemView) {\n super(itemView);\n imageView = itemView.findViewById(R.id.ivSomeImage);\n textView = itemView.findViewById(R.id.tvSomeText);\n }", "private void setRecyclerViewData() {\n\n itemList = new ArrayList<ListItem>();\n itemList.add(new RememberCardView(\"Du musst 12€ zahlen\"));\n itemList.add(new DateCardItem(\"Mo\", \"29.07.\", \"Training\", \"20:00\", \"21:45\"));\n itemList.add(new VoteCardItem(\"Welche Trikotfarbe ist besser?\"));\n }", "private void initLsitData() {\n\t\tlist = new ArrayList<View>();\n\n\t\tlist.add(new NewsMenupagerItem(Mactivity,TY).initView());\n\t\tlist.add(new NewsMenupagerItem(Mactivity,YL).initView());\n\t\tlist.add(new NewsMenupagerItem(Mactivity,QW).initView());\n\t\tlist.add(new NewsMenupagerItem(Mactivity,MV).initView());\n\n\n\t}", "private void setData() {\n\n if (id == NO_VALUE) return;\n MarketplaceItem item = ControllerItems.getInstance().getModel().getItemById(id);\n if (item == null) return;\n\n ControllerAnalytics.getInstance().logItemView(id, item.getTitle());\n\n if (item.getPhotos() != null\n && item.getPhotos().size() > 0 &&\n !TextUtils.isEmpty(item.getPhotos().get(0).getSrc_big(this)))\n Picasso.with(this).load(item.getPhotos().get(0).getSrc_big(this)).into((ImageView) findViewById(R.id.ivItem));\n else if (!TextUtils.isEmpty(item.getThumb_photo()))\n Picasso.with(this).load(item.getThumb_photo()).into((ImageView) findViewById(R.id.ivItem));\n\n adapter.updateData(item, findViewById(R.id.rootView));\n }", "protected abstract void populateView(View v, T model);", "@Override\n public void bindView(View view, Context context, Cursor cursor) {\n // Find fields to populate in inflated template\n TextView Ename = (TextView) view.findViewById(R.id.Ename);\n TextView Designation = (TextView) view.findViewById(R.id.Designation);\n TextView Salary = (TextView) view.findViewById(R.id.Salary);\n // Extract properties from cursor\n String ename = cursor.getString(cursor.getColumnIndexOrThrow(\"ename\"));\n String designation = cursor.getString(cursor.getColumnIndexOrThrow(\"designation\"));\n int salary = cursor.getInt(cursor.getColumnIndexOrThrow(\"salary\"));\n\n ImageView imgView =(ImageView)view.findViewById(R.id.ImageView01);\n\n\n imgView.setImageResource(R.drawable.ic_launcher);\n\n\n\n\n\n // Populate fields with extracted properties\n Ename.setText(ename);\n Designation.setText(designation);\n Salary.setText(String.valueOf(salary));\n }", "public void populateView() {\r\n populateHead();\r\n ArrayList arrayList = new ArrayList();\r\n arrayList.add(new AccDetailItem(\"Loan Amount\", this.account.totLoanAmt, MiscUtils.getColor(getResources(), this.account.totLoanAmt)));\r\n arrayList.add(new AccDetailItem(\"Interest Rate\", this.account.interestRate));\r\n arrayList.add(new AccDetailItem(\"Repayment Amount\", this.account.repaymentAmt, MiscUtils.getColor(getResources(), this.account.repaymentAmt)));\r\n arrayList.add(new AccDetailItem(\"Start Date\", this.account.startDt));\r\n arrayList.add(new AccDetailItem(\"End Date\", this.account.endDt));\r\n arrayList.add(new AccDetailItem(\"Status\", this.account.loanStatus));\r\n ArrayList arrayList2 = new ArrayList();\r\n arrayList2.add(new AccDetailItem(\"Outstanding Amount\", this.account.formattedOutstandingAmount, ContextCompat.getColor(getContext(), R.color.primary_red)));\r\n arrayList2.add(new AccDetailItem(\"Overdue Amount\", String.valueOf(this.account.overdueAmount), MiscUtils.getColor(getResources(), (double) this.account.overdueAmount)));\r\n arrayList2.add(new AccDetailItem(\"No. of Repayments Overdue\", this.account.overdueCount));\r\n this.list.setAdapter(new AccountDetailItemAdapter(getActivity(), arrayList));\r\n this.list2.setAdapter(new AccountDetailItemAdapter(getActivity(), arrayList2));\r\n MiscUtils.setListViewHeightBasedOnChildren(this.list);\r\n MiscUtils.setListViewHeightBasedOnChildren(this.list2);\r\n }", "private void setupView() {\n view.setName(advertisement.getTitle());\n view.setPrice(advertisement.getPrice());\n view.setDescription(advertisement.getDescription());\n view.setDate(advertisement.getDatePublished());\n view.setTags(advertisement.getTags());\n setCondition();\n if (advertisement.getImageUrl() != null) { //the url here is null right after upload\n view.setImageUrl(advertisement.getImageUrl());\n }\n }", "public ViewHolder(View view) {\n reviewAuthorTextView = (TextView) view.findViewById(R.id.list_review_author);\n reviewContentsTextView = (TextView) view.findViewById(R.id.list_review_contents);\n //reviewURLTextView = (TextView) view.findViewById(R.id.list_review_url);\n }", "public ViewHolder(View view) {\n super(view);\n mView = view;\n mIdView = (TextView) view.findViewById(R.id.id);\n mContentView = (TextView) view.findViewById(R.id.content);\n mIconView = (ImageView) view.findViewById(R.id.browserIcon);\n }", "private void initializeViews(Object object, ViewHolder holder) {\n }", "public ViewHolder(View itemView) {\n super(itemView);\n hospname= itemView.findViewById(R.id.hospname);\n address= itemView.findViewById(R.id.hospaddress);\n rrr= itemView.findViewById(R.id.rrrtext);\n hospimage= itemView.findViewById(R.id.hospital_image);\n callambulance= itemView.findViewById(R.id.bookambulancebutton);\n getroom= itemView.findViewById(R.id.bookroombutton);\n /*price= itemView.findViewById(R.id.bedprice);\n cat= itemView.findViewById(R.id.bedcat);\n bedimage= itemView.findViewById(R.id.bedimage);*/\n\n\n }", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "private void setUpViews() {\n\n updateFooterCarInfo();\n updateFooterUsrInfo();\n\n\n setResultActionListener(new ResultActionListener() {\n @Override\n public void onResultAction(AppService.ActionType actionType) {\n if (ModelManager.getInstance().getGlobalInfo() != null) {\n GlobalInfo globalInfo = ModelManager.getInstance().getGlobalInfo();\n\n switch (actionType) {\n case CarInfo:\n updateFooterCarInfo();\n break;\n case UsrInfo:\n updateFooterUsrInfo();\n break;\n case Charger:\n updateChargeStationList();\n break;\n }\n }\n }\n });\n }", "@Override\n protected void convert(BaseViewHolder baseViewHolder, String dataBean) {\n ((TextView)baseViewHolder.getView(R.id.dateText)).setText(dataBean);\n baseViewHolder.addOnClickListener(R.id.userHead);\n\n }", "@Override\n protected void onBindView(RecyclerView.ViewHolder holder, int position, Object data) {\n ((ViewHolder) holder).getBinding().setVariable(BR.click, new DetailWebItemHandler(context, list,position));\n /* ((ViewHolder) holder).getBinding().setVariable(BR.isSuccess, false);*/\n\n ((ViewHolder) holder).getBinding().setVariable(BR.dianzanClick, new DetailDianzanItemHandler(context, list, DetailVideoAdapter.this, position));\n ((ViewHolder) holder).getBinding().setVariable(BR.answerClick, new DetailAnswerItemHandler(activity, articleId, list.get(position)));\n\n ((ViewHolder) holder).getBinding().setVariable(BR.bean, ((CommentDetailBean.Data) data));\n ((ViewHolder) holder).getBinding().executePendingBindings();\n }", "@Override\n public void bindView(View view, Context context, Cursor cursor) {\n // Find fields to populate in inflated template\n TextView txtTitle = (TextView) view.findViewById(R.id.schoolTitle);\n TextView txtSchoolNo = (TextView) view.findViewById(R.id.schoolNo);\n TextView txtMajor = (TextView) view.findViewById(R.id.schoolMajor);\n TextView txtStartDate = (TextView) view.findViewById(R.id.schoolStartDate);\n TextView txtEndDate = (TextView) view.findViewById(R.id.schoolEndDate);\n TextView txtLocation = (TextView) view.findViewById(R.id.schoolLocation);\n TextView txtStatus = (TextView) view.findViewById(R.id.schoolStatus);\n\n // Extract properties from cursor\n String mTitle = cursor.getString(cursor.getColumnIndexOrThrow(\"school_title\"));\n String mSchoolNo = cursor.getString(cursor.getColumnIndexOrThrow(\"school_cardno\"));\n String mMajor = cursor.getString(cursor.getColumnIndexOrThrow(\"school_major\"));\n String mStartDate = cursor.getString(cursor.getColumnIndexOrThrow(\"start_date\"));\n String mEndDate = cursor.getString(cursor.getColumnIndexOrThrow(\"end_date\"));\n String mLocation = cursor.getString(cursor.getColumnIndexOrThrow(\"school_location\"));\n String mStatus = cursor.getString(cursor.getColumnIndexOrThrow(\"status\"));\n // Populate fields with extracted properties\n txtTitle.setText(mTitle);\n txtSchoolNo.setText(mSchoolNo);\n txtMajor.setText(mMajor);\n txtStartDate.setText(mStartDate);\n txtEndDate.setText(mEndDate);\n txtLocation.setText(mLocation);\n txtStatus.setText(mStatus);\n }", "@Override\n public void bindView(View view, Context context, Cursor cursor) {\n ViewHolder holder = (ViewHolder) view.getTag();\n\n /* Getting user details from cursor */\n String messageText = cursor.getString(holder.mTextIndex);\n Date dateSent = new Date(cursor.getInt(holder.mDateIndex));\n boolean isFromMember = cursor.getInt(holder.mIsFromMemberIndex) > 0;\n\n /* Setting user display name */\n holder.mTextView.setText(messageText);\n\n if (isFromMember) {\n ((LinearLayout) view).setGravity(Gravity.LEFT);\n holder.mImageView.setVisibility(View.VISIBLE);\n holder.mTextView.setBackgroundDrawable(context.getResources()\n .getDrawable(R.drawable.textview_chat_rounded_from));\n } else {\n ((LinearLayout) view).setGravity(Gravity.RIGHT);\n holder.mImageView.setVisibility(View.GONE);\n holder.mTextView.setBackgroundDrawable(context.getResources()\n .getDrawable(R.drawable.textview_chat_rounded_to));\n }\n\n /* Setting avatar */\n if (mMemberAvatar != null && isFromMember) {\n holder.mImageView.setImageBitmap(mMemberAvatar);\n }\n }", "@Override\n public void onBindViewHolder(DetailAdapter.ViewHolder holder, int position) {\n // - get element from your dataset at this position\n // - replace the contents of the view with that element\n //holder.mTextView.setText(mDataset[position]);\n holder.informacion.setText(mDataset[position]); //informacion es el dato que nos entrega el arreglo\n }", "private void valueToView() {\n mViewPager.setAdapter(new BreezingTestPagerAdapter(getSupportFragmentManager()));\n }", "@Override\n public void onBindViewHolder(final ViewHolder holder, int position) {\n holder.mIdView.setText(mValues.get(position).getTitle());\n holder.mContentView.setText(mValues.get(position).getDate());\n holder.itemView.setTag(mValues.get(position));\n holder.itemView.setOnClickListener(mOnClickListener);\n }", "private void setRecyclerViewData() {\n }", "private void populateViewCollections() {\n\n\t}", "@Override\n public void onBindViewHolder(ViewHolder holder, int position) {\n // - get element from your dataset at this position\n // - replace the contents of the view with that element\n\n // Individually handles each Contact in the contactList\n LeaderEntry currentEntry = leaderList.get(position);\n\n // Extracts the name of the Contact\n TextView name = holder.mTextViewName.findViewById(R.id.textView_Name);\n name.setText(currentEntry.getLeaderName());\n\n // Extracts the phone number of the Contact\n TextView number = holder.mTextViewName.findViewById(R.id.textView_Score);\n number.setText(currentEntry.getHighScore());\n\n }", "public ViewHolder(View itemView) {\n super(itemView);\n\n listName = (TextView) itemView.findViewById(R.id.listName);\n remainingItems = (TextView) itemView.findViewById(R.id.remainingItems);\n listButtonLayout = (LinearLayout) itemView.findViewById(R.id.listButtonLayout);\n btnView = (Button) listButtonLayout.findViewById(R.id.btnEditList);\n btnDeleteList = (Button) listButtonLayout.findViewById(R.id.btnDeleteList);\n\n\n }", "public ViewHolder3(View view)\n {\n super(view);\n this.view = view;\n\n this.author = (TextView) view.findViewById(R.id.author);\n this.rate = (TextView) view.findViewById(R.id.vote_by);\n this.content = (TextView) view.findViewById(R.id.my_review);\n }", "@Override\n\t\t\tpublic void setDates(RecyclerViewHolder holder, String data) {\n\t\t\t\tTextView tv= holder.getView(R.id.item_tv);\n\t\t\t\ttv.setText(data);\n\t\t\t}", "@Override\r\n\tprotected void initViews() {\n\t\t\r\n\t}", "@Override\n\tprotected void initView()\n\t{\n\n\t}", "@Override\n public void bindView(View view, Context context, Cursor cursor) {\n TextView subcode = (TextView) view.findViewById(R.id.subjectCodeListView);\n TextView subname = (TextView) view.findViewById(R.id.subjectNameListView);\n // Extract properties from cursor\n String subjectcode = cursor.getString(0);\n String subjectname = cursor.getString(1);\n // Populate fields with extracted properties\n subcode.setText(subjectcode);\n subname.setText(subjectname);\n }", "private void populateViews() {\n TextView songName = findViewById(R.id.songName);\n songName.setText(songs.getSongName());\n TextView albumName = findViewById(R.id.albumPlayerAlbumName);\n albumName.setText(songs.getAlbumName());\n TextView artistName = findViewById(R.id.albumPlayerArtistName);\n artistName.setText(songs.getArtistName());\n ImageView albumCover = findViewById(R.id.albumPlayerImage);\n albumCover.setImageResource(songs.getId());\n\n }", "protected void findAndCacheViews(View view) {\n\t SpeakerItemViews views = new SpeakerItemViews();\n\t views.headerView = view.findViewById(R.id.header);\n\t views.headerTextView = (TextView) view.findViewById(R.id.header_text);\n\t views.dividerView = view.findViewById(R.id.session_divider);\n\t views.nameView = (TextView) view.findViewById(R.id.speaker_name);\n\t views.companyView = (TextView) view.findViewById(R.id.speaker_company);\n\t views.starButton = (CheckBox) view.findViewById(R.id.star_button);\n\t view.setTag(views);\n\t }", "private View setupView(View v)\n {\n\n TextView item_name = (TextView)v.findViewById(R.id.item_name);\n TextView item_price = (TextView)v.findViewById(R.id.item_price);\n TextView item_description = (TextView)v.findViewById(R.id.item_description);\n\n add = (Button) v.findViewById(R.id.fabCart);\n add.setOnClickListener(this);\n mlike = (ImageView) v.findViewById(R.id.btnLike);\n mlike.setOnClickListener(this);\n\n if(mDescription != null) {\n item_name.setText(mDescription[Data.UzaData.NAME.ordinal()] + \" | \" + mDescription[Data.UzaData.SELLER.ordinal()]);\n item_price.setText(mDescription[Data.UzaData.PRICE.ordinal()]);\n item_description.setText(mDescription[Data.UzaData.DESCRIPTION.ordinal()]);\n }\n\n initPager(v);\n\n //TODO \"Show more pictures\" button\n //TODO \"Message\" button\n\n return v;\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n nameTextView = (TextView) itemView.findViewById(R.id.torrent_name);\n movieImageView = (ImageView) itemView.findViewById(R.id.movie_image);\n }", "public ViewHolder(View itemView) {\n tvGrupo = (TextView) itemView.findViewById(R.id.tvGrupo);\n tvNCD = (TextView) itemView.findViewById(R.id.tvNCD);\n tvACD = (TextView) itemView.findViewById(R.id.tvACD);\n ivCD = (ImageView) itemView.findViewById(R.id.ivCD);\n }", "@SuppressLint(\"SetTextI18n\")\n @Override\n public void bindView(View view, Context context, Cursor cursor) {\n if(Utils.weAreLollipop())view.findViewById(R.id.card).setElevation(contex.getResources().getDimension(R.dimen.elevation));\n String title=cursor.getString(cursor.getColumnIndexOrThrow(Contract.ITEM_TITLE));\n long itemID=cursor.getLong(cursor.getColumnIndexOrThrow(Contract.ITEM_ID));\n String date=cursor.getString(cursor.getColumnIndexOrThrow(Contract.ITEM_DATE));\n String sub=cursor.getString(cursor.getColumnIndexOrThrow(Contract.ITEM_SUBTITLE));\n TextView titleTextView= (TextView) view.findViewById(R.id.title);\n TextView subTextView= (TextView) view.findViewById(R.id.sub);\n TextView idTextView= (TextView) view.findViewById(R.id.item_id);\n TextView dateTextView= (TextView) view.findViewById(R.id.date);\n titleTextView.setText(title!=null?title:\"\");\n subTextView.setText(sub!=null?sub:\"\");\n idTextView.setText(\"\"+itemID);\n dateTextView.setText(date!=null?date:\"\");\n }", "public ShowDataViewHolder(final View itemView) {\n super(itemView);\n // image_url = (ImageView) itemView.findViewById(R.id.fetch_image);\n image_title = (TextView) itemView.findViewById(R.id.fetch_image_title);\n\n\n }", "@Override\n public void onBindViewHolder(ViewHolder holder, int position) {\n //get the data according to mposition\n Tweet tweet=mTweets.get(position);\n\n //populate the views according to this data\n holder.tvUsername.setText(tweet.user.name);\n holder.tvBody.setText(tweet.body);\n\n }", "private void bindView() {\n\n\t\tfindViewById(R.id.issue_feedback_container).addOnLayoutChangeListener(\n\t\t\t\tnew OnLayoutChangeListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onLayoutChange(View v, int left, int top,\n\t\t\t\t\t\t\tint right, int bottom, int oldLeft, int oldTop,\n\t\t\t\t\t\t\tint oldRight, int oldBottom) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tint addItem = bottom - oldBottom;\n\t\t\t\t\t\tif (addItem > 0 && oldBottom > 0) {\n\t\t\t\t\t\t\tScrollView scrollView = (ScrollView) findViewById(R.id.container);\n\t\t\t\t\t\t\tLog.i(TAG, \"deltaHeight=\" + addItem + \";bottom=\"\n\t\t\t\t\t\t\t\t\t+ bottom + \";oldBottom=\" + oldBottom);\n\t\t\t\t\t\t\tscrollView.scrollBy(0, addItem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\tissueDescView = (UserInputItemView) findViewById(R.id.issue_desc);\n\t\tissueTopic = (EditItemView) findViewById(R.id.issue_topic);\n\t\taddFile = (AddItemView) findViewById(R.id.issue_add_file);\n\t\tsolverMan = (ChooseItemView) findViewById(R.id.issue_choose_deliver);\n\t\tsolverMan.setContent(\"选择解决人\");\n\t\taddPerson = (AddItemView) findViewById(R.id.issue_add_person);\n\t\taddPerson.setVisibility(View.GONE);\n\t\tsolverMan.setChooseItemClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tgetDeliveryList(true, solverMan);\n\t\t\t}\n\t\t});\n\n\t\taddFile.setOnCreateItemViewListener(addfileListenr);\n\t\taddPerson.setOnCreateItemViewListener(addfoucsPersonCreateListenr);\n\n\t}", "public Viewholder(@NonNull View itemView)\n {\n super(itemView);\n btnReadMore = itemView.findViewById(R.id.btn_read_more);\n sqView = itemView.findViewById(R.id.sqView);\n title = itemView.findViewById(R.id.textTitle);\n body = itemView.findViewById(R.id.textBody);\n }", "public ViewHolder(@NonNull View view, Context ctx) {\n super(view);\n context = ctx;\n\n taskName = view.findViewById(R.id.item_name);\n taskDescription = itemView.findViewById(R.id.item_description);\n taskPriority = itemView.findViewById(R.id.item_priority);\n dateAdded = itemView.findViewById(R.id.item_date);\n\n editButton = itemView.findViewById(R.id.editButton);\n deleteButton = itemView.findViewById(R.id.deleteButton);\n\n editButton.setOnClickListener(this);\n deleteButton.setOnClickListener(this);\n\n }", "@Override\n public void onBindViewHolder(final ViewHolder holder, final int position) {\n // - get element from your dataset at this position\n // - replace the contents of the view with that element\n if(values != null) {\n final Genres genre = values.get(position);\n holder.txtHeader.setText(genre.getName());\n holder.txtFooter.setText(\"Type : \" + genre.getType());\n\n Picasso.get().load(img_url).resize(170,180).into(holder.img);\n\n }else if(animevalues != null){\n final Anime anime = animevalues.get(position);\n holder.txtHeader.setText(anime.getTitle());\n /*holder.txtHeader.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n }\n });*/\n holder.txtFooter.setText(\"Type : \" + anime.getType());\n\n Picasso.get().load(anime.getImage_url()).resize(150,180).into(holder.img);\n }\n }", "public ViewHolder(View rootView) {\n super(rootView);\n tvCityName = (TextView) rootView.findViewById(R.id.tv_view_city_list_item_city_name);\n }", "Object getViewDetails();", "private void populateUserView()\n\t{\n\t\t/* create dummy user properties, throw away later */\n\t\tPlayerViewModel userViewModel = new PlayerViewModel(currentUser.getString(\"facebookId\"), \n\t\t\t\t\t\t\t\t\t\tcurrentUser.getString(\"profilePicUrl\")+\"?type=large\", \n\t\t\t\t\t\t\t\t\t\tlocalCountMap.get(currentUser.getString(\"facebookId\")), \n\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\tfalse);\n\t\t\n\t\t/* create adapter for user view */\n\t\tuserCheeseTextView = (TextView) findViewById(R.id.cheeseCountTextView);\n\t\t//userProfileImageView = (ImageView) findViewById(R.id.userProfileImageView);\n\t\tuserProfileImageView = (CircularImageView) findViewById(R.id.userProfileImageView);\n\t\tuserViewAdapter = new UserViewAdapter(this, userCheeseTextView, userProfileImageView);\n\t\t\n\t\t/* set display values via adapter */\n\t\tuserViewAdapter.setUser(userViewModel);\t\t\n\t}", "private void bindData(ViewHolder vh, int position) {\n\n }", "@Override\n protected void initView() {\n }", "@Override\n protected void initView() {\n }", "private void initLabelRecycler() {\n\n id_flowlayout.setAdapter(new TagAdapter<ServerLabelEntity>(serverLabelEntityArrayList) {\n @Override\n public View getView(FlowLayout parent, int position, ServerLabelEntity serverLabelEntity) {\n TextView server_label_name_tv = (TextView) LayoutInflater.from(getContext()).inflate(R.layout.server_details_label_item,\n id_flowlayout, false);\n server_label_name_tv.setText(serverLabelEntity.getName());\n return server_label_name_tv;\n }\n });\n\n }", "@Override\n protected void initData() {\n\n setFragment(homeRecyclerFragment);\n }", "@Override\n public void bindView(View view, Context context, Cursor cursor) {\n //Find the fields to populate in inflated template\n TextView tvProductName = (TextView) view.findViewById(R.id.item_shopping_productname);\n TextView tvProductPrice = (TextView) view.findViewById(R.id.item_shopping_price);\n TextView tvProductStock = (TextView) view.findViewById(R.id.item_shopping_stock);\n TextView tvProductDescription = (TextView) view.findViewById(R.id.item_shopping_description);\n\n //Extract properties from Cursor\n String productName = cursor.getString(cursor.getColumnIndexOrThrow(ShoppingContract.ShoppingEntry.COLUMN_NAME));\n int productPrice = cursor.getInt(cursor.getColumnIndexOrThrow(ShoppingContract.ShoppingEntry.COLUMN_PRICE));\n int productStock = cursor.getInt(cursor.getColumnIndexOrThrow(ShoppingContract.ShoppingEntry.COLUMN_IN_STOCK));\n String productDescription = cursor.getString(cursor.getColumnIndexOrThrow(ShoppingContract.ShoppingEntry.COLUMN_DESCRIPTION));\n\n //Adding not written description in UI\n if(TextUtils.isEmpty(productDescription)){\n productDescription=context.getString(R.string.no_description_provided);\n }\n //Populated field with extracted properties\n tvProductName.setText(productName);\n tvProductPrice.setText(String.valueOf(productPrice));\n tvProductStock.setText(String.valueOf(productStock));\n tvProductDescription.setText(productDescription);\n\n }", "private void populateView(View view, TestCase item) {\n\t\tTextView tv_caseId = (TextView) view.findViewById(R.id.tv_caseId);\n\t\tTextView tv_caseName = (TextView) view.findViewById(R.id.tv_caseName);\n\n\t\t// set text values based on input message\n\t\ttry {\n\t\t\ttv_caseId.setText(String.valueOf(item.getCaseId()));\n\t\t\ttv_caseName.setText(item.getCaseName());\n\t\t\tboolean isSuccess = item.isSuccess();\n\t\t\tif (isSuccess) {\n\t\t\t\ttv_caseId.setTextColor(RESPONSE_SUCCESS_COLOR);\n\t\t\t\ttv_caseName.setTextColor(RESPONSE_SUCCESS_COLOR);\n\t\t\t} else {\n\t\t\t\ttv_caseId.setTextColor(RESPONSE_FAILURE_COLOR);\n\t\t\t\ttv_caseName.setTextColor(RESPONSE_FAILURE_COLOR);\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tLog.e(\"error\", ex.getMessage());\n\t\t}\n\t\t\n\t}", "@Override\r\n\tpublic View view(int arg0, View arg1, ViewGroup arg2) {\n\t\tHolder holder;\r\n\t\tif (arg1 == null) {\r\n\t\t\targ1 = ShowUtil.LoadXmlView(getContext(), R.layout.adress_item);\r\n\t\t\tholder = new Holder();\r\n\t\t\tholder.province = (TextView) arg1\r\n\t\t\t\t\t.findViewById(R.id.adress_item_title);\r\n\t\t\targ1.setTag(holder);\r\n\t\t}\r\n\t\tholder = (Holder) arg1.getTag();\r\n\t\tTextView provinceTxt = holder.province;\r\n\r\n\t\tfinal Province province = getData(arg0);\r\n\t\tif (province.isSelect()) {\r\n\t\t\tprovinceTxt.setBackgroundColor(getContext().getResources().getColor(\r\n\t\t\t\t\tR.color.blue));\r\n\t\t\tprovinceTxt.setTextColor(getContext().getResources().getColor(R.color.white));\r\n\t\t} else {\r\n\t\t\tprovinceTxt.setBackgroundColor(getContext().getResources().getColor(\r\n\t\t\t\t\tR.color.background));\r\n\t\t\tprovinceTxt.setTextColor(getContext().getResources().getColor(R.color.shallowGray));\r\n\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tprovinceTxt.setText(province.getTitle());\r\n\r\n\t\targ1.setOnClickListener(new OnClickListener() {\r\n\t\t\t\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\r\n\t\t\t\tcleanSelect();\r\n\t\t\t\tprovince.setSelect(true);\r\n\t\t\t\tnotifyDataSetChanged();\r\n\t\t\t\tonItem(new Object[]{\r\n\t\t\t\t\t\tprovince\t\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn arg1;\r\n\t}", "@Override\n\tprotected void initViews(View view) {\n\t\tsuper.initViews(view);\n//\t\tsendRequestData();\n\t}", "private void bindView() {\n mToolbar = (Toolbar) findViewById(R.id.tb_main);\n mMainLayout = (CoordinatorLayout) findViewById(R.id.crdl_main);\n mProgressDialog = (AVLoadingIndicatorView) findViewById(R.id.avi_progress_dialog);\n mPersonsView = (RecyclerView) findViewById(R.id.rv_persons);\n mPersonsView.setLayoutManager(new LinearLayoutManager(context));\n }", "public ViewHolder(View itemView) {\n super(itemView);\n\n mView = itemView;\n mUsernameTv = (TextView) mView.findViewById(R.id.usernameTv);\n mEmailTv = (TextView) mView.findViewById(R.id.emailTv);\n mFriendIv = (ImageView) mView.findViewById(R.id.friendIv);\n mYouTv = (TextView) mView.findViewById(R.id.youTv);\n\n mIsFriend = false;\n }", "private void prepareViews() {\n mTextViewHeader = (TextView) mHeaderView.findViewById(R.id.tv_text_header_enhanced_listview);\n mTextViewFooter = (TextView) mFooterView.findViewById(R.id.tv_text_footer_enhanced_listview);\n mTextViewTime = (TextView) mHeaderView.findViewById(R.id.tv_time_update_header);\n\n mArrowHeader = mHeaderView.findViewById(R.id.arrow_header);\n mArrowFooter = mFooterView.findViewById(R.id.arrow_footer);\n\n mPbHeader = mHeaderView.findViewById(R.id.pb_header_enhanced_listview);\n mPbFooter = mFooterView.findViewById(R.id.pb_footer_enhanced_listview);\n\n }", "@Override\n public void onBindViewHolder(ViewHolder holder, final int position) { //Cuando un elemento hace binding\n // - get element from your dataset at this position\n // - replace the contents of the view with that element\n final Track track = values.get(position); //RECUPERA ELEMENTO QUE QUIERES VISUALIZAR\n final ViewHolder vh = holder; //HEMOS TENIDO QUE CREARLA PORQUE ESTA ARRIBA EN LA CLASE Y EN EL REMOVE NO LA PODRIAMOS UTILIZAR\n holder.title.setText(track.getTitle());\n holder.id.setText(track.getSinger());\n holder.title.setOnClickListener(new View.OnClickListener(){\n @Override\n public void onClick(View v) {\n Intent trackview = new Intent(activity.getApplicationContext(), TrackDetailActivity.class);\n trackview.putExtra(\"id\",track.getId());\n trackview.putExtra(\"title\", track.getTitle());\n trackview.putExtra(\"singer\", track.getSinger());\n activity.startActivity(trackview);\n }\n });\n }", "@Override\n public void onBindViewHolder(MyAdapter.ViewHolder holder, int position) {\n // - get element from your dataset at this position\n // - replace the contents of the view with that element\n View holder1, holder2, holder3, holder4;\n holder1 = holder.mView.findViewById(R.id.subText);\n holder2 = holder.mView.findViewById(R.id.dueDateText);\n // holder3 = holder.mView.findViewById(R.id.gradeText);\n// holder4 = holder.mView.findViewById(R.id.descText);\n if (mDataset.get(position).getCourse() != null) {\n ((TextView) holder1).setText(mDataset.get(position).getCourse().getSub());\n }\n if (mDataset.get(position).getDueDate() != null) {\n ((TextView) holder2).setText((CharSequence) mDataset.get(position).getDueDate());\n }\n // ((TextView) holder3).setText(mDataset.get(position).get);\n// ((TextView) holder4).setText(mDataset[position]);\n //.setText(mDataset[position]));\n //setText(mDataset[position]);\n }", "@Override\n public void onBindViewHolder(ViewHolder holder, int position) {\n // - get element from your dataset at this position\n // - replace the contents of the view with that element\n holder.teamAbbreviation.setText(mDataset.get(position).getTeamAbbrevation());\n holder.numPlayers.setText(String.valueOf(mDataset.get(position).getNumPlayers()));\n holder.totalSalary.setText(String.valueOf(mDataset.get(position).getTotalSalary()));\n holder.itemView.setTag(mDataset.get(position).getPlayerList());\n }", "@Override\n protected void populateViewHolder(Upcoming_Events.EventViewHolder viewHolder, Event_accept model, int position) {\n }", "public ViewHolder(View itemView) {\n super(itemView);\n if (mFromSearch) {\n mNameView = (TextView) itemView.findViewById(R.id.single_search_title);\n mTickerView = (TextView) itemView.findViewById(R.id.single_search_ticker);\n } else {\n mNameView = (TextView) itemView.findViewById(R.id.tv_name);\n mPriceView = (TextView) itemView.findViewById(R.id.tv_price);\n }\n itemView.setOnClickListener(this);\n }", "public MyHolder(View itemView) {\n super(itemView);\n item = itemView.findViewById(R.id.item);\n noofpices = itemView.findViewById(R.id.noofpices);\n cost = itemView.findViewById(R.id.cost);\n amount = itemView.findViewById(R.id.total);\n plus = itemView.findViewById(R.id.plus);\n// minus = (ImageButton)itemView.findViewById(R.id.minus);\n delete = itemView.findViewById(R.id.del);\n\n // id= (TextView)itemView.findViewById(R.id.id);\n }", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "protected Object getViewData() {\n\t\treturn view.getViewData();\n\t}", "public void displayData(View view) {\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 onBindViewHolder(ViewHolder viewHolder, final int position) {\n Log.d(TAG, \"Element \" + position + \" set.\");\n\n // Get element from your dataset at this position and replace the contents of the view\n // with that element\n //viewHolder.getTextView().setText(mDataSet[position]);\n TextDrawable drawable = TextDrawable.builder().buildRound(\"AB\", Color.RED);\n viewHolder.getIconView().setImageDrawable(drawable);\n viewHolder.getNameView().setText(items.get(position).getName());\n viewHolder.getEmailView().setText(items.get(position).getEmail());\n viewHolder.getJobTitleView().setText(items.get(position).getJobTitle());\n viewHolder.getLocationView().setText(items.get(position).getLocation());\n viewHolder.getExtView().setText(items.get(position).getExt());\n }", "private void loadData() {\n if (mItem != null) {\n Picasso.with(getActivity()).load(mItem.getPictureFile()).\n placeholder(R.drawable.loading)\n .error(R.drawable.error)\n .fit() //\n .into(((ImageView) getView().findViewById(R.id.detailImageView)));\n ((EditText) getView().findViewById(R.id.visitstextView))\n .setText(\"\" + mItem.getVisits());\n\n ((TextView) getView().findViewById(R.id.detailTextView))\n .setText(\"\" + mItem.getTitle());\n ((RatingBar) getView().findViewById(R.id.detailsratingBar)).setRating((float) mItem.getRating());\n\n ReviewModelAdapter mReviewAdapter = new ReviewModelAdapter(getActivity(), R.id.txt_line1);\n try {\n mReviewAdapter.addAll(mItem.getReviews(getActivity()).all().toList());\n } catch (Exception e) {\n\n }\n ((ListView) getView().findViewById(R.id.detailsreviewlistview)).setAdapter(mReviewAdapter);\n\n\n }\n }", "public void updateView() {\n if (mData.isEmpty()) {\n Logger.d(TAG, \"The mData is empty\");\n return;\n }\n Set<View> viewSet = mData.keySet(); // keySet() returns [] if map is\n // empty\n Iterator<View> viewIterator = viewSet.iterator();\n if (viewIterator == null) {\n Logger.d(TAG, \"The viewIterator is null\");\n return;\n }\n while (viewIterator.hasNext()) {\n View view = viewIterator.next();\n if (view == null) {\n Logger.d(TAG, \"The view is null\");\n } else {\n Object obj = mData.get(view);\n if (obj == null) {\n Logger.d(TAG, \"The value is null\");\n } else {\n if (obj instanceof ChatsStruct) {\n ChatsStruct chatStruct = (ChatsStruct) obj;\n updateChats(view, chatStruct);\n } else if (obj instanceof InvitationStruct) {\n InvitationStruct inviteStruct = (InvitationStruct) obj;\n updateInvitations(view, inviteStruct);\n } else {\n Logger.d(TAG, \"Unknown view type\");\n }\n }\n }\n }\n }", "@Override\n public void onBindViewHolder(ReviewsAdapter.ReviewDataViewHolder holder, int position) {\n // Involves populating letsdecode.com.popularmovies.data into the item through holder\n // Get the letsdecode.com.popularmovies.data model based on position\n ReviewData reviewData = reviewDataList.get(position);\n int sequence = position + 1;\n holder.numberTextView.setText(sequence + \".\");\n holder.authorNameTextView.setText(\"Author: \" + reviewData.getAuthorName());\n holder.contentTextView.setText(reviewData.getContent());\n\n }", "private void getDataFromView() throws EmptyTextFieldException, EmptyChoiceBoxException, NumberSmallerOneException {\n\n date = _view.getDate().getValue();\n title = _view.getTitle().getText();\n function = _view.getFunction().getText();\n protagonist = _view.getProtagonist().getText();\n source = _view.getSource().getText();\n references = _view.getReferences().getText();\n description = _view.getDescription().getText();\n checkForEmptyFields();\n\n priority = _view.getPriorityMap().get(_view.getPriority().getValue());\n classification = _view.getClassificationMap().get(_view.getClassification().getValue());\n checkForEmptyChoiceBox();\n\n id = Integer.parseInt(_view.getId().getText());\n ftr = Integer.parseInt(_view.getFtr().getText());\n det = Integer.parseInt(_view.getDet().getText());\n checkForNumbersSmallerOne();\n }", "public ViewHolder(View itemView) {\n super(itemView);\n productDetails = (TextView) itemView.findViewById(R.id.category_item_layout_for_view_product_product_details);\n price = (TextView) itemView.findViewById(R.id.category_item_layout_for_view_product_MRP);\n sp = (TextView) itemView.findViewById(R.id.category_item_layout_for_view_product_SP);\n //qty = (Spinner) itemView.findViewById(R.id.category_item_layout_for_view_product_qty);\n productImage = (ImageView) itemView.findViewById(R.id.category_item_layout_for_view_product_image);\n addToCart = (TextView) itemView.findViewById(R.id.category_item_layout_for_view_product_addToCart);\n }", "public ViewHolder(View itemView) {\n super(itemView);\n this.productName = itemView.findViewById(R.id.productName);\n// this.productDesc = itemView.findViewById(R.id.productDesc);\n// this.productPrice = itemView.findViewById(R.id.productPrice);\n// this.imageView = itemView.findViewById(R.id.productImage);\n itemView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n onClickListener.orderType(v, getAdapterPosition());\n }\n });\n }", "@Override\r\n\tpublic void initViews() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initViews() {\n\t\t\r\n\t}", "private void displayData() {\n ChildStatement childStmt = app.getChildStatement();\n\n //---Child\n childModelViewSynchronizer = new ModelViewSynchronizer<Child>(CHILD_CLASS,\n getChildMetadata(), rootView, AppConstants.EMPTY_STRING);\n childModelViewSynchronizer.setLabels();\n childModelViewSynchronizer.setHeaderTitle(R.id.section_child_particulars,\n R.string.label_child);\n childModelViewSynchronizer.displayDataObject(childStmt.getChildItem().getChild());\n\n //---CDA Trustee\n cdaTrusteeModelViewSynchronizer = new ModelViewSynchronizer<Adult>(ADULT_CLASS,\n getCdaTrusteeMetaData(), rootView, AppConstants.EMPTY_STRING);\n cdaTrusteeModelViewSynchronizer.setLabels();\n cdaTrusteeModelViewSynchronizer.setHeaderTitle(R.id.section_cdat_particulars,\n R.string.label_adult_type_cdat);\n cdaTrusteeModelViewSynchronizer.displayDataObject(childStmt.getChildDevAccountTrustee());\n\n //---Child Development Bank Account\n cdaBankModelViewSynchronizer = new ModelViewSynchronizer<CdaBankAccount>(CDA_BANK_ACCOUNT_CLASS,\n getChildDevAccountMetaData(), rootView, AppConstants.EMPTY_STRING);\n cdaBankModelViewSynchronizer.setLabels();\n cdaBankModelViewSynchronizer.setHeaderTitle(R.id.section_cda_details,\n R.string.label_child_dev_acc_detail);\n cdaBankModelViewSynchronizer.displayDataObject(childStmt.getCdaBankAccount());\n\n //--- To From Date\n displayFromToDates();\n\n //Screen - Title and Instructions\n fragmentContainer.setFragmentTitle(rootView,\n R.string.title_activity_family_view_cda_details);\n fragmentContainer.setInstructions(rootView.findViewById(R.id.screen_instructions),\n CURRENT_POSITION, 0, false);\n }", "public void loadData() {\n if (this.model != null) {\n\n this.dataLayout.setVisibility(View.VISIBLE);\n this.emptyText.setVisibility(View.GONE);\n\n\n if (this.model.getSolution() != null) {\n this.solutionView.setText(this.model.getSolution());\n }\n if (this.model.getArguments() != null) {\n this.argumentsView.setText(this.model.getArguments());\n }\n if (this.model.getQuestion() != null) {\n this.questionView.setText(\n String.valueOf(this.model.getQuestion().getId()));\n }\n } else {\n this.dataLayout.setVisibility(View.GONE);\n this.emptyText.setVisibility(View.VISIBLE);\n }\n }", "@Override\n public void onBindViewHolder(final ViewHolder holder, int position) {\n holder.mItem = mValues.get(position);\n holder.mIdView.setText(mValues.get(position).mHangoutID);\n holder.mContentView.setText(mValues.get(position).mPrice);\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n int position = getAdapterPosition();\n\n\n nameTextView = (TextView) itemView.findViewById(R.id.contact_name);\n messageButton = (Button) itemView.findViewById(R.id.message_button);\n messageButton.setOnClickListener(new ButtonClick(this));\n itemView.setOnClickListener(this);\n\n }", "public ViewHolder(View view){\n super(view);\n\n artImage = view.findViewById(R.id.thumbnail);\n title = view.findViewById(R.id.headline_title);\n byline = view.findViewById(R.id.byline);\n addDate = view.findViewById(R.id.date_added);\n subText = view.findViewById(R.id.sub_text);\n view.setOnClickListener(this);\n\n }" ]
[ "0.6843712", "0.6714795", "0.6627011", "0.6624834", "0.65924156", "0.65838504", "0.65489745", "0.6531852", "0.64987946", "0.64935887", "0.6474712", "0.6458169", "0.64541304", "0.6436008", "0.6427071", "0.6413871", "0.64056826", "0.6397721", "0.63799566", "0.63663435", "0.63329965", "0.63286364", "0.63273674", "0.6325681", "0.6320826", "0.63125825", "0.62950015", "0.62931514", "0.6280647", "0.6280647", "0.62627244", "0.62627244", "0.62610596", "0.62553823", "0.6225734", "0.6220914", "0.6218311", "0.6205481", "0.6195371", "0.6193976", "0.61825204", "0.61812556", "0.61807674", "0.61768246", "0.6173723", "0.61693513", "0.6167984", "0.61658156", "0.6159298", "0.6153234", "0.6133422", "0.61313623", "0.61212206", "0.6115272", "0.610911", "0.6102355", "0.6089051", "0.60855854", "0.60799664", "0.6079633", "0.60783273", "0.60770065", "0.60765004", "0.6072444", "0.6070526", "0.6070411", "0.6070411", "0.6068258", "0.60656255", "0.6056188", "0.60534424", "0.60529196", "0.60527676", "0.60510516", "0.6044972", "0.6036526", "0.6032627", "0.60288906", "0.6024377", "0.6015149", "0.6010772", "0.6005458", "0.6005323", "0.6005323", "0.6004137", "0.5999953", "0.5998263", "0.599096", "0.5988546", "0.5983665", "0.5982772", "0.59818596", "0.597895", "0.5975739", "0.59730196", "0.59730196", "0.59723455", "0.59677804", "0.59657687", "0.59645236", "0.5960121" ]
0.0
-1
TODO 5. Setup item count based on data size
@Override public int getItemCount() { return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public int getSize() {\n return numItems;\n }", "@Override\n public int getSize() {\n return this.numItems;\n }", "@Override\n public int getItemCount() {\n // 12. Returning 0 here will tell our Adapter not to make any Items. Let's fix that.\n return listOfData.size();\n }", "@Override\n public int getSize() {\n return items.size();\n }", "public int size(){ return itemCount;}", "@Override\r\n\tprotected void readImpl()\r\n\t{\r\n\t\t_listId = readD();\r\n\t\tint count = readD();\r\n\t\tif (count <= 0 || count > Config.MAX_ITEM_IN_PACKET || count * BATCH_LENGTH != getByteBuffer().remaining())\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t_items = new Item[count];\r\n\t\tfor (int i = 0; i < count; i++)\r\n\t\t{\r\n\t\t\tint objectId = readD();\r\n\t\t\tint itemId = readD();\r\n\t\t\tlong cnt = readQ();\r\n\t\t\tif (objectId < 1 || itemId < 1 || cnt < 1)\r\n\t\t\t{\r\n\t\t\t\t_items = null;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t_items[i] = new Item(objectId, itemId, cnt);\r\n\t\t}\r\n\t}", "int getItemsCount();", "int getItemsCount();", "@Override\n public int getItemCount() {\n if (addedHeader()) {\n return getData() == null ? 0 : (getData().size() + 1);\n } else {\n return getData() == null ? 0 : getData().size();\n }\n }", "@Override\n\tpublic int getSize() {\n\t\treturn datas.size();\n\t}", "@Override\n public int getItemCount() {\n return mDataset.length();\n }", "public int size(){\n return numItems;\n }", "private void increaseSize() {\n data = Arrays.copyOf(data, size * 3 / 2);\n }", "@Override\n public int getItemCount() {\n return arrayData.size();\n }", "public long getItemCount() {\n\t\treturn this.getSize(data);\n\t}", "int getNumItems();", "@Override\n public int getItemCount() {\n return dummyDataList.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.length();\n }", "static int noValueSize() {\r\n return itemSize(false) * 2;\r\n }", "public int getCount() {\n return data.size() / 2;\n }", "@Override\n public int getItemCount() {\n return this.datas.size();\n }", "@Override\n public int getItemCount() {\n //list.length to return\n return mDataset.size();\n }", "public int size() {\n \treturn numItems;\n }", "int getItemSize();", "@Override\n public int getItemCount() {\n return dataList.size();\n }", "@Override\r\n public int getItemCount() {\r\n return dataset.size();\r\n }", "@Override\r\n\tpublic int size() {\r\n\r\n\t\treturn data.size();\r\n\t}", "@Override\n\tpublic int getDataCount() {\n\t\treturn list_fr.size();\n\t}", "public int getSize() {\r\n return list.getItemCount();\r\n }", "@Override\n public int getItemCount() {\n return data.size();\n }", "@Override\n public int getItemCount() {\n return data.size();\n }", "@Override\n public int getItemCount() {\n return mData.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n\tpublic int size() {\n\n\t\treturn this.numOfItems;\n\t}", "@Override\n public int getItemCount() {\n return mDataset.length;\n }", "@Override\n public int getItemCount() {\n return mDataset.length;\n }", "@Override\r\n\tpublic int size() {\r\n\t\treturn numItems;\r\n\t}", "@Override\n public int getItemCount()\n {\n return mData.size();\n }", "@Override\n\tpublic int size() {\n\t\treturn numItems;// numItems represents size\n\t}", "@Override\n public int getItemCount() {\n if(order_data.size() > 0)\n {\n return order_data.size() + 1;\n }\n else if(order_data.size() > 0)\n {\n return order_data.size() + 2;\n }\n else if(order_data.size() == 0)\n {\n return 1;\n }\n else\n {\n return 2;\n }\n\n }", "@Override\n public int getItemCount() {\n return dataset.size();\n }", "public int size()\r\n {\r\n return nItems;\r\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n }", "@Override\n public int getItemCount() {\n return listDataResult.size();\n }", "@Override\n\tpublic int countNumberOfDatas() {\n\t\treturn 0;\n\t}", "public int getCount() {\n\t\treturn data.size();\r\n\t}", "@Override\n public int getItemCount() {\n return rvData.size();\n }", "@Override\n public int getItemCount() {\n return dataset.length;\n }", "@Override\n public int getItemCount() {\n return mDataSet.length;\n }", "@Override\n public int getItemCount() {\n return mDataSet.length;\n }", "@Override\n public int getItemCount() {\n return mData.size();\n }", "@Override\n public int getItemCount() {\n return mData.size();\n }", "@Override\n public int getItemCount() {\n return mData.size();\n }", "@Override\n public int getItemCount() {\n return mData.size();\n }", "@Override\n public int getItemCount() {\n return mData.size();\n }", "@Override\n public int getItemCount() {\n return mData.size();\n }", "@Override\n public int getItemCount() {\n return mData.size();\n }", "@Override\n public int getItemCount() {\n return mData.size();\n }", "@Override\n public int getItemCount() {\n return mData.size();\n }", "@Override\n public int getItemCount() {\n return mData.size();\n }", "@Override\n public int getItemCount() {\n return mData.size();\n }", "@Override\n public int getItemCount() {\n return mData.length;\n }", "public int getSize() \n { \n return numberOfEntries;\n }", "int size() {\n return data.size();\r\n }", "@Override\n public int size() { return size; }", "public int size() {\n return numItems;\n }", "private int getResourceListSize() {\n return dataList.getResourceEndIndex();\n }", "@Override\n public int getItemCount() {\n return mDataset.size();\n\n }", "@Override\n public int getCount() {\n return jArrayQty.length();\n }", "@Override\n public int getItemCount() {\n\n return outfitDataSet.size();\n }", "public int getSize(){return this.size;}", "protected abstract int getNextBufferSize(E[] paramArrayOfE);", "public abstract long getCompleteListSize();", "public int size() {\n return nItems;\n }", "@Override\n public int getItemCount() {\n return dataSet.size();\n }", "public int getSize() {\n throw new OurBadException(\" Item '\" + this.serialize() + \"' is not an array.\");\n }", "public int getDataCount() {\n return data_.size();\n }", "@Override\n public int size() {\n return mData.size();\n }" ]
[ "0.6988653", "0.67661333", "0.6684519", "0.65241235", "0.64493364", "0.6369371", "0.63444006", "0.63444006", "0.6300946", "0.62987393", "0.6281332", "0.62776667", "0.62304085", "0.6219766", "0.62167317", "0.62158096", "0.6213192", "0.6206396", "0.6195377", "0.6169003", "0.61642945", "0.61376756", "0.61358094", "0.6129759", "0.6109352", "0.6107547", "0.6095972", "0.60949355", "0.6088458", "0.608679", "0.608679", "0.6079473", "0.6078365", "0.6078365", "0.6065129", "0.6041986", "0.6041986", "0.6041706", "0.6037794", "0.60324275", "0.60271364", "0.6021573", "0.60204446", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6014313", "0.6012487", "0.6006468", "0.6005589", "0.6003289", "0.600033", "0.59918344", "0.59918344", "0.5987919", "0.5987919", "0.5987919", "0.5987919", "0.5987919", "0.5987919", "0.5987919", "0.5987919", "0.5987919", "0.5987919", "0.5987919", "0.5978567", "0.59701437", "0.5949339", "0.5943414", "0.59400165", "0.5934072", "0.5932806", "0.5931983", "0.5926061", "0.592401", "0.5922312", "0.59195614", "0.5919436", "0.5916518", "0.5915592", "0.59107107", "0.58994377" ]
0.0
-1
TODO Autogenerated method stub
public String getFilePath() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public String getMapDescriptionFileName() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public String getUnitDescriptionFileName() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public String getWeightVectorFileName() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
/ / Constructors /
public Percolation(int n) { if (n < 1) throw new IllegalArgumentException("n is not positive"); virtualTopId = 0; virtualBottomId = n * n + 1; size = n; grid = new boolean[n][n]; final int componentAmount = n * n + 2; mainUnion = new WeightedQuickUnionUF(componentAmount); backwashAwareUnion = new WeightedQuickUnionUF(componentAmount); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Constructor() {\r\n\t\t \r\n\t }", "public Constructor(){\n\t\t\n\t}", "public CyanSus() {\n\n }", "public Pitonyak_09_02() {\r\n }", "private TMCourse() {\n\t}", "public _355() {\n\n }", "public CSSTidier() {\n\t}", "public PSRelation()\n {\n }", "public RngObject() {\n\t\t\n\t}", "public Curso() {\r\n }", "public Basic() {}", "public Libro() {\r\n }", "public Odontologo() {\n }", "private Rekenhulp()\n\t{\n\t}", "public Trening() {\n }", "public Cohete() {\n\n\t}", "public Phl() {\n }", "public Anschrift() {\r\n }", "public Coche() {\n super();\n }", "public Ov_Chipkaart() {\n\t\t\n\t}", "public Chick() {\n\t}", "public Clade() {}", "protected abstract void construct();", "public Orbiter() {\n }", "public Tbdtokhaihq3() {\n super();\n }", "public Rol() {}", "public AirAndPollen() {\n\n\t}", "public TTau() {}", "public Chauffeur() {\r\n\t}", "public Lanceur() {\n\t}", "public JSFOla() {\n }", "private NfkjBasic()\n\t\t{\n\t\t\t\n\t\t}", "public Pasien() {\r\n }", "private Instantiation(){}", "public Cgg_jur_anticipo(){}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public Tigre() {\r\n }", "protected GeometricObject() \n\t{\n\t\tdateCreated = new java.util.Date();\n\t}", "private SingleObject()\r\n {\r\n }", "public Demo() {\n\t\t\n\t}", "public Soil()\n\t{\n\n\t}", "Composite() {\n\n\t}", "public EnsembleLettre() {\n\t\t\n\t}", "private void __sep__Constructors__() {}", "public Tbdcongvan36() {\n super();\n }", "public Magazzino() {\r\n }", "public SlanjePoruke() {\n }", "public Excellon ()\n {}", "public mapper3c() { super(); }", "public OVChipkaart() {\n\n }", "public lo() {}", "public Livro() {\n\n\t}", "public ChaCha()\n\t{\n\t\tsuper();\n\t}", "@Override\r\n\tpublic void init() {}", "public Supercar() {\r\n\t\t\r\n\t}", "public SgaexpedbultoImpl()\n {\n }", "public Achterbahn() {\n }", "public Zeffit()\n {\n // TODO: initialize instance variable(s)\n }", "public AFMV() {\r\n }", "private IndexBitmapObject() {\n\t}", "public CMN() {\n\t}", "public Steganography() {}", "private TbusRoadGraph() {}", "public Carrinho() {\n\t\tsuper();\n\t}", "private MApi() {}", "@Override\n public void init() {}", "private CZ()\n {\n }", "public CD() {}", "public p7p2() {\n }", "public Catelog() {\n super();\n }", "public Mitarbeit() {\r\n }", "public Mannschaft() {\n }", "public Genret() {\r\n }", "public Self__1() {\n }", "public AntrianPasien() {\r\n\r\n }", "private Converter()\n\t{\n\t\tsuper();\n\t}", "private Ognl() {\n }", "protected Betaling()\r\n\t{\r\n\t\t\r\n\t}", "public Rook()\n {\n super();\n }", "private TAPosition()\n {\n\n }", "public Naive() {\n\n }", "public Overview() {\n\t\t// It will work whenever i create object with using no parameter const\n\t\tSystem.out.println(\"This is constructor\");\n\t}", "private Road()\n\t{\n\t\t\n\t}", "public Husdjurshotell(){}", "@Override\n\t\tpublic void init() {\n\t\t}", "public ExamMB() {\n }", "public Goodsinfo() {\n super();\n }", "public Aritmetica(){ }", "public Carrera(){\n }", "private Node() {\n\n }", "public OOP_207(){\n\n }", "private Composite() {\n }", "public Corso() {\n\n }", "public Boop() {\n\t\tsuper();\n\t}", "public Vaccine() {\n\t}", "public Lotto2(){\n\t\t\n\t}", "public Data() {}", "public AvaliacaoRisco() {\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}" ]
[ "0.84202886", "0.78166115", "0.71776414", "0.7029142", "0.6997788", "0.6988559", "0.698599", "0.69655824", "0.6958574", "0.69455236", "0.69264483", "0.69235736", "0.69148237", "0.6909453", "0.6896481", "0.6896198", "0.6878102", "0.6870602", "0.68672794", "0.6842882", "0.6840633", "0.6840214", "0.6836925", "0.68324536", "0.6823645", "0.6822566", "0.6812783", "0.6801895", "0.67968386", "0.67439944", "0.67318386", "0.67263633", "0.671435", "0.67136514", "0.6711922", "0.6704347", "0.66981107", "0.66965204", "0.6692949", "0.669221", "0.6690277", "0.667818", "0.6655319", "0.66551185", "0.6651808", "0.66477346", "0.66233927", "0.6620925", "0.6618219", "0.66174084", "0.66105056", "0.6608594", "0.6594065", "0.6585368", "0.65824443", "0.65799683", "0.65792644", "0.6577649", "0.65770644", "0.6576263", "0.6572612", "0.65669936", "0.6565091", "0.6563983", "0.6562797", "0.656054", "0.65588415", "0.65566367", "0.6549467", "0.6546707", "0.6544491", "0.65442044", "0.6542907", "0.6539986", "0.65367776", "0.6532379", "0.6531835", "0.65309185", "0.65294564", "0.6526406", "0.65254116", "0.65182686", "0.6516085", "0.6514157", "0.6514042", "0.65135074", "0.65111166", "0.6509801", "0.64981645", "0.6496173", "0.64949447", "0.64942473", "0.6493381", "0.6487091", "0.64837235", "0.6483175", "0.64826834", "0.64809376", "0.6478219", "0.6478219", "0.6478219" ]
0.0
-1
/ / API /
public void open(int row, int col) { if (isOpen(row, col)) return; grid[row - 1][col - 1] = true; ++openSites; // Transform the row and the column into an appropriate index // because the quick union class uses a one-dimensional array. final int currentSiteIndex = toIndex(row, col); // The topmost row must be connected to the virtual top. if (row == 1) { mainUnion.union(virtualTopId, currentSiteIndex); backwashAwareUnion.union(virtualTopId, currentSiteIndex); } // The bottommost row must be connected to virtual the bottom. if (row == size) mainUnion.union(virtualBottomId, currentSiteIndex); // Connect all neighbors of the current site if and only if the neighbors are open. if (row > 1 && isOpen(row - 1, col)) { final int topNeighborIndex = toIndex(row - 1, col); mainUnion.union(topNeighborIndex, currentSiteIndex); backwashAwareUnion.union(topNeighborIndex, currentSiteIndex); } if (row < size && isOpen(row + 1, col)) { final int bottomNeighborIndex = toIndex(row + 1, col); mainUnion.union(bottomNeighborIndex, currentSiteIndex); backwashAwareUnion.union(bottomNeighborIndex, currentSiteIndex); } if (col > 1 && isOpen(row, col - 1)) { final int leftNeighborIndex = toIndex(row, col - 1); mainUnion.union(leftNeighborIndex, currentSiteIndex); backwashAwareUnion.union(leftNeighborIndex, currentSiteIndex); } if (col < size && isOpen(row, col + 1)) { final int rightNeighborIndex = toIndex(row, col + 1); mainUnion.union(rightNeighborIndex, currentSiteIndex); backwashAwareUnion.union(rightNeighborIndex, currentSiteIndex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "API createAPI();", "public API() {}", "public api() {}", "public interface TvApi {\n\n /*\n 获取电视节目表\n */\n @POST(\"getProgram\")\n Call<TvShowData> getProgram(@Query(\"code\") String code, @Query(\"date\") String date, @Query(\"key\") String key);\n\n /*\n 获取频道类型列表\n */\n @POST(\"getCategory\")\n Call<TvTypeData> getCategory(@Query(\"key\") String key);\n\n /*\n\n */\n @POST(\"getChannel\")\n Call<TvChannelData> getChannel(@Query(\"pId\") String pId, @Query(\"key\") String key);\n}", "public interface Api {\n\n// root url after add multiple servlets\n\n String BASE_URL = \"https://simplifiedcoding.net/demos/\";\n\n @GET(\"marvel\")\n Call<List<Modelclass>> getmodelclass();\n\n\n\n}", "public interface LooksoftMainApi {\n @GET(\"main\")\n Call<Data> loadData();\n}", "public interface IPokeapiService {\n\n\n\n// @GET(\"lp_iem/result.json\")\n// Call<PokemonWs> listPokemon();\n\n @GET(\"?action=cardlist&\")\n Call<List<Pokemon>> listPokemon(@Query(\"user\")int user);\n //@Query(\"user\")int user\n\n @GET(\"?action=details&\")\n Call<Pokemon> getPokemon(@Query(\"card\")int id_card);\n\n @GET(\"?action=pokedex\")\n Call<List<Pokemon>> getPokedex();\n\n}", "public interface API {\n\n //Penyakit\n @GET(\"penyakitall/{page}/{count_page}\")\n Call<DiseaseResponse>\n getDiseaseList(@Path(\"page\") String page, @Path(\"count_page\") String count_page);\n\n @GET(\"penyakit/{page}/{count_page}\")\n Call<DiseaseResponse>\n getDiseaseListByLokasi(@Path(\"page\") String page, @Path(\"count_page\") String count_page, @Query(\"id_desa\") String id_desa);\n\n @POST(\"penyakit\")\n Call<DiseasePostResponse>\n postDisease(@Body DiseaseBody diseaseBody);\n @DELETE(\"penyakit\")\n Call<DeletePenyakitResponse> deletePenyakit(@Query(\"Id_penyakit\") String id_penyakit);\n\n @PUT(\"penyakit\")\n Call<PutPenyakitResponse> editPenyakit(@Query(\"Id_penyakit\") String id_penyakit,\n @Body PutPenyakitBody putPenyakitBody);\n\n @GET(\"tipepenyakit/{page}/{count_page}\")\n Call<TipePenyakitResponse>\n getTipePenyakitList(@Path(\"page\") String page, @Path(\"count_page\") String count_page);\n\n @POST(\"multimedia\")\n Call<MultimediaPostResponse>\n postMultimedia(@Body MultimediaBody multimediaBody);\n}", "public interface ApiService {\n @GET(\"questcms/floorplan\")\n Call<List<FloorPlan>> listFloorPlan();\n}", "public interface ApiInterface {\n\n @GET(\"status.txt\")\n Call<Integer> getStatus();\n\n @GET(\"login.php\")\n Call<LoginModel> login(@Query(\"phone\") String phone);\n\n @GET(\"verify.php\")\n Call<LoginModel> verify(@Query(\"phone\") String phone, @Query(\"code\") String code);\n}", "public interface APIInterface {\n @GET(\"/data/price\")\n Call<Object> compareCurrency(@Query(\"fsym\")String fsym, @Query(\"tsyms\") String tsyms);\n @GET(\"/api/data/coinlist/\")\n Call<CurrencyResource> CoinsList();\n}", "public interface d2ticker {\n @GET(\"/match/{id}\")\n void getMatchesList(@Path(\"id\") long id, Callback<Api> api);\n}", "public interface ApiService {\n @GET(\"/lista_pokemons.php\")\n void getPokemons(Callback<List<PokemonEntity>> response);\n\n\n}", "public interface ApiInterface {\n String HOST = \"http://fanyi.youdao.com/\";\n String IMG_HOST = \"http://www.bing.com/\";\n\n @GET(\"openapi.do\")\n Observable<Translation> getTranslation(@Query(\"keyfrom\") String keyfrom,\n @Query(\"key\") String key,\n @Query(\"type\") String type,\n @Query(\"doctype\") String doctype,\n @Query(\"version\") String version,\n @Query(\"q\") String q);\n\n @GET(\"HPImageArchive.aspx\")\n Observable<BackImg> getBackgroundImg(@Query(\"format\") String format,\n @Query(\"idx\") int idx,\n @Query(\"n\") int n);\n\n\n\n}", "public interface QMApi {\n @GET(\"10001/getProvinceCityAreaList\")\n Call<BaseResModel<AddressEntity>> getProvinceCityAreaList(@Query(\"localVersion\") String localVersion);\n\n @POST(\"10001/qmLogin\")\n Call<BaseResModel<UserInfoEntity>> login(@Body RequestBody jsonBody);\n}", "public interface Api {\n\n\n @GET(\"users?site=stackoverflow\")\n Call<UserResponse> getUser(@Query(\"pagesize\")int size,@Query(\"sort\")String sort);\n\n @GET(\"comments?site=stackoverflow\")\n Call<CommentsResponse> getComments(@Query(\"order\")String order,@Query(\"sort\")String votes,@Query(\"pagesize\")int size,@Query(\"min\")int min);\n\n @GET(\"posts/{ids}?site=stackoverflow\")\n Call<PostResponse> getPostResponseCall(@Path(\"ids\") long id);\n @GET(\"users/{ids}/questions?site=stackoverflow\")\n Call<QuestionsResponse> getQuestionsResponseCall (@Path(\"ids\")long id),@Query(\"sort\")String votes,\n}", "public interface API {\n @GET(\"api/v1.5/tr.json/translate\")\n Call<Resp> Translate(@QueryMap Map<String, String> parameters);\n\n}", "public interface RestApi {\n @GET(\"house_list\")\n Call<List<HouseInfo>> getHouseInfoList();\n\n @POST(\"landlordLogin\")\n Call<Landlord> landlordLogin(\n @Body Landlord landlord\n );\n\n @POST(\"landlordUpdate\")\n Call<Landlord> landlordUpdate(\n @Body Landlord landlord\n );\n\n @POST(\"incrementViewCount\")\n Call<RestHttpResponse> incrementViewCount(\n @Body HouseInfo houseInfo\n );\n\n @POST(\"tenantLogin\")\n Call<Tenant> tenantLogin(\n @Body Tenant tenant\n );\n\n @POST(\"tenantUpdate\")\n Call<Tenant> tenantUpdate(\n @Body Tenant tenant\n );\n\n @POST(\"search_house_list\")\n Call<List<HouseInfo>> getSearchHouseInfoList(@Body HouseSchCri criteria);\n\n @POST(\"getFavoriteList\")\n Call<List<HouseInfo>> getFavoriteList(@Body List<Favorite> favoriteList);\n\n}", "private ApiInfo apiInfo() {\n\t\treturn new ApiInfo(\"Langton ant app\", \"rest api for langton ant app\", version, null,\n\t\t\t\tnew Contact(\"leclerc\", \"N/A\", \"[email protected]\"), null, null, Collections.EMPTY_LIST);\n\t}", "private ApiInfo getApiInfo()\n {\n Contact contact = new Contact(\"Melchior Vrolijk\", \"\",\"[email protected]\");\n\n return new ApiInfo(\n \"Spring boot secure API documentation\",\n \"This is the demo spring boot secure api project documentation\",\n \"1.0\",\"\",contact,\n \"\",\"\",Collections.emptyList());\n }", "public interface Api {\n @GET(\"topher/2017/May/59121517_baking/baking.json\")\n Call<List<Recipe>> getRecipes();\n}", "public interface APIService {\n /**\n * 如果不需要转换成Json数据,可以用了ResponseBody;\n * @return call\n */\n @GET(\"apps?api_token={Your API Token}\")\n// Call<AppInfo> getAppInfo();\n Call<ResponseBody> getAppInfo();\n // you can add some other meathod\n}", "public interface Api {\n @GET(\"ikds.do\")\n Call<List<Movie>> getMovies(@Query(\"since\") int since, @Query(\"pagesize\") int pagesize);\n}", "public interface DataKPU {\n @GET(\"open/v1/api.php?cmd=wilayah_browse&\")\n Call<RWilayah> wilayah_browse(@Query(\"wilayah_id\") String idWil);\n}", "public interface Api {\n @GET(\"sites\") //Check urls here https://inthecheesefactory.com/blog/retrofit-2.0/en?fb_comment_id=885081521586565_886605554767495\n Single<List<Site>> sitesGet();\n\n @GET(\"sites/state\")\n Single<List<SiteState>> sitesStateGet(@QueryMap() Map<String, String> query);\n\n @POST(\"sites/state/connection/follow\")\n Single<SiteState> follow(@Body FollowCommand params);\n\n @POST(\"sites/state/connection/unfollow\")\n Completable unfollow(@Body UnfollowCommand params);\n }", "public interface WallpaperApi {\n @GET(\"api.php?latest\")\n Call<ImageList> getLastest();\n\n @GET(\"api.php?cat_list\")\n Call<CategoryList> getCategory();\n\n @GET(\"api.php\")\n Call<ImageList> getCategoryItem(@Query(\"cat_id\") String catId);\n}", "IWDViewController wdGetAPI();", "private ApiInfo apiInfo()\r\n\t {\r\n\t ApiInfo apiInfo = new ApiInfo(\r\n\t \"My Project's REST API\",\r\n\t \"This is a description of your API.\",\r\n\t \"version-1\",\r\n\t \"API TOS\",\r\n\t \"[email protected]\",\r\n\t \"API License\",\r\n\t \"API License URL\"\r\n\t );\r\n\t return apiInfo;\r\n\t }", "public interface AppAPI {\n\n @GET(\"weather\")\n Call<WeatherInfo> getCurrentWeather(@Query(\"id\") long cityId,\n @Query(\"units\") String units,\n @Query(\"appid\") String appId);\n\n @GET(\"forecast\")\n Call<Forecast> getForecast3hrs(@Query(\"id\") long cityId,\n @Query(\"units\") String units,\n @Query(\"appid\") String appId);\n\n @GET(\"find\")\n Call<CityResult> findCity(@Query(\"q\") String cityName,\n @Query(\"type\") String type,\n @Query(\"sort\") String sort,\n @Query(\"cnt\") int cnt,\n @Query(\"appid\") String appId);\n}", "interface ApiService {\n\n @GET(\"users/{user}/repos\")\n Call<List<FlickR>> getFlickRItems(@Path(\"user\") String user);\n\n @GET(\"users/{user}\")\n Call<Owner> getFlickRMedia(@Path(\"user\") String user);\n\n }", "public interface RestApi {\n\n @GET(\"/ride.asp\")\n Call<List<Model>> getData (@Query(\"userid\") int userId,\n @Query(\"from_name\") String fromName,\n @Query(\"from_lat\") double lat,\n @Query(\"from_lng\") double lng,\n @Query(\"to_name\") String toName,\n @Query(\"to_lat\") double toLat,\n @Query(\"to_lng\") double toLng,\n @Query(\"time\") long time);\n}", "public interface RestApi {\n}", "public interface SkateParks_API {\n String BASE_URL = \"http://danielburkedev.com/isa\";\n\n @GET(\"/isa_skateparksdb.php\")\n void getSkateParks( Callback<Skateparks_Model> cb);\n\n\n\n\n\n}", "public interface RequestService {\n //http://gank.io/api/data/Android/10/1\n /*@GET(\"api/data/Android/10/1\")\n Call<ResponseBody> getAndroidInfo();*/\n @GET(\"api/data/Android/10/1\")\n Call<GankBean> getAndroidInfo();\n @GET(\"api/data/Android/10/{page}\")\n Call<GankBean> getAndroidInfo(@Path(\"page\") int page);\n @GET(\"api/data/query?cityname=深圳\")\n Call<ResponseBody> getWeather(@Query(\"key\") String key,@Query(\"area\") String area);\n @GET(\"group/{id}/users\")\n Call<List<User2>> groupList(@Field(\"id\") int groupId, @QueryMap Map<String,String> options);\n @GET\n Call<GankBean> getAndroid2Info(@Url String url);\n\n}", "public interface StrockIndexApiService {\r\n// @Headers(GlobalContants.HeadsSet)\r\n// @GET(\"?key=a23cd4983655b336fbd1f440acfb1152\")\r\n// Call<StrockIndexBean> getStrockIndex(\r\n// @Query(\"type\") int type\r\n// );\r\n}", "public interface apiService {\n\n\n\n String base_url= \"http://192.168.43.154:8081/\";\n\n @GET(\"getprofile\")\n Call<Employee> getProfilehero(@Query(\"racf\") String id,@Query(\"password\") String pass);\n\n @GET(\"getpeopleonleave\")\n Call<Datesss> getdetailsondate(@Query(\"date\") String d);\n\n @GET(\"authentication\")\n Call<Auth> getAuth(@Query(\"racf\") String d,@Query(\"password\") String dd);\n\n @GET(\"getleavedates\")\n Call<leaves> getleavedates(@Query(\"racf\") String d);\n\n @GET(\"getwfhdates\")\n Call<WorkFromHome> getwfhdates(@Query(\"racf\") String dd);\n\n @GET(\"updateno\")\n Call<Auth> updating(@Query(\"racf\") String d,@Query(\"contacts\") String dd,@Query(\"contactnames\") String ddd);\n\n @GET(\"updateworkfromhome\")\n Call<Auth> updatingwfh(@Query(\"racf\") String d,@Query(\"dates\") String dd,@Query(\"reasons\") String ddd);\n\n @GET(\"updateonleave\")\n Call<Auth> updatingleave(@Query(\"racf\") String d,@Query(\"date\") String dd,@Query(\"reason\") String ddd);\n\n\n}", "public interface SinaApiService {\n\n @GET(\"cgi-bin/pitu_open_access_for_youtu.fcg\")\n Observable<MoveListBean> faceMerge(@Header(\"Authorization\") String appSign,\n @Body RequestBody body);\n}", "public interface ApiService {\n\n @GET(\"datacatalog?format=json\")\n Call<Catalog> getTopCatalog();\n\n\n/* @GET(\"item/{storyid}.json\")\n Call<StoryResponse> getStoryDetails(@Path(\"storyid\") String storyid);\n\n @GET(\"autocomplete/json\")\n Call<AutoCompleteGooglePlaces> getAutoCompleteResults(@Query(\"key\") String API_KEY,\n @Query(\"input\") String encode);\n\n @GET(\"nearbysearch/json\")\n Call<GetPlacesResponse> getPlaceDetails(@Query(\"location\") String location,\n @Query(\"radius\") int radius,\n @Query(\"key\") String key);*/\n}", "public interface API {\n\n String API_URL = \"https://letsgodubki-dtd.appspot.com/_ah/api/dubkiapi/v1\";//TODO //\n\n @GET(\"/itemscount\")\n public Observable<ArrayDorm> getItemsCount();\n\n}", "public interface PokeApiService {\n\n @GET(\"qvqk-dtmf.json\")\n Call<ArrayList<ViasRespuesta>> obtenerListaPokemon();\n}", "public interface ApiInterface {\n\n @GET(\"Articles/\")\n Call<List<Article>> getAllArticles();\n\n\n}", "public interface ApiInterface {\n\n\n @Headers({\"Content-Type: application/json\",})\n @POST(\"transport/public/registrations\")\n Call<Void> Register(@Body User user);\n\n\n //loginProcess\n @GET(\"user\")\n @Headers({\"Content-Type: application/json\"})\n Call<cUser> postWithFormParams();\n\n\n //userMe\n @GET(\"transport/user/me\")\n @Headers({\"Content-Type: application/json\"})\n Call<JsonObject> UserMe();\n\n\n\n //drivers\n @GET(\"transport/drivers\")\n @Headers({\"Content-Type: application/json\"})\n Call<JsonObject> drivers(\n @Query(\"latitud\") double latitud,\n @Query(\"longitud\") double longitud);\n\n\n}", "public interface API {\n\n// String BASE_URL = \"https://www.apiopen.top/\";\n String BASE_URL = \"http://gc.ditu.aliyun.com/\";\n\n\n @GET\n Observable<Response<ResponseBody>> doGet(@Url String Url);\n\n @FormUrlEncoded\n @POST\n Observable<Response<ResponseBody>> doPost(@Url String Url, @FieldMap HashMap<String, String> map);\n\n @Streaming\n @GET\n Observable<Response<ResponseBody>> doDownload(@Url String Url);\n}", "public interface ApiService {\n @POST(\"/AutoComplete/autocomplete/json\")\n void placeAuto(@Query(\"input\") String input, @Query(\"key\") String key, Callback<AutoComplete> callback);\n\n @POST(\"/geocode/json\")\n void getLatLng(@Query(\"address\") String address, @Query(\"key\") String key, Callback<GeocodingMain> callback);\n\n @POST(\"/directions/json\")\n void getroute(@Query(\"origin\") String origin, @Query(\"destination\") String destination, @Query(\"key\") String key, Callback<Directions> callback);\n\n @POST(\"/geocode/json\")\n void reverseGeoCoding(@Query(\"latlng\") String latLng, @Query(\"key\") String key, Callback<RevGeocodingMain> callback);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n}", "public interface DatosAPI\n{\n @GET(\"kspt-6t6c.json\")\n Call<List<CentrosAyuda>> obtenerLista();\n}", "public interface RestApis {\n\n @POST(\"verifyPassword?key= AIzaSyAUjt3lOrt0cFwbbd5Ag8M1-ISzQlE0Wjg\")\n Call<LoginResponse> loginUser(@Body LoginBody loginBody);\n\n @GET(\"events.json\")\n Call<EventKeyModel> getAllEvents();\n\n @PATCH(\"events/{eventid}\")\n Call<Void> punchit(@Path(\"eventid\") String eventid,@Body AddpunchedListModel addpunchedListModel);\n\n @POST(\"signupNewUser?key= AIzaSyAUjt3lOrt0cFwbbd5Ag8M1-ISzQlE0Wjg\")\n Call<LoginResponse> registerUser(@Body LoginBody loginBody);\n\n @POST(\"users/{uid}\")\n Call<Void> registerUserDb(@Path(\"uid\")String uid,@Body UserDetailsModel eventsDetailsBodyModel);\n}", "public interface RequestAPI {\n @GET(\"group\")\n Call<ListWeatherDTO> getDataWeather(@Query(\"id\") String id,\n @Query(\"appid\") String appId);\n\n @GET(\"weather\")\n Call<WeatherDTO> getDataByLocation(@Query(\"lat\") double lat,\n @Query(\"lon\") double lon,\n @Query(\"appid\") String appId);\n}", "public interface DubboApi {\n\n User hello(String name);\n\n String sleep();\n}", "public interface WarsawApiInterface {\n\n @GET(\"/api/action/wfsstore_get\")\n Call<WarsawResult> getPlacesByType(@Query(\"id\") String id, @Query(\"circle\") String circle, @Query(\"apikey\") String apikey);\n}", "ResourceAPI createResourceAPI();", "public interface CountryListAPI {\n\n //@POST(Constants.NewSessionURL)\n //Call<Session>createSession(@Body loginRequest loginRequest);\n\n @GET(Constants.CountriesListURL)\n Call<List<Country>> getAllCountries();\n\n\n\n}", "public interface DetailMovie {\n @GET(\"{id}\")\n Call<DetailMovies> getData(@Path(\"id\") int id,\n @Query(\"api_key\") String api_key,\n @Query(\"language\") String language,\n @Query(\"append_to_response\") String append_to_response\n );\n}", "public interface Service {\n\n\n @GET(\"/3/search/movie\")\n Call<Lista> getSearch(@Query(\"api_key\") String apiKey, @Query(\"query\") String queryString);\n\n}", "public interface StarWarsAPI {\r\n\r\n @GET\r\n Call<Character> getCharacter(@Url String url);\r\n\r\n @GET\r\n Call<Film> getFilm(@Url String url);\r\n}", "public interface HeroesApi {\n String BASE_URL = \"https://www.simplifiedcoding.net/demos/\";\n\n @GET(\"marvel\")\n Call<List<Hero>> getAll();\n}", "public interface Api {\n /**{\"response\": {\"zbsVer\": 0, \"hostId\": \"001207C40173\", \"room\": [{\"type\": \"\\u603b\\u7ecf\\u7406\", \"roomId\": \"322\", \"name\": \"\\u603b\\u7ecf\\u7406\"}, {\"roomId\": \"350\", \"type\": \"\\u4e3b\\u5367\", \"name\": \"\\u4e3b\\u5367\"}, {\"type\": \"\\u53a8\\u623f\", \"roomId\": \"366\", \"name\": \"\\u5475\\u5475\"}, {\"roomId\": \"381\", \"type\": \"\\u53a8\\u623f\", \"name\": \"\\u53a8\\u623f\"}, {\"roomId\": \"382\", \"type\": \"\\u9910\\u5385\", \"name\": \"\\u9910\\u5385\"}], \"softver\": 104, \"timestamp\": 1501838857, \"zbhVer\": 0, \"lastbackup\": 1499826785, \"pandId\": 101, \"firmver\": 217, \"numbers\": \"15905214137,15252089063,18912345678,15263985632,15152208332\", \"channelNo\": \"f\", \"registerHost\": false, \"name\": \"40173\"}, \"ret\": 0, \"md5\": \"a92c08fdf3a4b4f9aef04b3ce102df32\"}\n\n * 云端接口\n */\n String wrapper_request = \"/wrapper/request\";\n //\n// CloudInterface.h\n// ihome\n//\n// Created by on 3/13/15.\n// Copyright (c) 2015 Co.ltd. All rights reserved.\n\n //测试\n String urlCloud = \"/https://api2.boericloud.com\";\n //正式\n// String urlCloud = \"/https://api.boericloud.com\";\n\n String urlResetMobile = \"/auth/resetMobile\"; //重置手机号码\n String urlNegotiate = \"/auth/negotiate\";\n String urlRegister = \"/auth/register\"; //注册\n String urlSignin = \"/auth/login\"; //登录\n String urlSignOff = \"/auth/logout\"; //登出\n\n String urlResetCloudPassword = \"/auth/resetCloudpassword\"; //重置密码\n String urlSmsVerify = \"/auth/sms_verify\"; //短信验证\n String urlResetPWD = \"/auth/reset_password\"; //忘记密码\n String urlMobileVerify = \"/auth/mobile_verify\"; //验证手机号\n\n String urlUserUpdate = \"/user/update\";\n String urlUserUpdateToken = \"/user/update_token\";\n\n String urlUserPermissions = \"/user/host_permissions\"; //查询用户权限\n String urlUserUpdateExtend = \"/user/update_extend\"; //更新铃声和震动\n String urlUserShowExtend = \"/user/show_extend\"; //获取铃声和震动\n\n String urlHostBind = \"/host/bind\";\n String urlHostShow = \"/host/show\";\n\n String urlHostverifyadminpassword = \"/host/verifyadminpassword\";\n String urlHostSwitch = \"/host/switch\";\n\n String urlWrapperRequest = \"/wrapper/request\";//透传接口,一键备份\n String urlHostRestoreproperty = \"/host/restoreproperty\";//透传接口,一键还原\n\n String urlHostUpgrade = \"/upgrade/latest\";\n String urlHostUpgradeSoftware = \"/host/software_upgrade\";\n\n String urlSystemMessageShow = \"/systemMessage/show\"; //请求某天某类型的系统消息\n\n String urlWarningShow = \"/alarm/show1\"; //请求某天某类型的历史告警\n String urlAlarmDelete = \"/alarm/delete1\";//删除单条或多条历史告警\n String urlAlarmBatchDelete = \"/alarm/batch_delete\";//删除某天某类型的所有告警\n\n String urlSystemMessageDelete = \"/systemMessage/remove\";//删除某天某类型的系统消息\n String urlSystemBatchDelete = \"/systemMessage/batch_delete\";//删除某天某类型的所有系统消息\n\n String urlAlarmRead = \"/alarm/confirm_read\";//确认某条系统告警\n String urlSystemMessageRead = \"/systemMessage/confirmRead\";//确认某条系统消息\n\n String urlAddBlackList = \"/user/add_black_list\";//加入黑名单\n String urlRemoveBlackList = \"/user/remove_black_list\";//移除黑名单\n String urlQueryBlackList = \"/user/query_in_black_list\";//查询用户是否在黑名单内\n\n /*****************************/\n//主机直连 -> 设备相关\n String urlQueryWiseMediaList = \"/device/queryWiseMediaList\";//查询华尔斯背景音乐的歌曲列表\n String urlDeviceScan = \"/device/scan\";//扫描设备\n String urlDeviceLink = \"/device/link\";//关联设备->(新增)\n String urlDeviceQuerylink = \"/device/querylink\";//查询关联设备->(新增)\n String urlDeviceCmd = \"/device/cmd\";//控制设备\n String urlDeviceRemove = \"/device/remove\";//删除设备\n String urlDeviceDismiss = \"/device/dismiss\";//解绑设备\n String urlDeviceUpdateProp = \"/device/updateprop\";//更新设备属性\n String urlDevicesProperties = \"/devices/properties\";//查询设备属性\n String urlDeviceStatus = \"/device/status\";//查询设备状态\n String urlDeviceQueryOneProp = \"/device/queryOneProp\";//查询某一设备的属性->(新增)\n String urlDeviceConfigHgc = \"/device/configHgc\";//配置中控->(新增)\n String urlDeviceDeleteHgcConfig = \"/device/deleteHgcConfig\";//删除中控配置->(新增)\n String urlDeviceQueryHgcConfig = \"/device/queryHgcConfig\";//查询中控配置->(新增)\n String urlDeviceQueryMeterAddr = \"/device/queryMeterAddr\";//查询水电表的地址->(新增)\n String urlDeviceModifyMeterName = \"/device/modifyMeterName\";//修改水电表的名称->(新增)\n String urlDeviceQueryAllDevices = \"/device/queryAllDevices\";//查询所有设备的属性和状态->(新增)\n String urlDeviceSetFloorHeatingTimeTask = \"/device/setFloorHeatingTimeTask\";//设置地暖的定时任务->(新增)\n String urlDeviceSwitchFloorHeatingTimeTask = \"/device/switchFloorHeatingTimeTask\";//开启或者关闭地暖的定时任务->(新增)\n\n //主机直连 -> 主机相关\n String urlHostShowProperty = \"/host/showproperty\";//查询主机信息\n String urlHostModifyProperty = \"/host/modifyproperty\";//修改主机信息\n String urlHostQueryglobaldata = \"/host/queryglobaldata\";//查询全局信息->(新增)\n String urlHostModifyHostName = \"/host/modifyHostName\";//修改主机名称->(新增)\n\n //主机直连 -> 联动模式相关\n String urlPlanShow = \"/plan/show\";//查询指定的联动预案或模式\n String urlPlanUpdate = \"/plan/update\";//更新联动预案或模式\n String urlPlanQueryGlobalModes = \"/plan/queryGlobalModes\";//查询全局模式->(新增)\n String urlPlanModifyModeName = \"/plan/modifyModeName\";//修改模式名称->(新增)\n String urlPlanSetTimeTask = \"/plan/setTimeTask\";//设置模式定时\n String urlPlanTimeTaskSwitch = \"/plan/switchTimeTask\";//开启或关闭模式定时\n String urlPlanAllModes = \"/plan/allModes\";//查询当前主机下所有模式\n\n //主机直连 -> 房间区域相关\n String urlRoomsRemove = \"/room/remove\";//删除房间\n String urlRoomsUpdate = \"/room/update\";//更新房间\n String urlRoomsShow = \"/room/show\";//查询房间\n String urlAreaRemove = \"/room/removearea\";//删除区域\n String urlAreaUpdate = \"/room/updatearea\";//更新区域\n String urlAreaShow = \"/room/showarea\";//查询区域\n String urlRoomsUpdateMode = \"/room/updatemode\";//更新房间模式\n String urlRoomsShowMode = \"/room/showmode\";//查询房间模式\n String urlRoomsActiveMode = \"/room/activemode\";//激活房间模式\n\n//主机直连 -> 告警相关\n\n\n //主机直连 -> 用户相关\n String urlUserLogin = \"/user/login\";//直连登录->(新增)\n String urlUserAuthorizedLogin = \"/user/authorizedLogin\";//授权后的直连登陆(已在云端登陆)->(新增)\n String urlUserLogout = \"/user/logout\";//退出登录->(新增)\n String urlUserSaveUserInfo = \"/user/saveUserInfo\";//直连登录->(新增)\n /*****************************/\n\n String urlReportBloodsugar = \"/health/report_bloodsugar\";//上报血糖值\n String urlDeleteBloodsugar = \"/health/delete_bloodsugar\";//删除血糖值\n String urlUpdateBloodsugar = \"/health/update_bloodsugar\";//修改血糖值\n\n String urlReportBloodPressure = \"/health/report_bloodpressure\";//上报血压值\n String urlDeleteBloodPressure = \"/health/delete_bloodpressure\";//删除血压值\n\n String urlReportBodyWeight = \"/health/report_bodyweight\";//上报体重值\n String urlDeleteBodyWeight = \"/health/delete_bodyweight\";//删除体重值\n\n String urlReportUrine = \"/health/report_urine\"; //上报尿检值\n String urlDeleteUrine = \"/health/delete_urine\";//删除某一条尿检记录\n\n String urlDownHealthCache = \"/data/health_down\";//下载缓存数据\n String urlUploadHealthCache = \"/data/health_upload\";//上传缓存数据\n String urlUploadBloodPressureCache = \"/data/health_upload_blood_pressure\";//上传血压缓存数据\n String urlUploadBloodGlucoseCache = \"/data/health_upload_blood_glucose\";//上传血糖缓存数据\n String urlUploadBodyWeightCache = \"/data/health_upload_body_weight\";//上传体重缓存数据\n String urlUploadUrineCache = \"/data/health_upload_urine\";//上传尿检缓存数据\n\n String urlQueryElec = \"/energy/query_elec\"; //查询电能数据\n String urlQuerySocket = \"/energy/query_socket\"; //查询插座数据\n String urlQueryWater = \"/energy/query_water\"; //查询水表数据\n String urlQueryGas = \"/energy/query_gas\"; //查询气表数据\n\n\n String urlHostShow1 = \"/host/show1\"; //家庭管理中的主机属性\n\n String urlUserInfo = \"/user/userInfo\"; //查找用户信息\n String urlShowInviteCode = \"/user/show_invitecode\"; //查看邀请码\n String urlInvitationConvert = \"/integral/exchange_integral\"; //兑换邀请码\n String urlFamilyAddUser = \"/family/add_user\"; //增加家庭成员\n String urlFamilyTransPermission = \"/family/admin_permission_transfer\"; //转让管理员权限\n String urlFamilyUpdateAlias = \"/family/update_alias\"; //更新主机别名或用户别名\n String urlFamilyDeleteUser = \"/family/delete_user\"; //主机删除用户\n String urlFamilyDeleteHost = \"/family/delete_host\"; //管理员删除主机\n String urlFamilyUserIsAdmin = \"/family/user_isAdmin\"; //当前用户是否为管理员\n String urlFamilyUpdatePermissaion = \"/family/update_permission\"; //更新用户权限\n String urlFamilyUpdateShare = \"/family/update_share\"; //家庭分享健康数据\n String urlFamilyHostAdmin = \"/family/host_admin\"; //查询主机管理员\n\n String urlApplyUserApply = \"/apply/user_apply\"; //主机用户申请\n\n String urlApplyUserApplyV1 = \"/apply/user_apply_v1\"; //主机用户申请接口V1(将判断和推送放在后台)\n String urlApplyUserShow = \"/apply/user_show\"; //查询主机用户申请\n String urlApplyUserDelete = \"/apply/user_delete\"; //删除用户申请\n String urlApplyUserUpdateStatus = \"/apply/user_update_state\"; //更新用户状态\n\n String urlApplyUserUpdateStatusV1 = \"/apply/update_status_v1\"; //更新用户申请状态(将当前状态发送给后台进行筛选)\n String urlApplyUserHost = \"/apply/host_show\"; //查询主机下申请用户\n String urlApplyUserApplyIsExists = \"/apply/user_applyuserid_exist\"; //判断当前用户是否已经申请过\n String urlApplyUserReapply = \"/family/user_reapply\"; //用户重新申请\n String urlApplyQueryUserApplyOrAdnimReject = \"/apply/query_user_apply_reject\"; //查询用户申请或管理员拒绝记录\n\n String urlQueryUserApplyOrShare = \"/apply/query_user_apply_share\"; //查询用户是否有未处理申请或分享\n\n String urlNotificationPush = \"/notification/notification_push\"; //推送通知\n\n String notification_updateMsg = \"/notification_updateMsg\"; //报警通知\n String notification_updateScence = \"/notification_updateScence\"; //场景更新\n String notification_startHomeTimer = \"/notification_startHomeTimer\"; //开启主页轮询\n String notification_stopHomeTimer = \"/notification_stopHomeTimer\"; //关闭主页轮询\n String notification_startDeviceTimer = \"/notification_startDeviceTimer\"; //开启设备轮询\n String notification_stopDeviceTimer = \"/notification_stopDeviceTimer\"; //关闭设备轮询\n String notification_changeHost = \"/notification_changeHost\"; //切换主机\n String notification_updateCity = \"/notification_updateCity\"; //更新城市信息\n String notification_updateFamilyMembers = \"/notification_updateFamilyMembers\"; //更新家庭成员信息\n String notification_removeHomeNotifications = \"/notification_removeHomeNotifications\"; //移除所有通知\n String notification_familyRefresh = \"/notification_familyRefresh\"; //家庭成员刷新\n\n String urlShareUser = \"/share/user_share\"; //查询家庭的接口\n String urlQueryHealth = \"/health/query_health\"; //查询选定日期区间健康数据接口\n String urlQueryRecentHealth = \"/health/query_recent_health\"; //查询最近的健康数据分享接口\n\n String urlQueryRecentNotification = \"/notification/query_recent_notification\"; //查询最近的通知消息\n\n String urlFeedback = \"/feedback/feedback_push\"; //客户端的意见反馈\n\n String urlHostGuard = \"/host/guard\";//门禁对讲接听推送请求\n\n\n String urlStartScanBatch = \"/device/startScanBatch\";//开始批量添加\n String urlStopScanBatch = \"/device/stopScanBatch\";//停止批量添加\n\n String urlQueryDeviceBatch = \"/device/queryDeviceBatch\";//查询设备\n String urlSaveDeviceBatch = \"/device/saveDeviceBatch\";//保存\n\n String urlCommonDevice = \"/device/commondevice\";//设置、取消常用设备\n\n String urlHostShowOnline = \"/host/showonline\"; // 主机是否在线\n String urlgetMsgSettings = \"/settings/find_message_settings_by_mobile\";//获取消息设置\n String urlsetMsgSettings = \"/settings/save_message_settings\";//设置消息设置\n String urlsetPushMsg = \"/notification/notification_push\";//消息推送\n\n String urlQueryAirFilter = \"/energy/query_airFilter\";// 查询 历史记录\n String urlQueryTableWaterFilter = \"/energy/query_tableWaterFilter\";//\n String urlQueryFloorWaterFilter = \"/energy/query_floorWaterFilter\";//\n\n\n}", "public interface IApiService {\n\n @GET(\"/its/master_halte/{id}\")\n public Data<Station> getSynchListStation(@Path(\"id\") String id);\n\n @GET(\"/its/eta/{koridor}/{id}\")\n public Data<Incoming> getSynchListIncoming(@Path(\"koridor\") String koridor,@Path(\"id\") String id);\n}", "public interface WayMapAPI {\n @GET(\"maps/api/directions/json?\")\n Call<WayPoints> getWayFromCoordinate(@Query(\"origin\")String from, @Query(\"destination\") String to, @Query(\"key\") String api_key);\n\n\n}", "public interface API {\r\n\r\n // String SERVER_URL = \"http://192.168.11.150:8080\";\r\n// String SERVER_URL = \"http://10.0.2.2:8080/\";\r\n String SERVER_URL = \"http://societyfocus.com/\";\r\n String API_PATH_PATTERN = \"service/\";\r\n\r\n interface ILoginHeaderParams {\r\n String SOCIETY = \"X-Society\";\r\n String USERNAME = \"X-Username\";\r\n String PASSWORD = \"X-Password\";\r\n String DEVICE_ID = \"X-DeviceID\";\r\n String DEVICE_IDOld = \"X-DeviceIDOld\";\r\n String ACCESS_TOKEN = \"X-AccessToken\";\r\n }\r\n\r\n interface IPostLoginHeaderParams {\r\n String AUTH_TOKEN = \"X-Auth-Token\";\r\n\r\n }\r\n\r\n interface IAssetParams {\r\n String ID = \"id\";\r\n }\r\n\r\n interface IEventParams {\r\n String MONTH = \"month\";\r\n String YEAR = \"year\";\r\n }\r\n\r\n @GET(API_PATH_PATTERN + \"social/fblogin\")\r\n public Call<LoginResponse>\r\n fblogin(@Header(ILoginHeaderParams.DEVICE_ID) String deviceID,\r\n @Header(ILoginHeaderParams.DEVICE_IDOld) String deviceIDOld,\r\n @Query(\"accesstoken\") String FBToken);\r\n\r\n @GET\r\n public Call<GraphPhotoResponse> graphcall(@Url String url);\r\n\r\n @POST(API_PATH_PATTERN + \"access/login\")\r\n public Call<LoginResponse>\r\n login(@Header(ILoginHeaderParams.SOCIETY) String society,\r\n @Header(ILoginHeaderParams.USERNAME) String username,\r\n @Header(ILoginHeaderParams.PASSWORD) String password,\r\n @Header(ILoginHeaderParams.DEVICE_ID) String deviceID,\r\n @Header(ILoginHeaderParams.DEVICE_IDOld) String deviceIDOld);\r\n\r\n @POST(API_PATH_PATTERN + \"upload/image/base64\")\r\n public Call<UploadImageResponse> uploadimage(@Body UploadImage uploadImage);\r\n\r\n @GET(API_PATH_PATTERN + \"v1/comment/add/complaint_{Complaint_ID}/{MESSAGE}\")\r\n public Call<AddCommentResponse> getAddComment(@Header(IPostLoginHeaderParams.AUTH_TOKEN) String authToken,\r\n @Path(\"Complaint_ID\") String complaintID, @Path(\"MESSAGE\") String message);\r\n\r\n @GET(API_PATH_PATTERN + \"user/getalluser\")\r\n public Call<MembersResponse> getAllUsers(@Header(IPostLoginHeaderParams.AUTH_TOKEN) String authToken);\r\n\r\n @GET(API_PATH_PATTERN + \"society/asset/getall\")\r\n public Call<AssetsResponse> getAllSocietyAssets(@Header(IPostLoginHeaderParams.AUTH_TOKEN) String authToken);\r\n\r\n @GET(API_PATH_PATTERN + \"society/panel\")\r\n public Call<PanelResponse> getSocietyPanel(@Header(IPostLoginHeaderParams.AUTH_TOKEN) String authToken);\r\n\r\n @GET(API_PATH_PATTERN + \"society\")\r\n public Call<SocietyListResponse> getSocietyList();\r\n\r\n @POST(API_PATH_PATTERN + \"v1/complaint/save\")\r\n public Call<ComplaintResponse> saveComplaint(@Header(IPostLoginHeaderParams.AUTH_TOKEN) String authToken, @Body Complaint complaint);\r\n\r\n @GET(API_PATH_PATTERN + \"v1/complaint/getusercomplaint\")\r\n public Call<ComplaintListResponse> getUserComplaints(@Header(IPostLoginHeaderParams.AUTH_TOKEN) String authToken);\r\n\r\n @GET(API_PATH_PATTERN + \"v1/complaint/get/{id}\")\r\n public Call<ComplaintCommentResponse> getComplaintDetails(@Header(IPostLoginHeaderParams.AUTH_TOKEN) String authToken, @Path(\"id\") String complaintID);\r\n\r\n @POST(API_PATH_PATTERN + \"user/modifymyuser\")\r\n public Call<UserResponse> modifyUser(@Header(IPostLoginHeaderParams.AUTH_TOKEN) String authToken, @Body User user);\r\n\r\n @GET(API_PATH_PATTERN + \"user/modify/oldpass/{oldpassword}/newpass/{newpassword}/email/{email}\")\r\n public Call<BaseResponse> modifyPassword(@Header(IPostLoginHeaderParams.AUTH_TOKEN) String authToken, @Path(\"oldpassword\") String oldpassword, @Path(\"newpassword\") String newpassword, @Path(\"email\") String email);\r\n\r\n @POST(API_PATH_PATTERN + \"society/asset/book\")\r\n public Call<BookAssetResponse> saveAssetBooking(@Header(IPostLoginHeaderParams.AUTH_TOKEN) String authToken, @Body BookAsset bookAsset);\r\n\r\n @POST(API_PATH_PATTERN + \"society/asset/getassetbyuser\")\r\n public Call<AssetbookingByUserResponse> getAssetBooking(@Header(IPostLoginHeaderParams.AUTH_TOKEN) String authToken);\r\n\r\n @GET(API_PATH_PATTERN + \"vehicle/getvehilcebynumber/{vehiclenumber}\")\r\n public Call<CarSearchResponse> searchVehicleNumber(@Header(IPostLoginHeaderParams.AUTH_TOKEN) String authToken, @Path(\"vehiclenumber\") int vehiclenumber);\r\n\r\n @GET(API_PATH_PATTERN + \"society/noticeboard/getall\")\r\n public Call<NoticeBoardResponse> getAllNotices(@Header(IPostLoginHeaderParams.AUTH_TOKEN) String authToken);\r\n\r\n @POST(API_PATH_PATTERN + \"society/noticeboard/add\")\r\n public Call<AddNewNoticeResponse> addNewNotice(@Header(IPostLoginHeaderParams.AUTH_TOKEN) String authToken, @Body AddNewNotice newNotice);\r\n}", "@Test\n\t \n\t public void getApi() {\n\t\t \n\t\t Response getIt=get(\"https://reqres.in/api/users?page=2\");\n\t\t getIt.prettyPrint();\n\t\t System.out.println(getIt.getStatusCode());\n\t\t System.out.println(getIt.getTime());\n\t\t \n\t\t //to validate\n\t\t int validGstatus=getIt.getStatusCode();\n\t\t Assert.assertEquals(validGstatus,200);\n\t\t \n\t }", "private ApiInfo apiInfo() {\n Contact contact = new Contact(\"Hanchuanjun\", \"\", \"[email protected]\");\n ApiInfo apiInfo = new ApiInfo(\n \"GEHC SmartX SSO-OAuth模块api\",\n \"GEHC SmartX SSO-OAuth模块服务api\",\n \"v0.0.1\",\n \"初始化版本\",\n contact,\n \"\",\n \"\");\n return apiInfo;\n }", "public static void main(String[] args) {\n RestAdapter restAdapter;\n restAdapter = (RestAdapter) new RestAdapter.Builder().setEndpoint(API_URL)\n .build().create(MyAPI.class);\n\n\n }", "public interface GrafanaService {\n @GET(\"/render\")\n Call<List<ParsedStatElement>> getData(@Query(\"from\") String from, @Query(\"until\") String until, @Query(\"target\") String target, @Query(\"format\") String format);\n}", "public interface ICupidoApi {\n @POST(\"/api/location\")\n Call<Location> savePosition(@Body Location l);\n\n @GET(\"/api/users\")\n Call<List<User>> getUsers();\n}", "public interface SaavnApi\n{\n @GET(\"/api.php\")\n Call<List<Song>> makeSongRequest(\n @QueryMap(encoded=true) Map<String, String> options\n );\n\n @GET(\"/api.php\")\n Call<SongList> makePlaylistRequest(\n @QueryMap(encoded=true) Map<String, String> options\n );\n\n @GET(\"/api.php\")\n Call<Show> makeShowRequest(\n @QueryMap(encoded=true) Map<String, String> options\n );\n\n @GET(\"/api.php\")\n Call<Song> makeEpisodeRequest(\n @QueryMap(encoded=true) Map<String, String> options\n );\n}", "public interface ApiService {\n @GET(\"get_currency_rates.php\")\n Call<List<Currency>> getRates();\n}", "public interface APIService {\n}", "public interface GetProductionDataApi {\n @GET(\"/api/Production/GetProductionData\")\n public void getProductionData(@Query(NetWorkConstant.stid) String stid,@Query(NetWorkConstant.apikey)String apikey,NetCallback<NetWorkResultBean<ProductionDataPackge>> NetCallback);\n\n @GET(\"/api/Production/GetProductionState/\")\n public void getProductionState(@Query(NetWorkConstant.stid) String stid, @Query(NetWorkConstant.apikey) String apikey, NetCallback<NetWorkResultBean<ProductionStatePackge>> callback);\n\n}", "@DebugLog\npublic interface ApiService {\n final static String APPSETTINGS = \"/application_settings.json\";\n final static String MOVIES = \"/in_theaters.json\";\n\n // APPLICATION SETTINGS\n @Headers(\"Cache-Control: no-cache\")\n @GET(APPSETTINGS)\n void getApplicationSettings(Callback<ApplicationSettings> cb);\n\n // IN THEATERS\n @GET(MOVIES)\n void getMovies(@Query(\"apikey\") String key, @Query(\"page\") int page, @Query(\"page_limit\") int page_limit, Callback<Movies> cb);\n}", "public void request() {\n }", "public interface ApiAction {}", "public interface ApiService {\n\n @GET(\"/api/v1/rates/daily/\")\n Call<List<ExchangeRate>> getTodayExchangeRates();\n\n}", "public interface ApiInterface {\n @GET(\"json/movies.json\")\n Call<List<Movie>> getStudentDetails();\n}", "public interface ApiEndPointsAndPatameters {\n\t\n//\t/** Resource path for api resources */\n//\tString API_PREFIX = \"/api\";\n//\n\t/** Resource path for API version 1 */\n\tString API_VERSION_1 = \"/v1\";\n//\n//\t/** Resource path to get available power plants. */\n//\tString POWER_PLANT_PATH = \"/powerPlant\";\n//\n//\t/** Resource path to get power plant data for a given power plant id. */\n//\tString POWER_PLANT_DATA_PATH = \"/{id}\";\n//\n//\tString POWER_PLANT_DETAILS = \"/details\";\n//\n//\tString POWER_PLANT_DATA_SUM_BY_DAY = \"/sumByDay\";\n//\n//\tString POWER_PLANT_DATA_SUM_BY_WEEK = \"/sumByWeek\";\n//\n//\tString POWER_PLANT_DATA_SUM_BY_MONTH = \"/sumByMonth\";\n//\n//\tString POWER_PLANT_DATA_SUM_BY_YEAR = \"/sumByYear\";\n//\t\n//\tString POWER_PLANT_DATA_NEXT_HOUR_FORECAST = \"/nextHourForecast\";\n//\t\n//\tString POWER_PLANT_DATA_NEXT_DAY_FORECAST = \"/nextDayForecast\";\n//\n//\t/** Query parameter for filtering by start date. */\n//\tString QUERY_PARAMETER_START_DATE = \"startDate\";\n//\n//\t/** Query parameter for filtering by end date. */\n//\tString QUERY_PARAMETER_END_DATE = \"endDate\";\n//\n//\t/** Query parameter for filtering by power plant data type. */\n//\tString QUERY_PARAMETER_DATA_TYPE = \"dataType\";\n//\t\n//\t\n\t\n\t\n\t/** Query parameter for filtering by power plant data type. */\n\tString QUERY_AUTHENTICATION_ID = \"Authentication-ID\";\n\t\n\t/** Query parameter for filtering by power plant data type. */\n\tString QUERY_USER_PASSWORD = \"UserPassword\";\n\t\n\t/** Query parameter for filtering by power plant data type. */\n\tString QUERY_AUTHORISATION_ID = \"authorisation-id\";\n\t\n\t/** Resource path to get a list to the components a User has access to. */\n\tString USER_COMPONENT_LIST = \"/UserComponentLists\";\n\t\n\t/** Resource path to get a list of available resources for a component. */\n\tString DATA_LIST = \"/DataLists\";\n\t\n\t/** Resource path to authenticate. */\n\tString AUTHENTICATION = \"/authentication\";\n\t\n\t/** Resource path to logout. */\n\tString LOGOUT = \"/logout\";\n\t\n\t/** Resource path to get power plant data for a given power plant id. */\n\tString COMPONENT_ID_PATH = \"/{cId}\";\n\t\n\t/** Resource path to get power plant data for a given power plant id. */\n\tString SIDE_PATH = \"/{side}\";\n\t\n\t/** Resource path to get power plant data for a given power plant id. */\n\tString TYPE_PATH = \"/{type}\";\n\t\n\t/** Resource path to get power plant data for a given power plant id. */\n\tString DATE_PATH = \"/{date}\";\n}", "public interface ApiInterface {\n @GET(\"movie/top_rated\")\n Call<MoviesResponse> getTopRatedMovies(@Query(\"api_key\") String apiKey);\n\n @GET(\"movie/{id}\")\n Call<MoviesResponse> getMovieDetails(@Path(\"id\") int id, @Query(\"api_key\") String apiKey);\n\n}", "public interface GoogleApi {\n\n @Headers(\"Content-Type: application/json\")\n @POST(VISION_CLOUD)\n Call<VisionRespose> processImage64(@Header(\"Content-Length\") String bodyLength, @Query(\"key\") String apiKey, @Body VisionRequest visionRequest);\n\n @Headers(\"Content-Type: application/json\")\n @POST(VISION_CLOUD)\n Call<LogoResponse> processLogoImage64(@Header(\"Content-Length\") String bodyLength, @Query(\"key\") String apiKey, @Body VisionRequest visionRequest);\n\n @Headers(\"Content-Type: application/json\")\n @GET(TRANSLATION_CLOUD)\n Call<TranslationResponse> translateQuery(@Query(\"key\") String apiKey, @Query(\"source\") String source, @Query(\"target\") String target, @Query(\"q\") List<String> queries);\n}", "public interface StoreAPI {\n @GET(\"store/{id}\")\n Call<ApiResult<Store>> store(@Path(\"id\") int id);\n}", "public interface ApiService {\n\n\n\n}", "private Api() {\n // Implement a method to build your retrofit\n buildRetrofit(BASE_URL);\n }", "public interface Api {\n @Headers({\"Content-Type: application/json\",\"Accept: application/json\"})\n @POST(\"anslogsave\")\n Call<ResponseBody> anslogsave(@Body RequestBody anslog);\n\n @Headers({\"Content-Type: application/json\",\"Accept: application/json\"})\n @POST(\"robotlogsave\")\n Call<ResponseBody> robotlogsave(@Body RequestBody robotlogsave);\n\n @Headers({\"Content-Type: application/json\",\"Accept: application/json\"})\n @POST(\"robotstatsave\")\n Call<ResponseBody> robotstatsave(@Body RequestBody robotstatsave);\n\n @FormUrlEncoded\n @POST(\"borr\")\n Call<String> borr(@Field(\"title\")String title,\n @Field(\"inflag\")int inflag);\n @FormUrlEncoded\n @POST(\"guide\")\n Call<String> guide(@Field(\"title\")String title);\n @FormUrlEncoded\n @POST(\"\")\n Call<String> baidu();\n\n @Headers({\"Content-Type: application/json\",\"Accept: application/json\"})\n @POST(\"data\")\n Call<ResponseBody> upCewen(@Body RequestBody upCewen);\n\n @GET(\"doc_list?\")\n Call<String> search(@Query(\"search_txt\")String search);\n}", "public interface WeatherCurrentServiceAPI {\n /*@GET(\"data/2.5/weather?lat=52&lon=25&APPID=8e401c96e74d2f0c07da113eb27d51d0\")\n Call<WeatherCurentData>getWeatherResponse();*/\n\n @GET\n Call<WeatherCurentData> getWeatherResponse(\n @Url String url\n );\n\n}", "public interface ApiService {\n\n @GET(\"/iseAlim/league.json\")\n Call<Leagues> getLeague();\n\n\n}", "public interface ApiService {\n\n\n}", "public interface ApiInterface {\n\n @GET(\"{poblacion}.xml\")\n Call<Escrutinio_sitio> getPoblacionData(@Path(\"poblacion\") String poblacion);\n\n }", "public interface IOpenWeatherAPI {\n String ENDPOINT = \"http://api.openweathermap.org/\";\n\n String KEY_OPEN_WEATHER_API = \"0d664d5c76a364c4e18b207ac25a0ef4\";\n\n //******** 5 DÍAS/8 HORAS *******\n //@GET(\"/data/2.5/forecast\")\n //Call<RootPredicciones> getPredicciones(@Query(\"lat\") String latitud, @Query(\"lon\") String longitud);//Información meteorológica de 5 días de la latitud y longitud\n\n\n //******** Actual ***********\n @GET(\"data/2.5/weather\")\n Call<Prediccion> getPrediccionActual(@Query(\"lat\") String latitud, @Query(\"lon\") String longitud);//Información meteorológica actual de la latitud y longitud\n}", "public interface TravelApiService {\n @GET(\"api/users/{userCode}/travels\")\n Call<List<Travel>> getTravel(@Path(value = \"userCode\") String userCode);\n\n @POST(\"api/users/{userCode}/travels\")\n Call<PostTravelGsonResponce> postTravel(@Path(value = \"userCode\") String userCode, @Field(\"travel_date\") String travelDate, @Field(\"latitude\") Double latitude, @Field(\"longitude\") Double longitude, @Field(\"area_name\") String areaName, @Field(\"contry_name\") String countryName, @Field(\"token\") String token);\n}", "public interface BruceApi {\n\n\tString ENDPOINT = \"http://gank.avosapps.com/api\";\n\n\t@GET(\"/data/福利/\" + BruceFactory.pageSize + \"/{page}\")\n\tvoid getListData(@Path(\"page\") int page, Callback<FuliList> response);\n\n\t@GET(\"/day/{year}/{month}/{day}\")\n\tvoid getDataSet(@Path(\"year\") int year, @Path(\"month\") int month, @Path(\"day\") int day,Callback<DataSet> response);\n\n\t@GET(\"/day/{year}/{month}/{day}\")\n\tObservable<DataSet> getDataObservable(@Path(\"year\")int year,@Path(\"month\")int month,@Path(\"day\")int day);\n\n\t//但如果我们想获得JSON字符串,Callback的泛型里就不能写POJO类了,要写Response(retrofit.client包下)\n\t@GET(\"/data/福利/\" + BruceFactory.pageSize + \"/{page}\")\n\tvoid getResponseData(@Path(\"page\") int page, Callback<Response> response);\n\n\n}", "public interface ApiHelper {\n\n @GET(\"users\")\n Call<List<UserInfo>> getUsers();\n}", "public interface RealTimeTransportApi {\n\n @GET(\"busstopinformation\")\n Call<PublicStopListResponse> listAllStops(@Query(\"operator\") String operator);\n\n @GET(\"realtimebusinformation\")\n Call<RealtimeRouteResponse> getRealtimeInfo(@Query(\"stopid\") String stopId);\n\n}", "public interface APIService {\n\n String baseUrl = \"http://api.zhuishushenqi.com\";\n\n /**\n */\n// @FormUrlEncoded\n// @POST(\"/cats/lv2/statistics/\")\n// Flowable<GetListRsp> login(@Field(\"username\") String username,\n// @Field(\"password\") String password);\n\n /**\n * GetListRsp\n */\n @GET(\"/cats/lv2/statistics/\")\n Observable<GetListRsp> login(@QueryMap Map<String, String> params);\n}", "public interface ApiInterface {\n\n\n @GET(\"api/jsonBlob/9e44dca2-ad19-11e7-894a-5dc7a0a132b5\")\n Call<List<News>> getNewsAPIList();\n\n @PUT(\"api/jsonBlob/9e44dca2-ad19-11e7-894a-5dc7a0a132b5\")\n Call<List<News>> createNewsAPIBlob();\n\n @DELETE(\"/api/jsonBlob/9e44dca2-ad19-11e7-894a-5dc7a0a132b5\")\n Call deletePost();\n\n}", "public interface EndpointsApi {\n\n @GET(ConstantesRestApi.URL_GET_FOLOWS_MEDIA_RECENT)\n Call<MascotasResponse> getRecentMedia(@Path(\"user-id\") String id);\n\n @GET(ConstantesRestApi.URL_GET_PROFILE_USER_WITH_ID)\n Call<MascotasResponse> getProfile(@Path(\"user-id\") String id);\n\n @GET(ConstantesRestApi.URL_GET_FOLLOWS)\n Call<MascotasResponse> getFollows();\n\n @GET(ConstantesRestApi.URL_GET_FOLOWS_MEDIA_RECENT)\n Call<MascotasResponse> getFollowsMediaRecent(@Path(\"user-id\") String id);\n}", "interface APIInterface {\n\n @GET(\"users/\")\n Call<List<User>> doGetListResources();\n\n @GET(\"users/{id}\")\n Call<User> doGetUser(@Path(\"id\") String id );\n\n @POST(\"/api/users/\")\n Call<User> createUser(@Body User user);\n\n}", "private ParkingLotApi()\r\n {\r\n }", "public interface RuangguruApiClient {\n\n // TODO: 3/3/17 change this as desired request\n\n @GET(\"/login\")\n Call<LoginResponse> loginRequest(@Path(\"username\") String username\n , @Path(\"password\") String password);\n}", "public interface API {\n @GET(\"today\")\n Observable<RecommendBean> getRecommendData();\n\n @GET(\"search/query/listview/category/{category}/count/10/page/{page}\")\n Observable<SearchBean> getSearchData(@Path(\"category\") String category, @Path(\"page\") int page);\n\n @GET(\"xiandu/categories\")\n Observable<Categories> getCategoriesData();\n\n @GET(\"xiandu/category/{type}\")\n Observable<Category> getCategoryData(@Path(\"type\") String type);\n}", "@Api(value = \"课程分类管理\",description = \"课程分类管理\",tags = {\"课程分类管理\"})\npublic interface CategoryControllerApi {\n @ApiOperation(\"查询分类\")\n public CategoryNode findList(String id);\n}", "public interface IdeaApiService {\n @GET(\"version/android\")\n Observable<BasicResponse<VersionAfterBean>> updateVersionTEST(@Query(\"version\") String version);\n\n @GET(\"version/upgrade\")\n Observable<BasicResponse<Bean>> getappfindmeanu(@Query(\"version\") String version);\n\n @GET(\"merchandise/index\")\n Observable<BasicResponse<Bean>> getaa();\n}", "public interface ApiInterface {\n\n //Account API\n String ping(OkHttpClient client);\n\n String obtainAuthToken(OkHttpClient client, String username, String password);\n\n JSONObject checkAccountInfo(OkHttpClient client, String token);\n\n JSONObject getServerInformation(OkHttpClient client);\n\n //Starred File API\n List<StarredFile> listStarredFiles(OkHttpClient client, String token);\n\n //Library API\n List<Library> listLibraries(OkHttpClient client, String token);\n\n Library getLibraryInfo(OkHttpClient client, String token, String repo_id);\n\n List<LibraryHistory> getLibraryHistory(OkHttpClient client, String token, String repo_id);\n\n JSONObject createNewLibrary(OkHttpClient client, String token, String libName, String desc, String password);\n\n boolean deleteLibrary(OkHttpClient client, String token, String repo_id);\n\n //File API\n String getFileDownloadLink(OkHttpClient client, String token, String repo_id, String p, boolean reuse);\n\n FileDetail getFileDetail(OkHttpClient client, String token, String repo_id, String p);\n\n List<FileCommit> getFileHistory(OkHttpClient client, String token, String repo_id, String p);\n\n boolean createFile(OkHttpClient client, String token, String repo_id, String p);\n\n boolean renameFile(OkHttpClient client, String token, String repo_id, String p, String newName);\n\n boolean moveFile(OkHttpClient client, String token, String repo_id, String p, String dst_repo, String dst_dir);\n\n boolean revertFile(OkHttpClient client, String token, String repo_id, String p, String commit_id);\n\n boolean deleteFile(OkHttpClient client, String token, String repo_id, String p);\n\n String getUploadLink(OkHttpClient client, String token, String repo_id, String p);\n\n List<UploadFileRes> uploadFile(OkHttpClient client, String token, String uploadLink, String parent_dir, String relative_path, File... files);\n\n String getUpdateLink(OkHttpClient client, String token, String repo_id, String p);\n\n boolean updateFile(OkHttpClient client, String token, String updataLink, File file, String target_file);\n\n //Directory API\n List<DirectoryEntry> listDirEntriesByP(OkHttpClient client, String token, String repo_id, String p);\n\n// List<DirectoryEntry> listDirectoryEntriesByID(OkHttpClient client,String token,String repo_id,String id);\n\n List<DirectoryEntry> listAllDirEntries(OkHttpClient client, String token, String repo_id);\n\n boolean createNewDir(OkHttpClient client, String token, String repo_id, String p);\n\n boolean renameDir(OkHttpClient client, String token, String repo_id, String p, String newName);\n\n boolean deleteDir(OkHttpClient client, String token, String repo_id, String p);\n\n String getDirDownloadToken(OkHttpClient client, String token, String repo_id, String parent_dir, String dirents);\n\n boolean queryZipProgress(OkHttpClient client, String token, String dirDownloadToken);\n\n String getDirDownloadLink(OkHttpClient client, String token, String dirDownloadToken);\n}", "public interface ApiInterface {\n @GET(\"api/place/nearbysearch/json?rankby=distance&sensor=false\")\n Call<CityPlacesResponse> getNearPlaces(@Query(\"location\") String ltlng,@Query(\"types\") String type,@Query(\"key\") String key);\n\n @GET(\"api/place/details/json?\")\n Call<PlaceDetailsResponse> getDetailsPlace(@Query(\"placeid\") String placeId, @Query(\"key\") String key);\n\n @GET(\"api/directions/json?&units=metric\")\n Call<DistanceResponse> getWay(@Query(\"origin\") String ltlng, @Query(\"destination\") String pltplng, @Query(\"sensor\") boolean sensor, @Query(\"language\") String language, @Query(\"key\") String key);\n}", "public interface ApiService {\n @GET(\"MainQuize.json\")//list\n Call<MainQuizeDao> loadPhotoList();\n}" ]
[ "0.7671685", "0.72777003", "0.7262244", "0.6854822", "0.6814281", "0.6758555", "0.65944475", "0.6587333", "0.6585479", "0.65769225", "0.65535814", "0.65369105", "0.6508852", "0.6508194", "0.64727867", "0.64669096", "0.6463896", "0.6445774", "0.6445448", "0.6444885", "0.64444727", "0.64397305", "0.6423058", "0.6419681", "0.6417836", "0.641708", "0.64164895", "0.6415768", "0.64122224", "0.6402347", "0.6397896", "0.6384016", "0.638367", "0.63792634", "0.6378719", "0.6376286", "0.63726103", "0.6370762", "0.6369791", "0.6366691", "0.636611", "0.63590866", "0.63514686", "0.63514155", "0.63391554", "0.6336691", "0.63356817", "0.6335158", "0.63337505", "0.63296396", "0.6329251", "0.6327117", "0.6324167", "0.6323187", "0.6316415", "0.631181", "0.6311485", "0.63078976", "0.6305456", "0.63043606", "0.6303636", "0.63009465", "0.6296684", "0.62945753", "0.62750536", "0.6270659", "0.6267713", "0.62656486", "0.62581754", "0.62567353", "0.62556547", "0.62538815", "0.6252072", "0.62495416", "0.62463266", "0.6243663", "0.6242592", "0.6241113", "0.6239356", "0.6232634", "0.62291074", "0.6227513", "0.62261844", "0.6220859", "0.6219378", "0.62156534", "0.6214699", "0.6211628", "0.62073475", "0.6205359", "0.6200431", "0.62002414", "0.6197942", "0.6197349", "0.6194821", "0.61936885", "0.6191995", "0.6191322", "0.6186922", "0.6186152", "0.61762613" ]
0.0
-1
If the top virtual site is connected to the bottom virtual site, the system percolates.
public boolean percolates() { return mainUnion.connected(virtualTopId, virtualBottomId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean percolates()\n {\n return uf.connected(topVirtualSite, bottomVirtualSite);\n }", "private void connectToVirtualSites(int currentSite) {\n // if top row, connect to virtual top site\n if (currentSite < gridSize) {\n uf.union(currentSite, topVirtualSite);\n }\n\n // same with bottom row\n if (currentSite >= totalSites - gridSize) {\n uf.union(currentSite, bottomVirtualSite);\n }\n }", "public boolean percolates() {\n return mainObject.connected(vsite1, vsite2);\n }", "public boolean percolates() {\n if (openSitesCount < gridSize) {\n return false;\n }\n\n if (gridSize == 1 && openSitesCount == 1) {\n return true;\n }\n\n return wquf2.connected(virtualTopSiteIndex, virtualBottomSiteIndex);\n }", "public boolean percolates() {\n return sitesUF.connected(upSiteIndex, downSiteIndex);\n }", "public boolean percolates() {\n // The system percolates if top and bottom are connected\n return UF.connected(top, bottom);\n }", "public boolean percolates() {\n return backwashQuickUnion.connected(virtualTop, virtualBottom);\n }", "public boolean percolates() {\n if (wuf.connected(virtTop, virtBottom)) {\n hasPercolated = true;\n return true;\n }\n \n return false;\n }", "private void connectToOpenNeighbors(int currentSite)\n {\n int aboveSite = currentSite - gridSize;\n int leftOfSite = currentSite - 1;\n int rightOfSite = currentSite + 1;\n int belowSite = currentSite + gridSize;\n\n if (aboveSite > 0) {\n if (grid[aboveSite]) {\n uf.union(currentSite, aboveSite);\n }\n }\n\n if (rightOfSite % gridSize != 0 && rightOfSite < totalSites) {\n if (grid[rightOfSite]) {\n uf.union(currentSite, rightOfSite);\n }\n }\n\n if (leftOfSite % gridSize != gridSize-1 && leftOfSite > 0) {\n if (grid[leftOfSite]) {\n uf.union(currentSite, leftOfSite);\n }\n }\n\n if (belowSite < totalSites) {\n if (grid[belowSite]) {\n uf.union(currentSite, belowSite);\n }\n }\n }", "public boolean percolates(){\n\t\treturn unionFind.connected(virtualBottom, virtualTop);\n\t}", "public boolean percolates() {\n return unionFind.connected(topRoot, bottomRoot);\n }", "public boolean percolates() throws Exception {\n if (SIZE != 1 && ufVirtual.connected(0, SIZE - 1))\n return true;\n else if (SIZE == 1 && isOpen(1, 1))\n return true;\n return false;\n }", "public void bottomTopCheck() {\n bLCollide = false;\n bRCollide = false;\n tLCollide = false;\n tRCollide = false;\n if(grounded) {\n bottomCollision(); \n }\n else if(!grounded) {\n if(ySpeed > 0 || Math.abs(xSpeed) > Math.abs(ySpeed)) {\n bottomCollision(); \n }\n else if(ySpeed < 0 || Math.abs(xSpeed) > Math.abs(ySpeed)) {\n topCollision();\n }\n }\n }", "private void connectWithVirtualSites(int row, int col) {\n if (row == 1) {\n UF.union(0, getIndex(row, col));\n } else {\n UF.union(getSize() * getSize() + 1, getIndex(row, col));\n }\n }", "public boolean percolates() {\n return false;\n }", "public boolean percolates() {\n if(numberOfOpenSites() < length) {\n return false;\n }\n if(isPercolating) return true;\n for(int i = 0; i < length; i++) {\n if( isOpen(0, i) ) {\n for(int j = 0; j < length; j++) {\n if(isOpen(length - 1, j) && percolation.connected(translate(length-1,j),translate(0,i))) {\n isPercolating = true;\n return true;\n }\n }\n }\n }\n return false;\n }", "public void open(int row, int col) {\n validate(row, col);\n int thisSite = getThisSite(row, col);\n if (isOpen(row, col)) {\n return;\n }\n openSites += 1;\n openState[thisSite] = true;\n\n// if only one, open is percolate\n if (n == 1) {\n percolates = true;\n return;\n }\n if (row == 1) {\n// first row\n uf.union(vTop, thisSite);\n if (col == 1) {\n// the left top corner\n checkRight(row, col);\n } else if (col == n) {\n// the right top corner\n checkLeft(row, col);\n } else {\n// other in top\n checkRight(row, col);\n checkLeft(row, col);\n }\n checkBottom(row, col);\n } else if (row == n) {\n// last row\n// uf.union(vBottom, );\n bottom[col - 1] = getThisSite(row, col);\n if (col == 1) {\n// the left bottom corner\n checkRight(row, col);\n } else if (col == n) {\n// the right bottom corner\n checkLeft(row, col);\n } else {\n// other in bottom\n checkRight(row, col);\n checkLeft(row, col);\n }\n checkTop(row, col);\n } else {\n if (col == 1) {\n// the left col\n checkRight(row, col);\n } else if (col == n) {\n// the right col\n checkLeft(row, col);\n } else {\n// other in bottom\n checkRight(row, col);\n checkLeft(row, col);\n }\n checkTop(row, col);\n checkBottom(row, col);\n }\n// how to improve\n if (!percolates) {\n for (int i = 0; i < n; i++) {\n int site = bottom[i];\n int rowx = n;\n int colx = i + 1;\n if (site > 0 && isFull(rowx, colx)) {\n percolates = true;\n }\n }\n }\n }", "public void bottomPlatform()\r\n {\r\n //Bottom platform/ floor\r\n addObject (platforms[0], 141, 555);\r\n addObject (platforms[1], 424, 555);\r\n addObject (platforms[2], 700, 555);\r\n addObject (platforms[3], 950, 555);\r\n }", "public boolean percolates() {\n return UF.isConnected(0, getSize() * getSize() + 1);\n }", "public void updateTopWeight(){\r\n\t \tif(this.topNode != null)\r\n\t \t{\r\n\t \t\tif(this.topNode.isNoGoZone() == true)\r\n\t \t{\r\n\t \t\t\t//set edge weight to 9999999 if the next node is NO go zone or\r\n\t \t\t\t//boundary node\r\n\t \t\tthis.topWeight = weightOfNoGoZone;\r\n\t \t}\r\n\t \telse if(this.topNode.road == true && this.topNode.isNoGoZone() == false)\r\n\t \t{\r\n\t \t\t//set edge weight to 1 if the next node is a road node\r\n\t \t\tthis.topWeight = this.topNode.getOwnElevation();\r\n\t \t}\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\t//set edge weight to INF if the next node is NULL\r\n\t \t\tthis.topWeight = weightOfMapEdge;\r\n\t \t}\r\n\t }", "private void paintConnectionsBetweenPostBlocks() {\n if (checkBoxShowConnectionsOfGroundTruth.isSelected()) {\n for (BlockPair blockPair : blockPairs_groundTruth) {\n if (blockPair.leftVersion == positionOfCurrentLeftVersionInViewedPost) {\n Polygon polygon = paintPolygonOfConnections(blockPair.rightBlock, blockPair.leftBlock);\n connectionsPane.getChildren().add(polygon);\n }\n }\n }\n\n if (checkBoxShowConnectionsOfComputedSimilarity.isSelected()) {\n for (BlockPair blockPair : blockPairs_computedSimilarity) {\n if (blockPair.leftVersion == positionOfCurrentLeftVersionInViewedPost) {\n Line line = paintLineOfConnections(blockPair.rightBlock, blockPair.leftBlock);\n connectionsPane.getChildren().add(line);\n }\n }\n }\n }", "public void open(int row, int col) {\n if(!inRange(row, col)) {\n throw new IllegalArgumentException();\n }\n if(!isOpen(row, col)) {\n numOpen++;\n grid[row][col] = true;\n if(row==1) {\n // Opening a site on top connects it to the virtual top\n UF.union(((row-1)*size + col), top);\n UF2.union(((row-1)*size + col), top);\n }\n if(row==size) {\n // Opening a site on bottom connects it to the virtual bottom\n UF.union(((row-1)*size + col), bottom);\n }\n // Connect the site being opened to all its open neighbours\n if(row-1>=1 && grid[row-1][col]) {\n UF.union(((row-1)*size + col), (((row-1)-1)*size + col));\n UF2.union(((row-1)*size + col), (((row-1)-1)*size + col));\n }\n if(row+1<=size && grid[row+1][col]) {\n UF.union(((row-1)*size + col), (((row+1)-1)*size + col));\n UF2.union(((row-1)*size + col), (((row+1)-1)*size + col));\n }\n if(col-1>=1 && grid[row][col-1]) {\n UF.union(((row-1)*size + col), ((row-1)*size + (col-1)));\n UF2.union(((row-1)*size + col), ((row-1)*size + (col-1)));\n }\n if(col+1<=size && grid[row][col+1]) {\n UF.union(((row-1)*size + col), ((row-1)*size + (col+1)));\n UF2.union(((row-1)*size + col), ((row-1)*size + (col+1)));\n }\n }\n }", "public void open(int row, int col) {\n if (!this.isValid(row, col))\n throw new IndexOutOfBoundsException(\"row or col is out of side length!\");\n if (this.isOpen(row, col))\n return;\n\n // set the site to opened status\n this.status[getElement(row, col)] |= OPENBIT;\n\n // see whether the site is connected to top/bottom row\n byte top = (byte) (this.status[getElement(row, col)] & TOPBIT);\n byte bottom = (byte) (this.status[getElement(row, col)] & BOTTOMBIT);\n int parent = -1;\n\n // see whether the surrounding sites' root is connected to top/bottom row\n if (isValid(row - 1, col) && isOpen(row - 1, col)) {\n parent = this.uf.find(getElement(row - 1, col));\n top |= (this.status[parent] & TOPBIT);\n bottom |= (this.status[parent] & BOTTOMBIT);\n }\n if (isValid(row + 1, col) && isOpen(row + 1, col)) {\n parent = this.uf.find(getElement(row + 1, col));\n top |= (this.status[parent] & TOPBIT);\n bottom |= (this.status[parent] & BOTTOMBIT);\n }\n if (isValid(row, col - 1) && isOpen(row, col - 1)) {\n parent = this.uf.find(getElement(row, col - 1));\n top |= (this.status[parent] & TOPBIT);\n bottom |= (this.status[parent] & BOTTOMBIT);\n }\n if (isValid(row, col + 1) && isOpen(row, col + 1)) {\n parent = this.uf.find(getElement(row, col + 1));\n top |= (this.status[parent] & TOPBIT);\n bottom |= (this.status[parent] & BOTTOMBIT);\n }\n\n // connect to each surrounding site\n if (isValid(row - 1, col) && isOpen(row - 1, col)) {\n this.uf.union(getElement(row, col), getElement(row - 1, col));\n }\n if (isValid(row + 1, col) && isOpen(row + 1, col)) {\n this.uf.union(getElement(row, col), getElement(row + 1, col));\n }\n if (isValid(row, col - 1) && isOpen(row, col - 1)) {\n this.uf.union(getElement(row, col), getElement(row, col - 1));\n }\n if (isValid(row, col + 1) && isOpen(row, col + 1)) {\n this.uf.union(getElement(row, col), getElement(row, col + 1));\n }\n\n // judge whether the root of the site is connected to top/bottom row\n parent = this.uf.find(getElement(row, col));\n this.status[parent] |= (top | bottom);\n\n // if the root is connected to top & bottom, then the whole system is percolated\n if (TOPBIT == (this.status[parent] & TOPBIT) && BOTTOMBIT == (this.status[parent] & BOTTOMBIT))\n this.isPercolated = true;\n }", "void shouldUseSocksProxyInSecondPage() {\n }", "public boolean percolates(){\n return uf.connected(ufSize - 2, ufSize - 1);\n }", "public boolean percolates() {\n for (int i = 0; i < size; i++) {\r\n if (flowGrid[size * (size - 1) + i] < size) { // if any of the bottom row points at any of the index in the top row\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "@Override\n public void periodic() {\n SmartDashboard.putBoolean(\"Top Switch\", topSwitch.get());\n }", "public boolean percolates() {\n\t\tint top = uf.find(0);\n\t\tint bottom = uf.find(size * size + 1);\n\t\treturn top == bottom;\n\t}", "public int right_of(Halfedge el, Point p) {\r\n\t\tEdge e;\r\n\t\tSite topsite;\r\n\t\tint right_of_site, above, fast;\r\n\t\tfloat dxp, dyp, dxs, t1, t2, t3, yl;\r\n\r\n\t\te = el.ELedge;\r\n\t\ttopsite = e.reg[1];\r\n\t\tright_of_site = p.x > topsite.coord.x ? 1 : 0;\r\n\t\tif (right_of_site == 1 && el.ELpm == le)\r\n\t\t\treturn (1);\r\n\t\tif (right_of_site == 0 && el.ELpm == re)\r\n\t\t\treturn (0);\r\n\r\n\t\tif (e.a == 1.0) {\r\n\t\t\tdyp = p.y - topsite.coord.y;\r\n\t\t\tdxp = p.x - topsite.coord.x;\r\n\t\t\tfast = 0;\r\n\t\t\tif ((right_of_site == 0 & e.b < 0.0)\r\n\t\t\t\t\t| (right_of_site == 1 & e.b >= 0.0)) {\r\n\t\t\t\tabove = dyp >= e.b * dxp ? 1 : 0;\r\n\t\t\t\tfast = above;\r\n\t\t\t} else {\r\n\t\t\t\tabove = p.x + p.y * e.b > e.c ? 1 : 0;\r\n\t\t\t\tif (e.b < 0.0)\r\n\t\t\t\t\tabove = (above == 1 ? 0 : 1);\r\n\t\t\t\tif (above == 0)\r\n\t\t\t\t\tfast = 1;\r\n\t\t\t}\r\n\t\t\tif (fast == 0) {\r\n\t\t\t\tdxs = topsite.coord.x - (e.reg[0]).coord.x;\r\n\t\t\t\tabove = e.b * (dxp * dxp - dyp * dyp) < dxs * dyp\r\n\t\t\t\t\t\t* (1.0 + 2.0 * dxp / dxs + e.b * e.b) ? 1 : 0;\r\n\t\t\t\tif (e.b < 0.0)\r\n\t\t\t\t\tabove = (above == 1 ? 0 : 1);\r\n\t\t\t}\r\n\t\t} else { // e.b==1.0\r\n\t\t\tyl = e.c - e.a * p.x;\r\n\t\t\tt1 = p.y - yl;\r\n\t\t\tt2 = p.x - topsite.coord.x;\r\n\t\t\tt3 = yl - topsite.coord.y;\r\n\t\t\tabove = (t1 * t1 > (t2 * t2 + t3 * t3) ? 1 : 0);\r\n\t\t}\r\n\r\n\t\treturn (el.ELpm == le ? above : (above == 1 ? 0 : 1));\r\n\t}", "public boolean percolates(){\n \tif(this.gridLength == 1){\n \t\treturn isOpen(1,1);\n \t}\n \treturn (this.bottom[unionTest.find(0)]);\n }", "public void findNeighbours(ArrayList<int[]> visited , Grid curMap) {\r\n\t\tArrayList<int[]> visitd = visited;\r\n\r\n\t\t//System.out.println(\"FROM FIND NEIGHBOURS cur pos:\" +Arrays.toString(nodePos));\r\n\t\t//for(int j=0; j<visitd.size();j++) {\r\n\t\t\t//System.out.println(\"FROM FIND NEIGHBOURS\" +Arrays.toString(visited.get(j)));\r\n\t\t\t//System.out.println(\"FROM FIND NEIGHBOURS getvstd\" +Arrays.toString(visited.get(j)));\r\n\t\t//}\r\n\t\t//System.out.println(\"FROM FIND NEIGHBOURS\" +visited);\r\n\t\tCell left=curMap.getCell(0, 0);\r\n\t\tCell right=curMap.getCell(0, 0);\r\n\t\tCell upper=curMap.getCell(0, 0);\r\n\t\tCell down=curMap.getCell(0, 0);\r\n\t\t//the getStart() method returns x,y coordinates representing the point in x,y axes\r\n\t\t//so if either of [0] or [1] coordinate is zero then we have one less neighbor\r\n\t\tif (nodePos[1]> 0) {\r\n\t\t\tupper=curMap.getCell(nodePos[0], nodePos[1]-1) ; \r\n\t\t}\r\n\t\tif (nodePos[1] < M-1) {\r\n\t\t\tdown=curMap.getCell(nodePos[0], nodePos[1]+1);\r\n\t\t}\r\n\t\tif (nodePos[0] > 0) {\r\n\t\t\tleft=curMap.getCell(nodePos[0] - 1, nodePos[1]);\r\n\t\t}\r\n\t\tif (nodePos[0] < N-1) {\r\n\t\t\tright=curMap.getCell(nodePos[0]+1, nodePos[1]);\r\n\t\t}\r\n\t\t//for(int i=0;i<visitd.size();i++) {\r\n\t\t\t//System.out.println(Arrays.toString(visitd.get(i)));\t\r\n\t\t//}\r\n\t\t\r\n\t\t//check if the neighbor is wall,if its not add to the list\r\n\t\tif(nodePos[1]>0 && !upper.isWall() && (!exists(visitd,new int[] {nodePos[0], nodePos[1] - 1}))) {\r\n\t\t\t//Node e=new Node(this , this.N , this.M , new int[] {nodePos[0], nodePos[1] - 1},curMap);\r\n\t\t\t//if(e.getVisited()!=true) {\r\n\t\t\tNodeChildren.add(new Node(this , this.N , this.M , new int[] {nodePos[0], nodePos[1] - 1}, curMap)); // father of the new nodes is this node\r\n\t\t\t//}\r\n\t\t}\r\n\t\tif(nodePos[1]<M-1 &&!down.isWall() && (!exists(visitd,new int[] {nodePos[0], nodePos[1] + 1}))){\r\n\t\t\tNodeChildren.add(new Node(this , this.N , this.M , new int[] {nodePos[0], nodePos[1] + 1}, curMap));\r\n\t\t}\r\n\t\tif(nodePos[0]>0 && !left.isWall() && (!exists(visitd,new int[] {nodePos[0] - 1, nodePos[1]}))) {\r\n\t\t\tNodeChildren.add(new Node(this , this.N , this.M , new int[] {nodePos[0] - 1, nodePos[1]}, curMap));\r\n\t\t}\r\n\t\tif(nodePos[0]<N-1 && !right.isWall() && (!exists(visitd,new int[] {nodePos[0] + 1, nodePos[1]}))) {\r\n\t\t\tNodeChildren.add(new Node(this , this.N , this.M , new int[] {nodePos[0] + 1, nodePos[1]}, curMap));\r\n\t\t}\r\n\t\t//for(int i=0; i<NodeChildren.size();i++) {\r\n\t\t\t//System.out.println(\"Paidia sth find:\" + Arrays.toString(NodeChildren.get(i).getNodePos()));\r\n\t\t//}\r\n\t\t\t\t\t\t\r\n\t}", "public boolean percolates() {\n return uf.connected(source, sink);\n }", "@Override\npublic int mover() {\n\treturn posicaoTopoEscada;\n}", "private boolean linkMappingCoreSeparate( VirtualLink vLink, SubstrateSwitch edgeSwitch1,\n\t\t\tSubstrateSwitch edgeSwitch2, Topology topo) {\n\t\tMap<SubstrateSwitch, LinkedList<SubstrateSwitch>> listAggConnectEdge = topo.getListAggConnectEdge();\n\t\tMap<SubstrateSwitch, LinkedList<SubstrateSwitch>> listCoreConnectAggMap = topo.getListCoreConnectAgg();\t\n\t\tLinkedList<LinkPhyEdge> listPhyEdge = topo.getListLinkPhyEdge();\n\t\tLinkedList<SubstrateLink> listLinkBandwidth = topo.getLinkBandwidth();\n\t\tLinkedList<SubstrateSwitch> listAggSort1 = new LinkedList<>();\n\t\tLinkedList<SubstrateSwitch> listAggSort2 = new LinkedList<>();\n\t\tLinkedList<SubstrateSwitch> listCoreSort1 = new LinkedList<>();\n\t\tLinkedList<SubstrateSwitch> listCoreSort2 = new LinkedList<>();\n\t\t\n\t\tService sService = vLink.getsService();\n\t\tService dService = vLink.getdService();\n\t\t\n\t\tdouble bandwidthDemand = vLink.getBandwidthRequest();\n\t\tint count = 0;\n\t\t\n\t\tSubstrateSwitch edge1 = null, edge2 = null;\n\t\tSubstrateSwitch agg1 = null, agg2 = null;\n\t\tSubstrateSwitch core = null;\n\t\t\n\t\tLinkPhyEdge linkEdge1 = null, linkEdge2 = null;\n\t\t\n\t\tSubstrateLink linkAggEdge1a = null, linkAggEdge1b = null;\n\t\tSubstrateLink linkAggEdge2a = null, linkAggEdge2b = null;\n\t\tSubstrateLink linkCoreAgg1a = null, linkCoreAgg1b = null;\n\t\tSubstrateLink linkCoreAgg2a = null, linkCoreAgg2b = null;\n\t\t//===get edge switch connect to server=====================================//\n\t\tfor (LinkPhyEdge linkPhyEdge: listPhyEdge) { \n\t\t\t\n\t\t\tif(linkPhyEdge.getPhysicalServer().equals(sService.getBelongToServer())){\n\t\t\t\tedge1 = linkPhyEdge.getEdgeSwitch();\n\t\t\t\tif(linkPhyEdge.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\treturn false;\n\t\t\t\t}else {\n\t\t\t\t\tlinkEdge1 = linkPhyEdge;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\tif(linkPhyEdge.getPhysicalServer().equals(dService.getBelongToServer())) {\n\t\t\t\tedge2 = linkPhyEdge.getEdgeSwitch();\n\t\t\t\tif(linkPhyEdge.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\treturn false;\n\t\t\t\t}else {\n\t\t\t\t\tlinkEdge2 = linkPhyEdge;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tlistAggSort1 = sortListSwitch(listAggConnectEdge.get(edge1));\n\t\tlistAggSort2 = sortListSwitch(listAggConnectEdge.get(edge2));\n\t\n\t\t//=== find link connect Agg to Edge ======================================//\n\t\tAGG_EDGE_LOOP1:\n\t\tfor(int index = 0; index < listAggSort1.size(); index++) {\n\t\t\tagg1 = listAggSort1.get(index);\n\t\t\tfor (SubstrateLink link : listLinkBandwidth) {\n\t\t\t\tif(link.getStartSwitch() == edge1 && link.getEndSwitch() == agg1) {\n\t\t\t\t\tif(link.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlinkAggEdge1a = link;\n\t\t\t\t\t\tcount ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(link.getStartSwitch() == agg1 && link.getEndSwitch() == edge1) {\n\t\t\t\t\tif(link.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlinkAggEdge1b = link;\n\t\t\t\t\t\tcount ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(count == 2) break AGG_EDGE_LOOP1;\n\t\t\t}\t\n\t\t} // end for loop 1\n\t\tcount = 0;\n\t\tAGG_EDGE_LOOP2:\n\t\tfor(int index = 0; index < listAggSort2.size(); index++) {\n\t\t\tagg2 = listAggSort2.get(index);\n\t\t\tfor (SubstrateLink link : listLinkBandwidth) {\n\t\t\t\tif(link.getStartSwitch() == edge2 && link.getEndSwitch() == agg2) {\n\t\t\t\t\tif(link.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlinkAggEdge2a = link;\n\t\t\t\t\t\tcount ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(link.getStartSwitch() == agg2 && link.getEndSwitch() == edge2) {\n\t\t\t\t\tif(link.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlinkAggEdge2b = link;\n\t\t\t\t\t\tcount ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(count == 2) break AGG_EDGE_LOOP2;\n\t\t\t}\t\n\t\t} // end for loop 2\n\t\t//=== find link connect Agg to Core ======================================//\n\t\tlistCoreSort1 = sortListSwitch(listCoreConnectAggMap.get(agg1));\n\t\tlistCoreSort2 = sortListSwitch(listCoreConnectAggMap.get(agg2));\n\t\t\n\t\tif(!listCoreSort1.equals(listCoreSort2)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tfor(int index = 0; index < listCoreSort1.size(); index++) {\n\t\t\tcore = listCoreSort1.get(index);\n\t\t\tfor (SubstrateLink link : listLinkBandwidth) {\n\t\t\t\tif(link.getStartSwitch() == agg1 && link.getEndSwitch() == core) {\n\t\t\t\t\tif(link.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlinkCoreAgg1a = link;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(link.getStartSwitch() == core && link.getEndSwitch() == agg1) {\n\t\t\t\t\tif(link.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlinkCoreAgg1b = link;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(link.getStartSwitch() == agg2 && link.getEndSwitch() == core) {\n\t\t\t\t\tif(link.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlinkCoreAgg2a = link;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(link.getStartSwitch() == core && link.getEndSwitch() == agg2) {\n\t\t\t\t\tif(link.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlinkCoreAgg2b = link;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//===set up bandwidth for all found links above ========//\n\t\tlinkEdge1.setBandwidth(linkEdge1.getBandwidth() - bandwidthDemand);\n\t\tlinkEdge1.getEdgeSwitch().setPort(linkEdge1.getEdgeSwitch(), bandwidthDemand);\n\t\tlinkEdge2.setBandwidth(linkEdge2.getBandwidth() - bandwidthDemand);\n\t\tlinkEdge2.getEdgeSwitch().setPort(linkEdge2.getEdgeSwitch(), bandwidthDemand);\n\t\tvLink.getLinkPhyEdge().add(linkEdge1);\n\t\tvLink.getLinkPhyEdge().add(linkEdge2);\n\t\tlinkAggEdge1a.setBandwidth(linkAggEdge1a.getBandwidth() - bandwidthDemand);\n\t\tlinkAggEdge1a.getStartSwitch().setPort(linkAggEdge1a.getEndSwitch(), bandwidthDemand);\n\t\tlinkAggEdge1b.setBandwidth(linkAggEdge1b.getBandwidth() - bandwidthDemand);\n\t\tlinkAggEdge1b.getStartSwitch().setPort(linkAggEdge1b.getEndSwitch(), bandwidthDemand);\n\t\tlinkAggEdge2a.setBandwidth(linkAggEdge2a.getBandwidth() - bandwidthDemand);\n\t\tlinkAggEdge2a.getStartSwitch().setPort(linkAggEdge2a.getEndSwitch(), bandwidthDemand);\n\t\tlinkAggEdge2b.setBandwidth(linkAggEdge2b.getBandwidth() - bandwidthDemand);\n\t\tlinkAggEdge2b.getStartSwitch().setPort(linkAggEdge2b.getEndSwitch(), bandwidthDemand);\n\t\tlinkCoreAgg1a.setBandwidth(linkCoreAgg1a.getBandwidth() - bandwidthDemand);\n\t\tlinkCoreAgg1a.getStartSwitch().setPort(linkCoreAgg1a.getEndSwitch(), bandwidthDemand);\n\t\tlinkCoreAgg1b.setBandwidth(linkCoreAgg1b.getBandwidth() - bandwidthDemand);\n\t\tlinkCoreAgg1b.getStartSwitch().setPort(linkCoreAgg1b.getEndSwitch(), bandwidthDemand);\n\t\tlinkCoreAgg2a.setBandwidth(linkCoreAgg2a.getBandwidth() - bandwidthDemand);\n\t\tlinkCoreAgg2a.getStartSwitch().setPort(linkCoreAgg2a.getEndSwitch(), bandwidthDemand);\n\t\tlinkCoreAgg2b.setBandwidth(linkCoreAgg2b.getBandwidth() - bandwidthDemand);\n\t\tlinkCoreAgg2b.getStartSwitch().setPort(linkCoreAgg2b.getEndSwitch(), bandwidthDemand);\n\t\tvLink.getLinkSubstrate().add(linkAggEdge1a);\n\t\tvLink.getLinkSubstrate().add(linkAggEdge1b);\n\t\tvLink.getLinkSubstrate().add(linkAggEdge2a);\n\t\tvLink.getLinkSubstrate().add(linkAggEdge2b);\n\t\tvLink.getLinkSubstrate().add(linkCoreAgg1a);\n\t\tvLink.getLinkSubstrate().add(linkCoreAgg1b);\n\t\tvLink.getLinkSubstrate().add(linkCoreAgg2a);\n\t\tvLink.getLinkSubstrate().add(linkCoreAgg2b);\n\t\treturn true;\n\t}", "public void updateVerticalPosition() {\n\t\tVector3 avatarWorldPositionP1 = dolphinNodeOne.getWorldPosition();\n\t\tVector3 avatarLocalPositionP1 = dolphinNodeOne.getLocalPosition();\n\t\tVector3 terrainPositionP1 = (Vector3) Vector3f.createFrom(avatarLocalPositionP1.x(),\n\t\t\t\ttessellationEntity.getWorldHeight(avatarWorldPositionP1.x(), avatarWorldPositionP1.z()) + 0.3f,\n\t\t\t\tavatarLocalPositionP1.z());\n\t\tVector3 groundPositionP1 = (Vector3) Vector3f.createFrom(avatarLocalPositionP1.x(),\n\t\t\t\tgroundTessellation.getWorldHeight(avatarWorldPositionP1.x(), avatarWorldPositionP1.z() - 0.3f),\n\t\t\t\tavatarLocalPositionP1.z());\n\t\tif (avatarLocalPositionP1.y() <= terrainPositionP1.y() + 0.3f\n\t\t\t\t|| avatarLocalPositionP1.y() <= groundPositionP1.y()) {\n\t\t\tVector3 avatarPositionP1 = terrainPositionP1;\n\t\t\tif (avatarPositionP1.y() < groundPositionP1.y()) {\n\t\t\t\tavatarPositionP1 = groundPositionP1;\n\t\t\t}\n\t\t\tdolphinNodeOne.setLocalPosition(avatarPositionP1);\n\t\t\tsynchronizeAvatarPhysics(dolphinNodeOne);\n\t\t\tif (jumpP1) {\n\t\t\t\tdolphinNodeOne.getPhysicsObject().applyForce(0.0f, 800f, 0.0f, 0.0f, 0.0f, 0.0f);\n\t\t\t\t// jumpP1 = false;\n\t\t\t}\n\t\t} // else if (avatarLocaPositionP1.y() > terrainPositionP1.y() + 1.0f) {\n\t\t\t// jumpP1 = true;\n\t\t\t// }\n\t\tfor (int i = 0; i < npcEntity.length; i++) {\n\t\t\tVector3 npcWorldPosition = npcEntity[i].getNode().getWorldPosition();\n\t\t\tVector3 npcLocalPosition = npcEntity[i].getNode().getLocalPosition();\n\t\t\tVector3 npcTerrainPosition = (Vector3) Vector3f.createFrom(npcLocalPosition.x(),\n\t\t\t\t\ttessellationEntity.getWorldHeight(npcWorldPosition.x(), npcWorldPosition.z() + 0.3f),\n\t\t\t\t\tnpcLocalPosition.z());\n\t\t\tVector3 npcGroundPlanePosition = (Vector3) Vector3f.createFrom(npcLocalPosition.x(),\n\t\t\t\t\tgroundTessellation.getWorldHeight(npcWorldPosition.x(), npcWorldPosition.z() + 0.2f),\n\t\t\t\t\tnpcLocalPosition.z());\n\n\t\t\tif (npcLocalPosition.y() <= npcTerrainPosition.y() + 0.3f\n\t\t\t\t\t|| npcLocalPosition.y() <= npcGroundPlanePosition.y()) {\n\t\t\t\tVector3 npcPosition = npcTerrainPosition;\n\t\t\t\tif (npcLocalPosition.y() < npcGroundPlanePosition.y()) {\n\t\t\t\t\tnpcPosition = npcGroundPlanePosition;\n\t\t\t\t}\n\t\t\t\tnpcEntity[i].getNode().setLocalPosition(npcPosition);\n\t\t\t\tsynchronizeAvatarPhysics(npcEntity[i].getNode());\n\t\t\t}\n\n\t\t}\n\t}", "public boolean percolates() {\n\t\treturn cellTree.connected(side * side, side * side + 1);\n\t}", "public boolean percolates() {\n return this.isPercolated;\n }", "public void out_site(Site s) {\r\n\t\tif (triangulate == 0 & plot == 1 & debug == 0) {\r\n\t\t\t// circle (s.coord.x, s.coord.y, cradius);\r\n\t\t}\r\n\r\n\t\tif (triangulate == 0 & plot == 0 & debug == 0) {\r\n\t\t\tSystem.err.printf(\"s %f %f\\n\", s.coord.x, s.coord.y);\r\n\t\t}\r\n\r\n\t\tif (debug == 1) {\r\n\t\t\tSystem.err.printf(\"site (%d) at %f %f\\n\", s.sitenbr, s.coord.x,\r\n\t\t\t\t\ts.coord.y);\r\n\t\t}\r\n\t}", "private void\nremotetrafficScroll_Change() {\n\n\t// 22sept03\n\tfloat remotetrafficscalemax = 1000 / ((systemDesign_.remotetrafficmax - systemDesign_.remotetrafficmin) / 2); // 'en 1.1 change scale\n\tfloat remotetrafficscalemin = 0.00001f / ((systemDesign_.remotetrafficmax - systemDesign_.remotetrafficmin) / 2); // 'en 1.1 change scale\n\tfloat scalelogmin = (float)Math.log(remotetrafficscalemin);\n\tfloat scalelogmax = (float)Math.log(remotetrafficscalemax);\n\tfloat remotetrafficscalelog = scalelogmin \n\t\t\t\t+ (scalelogmax - scalelogmin) \n\t\t\t\t* (systemDesign_.remotetraffic - systemDesign_.remotetrafficmin) \n\t\t\t\t/ (systemDesign_.remotetrafficmax - systemDesign_.remotetrafficmin);\n\n\tif (remotetrafficCheck) {\n\t\tsystemDesign_.remotetrafficscale = RnR.Exp(remotetrafficscalelog);\n//\t remotetrafficscale = remotetrafficscalex\n//\t scinumformat remotetrafficscale, remotetrafficscaleouttext\n//\t remotetrafficscaleText.Text = remotetrafficscaleouttext\n//\t remotetrafficvalue = remotetrafficaveText.Text * remotetrafficscale\n//\t scinumformat remotetrafficvalue, remotetrafficvalueouttext\n\t\t}\n\telse {\n\t\tsystemDesign_.remotetrafficscale = 0;\n//\t remotetrafficvalueouttext = \"0\"\n//\t remotetrafficvalue = 0\n//\t scinumformat remotetrafficvalue, remotetrafficvalueouttext\n\t\t}\n\n\n\tupdateStatelistScale(MetroParams.UPDATE_STATELIST_SCALE_REMOTE_TRAFFIC);\n\t}", "public void open(int row, int col) {\n if (!validateCoordinates(row - 1, col - 1)) {\n throw new IllegalArgumentException(\"invalid (row, col) value provided\");\n }\n\n if (isOpen(row, col)) return;\n\n // 1 --> open site\n grid[row - 1][col - 1] = 1;\n openSitesCount++;\n\n // top neighbour\n if (row > 1 && isOpen(row - 1, col)) {\n performUnion(row, col, row - 1, col);\n }\n\n // right neighbour\n if (col <= gridSize - 1 && isOpen(row, col + 1)) {\n performUnion(row, col, row, col + 1);\n }\n\n // down neighbour\n if (row <= gridSize - 1 && isOpen(row + 1, col)) {\n performUnion(row, col, row + 1, col);\n }\n\n // left neighbour\n if (col > 1 && isOpen(row, col - 1)) {\n performUnion(row, col, row, col - 1);\n }\n\n // connect to virtual top site if newly opened\n // site is in row 1 (top row)\n if (row == 1) {\n int indexP = xyToOneD(row, col);\n wquf.union(indexP, virtualTopSiteIndex);\n wquf2.union(indexP, virtualTopSiteIndex);\n } else if (row == gridSize) {\n int indexP = xyToOneD(row, col);\n wquf2.union(indexP, virtualBottomSiteIndex);\n }\n }", "public boolean isFull(int i, int j) {\n if (!checkIndex(i, j))\n throw new IndexOutOfBoundsException(\"invalid index i or j for grid site\");\n int idx = xyTo1D(i, j);\n // is virtual top site connected to this site\n //return mUnionFind.connected(0, idx);\n return mUnionFind.find(0) == mUnionFind.find(idx);\n\n }", "void bottomInv() {\n startAnimation(bottomSubCubes(), Axis.Y, Direction.CLOCKWISE);\n bottomCubeSwap();\n bottomCubeSwap();\n bottomCubeSwap();\n }", "public boolean isSite() {\n return site;\n }", "public void open(int i, int j) {\n if (isOpen(i, j))\n return;\n\n int element = ((i-1)*siteDepth) + (j-1) + 1;\n\n if (i == 1) {\n // connect the top row to its virtual node\n wuf.union(virtTop, element);\n wufFull.union(virtTop, element);\n }\n\n if (i == siteDepth) {\n // connect the bottom row to its virtual node\n wuf.union(element, virtBottom);\n }\n\n // connect neighbors if they are open\n if ((i != 1) && isOpen(i - 1, j)) {\n wuf.union(element, element - siteDepth);\n wufFull.union(element, element - siteDepth);\n }\n\n if ((i != siteDepth) && isOpen(i + 1, j)) {\n wuf.union(element, element + siteDepth);\n wufFull.union(element, element + siteDepth);\n }\n \n if ((j != 1) && isOpen(i, j - 1)) {\n wuf.union(element, element - 1);\n wufFull.union(element, element - 1);\n }\n\n if ((j != siteDepth) && isOpen(i, j + 1)) {\n wuf.union(element, element + 1);\n wufFull.union(element, element + 1);\n }\n\n // Open the current site\n sites[i][j] = true;\n\n if (!hasPercolated && wuf.find(element) == wuf.find(virtTop))\n wufFull.union(virtTop, element);\n\n }", "public void setSite(boolean site) {\n this.site = site;\n }", "public void updateBottomWeight(){\r\n\t \tif(this.bottomNode != null)\r\n\t \t{\r\n\t \t\tif( this.bottomNode.isNoGoZone() == true)\r\n\t \t{\r\n\t \t\t\t//set edge weight to 9999 if the next node is NO go zone or\r\n\t \t\t\t//boundary node\r\n\t \t\tthis.bottomWeight = weightOfNoGoZone;\r\n\t \t}\r\n\t \telse if(this.bottomNode.isRoad() == true && this.bottomNode.isNoGoZone() == false)\r\n\t \t{\r\n\t \t\t//set edge weight to 1 if the next node is a road node\r\n\t \t\tthis.bottomWeight = this.bottomNode.getOwnElevation();\r\n\t \t}\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\t//set edge weight to INF if the next node is NULL\r\n\t \t\tthis.bottomWeight = weightOfMapEdge;\r\n\t \t}\r\n\t }", "private void checkAndConnect(int srcIndex, int dstRow, int dstCol) {\n if (isInGrid(dstRow, dstCol) && isOpen(dstRow, dstCol)) {\n final int dstIndex = convertRowColToIndex(dstRow, dstCol);\n gridGraphVirtualTop.union(srcIndex, dstIndex);\n gridGraphVirtualTopBottom.union(srcIndex, dstIndex);\n }\n }", "void bottom() {\n startAnimation(bottomSubCubes(), Axis.Y, Direction.ANTICLOCKWISE);\n bottomCubeSwap();\n }", "public void showViewsIfAllConnectionsAreConnected() {\n\n // check if SignalR and MS SQL is connected\n if (!isSignalRConnected) {\n return;\n }\n if (!isMSSQLConnected) {\n return;\n }\n\n //show wiews - setScannerSection or setDeffectSection or setOverViewSection\n setScannerSection();\n\n }", "public boolean percolates() {\n return percolates;\n }", "public boolean percolates(){\n\t\tif(isPathological)\n\t\t\treturn isOpen(1,1);\n\t\t//System.out.println(\"Root top: \"+ quickUnion.find(N+2));\n\t\t\n\t\treturn (quickUnion.find(N*N+1) == quickUnion.find(0)); \t\n\t}", "public boolean goAllUp() {\n\t\tif ( topLimitSwitch.get() ) {\n\t\t\tstop();\n\t\t}\n\t\telse {\n\t\t\tup();\n\t\t}\n\t\t\n\t\treturn topLimitSwitch.get();\n\t}", "@Test\n public void testGetVerticalPillarAbove(){\n Pillar pillar = largePillarMap.get(Maze.position(0,0));\n Pillar edgePillar = largePillarMap.get(Maze.position(4,4));\n Pillar neighbor = largeMaze.getVerticalPillar(pillar, true);\n assertEquals(0, neighbor.getX());\n assertEquals(1, neighbor.getY());\n\n neighbor = largeMaze.getVerticalPillar(edgePillar, true);\n assertEquals(null, neighbor);\n }", "private void combinedEdgeDetection() {\n if(isDetectingEdge())\n {\n if(currentCount == 0)\n {\n debugTimer.start();\n }\n currentCount++;\n// SmartDashboard.putInt(\"current count: \", currentCount);\n }\n else{//otherwise, leave the count at 0\n currentCount = 0;\n }\n //once the count reaches the minimum required for detection\n if(currentCount >= minDetectionCount)\n {\n //invert the current state of detection\n currentlyDetecting = !currentlyDetecting;\n// SmartDashboard.putDouble(\"timer count: \", debugTimer.get());\n debugTimer.stop();\n debugTimer.reset();\n }\n\t}", "@Test\n public void testGetVerticalPillarBelow(){\n Pillar pillar = largePillarMap.get(Maze.position(0,0));\n Pillar edgePillar = largePillarMap.get(Maze.position(4,4));\n Pillar neighbor = largeMaze.getVerticalPillar(pillar, false);\n assertEquals(null, neighbor);\n\n neighbor = largeMaze.getVerticalPillar(edgePillar, false);\n assertEquals(4, neighbor.getX());\n assertEquals(3, neighbor.getY());\n }", "public void checkHostGraphAndNextStep() {\r\n\t\tif (this.hostGraph != null) {\r\n\t\t\tthis.stepPanel.setStep(StepPanel.STEP_STOP_GRAPH);\r\n\t\t\tthis.gragraNames.setSelectedIndex(-1);\r\n\t\t}\r\n\t}", "public void updateTravelledAndVisited() {\n Storage storage = Main.getStorage();\n routeStatsCalculator.updateLeastTravelledRoute(storage.getHistory());\n routeStatsCalculator.updateMostTravelledRoute(storage.getHistory());\n airportStatsCalculator.updateMostVisitedSrcAirports(storage.getHistorySrcAirports());\n airportStatsCalculator.updateLeastVisitedSrcAirports(storage.getHistorySrcAirports());\n airportStatsCalculator.updateMostVisitedDestAirports(storage.getHistoryDestAirports());\n airportStatsCalculator.updateLeastVisitedDestAirports(storage.getHistoryDestAirports());\n }", "public int distTo(Site s) {\n\t\treturn distTo[s.getX()][s.getY()];\n\t}", "public void enterSiteAsFirstTimeVisitor(){\n if(!browser.browserDriver().browser().isDesktop()) {\n enterSiteWithCleanBrowser();\n if (browser.browserDriver().browser().isTablet() && ((AppiumDriver) browser.driver()).getOrientation() == ScreenOrientation.PORTRAIT) {\n ((AppiumDriver) browser.driver()).rotate(ScreenOrientation.LANDSCAPE);\n }\n } else {\n navigateToHome();\n }\n }", "public boolean percolates() {\n return uf.connected(n*n, n*n+1);\r\n }", "public boolean percolates() {\n\t\treturn linearGrid.connected(0, 1);\n\t}", "public Boolean isScmSite() {\n return this.isScmSite;\n }", "public boolean isConnectedPort() {\n for (Tile t : getTile().getSurroundingTiles(1)) {\n if (!t.isLand() && t.isHighSeasConnected()) return true;\n }\n return false;\n }", "public void tunnel() {\r\n\t\tboolean status = true;\r\n\t\tfor (CellStorage i : node) {\r\n\t\t\tif (i.getCell().tunnelTo != null) {\r\n\t\t\t\tCellStorage tunnelTo = null;\r\n\t\t\t\t// Searching for destinated node from the tunnel\r\n\t\t\t\tfor (int k = 0; k < node.size(); k++) {\r\n\t\t\t\t\tif (node.get(k).getCell() == i.getCell().tunnelTo) {\r\n\t\t\t\t\t\ttunnelTo = node.get(k);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ti.setTunnel(tunnelTo);\r\n\r\n\t\t\t\t// Calling validateConnection method to make sure that no duplicated connection\r\n\t\t\t\t// is made.\r\n\t\t\t\t// Create new connection if no duplicate.\r\n\r\n\t\t\t\tstatus = validateConnection(i, tunnelTo);\r\n\t\t\t\tif (status == false) {\r\n\t\t\t\t\tHashMapConnectedNodes tunnelSet = new HashMapConnectedNodes();\r\n\t\t\t\t\ttunnelSet.hmConnectedNodesObj.put(i.getIndex(), i);\r\n\t\t\t\t\ttunnelSet.hmConnectedNodesObj.put(tunnelTo.getIndex(), tunnelTo);\r\n\t\t\t\t\thshMConnectedNodes.add(tunnelSet);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void Grasshopper(){\n this.hops = 2;\n this.hopLim = 3;\n }", "public boolean gameOverP2()\n\t{\n\t\tfor(Block b:blocks2)\n\t\t{\n\t\t\tif(b != p2.head)\n\t\t\t{\n\t\t\t\tif(b.posX == p2.head.posX && b.posY == p2.head.posY)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif(p2.head.posX == getW() - 2 || p2.head.posY == getH() - 2)\t//south walls \n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif(p2.head.posX < 1 || p2.head.posY < 1)\n\t\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "boolean reachedEdge() {\n\t\treturn this.x > parent.width - 30;// screen width including the size of\n\t\t\t\t\t\t\t\t\t\t\t// the image\n\t}", "public void voronoi(int triangulate, boolean output) {\r\n\t\tSite newsite, bot, top, temp, p;\r\n\t\tSite v;\r\n\t\tPoint newintstar = new Point();\r\n\t\tint pm;\r\n\t\tHalfedge lbnd, rbnd, llbnd, rrbnd, bisector;\r\n\t\tEdge e;\r\n\r\n\t\tPQinitialize();\r\n\t\tif (sorted == 1) {\r\n\t\t\tbottomsite = readone();\r\n\t\t} else {\r\n\t\t\tbottomsite = nextone();\r\n\t\t}\r\n\r\n\t\tELinitialize();\r\n\r\n\t\tif (sorted == 1) {\r\n\t\t\tnewsite = readone();\r\n\t\t} else {\r\n\t\t\tnewsite = nextone();\r\n\t\t}\r\n\t\twhile (true) {\r\n\t\t\tif (!PQempty())\r\n\t\t\t\tnewintstar = PQ_min();\r\n\r\n\t\t\tif (newsite != null\r\n\t\t\t\t\t&& (PQempty() || newsite.coord.y < newintstar.y || (newsite.coord.y == newintstar.y && newsite.coord.x < newintstar.x))) {\r\n\r\n\t\t\t\tlbnd = ELleftbnd((newsite.coord));\r\n\t\t\t\trbnd = ELright(lbnd);\r\n\t\t\t\tbot = rightreg(lbnd);\r\n\t\t\t\te = bisect(bot, newsite);\r\n\t\t\t\tbisector = HEcreate(e, le);\r\n\t\t\t\tELinsert(lbnd, bisector);\r\n\t\t\t\tif ((p = intersect(lbnd, bisector)) != null) {\r\n\t\t\t\t\tPQdelete(lbnd);\r\n\t\t\t\t\tPQinsert(lbnd, p, dist(p, newsite));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlbnd = bisector;\r\n\t\t\t\tbisector = HEcreate(e, re);\r\n\t\t\t\tELinsert(lbnd, bisector);\r\n\t\t\t\tif ((p = intersect(bisector, rbnd)) != null) {\r\n\t\t\t\t\tPQinsert(bisector, p, dist(p, newsite));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (sorted == 1) {\r\n\t\t\t\t\tnewsite = readone();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tnewsite = nextone();\r\n\t\t\t\t}\r\n\r\n\t\t\t} else if (!PQempty()) {\r\n\t\t\t\t/* intersection is smallest */\r\n\r\n\t\t\t\tlbnd = PQextractmin();\r\n\t\t\t\tllbnd = ELleft(lbnd);\r\n\t\t\t\trbnd = ELright(lbnd);\r\n\t\t\t\trrbnd = ELright(rbnd);\r\n\t\t\t\tbot = leftreg(lbnd);\r\n\t\t\t\ttop = rightreg(rbnd);\r\n\r\n\t\t\t\tif (output) {\r\n\t\t\t\t\tout_triple(bot, top, rightreg(lbnd));\r\n\t\t\t\t} else {\r\n\t\t\t\t\taddTriangle(bot, top, rightreg(lbnd));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tv = lbnd.vertex;\r\n\t\t\t\tmakevertex(v);\r\n\t\t\t\tendpoint(lbnd.ELedge, lbnd.ELpm, v);\r\n\t\t\t\tendpoint(rbnd.ELedge, rbnd.ELpm, v);\r\n\t\t\t\tELdelete(lbnd);\r\n\t\t\t\tPQdelete(rbnd);\r\n\t\t\t\tELdelete(rbnd);\r\n\t\t\t\tpm = le;\r\n\t\t\t\tif (bot.coord.y > top.coord.y) {\r\n\t\t\t\t\ttemp = bot;\r\n\t\t\t\t\tbot = top;\r\n\t\t\t\t\ttop = temp;\r\n\t\t\t\t\tpm = re;\r\n\t\t\t\t}\r\n\t\t\t\te = bisect(bot, top);\r\n\t\t\t\tbisector = HEcreate(e, pm);\r\n\t\t\t\tELinsert(llbnd, bisector);\r\n\t\t\t\tendpoint(e, re - pm, v);\r\n\t\t\t\tderef(v);\r\n\t\t\t\tif ((p = intersect(llbnd, bisector)) != null) {\r\n\t\t\t\t\tPQdelete(llbnd);\r\n\t\t\t\t\tPQinsert(llbnd, p, dist(p, bot));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ((p = intersect(bisector, rrbnd)) != null) {\r\n\t\t\t\t\tPQinsert(bisector, p, dist(p, bot));\r\n\t\t\t\t}\r\n\r\n\t\t\t} else\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tfor (lbnd = ELright(ELleftend); lbnd != ELrightend; lbnd = ELright(lbnd)) {\r\n\t\t\te = lbnd.ELedge;\r\n\r\n\t\t}\r\n\r\n\t}", "private void printMostVisited()\r\n\t{\r\n\t\tint greatestIndex = 0;\r\n\t\tint greatest = (int)webVisited[1][greatestIndex];\r\n\t\t\r\n\t\tfor (int i = 0; i < siteVisited; i++)\r\n\t\t{\r\n\t\t\tif ((int)webVisited[1][i] > greatest)\r\n\t\t\t{\r\n\t\t\t\tgreatestIndex = i;\r\n\t\t\t\tgreatest = (int)webVisited[1][greatestIndex];\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"Most visited website is: \" + webVisited[0][greatestIndex]);\r\n\t}", "public Direction getMostValuableDirection(Location location) {\r\n\t\tint northSum = 0, southSum = 0, westSum = 0, eastSum = 0;\r\n\t\t// the neighbors are saved in an array and we know the order for each\r\n\t\t// neighbor\r\n\t\tArrayList<Location> neighbors = location.getNeighbors(location, map, 1);\r\n\t\t// so we know the north neighbors are on the 0, 1, 2 positions\r\n\t\tif(neighbors.get(0).getSite().owner != myID) {\r\n\t\t\tnorthSum += neighbors.get(0).getSite().strength;\r\n\t\t}\r\n\t\tif(neighbors.get(1).getSite().owner != myID) {\r\n\t\t\tnorthSum += neighbors.get(1).getSite().strength;\r\n\t\t}\r\n\t\tif(neighbors.get(2).getSite().owner != myID) {\r\n\t\t\tnorthSum += neighbors.get(2).getSite().strength;\r\n\t\t}\r\n\r\n\t\t// the east neighbors are on the 3, 4, 5 positions\r\n\t\tif(neighbors.get(3).getSite().owner != myID) {\r\n\t\t\teastSum += neighbors.get(3).getSite().strength;\r\n\t\t}\r\n\t\tif(neighbors.get(4).getSite().owner != myID) {\r\n\t\t\teastSum += neighbors.get(4).getSite().strength;\r\n\t\t}\r\n\t\tif(neighbors.get(5).getSite().owner != myID) {\r\n\t\t\teastSum += neighbors.get(5).getSite().strength;\r\n\t\t}\r\n\r\n\t\t// the south neighbors are on the 6, 7, 8 positions\r\n\t\tif(neighbors.get(6).getSite().owner != myID) {\r\n\t\t\tsouthSum += neighbors.get(6).getSite().strength;\r\n\t\t}\r\n\t\tif(neighbors.get(7).getSite().owner != myID) {\r\n\t\t\tsouthSum += neighbors.get(7).getSite().strength;\r\n\t\t}\r\n\t\tif(neighbors.get(8).getSite().owner != myID) {\r\n\t\t\tsouthSum += neighbors.get(8).getSite().strength;\r\n\t\t}\r\n\r\n\t\t// the west neighbors are on the 9, 10, 11 positions\r\n\t\tif(neighbors.get(9).getSite().owner != myID) {\r\n\t\t\twestSum += neighbors.get(9).getSite().strength;\r\n\t\t}\r\n\t\tif(neighbors.get(10).getSite().owner != myID) {\r\n\t\t\twestSum += neighbors.get(10).getSite().strength;\r\n\t\t}\r\n\t\tif(neighbors.get(11).getSite().owner != myID) {\r\n\t\t\twestSum += neighbors.get(11).getSite().strength;\r\n\t\t}\r\n\t\t// get maximum sum\r\n\t\tfloat max = Math.max(Math.max(northSum, southSum), Math.max(eastSum, westSum));\r\n\t\t// return the best direction\r\n\t\tif (max == northSum)\r\n\t\t\treturn Direction.NORTH;\r\n\t\telse if (max == southSum)\r\n\t\t\treturn Direction.SOUTH;\r\n\t\telse if (max == eastSum)\r\n\t\t\treturn Direction.EAST;\r\n\t\telse\r\n\t\t\treturn Direction.WEST;\r\n\t}", "public boolean percolates(){\r\n\t\treturn uf.connected(N * N, N * N + 1);\r\n\t}", "@Override\n\tpublic void local_queryTopGiver() {\n\t\tqueryTopGiver();\n\t\t\n\t}", "public boolean percolates() {\n return myUF.connected(n*n, n*n + 1);\n }", "static void bridge()\n {\n // Mark all the vertices as not visited\n boolean visited[] = new boolean[V];\n int disc[] = new int[V];\n int low[] = new int[V];\n int parent[] = new int[V];\n \n \n // Initialize parent and visited, and ap(articulation point)\n // arrays\n for (int i = 0; i < V; i++)\n {\n parent[i] = NIL;\n }\n \n // Call the recursive helper function to find Bridges\n // in DFS tree rooted with vertex 'i'\n for (int i = 0; i < V; i++)\n if (!visited[i])\n bridgeUtil(i, visited, disc, low, parent);\n }", "public boolean hasSite() {\n return fieldSetFlags()[0];\n }", "public boolean percolates() {\n \treturn weigtedJoin.connected(N * N, N * N + 1);\n }", "@java.lang.Override\n public boolean hasVpnTunnel() {\n return stepInfoCase_ == 11;\n }", "public void open(int row, int col) {\n if (isOpen(row, col)) return;\n grid[row - 1][col - 1] = true;\n ++openSites;\n\n // Transform the row and the column into an appropriate index\n // because the quick union class uses a one-dimensional array.\n final int currentSiteIndex = toIndex(row, col);\n\n // The topmost row must be connected to the virtual top.\n if (row == 1) {\n mainUnion.union(virtualTopId, currentSiteIndex);\n backwashAwareUnion.union(virtualTopId, currentSiteIndex);\n }\n // The bottommost row must be connected to virtual the bottom.\n if (row == size) mainUnion.union(virtualBottomId, currentSiteIndex);\n\n // Connect all neighbors of the current site if and only if the neighbors are open.\n if (row > 1 && isOpen(row - 1, col)) {\n final int topNeighborIndex = toIndex(row - 1, col);\n mainUnion.union(topNeighborIndex, currentSiteIndex);\n backwashAwareUnion.union(topNeighborIndex, currentSiteIndex);\n }\n\n if (row < size && isOpen(row + 1, col)) {\n final int bottomNeighborIndex = toIndex(row + 1, col);\n mainUnion.union(bottomNeighborIndex, currentSiteIndex);\n backwashAwareUnion.union(bottomNeighborIndex, currentSiteIndex);\n }\n\n if (col > 1 && isOpen(row, col - 1)) {\n final int leftNeighborIndex = toIndex(row, col - 1);\n mainUnion.union(leftNeighborIndex, currentSiteIndex);\n backwashAwareUnion.union(leftNeighborIndex, currentSiteIndex);\n }\n\n if (col < size && isOpen(row, col + 1)) {\n final int rightNeighborIndex = toIndex(row, col + 1);\n mainUnion.union(rightNeighborIndex, currentSiteIndex);\n backwashAwareUnion.union(rightNeighborIndex, currentSiteIndex);\n }\n }", "static void drawTopo() {\n\t\tif (currentStage[currentSlice-1]>2)\n\t\t{\n\t\t\tfloat x1,y1,x2,y2;\n\t\t\tint N = pop.N;\n\t\t\tArrayList balloons = pop.BallList;\n\n\t\t\tfor (int i=0;i<N;i++)\n\t\t\t{\n\t\t\t\tPoint P1 = ((Balloon)(balloons.get(i))).getPoint();\n\t\t\t\tx1 = (float)(P1.getX());\n\t\t\t\ty1 = (float)(P1.getY());\n\n\t\t\t\tfor (int j=0;j<i;j++)\n\t\t\t\t{\n\t\t\t\t\tif (pop.topo[i][j]==true)\n\t\t\t\t\t{\n\t\t\t\t\t\t// label connection between cells (potential neighbours)\n\t\t\t\t\t\tjava.awt.geom.GeneralPath Tshape = new GeneralPath();\n\t\t\t\t\t\tPoint P2 = ((Balloon)(balloons.get(j))).getPoint();\n\t\t\t\t\t\tx2 = (float)(P2.getX());\n\t\t\t\t\t\ty2 = (float)(P2.getY());\n\t\t\t\t\t\tTshape.moveTo(x1, y1);\n\t\t\t\t\t\tTshape.lineTo(x2, y2);\n\t\t\t\t\t\tRoi XROI = new ShapeRoi(Tshape);\n\t\t\t\t\t\tXROI.setStrokeWidth(1);\n\t\t\t\t\t\tXROI.setStrokeColor(Color.green);\n\t\t\t\t\t\tOL.add(XROI);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void affchageReseau() {\n System.out.print(\"\\nComputers Network Infected/Uninfected\\n\");\n Computer Computer = start;\n if (taille == 0) {\n System.out.print(\"Empty\\n\");\n return;\n }\n if (start.getLinkNext() == start) {\n System.out.print(start + \" <-> \" + Computer + \"\\n\");\n return;\n }\n\n System.out.print(start + \" <-> \");\n Computer = start.getLinkNext();\n while (Computer.getLinkNext() != start) {\n System.out.print(Computer + \" <-> \");\n Computer = Computer.getLinkNext();\n }\n System.out.print(Computer + \" <-> \");\n Computer = Computer.getLinkNext();\n System.out.print(Computer + \"\\n\");\n }", "protected boolean isParallelImplicitLinksAtTop() {\r\n\t\treturn true;\r\n\t}", "public boolean isHopper() {\n return this.type == Type.HOPPER;\n }", "@java.lang.Override\n public boolean hasVpnTunnel() {\n return stepInfoCase_ == 11;\n }", "public boolean percolates() {\n if (this.n == 1) return isOpen(1, 1);\n return this.uf.connected(0, this.n * this.n + 1);\n }", "private void displayConnections()\n {\n if (agent == null)\n {\n JOptionPane.showMessageDialog(null, \"No Portal Connected\", \"Portal\", JOptionPane.ERROR_MESSAGE);\n }\n else\n {\n String connection = agent.getPortal().getHandle();\n JOptionPane.showMessageDialog(null, connection, \"Portal\", JOptionPane.INFORMATION_MESSAGE);\n }\n }", "@Override\n protected void startSolving() {\n super.startSolving();\n solveState = SolveState.FirstFaceCross;\n mTopColor = mTopSquares.get(CENTER).getColor();\n mBottomColor = mBottomSquares.get(CENTER).getColor();\n sendMessage(\"Top is \" + mTopSquares.get(CENTER).colorName() +\n \" and bottom is \" + mBottomSquares.get(CENTER).colorName());\n firstFaceCross();\n }", "private void checkBoundaries() {\n if (!isDestroyed()) {\n float upperEdge = screen.getGameCam().position.y + screen.getGameViewPort().getWorldHeight() / 2;\n float bottomEdge = screen.getGameCam().position.y - screen.getGameViewPort().getWorldHeight() / 2;\n if (bottomEdge <= getY() + getHeight() && getY() <= upperEdge) {\n b2body.setActive(true);\n currentState = b2body.getLinearVelocity().x > 0 ? State.MOVING_RIGHT : State.MOVING_LEFT;\n } else {\n if (b2body.isActive()) { // Was on camera...\n // It's outside bottom edge\n if (bottomEdge > getY() + getHeight()) {\n if(!world.isLocked()) {\n world.destroyBody(b2body);\n }\n currentState = State.FINISHED;\n }\n }\n }\n }\n }", "static void topView( Node root) \n{ \n\t// Base case \n\tif (root == null) { \n\t\treturn; \n\t} \n\n\t// Take a temporary node \n\tNode temp = null; \n\n\t// Queue to do BFS \n\tQueue<Pair > q = new LinkedList<Pair>(); \n\n\t// map to store node at each vartical distance \n\tMap<Integer, Integer> mp = new TreeMap<Integer, Integer>(); \n\n\tq.add(new Pair( root, 0 )); \n\n\t// BFS \n\twhile (q.size()>0) { \n\n\t\ttemp = q.peek().first; \n\t\tint d = q.peek().second; \n\t\tq.remove(); \n\n\t\t// If any node is not at that vertical distance \n\t\t// just insert that node in map and print it \n\t\tif (mp.get(d) == null) {mp.put(d, temp.data); \n\t\t} \n\n\t\t// Continue for left node \n\t\tif (temp.left!=null) { \n\t\t\tq.add(new Pair( temp.left, d - 1 )); \n\t\t} \n\n\t\t// Continue for right node \n\t\tif (temp.right!=null) { \n\t\t\tq.add(new Pair( temp.right, d + 1 )); \n\t\t} \n\t} \n\tfor(Integer data:mp.values()){ \n\tSystem.out.print( data + \" \"); \n\t} \n}", "public void open(int row, int col) {\n if (isOpen(row, col))\n return;\n int index = rowColToIndex(row, col);\n sitesIsOpen[index] = true;\n if (row == 1) {\n sitesUF.union(index, upSiteIndex);\n sidesFullUF.union(index, upSiteIndex);\n }\n\n\n //!this.percolates() this situation is prevent after percolates, every\n //sites open down will be full, but not fix 在下面按了几个后, 另一块区域联通是的,原来的区域 full 了\n if (row == side && !this.percolates())\n sitesUF.union(index, downSiteIndex);\n\n for (int aroundIndex : indexsAround(row, col)) {\n if (sitesIsOpen[aroundIndex]) {\n sitesUF.union(aroundIndex, index);\n sidesFullUF.union(aroundIndex, index);\n }\n }\n\n }", "public void checkChannel1(){\n\t\ttools.findAndReport(\"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.support.v4.view.ViewPager/android.view.View/android.widget.RelativeLayout/android.support.v7.widget.RecyclerView/android.widget.LinearLayout[1]/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.RelativeLayout\", \"No se encuentra el primer en vivo\");\r\n\t}", "public boolean percolates() {\n if (mGridSize == 1 && !isOpen(1, 1))\n return false;\n //return mUnionFind.connected(0, mGridSize * mGridSize + 1);\n return mUnionFind.find(0) == mUnionFind.find(mGridSize * mGridSize + 1);\n\n }", "public Percolation(int gridSize) {\n\n if (gridSize <= 0)\n throw new java.lang.IllegalArgumentException(\n \"Incorrect size for percolation grid\" + gridSize);\n\n this.siteDepth = gridSize;\n this.virtTop = 0;\n this.virtBottom = gridSize * gridSize + 1;\n this.hasPercolated = false;\n\n // Adding 2 for the virtual nodes\n wuf = new WeightedQuickUnionUF(this.siteDepth * this.siteDepth + 2);\n // Adding 1 for the top virtual node\n wufFull = new WeightedQuickUnionUF(this.siteDepth * this.siteDepth + 1);\n\n sites = new boolean[siteDepth+1][siteDepth+1];\n\n for (int i = 0; i <= siteDepth; i++)\n for (int j = 0; j <= siteDepth; j++)\n sites[i][j] = false;\n }", "public boolean isSiteOnly()\n\t\t{\n\t\t\tboolean isSiteOnly = false;\n\t\t\tisSiteOnly = !isGroupPossible() && !isPubviewPossible();\n\t\t\treturn isSiteOnly;\n\t\t}", "@Override\n\tpublic boolean estPleine() {\n\t\treturn getNbClients()==capacite;\n\t}", "@Override\n\tpublic boolean step(){\n\t\tboolean ret=false;\n\t\tif(!isFollowing()){\n\t\t\t//80% valoszinuseggel leptet egy szomszedra\n\t\t\tRandom rng=new Random();\n\t\t\tboolean doAStep =rng.nextInt(10)>1;\n\t\t\tif(doAStep){\n\t\t\t\tif(tile != null){\n\t\t\t\tint bound=tile.getNeighbors().size();\n\t\t\t\t//System.out.println(\"bound :\"+bound);\n\t\t\t\t//System.out.println(\"ez lett a bound: \"+rng.nextInt(bound));\n\t\t\t\tret=step(tile.getNeighbors().get(rng.nextInt(bound)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "@java.lang.Override\n public boolean hasVpnGateway() {\n return stepInfoCase_ == 10;\n }", "void calcVertSeamInfo() {\n SeamInfo tr = null;\n SeamInfo tl = null;\n SeamInfo t = null;\n if (this.topRight() != null) {\n tr = topRight().seamInfo;\n }\n if (this.topLeft() != null) {\n tl = topLeft().seamInfo;\n }\n if (this.up != null) {\n t = up.seamInfo;\n }\n\n double min = Double.MAX_VALUE;\n SeamInfo cameFrom = null;\n\n if (tr != null && min > tr.totalWeight) {\n min = tr.totalWeight;\n cameFrom = tr;\n }\n if (tl != null && min > tl.totalWeight) {\n min = tl.totalWeight;\n cameFrom = tl;\n }\n if (t != null && min > t.totalWeight) {\n min = t.totalWeight;\n cameFrom = t;\n }\n\n // for top border cases\n if (cameFrom == null) {\n min = 0;\n }\n\n this.seamInfo = new SeamInfo(this, min + this.energy(), cameFrom, true);\n }", "public boolean checkSouth(HashMap<Coordinate,MapTile> currentView){\n\t\t\tCoordinate currentPosition = new Coordinate(getPosition());\n\t\t\tfor(int i = 0; i <= wallSensitivity; i++){\n\t\t\t\tMapTile tile = currentView.get(new Coordinate(currentPosition.x, currentPosition.y-i));\n\t\t\t\tif(tile.isType(MapTile.Type.WALL)){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public boolean percolates(){\n\t //special case for n=1:\n\t if(n==1 && numOpen==0){\n\t return false;\n\t }\n\t //this seems very inefficient.. maybe fix\n\t //way to prevent backwash\n\t for(int i= (n*n -n)+1; i <= n*n; i++){\n\t if(grid.connected(0, i)){\n\t return true;\n\t }\n\t }\n\t\treturn false;\n\t}", "private void printNumVisited()\r\n\t{\r\n\t\tSystem.out.println(\"\");\r\n\t\tfor (int i = 0; i < siteVisited; i++)\r\n\t\t\tSystem.out.println(webVisited[0][i] + \" visited \" + webVisited[1][i] + \" time(s)\");\r\n\t}" ]
[ "0.73434705", "0.70516926", "0.6769987", "0.65127015", "0.6479789", "0.6476564", "0.6153489", "0.6075679", "0.60174114", "0.59502333", "0.53211445", "0.5232819", "0.509114", "0.5043125", "0.50324076", "0.50228155", "0.50116336", "0.50032294", "0.4991538", "0.49667484", "0.49636903", "0.49491227", "0.49465007", "0.48963845", "0.48857927", "0.48655626", "0.48575985", "0.4828382", "0.48239192", "0.4822969", "0.4810399", "0.48023453", "0.47630668", "0.4761062", "0.4749995", "0.4718854", "0.47124636", "0.47012436", "0.46976662", "0.46955433", "0.46871617", "0.4680495", "0.46793318", "0.46665677", "0.46572682", "0.463578", "0.46250874", "0.46182653", "0.4618122", "0.46150336", "0.46104208", "0.46033946", "0.46020424", "0.45907933", "0.45808545", "0.45804882", "0.45782498", "0.45689407", "0.45595345", "0.45555088", "0.45469934", "0.4544647", "0.45419794", "0.45389083", "0.45336506", "0.45306757", "0.45223334", "0.45182037", "0.45025697", "0.45006442", "0.44844586", "0.44840688", "0.4481834", "0.44724125", "0.44693735", "0.44628704", "0.44615027", "0.44574308", "0.44561434", "0.44553488", "0.4448039", "0.4435002", "0.44344506", "0.44308782", "0.442343", "0.44218132", "0.4419088", "0.4416393", "0.44150513", "0.44104552", "0.44101632", "0.44083002", "0.44025943", "0.44017315", "0.4396251", "0.43949488", "0.43940002", "0.43900776", "0.43875456", "0.43852437" ]
0.61003137
7
/ / Helper methods /
private void validateRowAndColumn(int row, int col) { // row or column must be in range [1, N] if ((row < 1 || row > size) || (col < 1 || col > size)) { throw new IllegalArgumentException("wrong row or column"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "private void strin() {\n\n\t}", "private stendhal() {\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "private static void cajas() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "protected boolean func_70814_o() { return true; }", "public void method_4270() {}", "@Override\n protected void getExras() {\n }", "private Util() { }", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "private void kk12() {\n\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "private FormatUtilities() {}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n public void perish() {\n \n }", "private void getStatus() {\n\t\t\n\t}", "public abstract String mo9239aw();", "String processing();", "public void smell() {\n\t\t\n\t}", "private ArraySetHelper() {\n\t\t// nothing\n\t}", "public abstract void mo56925d();", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "@Override\n\tpublic void anular() {\n\n\t}", "public abstract String mo41079d();", "public static void listing5_14() {\n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public abstract void mo70713b();", "public interface CommonUtils {\n\tpublic static String getPrintStackTrace(Exception e){\n\t\t//StringWriter writes upon the string\n\t\tStringWriter sw = new StringWriter();\n\t\t//PrintWriter integrates with StringWriter\n\t\tPrintWriter pw = new PrintWriter(sw);\n\t\t//This line used to write in catch block then it will writes in the console prints upon the console\n\t\t//Basically prints the data upon the console\n\t\te.printStackTrace(pw);\n\t\t//it will converts to tostring method into some meaningful data\n\t\treturn sw.toString();\n\t}\n}", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "protected abstract Set method_1559();", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public void mo4359a() {\n }", "protected void mo6255a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public abstract String mo118046b();", "@Override\n\tpublic void initUtils() {\n\n\t}", "abstract String mo1748c();", "@Override\r\n\tpublic void func02() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void func02() {\n\t\t\r\n\t}", "public abstract String mo9238av();", "Operations operations();", "void unableToListContents();", "java.lang.String getHowToUse();", "java.lang.String getHowToUse();", "public abstract String mo8770a();", "private BuilderUtils() {}", "public void gored() {\n\t\t\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private void searchFunction() {\n\t\t\r\n\t}", "public abstract String mo13682d();", "public void mo55254a() {\n }", "private void m50366E() {\n }", "public static String getInfo() {\n/* 327 */ return \"\";\n/* */ }", "abstract int pregnancy();", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public void mo21877s() {\n }", "private ProcessorUtils() { }", "public void skystonePos4() {\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "private void parseData() {\n\t\t\r\n\t}", "public abstract void mo27386d();", "public abstract void mo27385c();", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "void mo57277b();", "private static void iterator() {\n\t\t\r\n\t}", "public abstract String use();", "public abstract String mo41086i();", "public abstract String mo11611b();", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@SuppressWarnings(\"unused\")\n private void generateInfo()\n {\n }", "public final void mo51373a() {\n }", "private FlyWithWings(){\n\t\t\n\t}", "protected OpinionFinding() {/* intentionally empty block */}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "private MetallicityUtils() {\n\t\t\n\t}", "OptimizeResponse() {\n\n\t}", "void mo57278c();", "protected boolean func_70041_e_() { return false; }", "public abstract String getInfo();" ]
[ "0.5495899", "0.5495899", "0.54505235", "0.54327035", "0.53954303", "0.53698415", "0.53669816", "0.53338206", "0.53307915", "0.5301819", "0.5288399", "0.52707165", "0.5270206", "0.5260756", "0.5258446", "0.5204558", "0.5204", "0.51774746", "0.51694417", "0.5161638", "0.51597124", "0.5115783", "0.5090864", "0.5079398", "0.5068267", "0.5067071", "0.5054269", "0.50489676", "0.50489676", "0.50489676", "0.50489676", "0.5026839", "0.5020229", "0.5015184", "0.49923262", "0.49916464", "0.49892607", "0.49892607", "0.4985783", "0.49718812", "0.49704516", "0.49569213", "0.4949889", "0.49492753", "0.49484447", "0.49394262", "0.49389732", "0.4938869", "0.4938869", "0.4938869", "0.4938869", "0.4938869", "0.4938869", "0.4938869", "0.49311227", "0.4930256", "0.4927589", "0.49245626", "0.49245626", "0.49188685", "0.4914055", "0.48893028", "0.48824647", "0.48824647", "0.48811686", "0.4880899", "0.48745212", "0.48671734", "0.48671734", "0.48615867", "0.48596013", "0.48538777", "0.4853631", "0.48498", "0.48493674", "0.48489973", "0.4848895", "0.4846125", "0.4843971", "0.48264724", "0.48253036", "0.482303", "0.48189053", "0.48155886", "0.48075452", "0.480664", "0.4806496", "0.4804736", "0.48042986", "0.48009133", "0.47969523", "0.47964174", "0.47945434", "0.47939736", "0.47918427", "0.47861594", "0.4784466", "0.47582057", "0.47579557", "0.4756949", "0.4749964" ]
0.0
-1
/ Getters and setters for the class attributes
public long getId() { return id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\npublic void setAttributes() {\n\t\n}", "private Attributes getAttributes()\r\n\t{\r\n\t return attributes;\r\n\t}", "public static void initializeClassAttributes() {\n\t\tAboraSupport.findAboraClass(IntegerVarArray.class).setAttributes( new Set().add(\"CONCRETE\").add(\"PSEUDOCOPY\"));\n\t}", "public Attributes getAttributes() { return this.attributes; }", "public Attr() {\n\t\t\tsuper();\n\t\t}", "Attributes getAttributes();", "protected LPDMODOMAttribute() {\n }", "@Override\n\tpublic void buildAttributes(JDefinedClass cls) {\n\n\t}", "public HashMap getClassWithAttr() {\n return storingClassWithAttr;\n }", "@Override\n public List<MappedField<?>> getAttributes() {\n return attributes;\n }", "IAttributes getAttributes();", "@Override\r\n\tpublic Map<String, String> getAttributes() {\r\n\t\treturn this.attributes;\r\n\t}", "public void setAttributes(Attributes attributes) {\n this.attributes = attributes;\n }", "@Override\r\n protected void parseAttributes()\r\n {\n\r\n }", "@Override\n public void onRPClassAddAttribute(RPClass rpclass,\n String name, Definition.Type type) {\n }", "final private void setupAttributes() {\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_BASE_DPI, DEFAULT_BASE_DPI));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_BASE_DENSITY, DEFAULT_BASE_DENSITY));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_BASE_SCREEN, DEFAULT_BASE_SCREEN));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_PROPORTION_FROM, DEFAULT_PROPORTION_FROM));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_PROPORTION_MODE, DEFAULT_PROPORTION_MODES));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_BACKGROUND_COLOR, DEFAULT_BACKGROUND_COLOR));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_CALIBRATE_DPI, DEFAULT_CALIBRATE_DPI));\r\n\t\tmAttributes.add(new com.org.multigear.mginterface.engine.Configuration.Attr(ATTR_RESTORER_NOTIFICATION, new Object()));\r\n\t}", "Attribute createAttribute();", "Attribute createAttribute();", "@Override\npublic void processAttributes() {\n\t\n}", "@Override\n public void onRPClassAddAttribute(RPClass rpclass,\n String name, Definition.Type type, byte flags) {\n }", "protected abstract void createAttributes();", "public void setupProperties() {\n // left empty for subclass to override\n }", "public Object[] getAttributes() {\n\t\treturn new Object[] {true}; //true for re-init... \n\t}", "public String getAttributes() {\n return attributes;\n }", "public String getAttributes() {\n return attributes;\n }", "private FastVector getAccInstanceAttributes() {\n Attribute x_mean = new Attribute(\"x-axis mean\");\n Attribute x_var = new Attribute(\"x-axis var\");\n Attribute y_mean = new Attribute(\"y-axis mean\");\n Attribute y_var = new Attribute(\"y-axis var\");\n Attribute z_mean = new Attribute(\"z-axis mean\");\n Attribute z_var = new Attribute(\"z-axis var\");\n\n // Declare the class attribute along with its values\n FastVector fvClassVal = new FastVector(2);\n fvClassVal.addElement(\"none\");\n fvClassVal.addElement(\"tap\");\n Attribute classAttribute = new Attribute(\"theClass\", fvClassVal);\n\n // Declare the feature vector\n FastVector fvWekaAttributes = new FastVector(7);\n\n fvWekaAttributes.addElement(x_mean);\n fvWekaAttributes.addElement(x_var);\n fvWekaAttributes.addElement(y_mean);\n fvWekaAttributes.addElement(y_var);\n fvWekaAttributes.addElement(z_mean);\n fvWekaAttributes.addElement(z_var);\n fvWekaAttributes.addElement(classAttribute);\n\n// // Declare the numeric attributes\n// Attribute x_var = new Attribute(\"var_x\");\n// Attribute x_var_delta = new Attribute(\"delta_var_x\");\n// Attribute y_var = new Attribute(\"var_y\");\n// Attribute y_var_delta = new Attribute(\"delta_var_y\");\n// Attribute z_var = new Attribute(\"var_z\");\n// Attribute z_var_delta = new Attribute(\"delta_var_z\");\n//\n// // Declare the class attribute along with its values\n// FastVector fvClassVal = new FastVector(3);\n// fvClassVal.addElement(\"none\");\n// fvClassVal.addElement(\"motion\");\n// fvClassVal.addElement(\"tap\");\n// Attribute classAttribute = new Attribute(\"theClass\", fvClassVal);\n\n// // Declare the feature vector\n// FastVector fvWekaAttributes = new FastVector(7);\n//\n// fvWekaAttributes.addElement(x_var);\n// fvWekaAttributes.addElement(x_var_delta);\n// fvWekaAttributes.addElement(y_var);\n// fvWekaAttributes.addElement(y_var_delta);\n// fvWekaAttributes.addElement(z_var);\n// fvWekaAttributes.addElement(z_var_delta);\n// fvWekaAttributes.addElement(classAttribute);\n\n return fvWekaAttributes;\n }", "TAttribute createTAttribute();", "public void setAge(int age) { this.age = age; }", "private void initClassAttributes(){ \r\n\t\tanyMissingValue = new boolean[3];\r\n\t\tanyMissingValue[0] = false; \r\n\t\tanyMissingValue[1] = false;\r\n\t\tanyMissingValue[2] = false;\r\n\t\tnumInputAttributes = Attributes.getInputNumAttributes();\r\n\t\tnumOutputAttributes = Attributes.getOutputNumAttributes();\r\n\t\tnumUndefinedAttributes = Attributes.getNumAttributes() - (numInputAttributes+numOutputAttributes);\r\n\t\tintNominalValues = new int[3][];\r\n\t\tnominalValues = new String[3][];\r\n\t\trealValues = new double[3][];\r\n\t\tmissingValues = new boolean[3][];\r\n\t\tnominalValues[0] = new String[numInputAttributes];\r\n\t\tnominalValues[1] = new String[numOutputAttributes];\r\n\t\tnominalValues[2] = new String[numUndefinedAttributes];\r\n\t\tintNominalValues[0] = new int[numInputAttributes];\r\n\t\tintNominalValues[1] = new int[numOutputAttributes];\r\n\t\tintNominalValues[2] = new int[numUndefinedAttributes];\r\n\t\trealValues[0] = new double[numInputAttributes];\r\n\t\trealValues[1] = new double[numOutputAttributes];\r\n\t\trealValues[2] = new double[numUndefinedAttributes];\r\n\t\tmissingValues[0] = new boolean[numInputAttributes];\r\n\t\tmissingValues[1] = new boolean[numOutputAttributes];\r\n\t\tmissingValues[2] = new boolean[numUndefinedAttributes];\r\n\r\n\t\tfor(int i=0;i<numInputAttributes;i++) missingValues[0][i]=false; \r\n\t\tfor(int i=0;i<numOutputAttributes;i++) missingValues[1][i]=false; \r\n\t\tfor(int i=0;i<numUndefinedAttributes; i++) missingValues[2][i]=false;\r\n\r\n\t}", "public abstract Map getAttributes();", "public abstract Map<String, Object> getAttributes();", "public interface IAttributes {\n\n\t/***\n\t * Integer index of the attribute. Should be used with defined public static final int values.\n\t * Chosen because of better extensibility (an enum cannot extend another enum).\n\t * More specific object attribute definitions should extend the ObjectAttributesBase class in order\n\t * to have access to all derived attributes.\n\t * \n\t * @param attribute integer index of attribute\n\t * @return\n\t */\n\tObject getAttribute(int attribute);\n\t\n\tvoid setAttribute(int attribute, Object value);\n}", "public Attribute(String title) {\n \t\tthis.title = title;\n \t\tconflictMagnitude = 0;\n \t}", "public interface Attribute {\n\n /**\n * The id of the attribute. This will be unique for all attributes in a\n * graph. However, if an attribute is removed from the graph, future\n * attributes may (and probably will) reuse this id.\n *\n * @return the id of the attribute.\n */\n public int getId();\n\n /**\n * Sets the id of this attribute.\n *\n * @param id the new id of this attribute.\n */\n public void setId(final int id);\n\n /**\n * Returns the element type that this attribute is associated with.\n *\n * @return the element type that this attribute is associated with.\n */\n public GraphElementType getElementType();\n\n /**\n * Sets the element type of this attribute.\n *\n * @param elementType the new element type of this attribute.\n */\n public void setElementType(final GraphElementType elementType);\n\n /**\n * The type of this attribute.\n * <p>\n * This is a String as returned by\n * {@link au.gov.asd.tac.constellation.graph.attribute.AttributeDescription#getName()}\n * from one of the registered AttributeDescription instances.\n *\n * @return The type of this attribute.\n */\n public String getAttributeType();\n\n /**\n * Sets the type of this attribute.\n *\n * @param attributeType the new type of the attribute.\n */\n public void setAttributeType(final String attributeType);\n\n /**\n * Return the name of the attribute. This name will be unique for all\n * attributes associated with the same element type in a graph. This is the\n * value that is presented to the user in the UI and the most common way in\n * which attributes are looked up in the graph.\n *\n * @return the name of the attribute.\n */\n public String getName();\n\n /**\n * Sets a new name for this attribute.\n *\n * @param name the new name for the attribute.\n * @see Attribute#getName()\n */\n public void setName(final String name);\n\n /**\n * Returns the description of an attribute. The description provides more\n * detailed information about the attribute such as how it is being used or\n * and constraints that should be observed.\n *\n * @return the description of an attribute.\n */\n public String getDescription();\n\n /**\n * Sets a new description of an attribute.\n *\n * @param description the new description of the attribute.\n * @see Attribute#getDescription()\n */\n public void setDescription(final String description);\n\n /**\n * Returns the current default value for this attribute. This is the value\n * that new elements will get when they are created.\n *\n * @return the current default value for this attribute.\n */\n public Object getDefaultValue();\n\n /**\n * Sets the new default value for this attribute. This will not change the\n * values of any existing elements but rather the value that new elements\n * will get given when they are created.\n *\n * @param defaultValue the new default value for the attribute.\n */\n public void setDefaultValue(final Object defaultValue);\n\n /**\n * Returns the class of the attribute description that defines this\n * attribute.\n *\n * @return the class of the attribute description that defines this\n * attribute.\n */\n public Class<? extends AttributeDescription> getDataType();\n\n /**\n * Sets the data type of this attribute.\n *\n * @param dataType the new datatype of this attribute.\n */\n public void setDataType(final Class<? extends AttributeDescription> dataType);\n\n /**\n * Returns the attribute merger for this attribute.\n *\n * @return the attribute merger for this attribute.\n */\n public GraphAttributeMerger getAttributeMerger();\n\n /**\n * Sets the attribute merger for this attribute.\n *\n * @param attributeMerger the attribute merger for this attribute.\n */\n public void setAttributeMerger(final GraphAttributeMerger attributeMerger);\n}", "@Override\n\t\tpublic void setAttribute(String name, Object value) {\n\t\t\t\n\t\t}", "public String attribute() {\n return this.attribute;\n }", "public ExtensionAttributes_() {\n }", "protected abstract boolean populateAttributes();", "@Override\r\n\tpublic Map<String, Object> getAttributes() {\n\t\treturn null;\r\n\t}", "private String getClassAttribute() {\n return String.join(\" \", classAttribute);\n }", "public String getAttr() {\n return attr;\n }", "public String getAttributeName() {\n/* 85 */ return this.attributeName;\n/* */ }", "protected abstract void bindAttributes();", "public ConnectionAttributes getAttributes() {\n \treturn new ConnectionAttributes(strDbName , strUser, strPasswd, strCharSet, iLoginTimeout);\n }", "@Override\n protected void updateProperties() {\n }", "Map<String, Object> getAttributes();", "Map<String, Object> getAttributes();", "Map<String, Object> getAttributes();", "public abstract ImportAttributes getAttributes();", "public int getLength(){ // getter method\n return length; // return the value of the class attribute radius\n }", "private void initReservedAttributes()\n {\n addIgnoreProperty(ATTR_IF_NAME);\n addIgnoreProperty(ATTR_REF);\n addIgnoreProperty(ATTR_UNLESS_NAME);\n addIgnoreProperty(ATTR_BEAN_CLASS);\n addIgnoreProperty(ATTR_BEAN_NAME);\n }", "public java.lang.Integer getAttributes() {\r\n return attributes;\r\n }", "@Override\r\n\t\tpublic boolean hasAttributes()\r\n\t\t\t{\n\t\t\t\treturn false;\r\n\t\t\t}", "public List<GenericAttribute> getAttributes() {\n return attributes;\n }", "@Override\n public Map<String, Set<String>> getRequiredAttributes() {\n return requiredAttributes;\n }", "public void setAttributes(FactAttributes param) {\r\n localAttributesTracker = true;\r\n\r\n this.localAttributes = param;\r\n\r\n\r\n }", "public Object attribute(String name) {\n return Classes.getFieldValue(this, name);\n }", "public AttribInfo(){\n m_deprecated = false;\n m_hidden = false;\n m_multipleSelection = false;\n m_attributeValues = null;\n m_attributeValueMap = null;\n m_description = null;\n m_labelName = null;\n m_defaultValue = null;\n m_propertyMapKeyName = null;\n m_mapComponentClassName = null;\n m_preferredType = null;\n }", "@Override\n\n // <editor-fold defaultstate=\"collapsed\" desc=\" UML Marker \"> \n // #[regen=yes,id=DCE.E1700BD9-298C-DA86-4BFF-194B41A6CF5E]\n // </editor-fold> \n protected String getProperties() {\n\n return \"Size = \" + size + \", Index = \" + value;\n\n }", "private static int SCARD_ATTR_VALUE(int iClass, int iTag)\n {\n return (iClass << 16) | iTag;\n }", "Map<String, String> getAttributes();", "public AttributeField(Field field){\n this.field = field;\n }", "@Override\n\tpublic Attributes getAttributes() {\n\t\treturn (Attributes)map.get(ATTRIBUTES);\n\t}", "private Attribute createAttribute() {\n\t\t\tAttribute att = AttributeFactory.createAttribute(getName(), getValueType());\n\t\t\tatt.getAnnotations().clear();\n\t\t\tatt.getAnnotations().putAll(getAnnotations());\n\t\t\tattribute = att;\n\t\t\treturn att;\n\t\t}", "protected SLEXMMAttribute(SLEXMMStorageMetaModel storage) {\n\t\tsuper(storage);\n\t}", "public void setAttributes (List<GenericAttribute> attributes) {\n this.attributes = attributes;\n }", "void setInt(int attributeValue);", "@java.lang.Override\n public trinsic.services.common.v1.CommonOuterClass.JsonPayload getAttributes() {\n return attributes_ == null ? trinsic.services.common.v1.CommonOuterClass.JsonPayload.getDefaultInstance() : attributes_;\n }", "public String getAttributes() {\n\t\treturn getProperty(\"attributes\");\n\t}", "public AttributeContainer() {\n super();\n }", "@Test\n public void testSetAttributes() {\n System.out.println(\"setAttributes\");\n ArrayList<ProjectAttribute> attributes = null;\n ProjectEditController instance = new ProjectEditController();\n instance.setAttributes(attributes);\n assertEquals(instance.getAttributes(), attributes);\n\n }", "public java.util.Collection getAttributes();", "public AttrObject(){\t\r\n\tvalue = null;\r\n }", "@Override\n\t\tpublic void addAttribute(String name, String value) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void addAttribute(String name, String value) {\n\t\t\t\n\t\t}", "public Map<String, Set<String>> getAttributes() {\n return attributes;\n }", "public FactAttributes getAttributes() {\r\n return localAttributes;\r\n }", "@java.lang.Override\n public trinsic.services.common.v1.CommonOuterClass.JsonPayloadOrBuilder getAttributesOrBuilder() {\n return getAttributes();\n }", "public Attribute[] getAttributes()\n {\n return _attrs;\n }", "public static void main(String[] args) {\n Student s1 = new Student();\r\n \r\n //set the age for the student \r\n// s1.age = -500; \r\n// System.out.println(\"Age: \"+s1.age);\r\n\r\n s1.setAge(-500);\r\n System.out.println(s1.getAge()); //23 \r\n\r\n \r\n }", "public IRAttribute ( ) {\n\t\tsuper();\n\t}", "@Override\n protected void readAttributes(XMLStreamReader in)\n throws XMLStreamException {\n super.readAttributes(in);\n \n setName(in.getAttributeValue(null, \"name\"));\n \n owner = getFreeColGameObject(in, \"owner\", Player.class);\n \n tile = getFreeColGameObject(in, \"tile\", Tile.class);\n \n // @compat 0.9.x\n String typeStr = in.getAttributeValue(null, \"settlementType\");\n SettlementType settlementType;\n if (typeStr == null) {\n String capital = in.getAttributeValue(null, \"isCapital\");\n settlementType = owner.getNationType()\n .getSettlementType(\"true\".equals(capital));\n // end compatibility code\n } else {\n settlementType = owner.getNationType().getSettlementType(typeStr);\n }\n setType(settlementType);\n }", "@Override\n\t\tpublic void setAttribute(String name, Object o) {\n\t\t\t\n\t\t}", "public List<String> attributes() {\n return this.attributes;\n }", "protected boolean includeClassAttribute() {\r\n return true;\r\n }", "String attributeToSetter(String name);", "public AttributeBornMchMother() {\n }", "public Collection<HbAttributeInternal> attributes();", "public Map<String, Object> getAttributes();", "public Map<String, Object> getAttributes();", "public WSLAttributeList getAttributes() {return attributes;}", "public InspectionAttributes() {\n }", "@Test\n public void testAttributeManagement() {\n Tag tag = new BaseTag(\"testtag\");\n String attributeName = \"testAttr\";\n String attributeValue = \"testValue\";\n tag.addAttribute(attributeName, attributeValue);\n assertEquals(\"Wrong attribute value returned\", attributeValue, tag.getAttribute(attributeName));\n assertNotNull(\"No attribute map\", tag.getAttributes());\n assertEquals(\"Wrong attribute map size\", 1, tag.getAttributes().size());\n assertEquals(\"Wrong attribute in map\", attributeValue, tag.getAttributes().get(attributeName));\n tag.removeAttribute(attributeName);\n assertNull(\"Attribute was not removed\", tag.getAttribute(attributeName));\n }", "public List<Attribute> getAttributes() {\r\n return attributes;\r\n }", "public AttributeMap()\r\n\t{\r\n\t\tsuper();\r\n\t}", "public Map<String, String> getAttributes() {\n\t\treturn attributes;\n\t}", "public Attribute(String name, Type type, int ID, int length){\r\n\t\tthis.name = name;\r\n\t\tthis.type = type;\r\n\t\tthis.ID = ID;\r\n\t\tthis.length = length;\r\n\t\tvalues = new ArrayList();\r\n\t}", "public Attributes getAttributes() {\n\t\treturn null;\r\n\t}", "RakudoObject get_attribute(ThreadContext tc, RakudoObject object, RakudoObject classHandle, String name);", "public int getAge() {return age;}", "public int getAttribute() {\n return Attribute;\n }" ]
[ "0.6889523", "0.6527097", "0.6497852", "0.64951426", "0.6493571", "0.6384917", "0.63816756", "0.6318411", "0.62035006", "0.6103707", "0.60877454", "0.6068718", "0.6047711", "0.59693784", "0.5954799", "0.59429246", "0.5929212", "0.5929212", "0.5882371", "0.58684707", "0.5853311", "0.58499074", "0.58350104", "0.5834235", "0.5834235", "0.58272994", "0.58255774", "0.58076966", "0.57764775", "0.5771769", "0.5753077", "0.5743016", "0.5732349", "0.5721024", "0.57016367", "0.57009715", "0.5694607", "0.56836265", "0.56832683", "0.5676047", "0.56737435", "0.5669085", "0.5647747", "0.56432694", "0.5638763", "0.5633293", "0.5633293", "0.5633293", "0.56181777", "0.56174034", "0.5610214", "0.5596933", "0.5574088", "0.55711675", "0.55592", "0.5556745", "0.5555318", "0.5543398", "0.5539612", "0.55346566", "0.5528913", "0.55237997", "0.55172527", "0.5513342", "0.5512633", "0.55083984", "0.5507317", "0.5505442", "0.5503224", "0.54976094", "0.5492832", "0.5492648", "0.5477158", "0.5473552", "0.5473552", "0.54718685", "0.5467798", "0.54660577", "0.5465048", "0.545489", "0.54526", "0.544159", "0.5440066", "0.543384", "0.54280704", "0.54279757", "0.5425022", "0.54231024", "0.5421768", "0.5421768", "0.54155934", "0.5410148", "0.5408958", "0.5404277", "0.5399586", "0.5393288", "0.53919566", "0.5390384", "0.538971", "0.5389215", "0.538557" ]
0.0
-1
/ abstract methods to implement in child classes for add and print details
public abstract void addDetails();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public void printInfo();", "@Override\n\tpublic void getDetail() {\n\t\t\n\t}", "public void printDetails()\n {\n super.printDetails();\n System.out.println(\"The author is \" + author + \" and the isbn is \" + isbn); \n }", "public abstract void displayInfo();", "abstract String getDetails();", "public abstract String showDetails();", "@Override\n\tpublic void grandDetails() {\n\t\tsuper.grandDetails();\n\t}", "@Override\n public void information() {\n System.out.println(\"\");\n System.out.println(\"Dog :\");\n System.out.println(\"Age : \" + getAge());\n System.out.println(\"Name : \" + getName());\n System.out.println(\"\");\n }", "public void printDetails()\n {\n super.printDetails();\n System.out.println(\"Body type: \" + bodyType + \" Number of doors: \" + noOfDoors + \" Number of seats: \" + noOfSeats);\n System.out.println();\n }", "public abstract String printEmployeeInformation();", "public abstract String getInfo();", "public abstract String getInfo();", "@Override\r\n\tpublic void printTransdetails() {\n\t\t\r\n\t}", "@Override\n\tpublic void printInfo() {\n\t\tsuper.printInfo();\n\t\tmessage();\n\t\tdoInternet();\n\t\tmailing();\n\t\tcalling();\n\t\twatchingTV();\n\n\t}", "@Override\n public String toString() {\n return detail;\n }", "public abstract void description();", "public void autoDetails() {\n\t\t\r\n\t}", "public void printInfo(){\n\t}", "public void printInfo(){\n\t}", "public String wantDetail();", "public void carDetails() {\n\t\t\r\n\t}", "@Override\n public void printDetails() {\n super.printDetails(); // uses its superclass version of the method to print the basic attributes\n System.out.print(\"Time: \" + this.getTime()); // printing the time of the event\n }", "public void printDetails() {\n PrintFormatter pf = new PrintFormatter();\n\n String first = \"############# Armor Details #############\";\n System.out.println(first);\n pf.formatText(first.length(), \"# Items stats for: \" + name);\n pf.formatText(first.length(), \"# Armor Type: \" + itemsType);\n pf.formatText(first.length(), \"# Slot: \" + slot);\n pf.formatText(first.length(), \"# Armor level: \" + level);\n\n if (baseStats.getHealth() > 0)\n pf.formatText(first.length(), \"# Bonus HP: \" + baseStats.getHealth());\n\n if (baseStats.getStrength() > 0)\n pf.formatText(first.length(), \"# Bonus Str: \" + baseStats.getStrength());\n\n if (baseStats.getDexterity() > 0)\n pf.formatText(first.length(), \"# Bonus Dex: \" + baseStats.getDexterity());\n\n if (baseStats.getIntelligence() > 0)\n pf.formatText(first.length(), \"# Bonus Int: \" + baseStats.getIntelligence());\n\n System.out.println(\"########################################\");\n\n }", "public void info() {\r\n System.out.println(\" Name: \" + name + \" Facility: \" + facility + \" Floor: \" + floor + \" Covid: \"\r\n + positive + \" Age: \" + age + \" ID: \" + id);\r\n }", "@Override\n public void print() {\n System.out.println(\"VIn:- \"+getVehicalIndentificationNumber());\n System.out.println(\"Description:- \"+getVechicalDiscription());\n System.out.println(\"Manufacturer:- \"+getManufacturerName());\n System.out.println(\"isSelfDrive:- \"+getSelfDrive());\n System.out.println(\"isInsured:- \"+getInsured());\n System.out.println(\"insuranceProviderName:- \"+getInsuranceProviderName());\n System.out.println(\"NumberOfSeat:- \"+getNoOfSeat());\n System.out.println(\"FuelType:- \"+getFuelType());\n System.out.println(\"BaseRate:- \"+getBaseRate());\n System.out.println(\"RatePerKm:- \"+getRatePerKm());\n System.out.println(\"VehicleType:- \"+getVehicleType());\n System.out.println(\"Color:- \"+getColor());\n }", "@Override\r\n\t\t\tpublic void print() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n public String getRecordDetail() {\n return \"[\" + type + \"] \"\n + \"[\" + people + \" pax] \"\n + \"[\" + \"Total: $\" + amount + \"] \"\n + \"[\" + amountToMoney() + \" per person] \"\n + nameList;\n }", "@Override\n\t\t\tpublic void print() {\n\t\t\t\t\n\t\t\t}", "public void showInfomation()\n {\n\t System.out.println(\"\\nSide\"+\"\\n\\tnumber: \"+ super.getNumber() +\"\\n\\tdishName: \" + super.getDishName() + \"\\n\\tmaker: \"+maker+\"\\n\\tprice : \" + super.getPrice()+\"$\");\n }", "abstract public T getInfo();", "public void printDetails()\n {\n System.out.println(title);\n System.out.println(\"by \" + author);\n System.out.println(\"no. of pages: \" + pages);\n \n if(refNumber == \"\"){\n System.out.println(\"reference no.: zzz\");\n }\n else{\n System.out.println(\"reference no.: \" + refNumber);\n }\n \n System.out.println(\"no. of times borrowed: \" + borrowed);\n }", "void printEmployeeDetail(){\n\t\tSystem.out.println(\"First name: \" + firstName);\n\t\tSystem.out.println(\"Last name: \" + lastName);\n\t\tSystem.out.println(\"Age: \" + age);\n\t\tSystem.out.println(\"Salary: \" + salary);\n\t\tSystem.out.println(firstName + \" has \" + car.color + \" \" + car.model + \" it's VIN is \" + car.VIN + \" and it is make year is \" + car.year );\n\t\t\n\t}", "public void printDetails()\n {\n System.out.println(\"Name: \" + foreName + \" \"\n + lastName + \"\\nEmail: \" + emailAddress);\n }", "@Override\n\tprotected void print() {\n\t\tSystem.out.println(\"-----------\"+this.getName()+\"\");\n\t}", "protected GeneralInfo(){\r\n \t\tsuper();\r\n \t}", "void displayDetails(String title, String description);", "public void empDetails() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t}", "@SuppressWarnings(\"unused\")\n private void generateInfo()\n {\n }", "public void printInformation() {\n\n System.out.println(\"Name: \" + name);\n System.out.println(\"Weight: \" + weight);\n System.out.println(\"Shape: \" + shape);\n System.out.println(\"Color: \" + color);\n }", "@Override\n\t\tpublic void print() {\n\n\t\t}", "public static void printInfo(){\n }", "@Override\n\tpublic Object getDetails() {\n\t\treturn details;\n\t}", "@Override\n\tpublic abstract String toString ();", "void printInfo();", "private void callFormDetailFunctions() {\n ArrayList<Item> items = new ArrayList<>();\n items.addAll(computers);\n items.addAll(printers);\n getBuildingNames(items);\n getBrandNames(items);\n getOSNames(computers);\n setAdapters();\n }", "@Override\n public void display(){\n System.out.println(\"Student id: \"+getStudentId()+\"\\nName is: \"+getName()+\"\\nAge :\"+getAge()+\"\\nAcademic year: \"+getSchoolYear()\n +\"\\nNationality :\"+getNationality());\n }", "@Override\n\tpublic abstract String toString();", "public abstract String description();", "public abstract String description();", "abstract void print();", "@Override\n public String toString()\n {\n return super.toString() + \" \" + this.extended + \" \" + this.price + \n \" \" + this.number;\n }", "public void getInfo(){\n System.out.println(\"Name: \" + name + \"\\n\" + \"Address: \" + address);\n }", "public String getAnotherDetail();", "@Override\n public void print() {\n }", "@Override\n public abstract String toString();", "@Override\r\n\tpublic void print() {\n\t}", "public void printDetails() {\n System.out.println(\"Name: \" + getFirstName() + \" \" + getLastName());\n System.out.println(\"Height: \" + getHeight() + \" inches\");\n System.out.println(\"Weight: \" + (int) getWeight() + \" pounds\");\n\n // unary, binary, ternary(3)\n // ternary operator\n String travelMessage = canTravel ? \"Does travel\" : \"Does not travel\";\n System.out.println(travelMessage);\n\n String smokeMessage = smokes ? \"Does smoke\" : \"Does not smoke\";\n System.out.println(smokeMessage);\n\n // ternary operators can replace simple if-else statement\n // System.out.print(\"Does \");\n // if (!isCanTravel())\n // System.out.print(\"not \");\n // System.out.println(\"travel\");\n // System.out.print(\"Does \");\n // if (!isSmokes())\n // System.out.print(\"not \");\n // System.out.println(\"smoke\");\n }", "@Override\r\n public String toString() {\n return super.toString();\r\n }", "@Override\n\tprotected abstract OpenableElementInfo createElementInfo();", "@Override\n public String toString() {\n return info();\n }", "@Override\n\tpublic void bankInfo(T ref) {\t// act as an add(Object ref) method\n\t\tSystem.out.println(ref);\n\t}", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n public abstract String toString();", "@Override\n\tpublic void print() {\n\n\t}", "public void xxx() {\n System.out.println(\"Salary: \" + salary);\n printInfo();\n\n Employee e = new Employee(\"Andy\", \"123\", 26);\n// System.out.println(\"Name: \" + e.name + \"; Age: \" + e.age + \";ID: \" + e.id);\n\n Manager m = new Manager(\"Andylee\", \"124\", 27);\n// System.out.println(\"Name: \" + m.name + \"; Age: \" + m.age + \";ID: \" + m.id);\n\n }", "@Override\n\tvoid putData() {\n\t\tSystem.out.println(\"Brand : \"+brand);\n\t\tSystem.out.println(\"Model : \"+model);\n\t\tSystem.out.println(\"Year of manufacture : \"+year_of_manufacture);\n\t\tSystem.out.println(\"CC : \"+cc);\n\t}", "java.lang.String getDetails();", "public void empdetails() {\r\n\t\tSystem.out.println(\"name : \"+ name);\r\n\t}", "@Override\n\tpublic void print() {\n System.out.println(\"Leaf [isbn=\"+number+\", title=\"+title+\"]\");\n\t}", "public AbstractCar(String car){\n\t\n\tSystem.out.println(\"\\n\\n The following are the details for : \" + car);\n}", "@Override\n\tpublic void detail(GalaxyNote phone) {\n\t\t\n\t}", "@Override\n\tpublic void print() {\n\t\t\n\t}", "@Override\r\n public String toString() {\n return super.toString();\r\n }", "void printCarInfo();", "public void testPrintStudentDetails() {\n\t System.out.println(\"printStudentDetails\");\n\t Student instance = student1;\n\t student1.addCourse(course1);\n\t student1.addModule(module1);\n\t instance.printStudentDetails();\n\t }", "@Override\r\n public void display() { //implements abstract display() method from Division.java\r\n System.out.println(\"Division Name: \" + getDivisionName());\r\n System.out.println(\"Account Number: \" + getAccountNumber());\r\n\r\n System.out.println(\"Country: \" + getCountry());\r\n System.out.println(\"Language Spoken: \" + getLanguageSpoken() + \"\\n\");\r\n\r\n }", "@Override\n public String toString() {\n return \"[E]\" + super.toString() + \"(at: \" + details + \")\";\n }", "public void printDetails()\r\n\t{\r\n\t\tSystem.out.println(flightNumber);\r\n\t\tSystem.out.println(departurePoint);\r\n\t\tSystem.out.println(destination);\r\n\t\tSystem.out.println(departureTime);\r\n\t\tSystem.out.println(arrivalTime);\r\n\t\tSystem.out.println(checkedInPassengers);\r\n\t\tif(status == 'S')\r\n\t\t\tSystem.out.println(\"Scheduled\");\r\n\t\t\t\r\n\t\tif(status == 'B')\r\n\t\t\tSystem.out.println(\"Boarding\");\r\n\t\tif(status == 'D')\r\n\t\t\tSystem.out.println(\"Departed\");\r\n\t\tif(status == 'C')\r\n\t\t\tSystem.out.println(\"Canceled\");\r\n\t\t\r\n\t\t\t\t\r\n\t}", "@Override\n\tpublic void addPrintLabelInfo(GUIPrintLabelDto printLabelEntity) {\n\t}", "public abstract void showStat();", "@Override\n\tpublic String toString() {\n\t\treturn \"Name : \" + getName() + \", level : \" + level + \", Dni : \" + getDni()\n\t\t + \", Age : \" + getAge() \n\t\t + super.toString()+\"\\n\";\n\t}", "public abstract String getDescription();", "public abstract String getDescription();", "public abstract String getDescription();", "public abstract String getDescription();", "public abstract String getDescription();", "public abstract String getDescription();", "public abstract String getDescription();", "public abstract String getDescription();", "@Override\n\tpublic void addDetails(String details) {\n\t\tthis.details = details;\n\t}", "void printloadDetails(loadDetails iLoadDetails)\n {\n System.out.println(iLoadDetails.getLorryName());\n System.out.println(iLoadDetails.getEstateName());\n System.out.println(iLoadDetails.getDate());\n }", "int addition(int num1, int num2) {\n System.out.print(\"\\nIn Abstract Parent Class : \");\n return num1 + num2;\n }", "@Override//overring a library function\n public String toString() {\n return shape + \" \" + name;//toString() is called everytime printing is done\n }", "protected abstract void updateInfos();", "public abstract void print();" ]
[ "0.7205639", "0.71651286", "0.7015168", "0.68543965", "0.6821994", "0.6743304", "0.6563363", "0.6549146", "0.6492832", "0.643395", "0.6385931", "0.6385931", "0.6383308", "0.6372627", "0.63344127", "0.63163066", "0.6311364", "0.6303371", "0.6303371", "0.6261186", "0.6253942", "0.6213738", "0.61792254", "0.6161872", "0.6126962", "0.6113704", "0.61113113", "0.6098407", "0.60869884", "0.60850227", "0.60477304", "0.603595", "0.6012049", "0.5989037", "0.59873796", "0.59762335", "0.5963847", "0.5962236", "0.5943845", "0.5939065", "0.5921311", "0.59185326", "0.59086883", "0.5903701", "0.5884475", "0.5884219", "0.58816165", "0.5873772", "0.5873772", "0.58489376", "0.5848738", "0.5846991", "0.5832886", "0.58264625", "0.58223057", "0.58191717", "0.5816104", "0.58148354", "0.5811756", "0.5810216", "0.580997", "0.58058524", "0.58058524", "0.58058524", "0.58058524", "0.58058524", "0.58058524", "0.58058524", "0.5805755", "0.58054703", "0.5802508", "0.5798918", "0.57873243", "0.5781163", "0.5770643", "0.5769729", "0.57683927", "0.57552123", "0.5744748", "0.5744715", "0.5740957", "0.5733002", "0.57273114", "0.57216257", "0.57210493", "0.57169384", "0.571437", "0.571437", "0.571437", "0.571437", "0.571437", "0.571437", "0.571437", "0.571437", "0.5713439", "0.571138", "0.5711258", "0.5707941", "0.57063997", "0.57023764" ]
0.7325416
0
Synchronize on LOCK to ensure that we don't end up creating two singletons.
public static synchronized CodeChatManager getInstance() { synchronized (LOCK){ if(instance == null) { CodeChatManager manager = new CodeChatManager(); instance = manager; return manager; } return instance; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Singleton doubleCheckLocking(){\n if(instance != null){\n return instance;\n }\n synchronized (key){\n if(instance == null){\n instance = new Singleton();\n }\n return instance;\n }\n }", "private SingletonSyncBlock() {}", "private SingletonDoubleCheck() {}", "public LockSync() {\n lock = new ReentrantLock();\n }", "private static void multiThreading(){\n\t\tSystem.out.println(\"\\nCreating new two separate instances of Singleton using Multi threading\");\n\t\tExecutorService service = Executors.newFixedThreadPool(2);\n\t\tservice.submit(TestSingleton::useSingleton);\n\t\tservice.submit(TestSingleton::useSingleton);\n\t\tservice.shutdown();\n\t}", "private static void createSingletonObject() {\n\t\tSingleton s1 = Singleton.getInstance();\n\t\tSingleton s2 = Singleton.getInstance();\n\n\t\tprint(\"S1\", s1);\n\t\tprint(\"S2\", s2);\n\t}", "public SingletonSyncBlock getInstance() { // when getting a new instance, getInstance as synchronized method is\n\t\t\t\t\t\t\t\t\t\t\t\t// called\n\n\t\tif (SINGLETON_INSTANCE == null) { // if no Singleton was yet initialized, one instance will be created else,\n\t\t\t\t\t\t\t\t\t\t\t// it's returned the one already created.\n\n\t\t\tsynchronized (SingletonSyncBlock.class) { // synchronized block\n\n\t\t\t\tif (SINGLETON_INSTANCE == null) {\n\n\t\t\t\t\tSINGLETON_INSTANCE = new SingletonSyncBlock();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn SINGLETON_INSTANCE;\n\n\t}", "synchronized static PersistenceHandler getInstance() {\n return singleInstance;\n }", "@Test\n public void testMultipleCallsReturnTheSameObjectInSameThread() {\n // Create several instances in the same calling thread\n S instance1 = this.singletonInstanceMethod.get();\n S instance2 = this.singletonInstanceMethod.get();\n S instance3 = this.singletonInstanceMethod.get();\n // now check they are equal\n assertSame(instance1, instance2);\n assertSame(instance1, instance3);\n assertSame(instance2, instance3);\n }", "private SingletonThreadSafeExample(){\n this.invoke++;\n }", "Shared shared();", "public static ThreadSafe getInstaceDoubleChecking(){\n if(instance==null){\n synchronized (ThreadSafe.class) {\n if (instance==null) {\n instance = new ThreadSafe();\n }\n }\n }\n return instance;\n }", "public static SingleObject getInstance(){\n return instance;\n }", "synchronized public static SampletypeManager getInstance()\n {\n return singleton;\n }", "private Locks() {\n\t\tlockId = ObjectId.get().toString();\n\t}", "private Singleton(){}", "public static synchronized LazyLoadingSingleton getInstanceSynchronized() {\n\t\tif (INSTANCE == null) {\n\t\t\tINSTANCE = new LazyLoadingSingleton();\n\t\t}\n\t\treturn INSTANCE;\n\t}", "public static synchronized N_ThreadSafeSingalton getInstance() throws InterruptedException{\n\t\t\n\t\tif (uniqueInstance == null){\n\t\t\tThread.sleep(1000);// just to show multithreading issue.\n\t\t\tuniqueInstance=new N_ThreadSafeSingalton();\n\t\t}\t\t\n\t\t\n\t\treturn uniqueInstance;\n\t}", "private SingletonEager(){\n \n }", "private MySingleton() {\r\n\t\tSystem.out.println(\"Only 1 object will be created\");\r\n\t}", "public static ThreadSafeSingleton getInstanceWithDoubleCheck() {\n\t\tif (instance == null) {\n\t\t\tsynchronized (ThreadSafeSingleton.class) {\n\t\t\t\tif (instance == null) {\n\t\t\t\t\tinstance = new ThreadSafeSingleton();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn instance;\n\t}", "private SingletonSample() {}", "public static SingleObject getInstance(){\n\t\treturn instance;\n\t}", "public static SingleObject getInstance()\r\n {\r\n return instance;\r\n }", "public static DoubleCheckedLocking getInstanceUsingDoubleLocking(){\n\t if(instance == null){\n\t synchronized (DoubleCheckedLocking.class) {\n\t if(instance == null){\n\t instance = new DoubleCheckedLocking();\n\t }\n\t }\n\t }\n\t return instance;\n\t}", "private Singleton() { }", "private LazySingleton(){}", "public static void main (String[] args) {\n\n\n Thread t1= new Thread(new Runnable() {\n @Override\n public void run() {\n System.out.println(\"Output: \"+Singleton.getInstance());\n Singleton.setObjName(\"Meow!!\");\n System.out.println(\"t1 Name: \"+Singleton.getName());\n }\n });\n\n Thread t2 = new Thread(new Runnable() {\n @Override\n public void run() {\n\n System.out.println(\"Output: \"+Singleton.getInstance());\n System.out.println(\"t2 Name: \"+Singleton.getName());\n\n }\n });\n\n Thread t3 = new Thread(new Runnable() {\n @Override\n public void run() {\n\n System.out.println(\"Output: \"+Singleton.getInstance());\n Singleton.setObjName(\"WolWol\");\n System.out.println(\"t3 Name: \"+Singleton.getName());\n\n }\n });\n\n Thread t4 = new Thread(new Runnable() {\n @Override\n public void run() {\n\n System.out.println(\"Output: \"+Singleton.getInstance());\n System.out.println(\"t4 Name: \"+Singleton.getName());\n\n }\n });\n\n// t1.start();\n// t2.start();\n// t3.start();\n// t4.start();\n\n \n }", "@Override\n public boolean isSingleton() {\n return false;\n }", "static Lock createLock() {\n return new /*Prio*/Lock();\n }", "public static synchronized MultiThreadedSingleton getInstance() {\n\t\t//Lazy instantiation using double locking mechanism.\n\t\tif (singleton == null) {\n\t\t\tsynchronized (MultiThreadedSingleton.class) {\n\t\t\t\tif (singleton == null) {\n\t\t\t\t\tsimulateRandomActivity();\n\t\t\t\t\tsingleton = new MultiThreadedSingleton();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tlogger.info(\"created singleton: \" + singleton);\n\t\treturn singleton;\n\t}", "private SingletonSigar(){}", "private Singleton() {\n\t}", "public static synchronized LazyLoadingSingleton getInstanceWithSynchronizedBlock() {\n\t\tif (INSTANCE == null) {\n\t\t\tsynchronized (LazyLoadingSingleton.class) {\n\t\t\t\tINSTANCE = new LazyLoadingSingleton();\n\t\t\t}\n\t\t}\n\t\treturn INSTANCE;\n\t}", "LockManager() {\n }", "public DPSingletonLazyLoading getInstance(){ //not synchronize whole method. Instance oluşmuş olsa bile sürekli burada bekleme olur.\r\n\t\tif (instance == null){//check\r\n\t\t\tsynchronized(DPSingletonLazyLoading.class){ //critical section code NOT SYNCRONIZED(this) !!\r\n\t\t\t\tif (instance == null){ //double check\r\n\t\t\t\t\tinstance = new DPSingletonLazyLoading();//We are creating instance lazily at the time of the first request comes.\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn instance;\r\n\t}", "public static Singleton getInstance() {\n return SingletonHolder.SINGLETON_INSTANCE;\n }", "private SingletonH() {\n System.out.println(Thread.currentThread().getName()\n + \": creating SingletonH\");\n }", "public static synchronized SingletonThreadSave getInstance(){\n if(uniqueThreadSaveInstance == null){\n uniqueThreadSaveInstance = new SingletonThreadSave();\n }\n return uniqueThreadSaveInstance;\n }", "private EagerInitializedSingleton() {\n\t}", "private EagerInitializedSingleton() {\n\t}", "synchronized public static InstitutionManager getInstance()\n {\n return singleton;\n }", "static void useSingleton(){\n\t\tSingleton singleton = Singleton.getInstance();\n\t\tprint(\"singleton\", singleton);\n\t}", "public static synchronized Singleton getInstanceTS() {\n\t\tif (_instance == null) {\n\t\t\t_instance = new Singleton();\n\t\t}\n\t\treturn _instance;\n\t}", "public static synchronized Singleton getInstance(){\n if(instance == null){\n instance = new Singleton();\n }\n return instance;\n }", "private Singleton()\n\t\t{\n\t\t}", "public void lock() {\r\n super.lock();\r\n }", "private void checkSingleInstance() {\r\n\t\t//Erzeugt ein RandomAccessFile \"flag\"\r\n\t\tfinal File file = new File(\"flag\");\r\n\t\tRandomAccessFile randomAccessFile;\r\n\t\t\r\n\t\ttry \r\n\t\t{\r\n\t\t\t//Ist es der Applikation nicht möglich, das erstellte File zu sperren, zeigt es an, dass bereits eines vorhanden ist.\r\n\t\t\t//Dementsprechend wird die Applikation beendet, da bereits eine Instanz geöffnet wurde.\r\n\t\t\trandomAccessFile = new RandomAccessFile(file, \"rw\");\r\n\t\t\tfinal FileLock fileLock = randomAccessFile.getChannel().tryLock();\r\n\r\n\t\t\tif (fileLock == null) {\r\n\t\t\t\tPlatform.exit();\r\n\t\t\t}\r\n\t\t} catch (Exception e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t}", "ObjectPool() {\n deadTime = DEFAULT_DEADTIME;\n lock = new Hashtable<T, Long>();\n unlock = new Hashtable<T, Long>();\n }", "public void lock() {\n super.lock();\n }", "public void lock() {\n super.lock();\n }", "public void lock() {\n super.lock();\n }", "public synchronized static SynchronizedMethodSingleton getInstance()\n\t{\n\t\tif ( instance == null )\n\t\t{\n\t\t\tinstance = new SynchronizedMethodSingleton();\n\t\t}\n\t\treturn instance;\n\t}", "public void lock() {\n\n }", "private Singleton(){\n }", "private SingletonObject() {\n\n\t}", "public /* synchronized */ static LazyInitClass getInstanceThreadSafe() {\r\n\t\t//first if is for perfrroamce betterment\r\n\t\t//once object got created no need to synchronize and stop other threads to read\r\n\t\tif(instance == null) {\r\n\t\t\tsynchronized (LazyInitClass.class) {\r\n\t\t\t\tif(instance == null) {\r\n\t\t\t\t\tinstance = new LazyInitClass();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\treturn instance;\r\n\t}", "void lock();", "synchronized public static void setInstance(SampletypeManager instance)\n {\n singleton = instance;\n }", "public void synchronize(){ \r\n }", "@Test\n public void testSingleton() throws InterruptedException{\n Singleton[] results = new Singleton[threadNumber];\n\n for(int i=0; i<threadNumber; i++) {\n final int finalI = i;\n executor.execute(() -> {\n try {\n long threadId = Thread.currentThread().getId();\n logger.info(\"[Thread-\" + threadId + \"] is running\");\n results[finalI] = Singleton.getInstance();\n logger.info(\"[Thread-\" + threadId + \"] is finished\");\n }\n catch (Throwable t) {\n logger.error(t, t.getCause());\n }\n });\n }\n executor.shutdown();\n executor.awaitTermination(10, TimeUnit.SECONDS);\n\n long count = Arrays.stream(results).distinct().count();\n assertEquals(\"Instance number supposed to be only one, but you got \" + count, expectInstances, count);\n }", "private SingletonAR() {\n System.out.println(Thread.currentThread().getName()\n + \": creating SingletonAR\");\n }", "public LockSync(Lock sharedLock) {\n lock = Objects.requireNonNull(sharedLock);\n }", "public boolean isSingleton() {\n\t\treturn false;\r\n\t}", "private Singleton2A(){\n\t\tif(instance != null){\n\t\t\tthrow new RuntimeException(\"One instance already created cant create other\");\n\t\t}\t\t\n\t\tSystem.out.println(\"I am private constructor\");\n\t}", "protected Object readResolve(){\n return singletonInstance;\n }", "public static Singleton getInstance() {\n return mSing;\n }", "private J2_Singleton() {}", "synchronized public static PreferenceManager getInstance()\n {\n return singleton;\n }", "public static Singleton getInstance(){\n if(instance == null)\n {\n synchronized (Singleton.class) {\n if (instance == null) {\n instance = new Singleton();\n Log.d(\"***\", \"made new Singleton\");\n }\n }\n }\n return instance;\n }", "private EagerInitializationSingleton() {\n\t}", "public static synchronized ThreadSafeSingleton getInstance() {\n\t\tif (instance == null) {\n\t\t\tinstance = new ThreadSafeSingleton();\n\t\t}\n\t\treturn instance;\n\t}", "private static void j_lock() {\r\n\t\tdo {\r\n\t\t\tLOCK_FILES_DIR.mkdirs();\r\n\t\t\ttry {\r\n\t\t\t\tRandomAccessFile raf = new RandomAccessFile(GLOBAL_LOCK_FILE,\r\n\t\t\t\t\t\t\"rw\");\r\n\t\t\t\tFileChannel channel = raf.getChannel();\r\n\t\t\t\tFileLock lock = channel.lock();\r\n\t\t\t\tglobalFileChannel = channel;\r\n\t\t\t\tglobalFileLock = lock;\r\n\t\t\t\tbreak;\r\n\t\t\t} catch (Throwable t) {\r\n\t\t\t\t;\r\n\t\t\t}\r\n\t\t} while (true);\r\n\t}", "public static synchronized void foo() {\n\n }", "public SimpleReadWriteLock() {\n\n\t\treaderLock = new ReadLock();\n\t\twriterLock = new WriteLock();\n\t\treaders = 0;\n\t\twriters = 0;\n\t\tthis.lock = this;\n\t}", "private Singleton() {\n if (instance != null){\n throw new RuntimeException(\"Use getInstance() to create Singleton\");\n }\n }", "public Lock() {\r\n }", "private static Session getInstance() {\n return SingletonHolder.INSTANCE;\n }", "public static synchronized SingletonImpl getSingleton() {\n\t\t\n\t\tif(mySingleton == null){\n\t\t\tmySingleton = new SingletonImpl();\n\t\t}\n\t\treturn mySingleton;\n\t}", "private void RecordStoreLockFactory() {\n }", "public boolean isSingleton() {\n\t\treturn false;\n\t}", "public static Boolean getSingleton() {\r\n\t\treturn singleton;\r\n\t}", "public static synchronized Singleton getInstance() {\n\t\tif(instance ==null) {\n\t\t\tinstance= new Singleton();\n\t\t\t\n\t\t}\n\t\treturn instance;\n\t}", "@Test(timeout = 10000)\n public void testMultipleCallsReturnTheSameObjectInDifferentThreads() throws Exception {\n\n // Create 10000 tasks and inside each callable instantiate the singleton class\n final List<Callable<S>> tasks = new ArrayList<>();\n for (int i = 0; i < 10000; i++) {\n tasks.add(this.singletonInstanceMethod::get);\n }\n\n // Use up to 8 concurrent threads to handle the tasks\n final ExecutorService executorService = Executors.newFixedThreadPool(8);\n final List<Future<S>> results = executorService.invokeAll(tasks);\n\n // wait for all of the threads to complete\n final S expectedInstance = this.singletonInstanceMethod.get();\n for (Future<S> res : results) {\n final S instance = res.get();\n assertNotNull(instance);\n assertSame(expectedInstance, instance);\n }\n\n // tidy up the executor\n executorService.shutdown();\n\n }", "public static synchronized ThreadSafeSingleton getInstance() {\n\t\tif (null == instance) {\n\t\t\tinstance = new ThreadSafeSingleton();\n\t\t}\n\n\t\treturn instance;\n\t}", "public static synchronized StitchObjectMapper getInstance() {\n if (singleton != null) {\n return singleton;\n }\n singleton = new StitchObjectMapper();\n return singleton;\n }", "public static Singleton instance() {\n return Holder.instance;\n }", "public static LazyLoadingSingleton getInstaceWithoutThreadSafty() {\n\t\tif (INSTANCE == null) {\n\t\t\tINSTANCE = new LazyLoadingSingleton();\n\t\t}\n\t\treturn INSTANCE;\n\t}", "static public Abc getObject() //Double Chcked Locking\n {\n if(obj1==null) {\n synchronized (Abc.class) {\n if (obj1 == null) {\n obj1 = new Abc();\n }\n }\n\n }\n return obj1;\n }", "public static SingletonEager get_instance(){\n }", "public boolean isSingleton()\n\t{\n\t\treturn true;\n\t}", "private SingletonClass() {\n objects = new ArrayList<>();\n }", "public static Singleton getInstance( ) {\n return singleton;\n }", "@Test\r\n\tvoid testReentrant() throws Exception\r\n\t{\r\n\t\tfinal PageAccessSynchronizer sync = new PageAccessSynchronizer(Duration.ofSeconds(5));\r\n\t\tsync.lockPage(0);\r\n\t\tsync.lockPage(0);\r\n\t}", "private SingletonStatementGenerator() {\n\t}", "public static SingletonEager getInstance()\n {\n return instance;\n }", "private Object readResolve() {\n\t\treturn singletonObj;\n\t}", "public boolean synchronize() {\n\t\treturn false;\n\t}", "public static RCProxy instance(){\n\t\treturn SingletonHolder.INSTANCE;\n\t}", "@Around(\"singletonsScope()\")\n \tpublic Object aroundSingletons(ProceedingJoinPoint jp) throws Throwable {\n\n Class<?> singClass = jp.getSignature().getDeclaringType();\n logger.info(\"Creating singleton for class: {}\", singClass);\n\n Object singObj = this.singletons.get(singClass);\n if (singObj == null) {\n logger.info(\"First time singleton creation, adding to map\");\n singObj = jp.proceed();\n this.singletons.put(singClass, singObj);\n }\n logger.debug(\"Object: \" + singObj);\n return singObj;\n }", "synchronized public static void setInstance(InstitutionManager instance)\n {\n singleton = instance;\n }" ]
[ "0.7250501", "0.72339916", "0.69195294", "0.6823505", "0.67646664", "0.6721133", "0.65336186", "0.6396465", "0.6342491", "0.6336332", "0.63151616", "0.62931156", "0.6289697", "0.62778026", "0.6261271", "0.6252224", "0.62205034", "0.6218236", "0.61898744", "0.61898524", "0.61814916", "0.6167987", "0.6161304", "0.61379254", "0.6135348", "0.61318696", "0.6129252", "0.6116149", "0.61007434", "0.6072973", "0.60437506", "0.60429007", "0.60360754", "0.60354257", "0.6035032", "0.6027188", "0.6026928", "0.6015601", "0.5998741", "0.5998739", "0.5998739", "0.5992583", "0.5974939", "0.5966698", "0.59630275", "0.59591013", "0.5942083", "0.59279054", "0.59233963", "0.591933", "0.591933", "0.591933", "0.5918844", "0.59183425", "0.5912475", "0.58848166", "0.58773124", "0.58547795", "0.5851422", "0.58348686", "0.5827601", "0.58074474", "0.5783209", "0.57743317", "0.5772288", "0.57692033", "0.5766548", "0.57637954", "0.5759967", "0.5754757", "0.5750753", "0.57466966", "0.5745568", "0.5744849", "0.57325935", "0.5731201", "0.57183826", "0.57108474", "0.5707209", "0.57067645", "0.57005686", "0.5691885", "0.569102", "0.56895846", "0.56885713", "0.56870157", "0.56800485", "0.56788874", "0.5672629", "0.5671468", "0.56612414", "0.5659709", "0.5644549", "0.56427854", "0.5641652", "0.5638608", "0.5634393", "0.56094927", "0.5601377", "0.5599929", "0.55934113" ]
0.0
-1
Testing the checkChangeImage() function
@Test void checkChangeImage() { ImageViewModel imageModel = new ImageViewModel(); int countUp = 10; int totalTime = 70; int i = imageModel.checkChangeImage(countUp, totalTime); assertEquals(1, i); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testRefreshImage()\n {\n Image orig = cover.getImage();\n cover.setType(GamePiece.O);\n cover.refreshImage();\n assertEquals(false, orig.equals(cover.getImage()));\n }", "public void testGetSetImageImage() {\n\t\tassertEquals(testNormal.getImage(), new ImageIcon(\"PACMAN/smallpill.png\").getImage());\n\t\t\n\t\t//SET NEW IMAGE\n\t\ttestNormal.setImage(testImage);\n\t\tassertEquals(testNormal.getImage(), testImage);\n\t}", "private void change_im_check(boolean boo){\r\n if(boo){ //IMAGEN SI EL MEASURE ES CORRECTO\r\n im_check.setImage(new Image(getClass().getResourceAsStream(\"/Images/img06.png\")));\r\n }else{ //IMAGEN PARA LA BUSQUEDA DE UN MEASURE\r\n im_check.setImage(new Image(getClass().getResourceAsStream(\"/Images/img34.png\")));\r\n }\r\n }", "@Test\n public void editPicture_NotNull(){\n Bitmap originalImage = BitmapFactory.decodeResource(appContext.getResources(),R.drawable.ic_add);\n testRecipe.setImage(originalImage, appContext);\n Bitmap newImage = BitmapFactory.decodeResource(appContext.getResources(),R.drawable.ic_cart);\n testRecipe.setImage(newImage, appContext);\n assertNotEquals(\"editPicture - New Image Not Null\", null, testRecipe.getImage(appContext));\n }", "@Test\n public void testChangeGrey() {\n System.out.println(\"changeGrey\");\n ImageFilter instance = null;\n BufferedImage expResult = null;\n BufferedImage result = instance.changeGrey();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "@Override\n public int checkImage(Image img, int w, int h, ImageObserver o) {\n return Toolkit.getDefaultToolkit().checkImage(img, w, h, o);\n }", "public void changeAction()\r\n {\r\n bufferedImage = imageCopy[0];\r\n edited = imageCopy[1];\r\n cropedPart = imageCopy[2];\r\n bufferedImage = imageCopy[3];\r\n\r\n isBlured = statesCopy[0];\r\n isReadyToSave = statesCopy[1];\r\n isChanged = statesCopy[2];\r\n isInverted = statesCopy[3];\r\n isRectangularCrop = statesCopy[4];\r\n isCircularCrop = statesCopy[5];\r\n isImageLoaded = statesCopy[6];\r\n }", "@Test\n public void addPicture_ReturnsTrue(){\n Bitmap image = BitmapFactory.decodeResource(appContext.getResources(),R.drawable.ic_add);\n assertEquals(\"addPicture - Returns True Upon Valid Pic\", true, testRecipe.setImage(image, appContext));\n assertNotEquals(\"addPicture - Not Null Upon Valid Pic\", null, testRecipe.getImage(appContext));\n }", "public void testSetImage() {\n byte[] image = new byte[] {1, 2, 3};\n byte[] expResult = new byte[] {1, 2, 3};\n CLImage instance = new CLImage();\n instance.setImage(image);\n assertEquals(expResult.length, instance.image.length);\n for (int i = 0; i < expResult.length; ++i)\n {\n assertEquals(expResult[i], instance.image[i]);\n }\n }", "public void testGetImage() {\n CLImage instance = new CLImage();\n byte[] expResult = new byte[] {1, 2, 3};\n instance.image = new byte[] {1, 2, 3};\n byte[] result = instance.getImage();\n assertEquals(expResult.length, result.length);\n for (int i = 0; i < expResult.length; ++i)\n {\n assertEquals(expResult[i], result[i]);\n }\n }", "public void isImagePresent() {\r\n\t\t\t\r\n\t\t}", "@Test\n public void getPicture_Exists(){\n Bitmap image = BitmapFactory.decodeResource(appContext.getResources(),R.drawable.ic_add);\n testRecipe.setImage(image, appContext);\n Bitmap retrieved = testRecipe.getImage(appContext);\n assertNotEquals(\"getPicture - Not Null\", null, retrieved);\n }", "public void testGetSetImageString() {\n\t\tassertEquals(testNormal.getImage(), new ImageIcon(\"PACMAN/smallpill.png\").getImage());\n\t\t\n\t\t//SET NEW IMAGE (\"PACMAN/littlepill.png\" because it exists)\n\t\ttestNormal.setImage(\"PACMAN/bigpill.png\");\n\t\tassertEquals(testNormal.getImage(), new ImageIcon(\"PACMAN/bigpill.png\").getImage());\n\t}", "@Test //Associated with Confirm image icon exists (Scenario 2)\n public void confirmImageIconExistsTest() throws Exception {\n onView(withId(R.id.contact_new)).perform(click());\n\n //types in the name \"Shane\" into the name field for the Contact\n onView(withId(R.id.info_name)).perform(typeText(\"Shane\"), closeSoftKeyboard());\n\n //performs a click operation on the \"Submit Changes\" button\n onView(withId(R.id.info_edit_button)).perform(click());\n\n //performs a scroll action within the activity to take you to the necessary spot where\n //the newly created contact will be located\n onView(withId(R.id.contacts_list)).perform(RecyclerViewActions.scrollToPosition(0));\n\n //performs a click operation on the newly created Contact that is within the field\n //of view for the RecyclerView\n onView(withText(\"Shane\")).perform(click());\n\n //performs a click operation on the \"Edit Contact Info\" button\n onView(withId(R.id.info_edit_button)).perform(click());\n\n //confirms that the button on the Edit Contact screen associated with the id info_delete_button\n //has a string associated with it that reads \"Delete Contact\". This string and id is unique in the\n //app and only exists in this singular activity.\n onView(withId(R.id.info_delete_button)).check(matches(withText(R.string.info_delete)));\n\n onView(withId(R.id.info_pic)).check(matches(withContentDescription(R.string.image_contact)));\n\n //clicks the Delete Contact button\n onView(withId(R.id.info_delete_button)).perform(click());\n }", "public void changeImage(){\n if(getImage()==storeItemImg) setImage(selected);\n else setImage(storeItemImg);\n }", "@Test\n public void testNotRegenerateImage() throws Exception {\n assertFalse(\n \"This flag should not be committed as true\", ImageSimilarity.REGENERATE_EXPECTED_IMAGES);\n }", "public void imageChanged(ImageChangeActions actions) {\n compositeImageUpToDate = false;\n\n if(actions.isRepaint()) {\n if (ic != null) {\n ic.repaint();\n }\n }\n\n if(actions.isUpdateHistogram()) {\n HistogramsPanel.INSTANCE.updateFromCompIfShown(this);\n }\n }", "@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkImageScale() {\n\t\tboolean flag = oTest.checkImageScale();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}", "public void fireImageChange() {\n if (fireRequired) {\n observer.fire(transform());\n fireRequired = false;\n }\n }", "@Test\n\tpublic void testUpdateImage() {\n\n\t\tip = new ImagePlus();\n\t\t//assertNull(ip.img);\n\t\tip.updateImage();\n\t\t//assertNull(ip.img);\n\n\t\tip = new ImagePlus(DataConstants.DATA_DIR + \"head8bit.tif\");\n\t\t//assertNull(ip.img);\n\t\tip.updateImage();\n\t\t//assertNotNull(ip.img);\n\t}", "@Test\n public void equality() {\n ImageReference expected = createSampleImage();\n\n assertEquals(expected, createSampleImage());\n assertNotEquals(expected, new ImageReference.Builder()\n .setContentUri(\"content://bar\")\n .setIsTintable(true)\n .setOriginalSize(TEST_WIDTH, TEST_HEIGHT)\n .build());\n assertNotEquals(expected, new ImageReference.Builder()\n .setContentUri(TEST_CONTENT_URI)\n .setIsTintable(false)\n .setOriginalSize(TEST_WIDTH, TEST_HEIGHT)\n .build());\n assertNotEquals(expected, new ImageReference.Builder()\n .setContentUri(TEST_CONTENT_URI)\n .setIsTintable(false)\n .setOriginalSize(1, TEST_HEIGHT)\n .build());\n assertNotEquals(expected, new ImageReference.Builder()\n .setContentUri(TEST_CONTENT_URI)\n .setIsTintable(false)\n .setOriginalSize(TEST_WIDTH, 1)\n .build());\n\n assertEquals(expected.hashCode(), new ImageReference.Builder()\n .setContentUri(TEST_CONTENT_URI)\n .setIsTintable(true)\n .setOriginalSize(TEST_WIDTH, TEST_HEIGHT)\n .build()\n .hashCode());\n }", "boolean isImageDisplayed();", "@Test\n public void pictureSingleTest() {\n // TODO: test pictureSingle\n }", "private void checkImage(int id, GraphicsContext gc)\n {\n switch (id)\n {\n case 1:\n drawImage(gc, \"/images/wandel.png\", 0, 0);\n drawImage(gc, \"/images/hero_onder.png\", 5, 5);\n break;\n case 2:\n drawImage(gc, \"/images/wandel.png\", 0, 0);\n break;\n case 3:\n drawImage(gc, \"/images/doel.png\", 0, 0);\n break;\n case 4:\n drawImage(gc, \"/images/muur.png\", 0, 0);\n break;\n case 5:\n drawImage(gc, \"/images/wandel.png\", 0, 0);\n drawImage(gc, \"/images/kist.png\", 5, 5);\n break;\n }\n }", "@Override\n\tpublic boolean imageUpdate(Image arg0, int arg1, int arg2, int arg3, int arg4, int arg5) {\n\t\treturn false;\n\t}", "private void change_im_val(int boo, ImageView im_obj){\r\n if(boo == 200){ //IMAGEN SI EL VEHICULO ES CORRECTO\r\n im_obj.setImage(new Image(getClass().getResourceAsStream(\"/Images/img57a.png\")));\r\n }else{ //IMAGEN PARA LA BUSQUEDA DE UN VEHICULO\r\n im_obj.setImage(new Image(getClass().getResourceAsStream(\"/Images/img61a.png\")));\r\n }\r\n }", "@Test\n public void getPicture_NoPictureExist(){\n Bitmap retrieved = testRecipe.getImage(appContext);\n assertNotEquals(\"getPicture - Not Null\", null, retrieved);\n }", "@Test\n public void testImage() {\n int expected = 4;\n assertEquals(expected, image.getHeight());\n assertEquals(expected, image.getWidth());\n }", "public boolean setImage(BufferedImage image) {\n this.image = image;\n boolean res = resetcontrols();\n fireRequired = true;\n return res;\n }", "void mo60904b(AvatarImageWithVerify avatarImageWithVerify);", "public static WebElement check_imgPAEnhancedEntranceIsChanged(Read_XLS xls, String sheetName, int rowNum, \r\n \t\tList<Boolean> testFail) throws Exception{\r\n \ttry{\r\n \t\tWebDriverWait waits = new WebDriverWait(driver, 15);\r\n \t\twaits.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(\".paIco_check\")));\r\n \t\t\r\n \t//\tBoolean isImgBeforeClickedExists = driver.findElement(By.cssSelector(\".paIco\")).isDisplayed();\r\n \t\tBoolean isPAEnhanceEntranceImgChanged = driver.findElement(By.cssSelector(\".paIco_check\")).isDisplayed();\r\n \t//\tAdd_Log.info(\"Is image 'Update me on new products' exists ::\" + isImgBeforeClickedExists);\r\n \t\tAdd_Log.info(\"Is image 'View latest products' exists ::\" + isPAEnhanceEntranceImgChanged);\r\n \t\t\r\n \t//\tif(isImgBeforeClickedExists == false && isPAEnhanceEntranceImgChanged == true){\r\n \t\tif(isPAEnhanceEntranceImgChanged == true){\r\n \t\t\tAdd_Log.info(\"The PA Enhanced Entrance image is changed.\");\r\n \t\t\tSuiteUtility.WriteResultUtility(\r\n \t\t\t\t\txls, sheetName, Constant.COL_PA_ENHANCED_ENTRANCE_IMG_CHANGED, rowNum, Constant.KEYWORD_PASS);\r\n \t\t}else{\r\n \t\t\tAdd_Log.info(\"The PA Enhanced Entrance image is NOT changed.\");\r\n \t\t\tSuiteUtility.WriteResultUtility(\r\n \t\t\t\t\txls, sheetName, Constant.COL_PA_ENHANCED_ENTRANCE_IMG_CHANGED, rowNum, Constant.KEYWORD_FAIL);\r\n \t\t\ttestFail.set(0, true);\r\n \t\t}\r\n \t}catch(Exception e){\r\n \t\tAdd_Log.error(\"The PA Enhanced Entrance image is NOT found on the page.\");\r\n \t\t// Get the list of window handles\r\n \t\tArrayList<String> tabs = new ArrayList<String> (driver.getWindowHandles());\r\n \t\tAdd_Log.info(\"Print number of window opened ::\" + tabs.size());\r\n\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }", "void mo60902a(AvatarImageWithVerify avatarImageWithVerify);", "public final boolean imageUpdate(java.awt.Image image, int infoflags, int x, int y, int width, int height) {\r\n\treturn false;\r\n}", "@Test\n public void testSetImageLink() {\n System.out.println(\"setImageLink\");\n user.setImageLink(\"Img_Mau\");\n assertEquals(\"Img_Mau\", user.getImageLink());\n }", "@Test\n public void singlePicTest() {\n // TODO: test singlePic\n }", "boolean hasPicture();", "boolean hasImageByHandler();", "private void actionComboboxChangedImage ()\r\n\t{\r\n\r\n\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t//---- Check if the project is empty or not\r\n\t\tif (tableSize != 0)\r\n\t\t{\r\n\t\t\tif (isDisplaySamples) { helperDisplayDetectedSamples(); }\r\n\t\t\telse { helperDisplayInputImage(); }\r\n\r\n\t\t\thelperDisplaySamplesCombobox();\r\n\t\t\thelperDisplayResults();\r\n\t\t\thelperDisplayChart(true);\r\n\t\t}\r\n\t}", "public void changeImage() {\r\n this.image = ColourDoor.image2;\r\n }", "@Override\n\tpublic boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {\n\t\treturn false;\n\t}", "public static void compareImage( BufferedImage expectedImage, BufferedImage calculatedImage) {\n\n // take buffer data from botm image files //\n DataBuffer dbA = expectedImage.getData().getDataBuffer();\n int dataTypeSizeA= dbA.getDataTypeSize(DataBuffer.TYPE_BYTE);\n\n DataBuffer dbB =calculatedImage.getData().getDataBuffer();\n int dataTypeSizeB = dbB.getDataTypeSize(DataBuffer.TYPE_BYTE);\n\n\n //validate the image size\n Assert.assertEquals(dataTypeSizeA, dataTypeSizeB);\n Assert.assertEquals(dbA.getSize(), dbB.getSize());\n\n\n if (expectedImage.getWidth() == calculatedImage.getWidth() && expectedImage.getHeight() == calculatedImage.getHeight()) {\n for (int x = 0; x < calculatedImage.getWidth(); x++) {\n for (int y = 0; y < calculatedImage.getHeight(); y++) {\n Assert.assertEquals(expectedImage.getRGB(x, y), calculatedImage.getRGB(x, y));\n\n }\n }\n }\n\n\n }", "private boolean validateEventMainImage(){\n if(imageUri == null){\n Toasty.error(CreateEventActivity.this, \"Please set the main image for the event\", Toast.LENGTH_SHORT, true).show();\n return false;\n }\n else{\n return true;\n }\n }", "public boolean checkImageComponent(String filename) {\n if (componentMap.containsKey(filename))\n return true;\n else\n return false;\n }", "@Test\n public void testGetImage() {\n int[][][] copyImage = image.getImage();\n assertEquals(copyImage.length, image.getHeight());\n }", "public static void VerifyCommonComponent_ImageShape(int ImageShape){\n\t\t\tString actualCommonComponentDataImage=\"\";\n\t\t\ttry{\n\t\t\t\tactualCommonComponentDataImage=sitecoreObj.commonComponentImageShape.getAttribute(\"class\");\n\t\t\t\tAssert.assertEquals(actualCommonComponentDataImage, \"common--component \" + expectedData.getProperty(\"FourItemsWithInset_InsetImageShape\"+ImageShape));\n\t\t\t\tlog.info(\"The Actual AboutUs CommonComponent Data Image- \"+actualCommonComponentDataImage);\n\t\t\t\tlog.info(\"The Expected AboutUs CommonComponent Data Image- \"+ \"common--component \" + expectedData.getProperty(\"FourItemsWithInset_InsetImageShape\"+ImageShape));\n\t\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs CommonComponent Inset Images are Same\");\n\t\t\t}catch(AssertionError e){\n\t\t\t\tlog.error(\"The Actual AboutUs CommonComponent Data Image- \"+actualCommonComponentDataImage);\n\t\t\t\tlog.error(\"The Expected AboutUs CommonComponent Data Image- \"+ \"common--component \" + expectedData.getProperty(\"FourItemsWithInset_InsetImageShape\"+ImageShape)); \n\t\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs CommonComponent Inset Images are NOT same\");\n\t\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\t\tlog.error(\"TEST FAILED: There is No Inset Images and On CommonComponent Container\");\n\t\t\t}\n\t\t}", "int seachImage(Image img) {\r\n\t\treturn 1;\r\n\t}", "boolean hasImageByTransform();", "@Test\n public void picture3FixedTest() {\n // TODO: test picture3Fixed\n }", "private void getImageSaveAsPropertiesTester(CadResponse originalProperties, CadResponse resultProperties)\n\t{\n\t}", "private void assertImageIsValid(Image img) throws ComparandumException {\n\t\tif (img.getWidth(null) == -1 || img.getHeight(null) == -1) {\n\t\t\tthrow new ComparandumException(\"Error loading image.\", null);\n\t\t}\n\t}", "@Test\n\tpublic void testDownLoadImage(){\n\t\tFile file = new File(\"D:\\\\mxk-test\\\\images\\\\20140214\\\\103171-10404.jpg\");\n\t\tSystem.out.println(\"ok\");\n//\t\tContent content = new Content();\n//\t\tbyte[] byteFile = HttpUtil.getImageByte(content.getSimpleImage());\n//\t\tif(byteFile != null){\n//\t\t\tString fileName = StringUtil.cutOutUrlFileName(content.getSimpleImage());\n//\t\t\tString foldler = StringUtil.dateToString(new Date(), \"yyyyMMdd\");\n//\t\t\tString simpleImage = baseFileUploadService.saveFile(byteFile, fileName , foldler);\n//\t\t\tresource.setSimpleImage(simpleImage);//图片保存成功后\n//\t\t\tif(simpleImage != null){\n//\t\t\t\tresource.setSimpleImageName( foldler + \"/\" + fileName);\n//\t\t\t\tStringBuilder sb = new StringBuilder();\n//\t\t\t\tfor(String img : content.getImages()){\n//\t\t\t\t\tsb.append(img+\",\");\n//\t\t\t\t}\n//\t\t\t\tresource.setImages(sb.toString());\n//\t\t\t}\n\t}", "@Test\n public void testRecomputeStretch(){\n //Recalculate stretch\n imageData.recomputeStretch(frArray, 0, rangeValues, true);\n BufferedImage stretchImage =imageData.getImage(frArray);\n Assert.assertNotEquals(expectedImage, stretchImage);\n }", "public void changePhoto() {\r\n\t\tisPictFetche = false;\r\n\t\tlaPhoto = new Photo();\r\n\t\tlaPhotoCandidate = new Photo();\r\n\t}", "private boolean checkBarcodeImg(Barcode barcode) {\n//\t\tif(barcode.getImg())\n\t\treturn true;\n\t}", "public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h)\r\n\t\t{\n\t\t\tif ((flags & ALLBITS) != 0) {\r\n\t\t\t\trepaint();\r\n\t\t\t}\r\n\t\t\treturn ((flags & (ALLBITS | ERROR)) == 0);\r\n\t\t}", "public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h)\r\n\t\t{\n\t\t\tif ((flags & ALLBITS) != 0) {\r\n\t\t\t\trepaint();\r\n\t\t\t}\r\n\t\t\treturn ((flags & (ALLBITS | ERROR)) == 0);\r\n\t\t}", "@Test\n public void testGetIcon() throws Exception {\n assert ResourceManager.getIcon(\"/images/card_00.png\") instanceof ImageIcon;\n }", "public void foreachJPEGcompareWithJPEG(ParameterHelper _aParam)\n {\n // TODO: auslagern in eine function, die ein Interface annimmt.\n String sInputPath = _aParam.getInputPath();\n File aInputPath = new File(sInputPath);\n// if (!aInputPath.exists())\n// {\n// GlobalLogWriter.println(\"Error, InputPath or File in InputPath doesn't exists. Please check: '\" + sInputPath + \"'\");\n// assure(\"Error, InputPath or File in InputPath doesn't exists. Please check: '\" + sInputPath + \"'\", false);\n// }\n if (aInputPath.isDirectory())\n {\n // check a whole directory\n // a whole directory\n FileFilter aFileFilter = FileHelper.getFileFilterJPEG();\n traverseDirectory(aFileFilter, _aParam);\n }\n else\n {\n // the inputpath contains a file\n if (sInputPath.toLowerCase().endsWith(\".ini\"))\n {\n IniFile aIniFile = new IniFile(_aParam.getInputPath());\n while (aIniFile.hasMoreElements())\n {\n String sSection = (String)aIniFile.nextElement();\n// TODO: not supported yet.\n // callEveryPictureInIniFile(aIniFile, sSection, _aParam);\n }\n }\n else\n {\n // call for a single jpeg file\n try\n {\n String sOutputFilename = _aParam.getOutputPath();\n if (sInputPath.toLowerCase().endsWith(\".jpg\") ||\n sInputPath.toLowerCase().endsWith(\".jpeg\") )\n {\n checkOneFile(sInputPath, sOutputFilename, _aParam);\n }\n else\n {\n // check if there exists a ini file\n String sPath = FileHelper.getPath(sInputPath); \n String sBasename = FileHelper.getBasename(sInputPath);\n\n runThroughEveryReportInIndex(sPath, sBasename, _aParam);\n \n String sStatusRunThrough = (String)_aParam.getTestParameters().get(\"last_state\");\n String sStatusInfo = (String)_aParam.getTestParameters().get(\"last_info\");\n\n if (sStatusRunThrough != null &&\n sStatusInfo != null )\n {\n // store the bad status in the <Name>.odb.ps.ini file \n String sOutputPath = _aParam.getOutputPath();\n String sBasenameIni = FileHelper.appendPath(sOutputPath, sBasename + \".ps.ini\");\n IniFile aBasenameIni = new IniFile(sBasenameIni);\n aBasenameIni.insertValue(\"global\", \"state\", sStatusRunThrough);\n aBasenameIni.insertValue(\"global\", \"info\", sStatusInfo); \n aBasenameIni.close();\n }\n \n }\n }\n catch (OfficeException e)\n {\n // TODO: unhandled yet.\n GlobalLogWriter.println(\"Warning: caught OfficeException \" + e.getMessage());\n }\n // callEntry(sInputPath, _aParam);\n }\n }\n }", "public boolean changeCDRom(String uuid, String imageFilePath) throws HyperVException;", "boolean mo60903a(AvatarImageWithVerify avatarImageWithVerify, UserVerify userVerify);", "@Test(enabled = false)\n public void testCreateImage() {\n }", "@Test\r\n public void testSetImagePath() {\r\n System.out.println(\"setImagePath\");\r\n String imagePath = \"\";\r\n \r\n instance.setImagePath(imagePath);\r\n assertEquals(imagePath, instance.getImagePath());\r\n \r\n }", "private void updatePicture() {\n \tif (!picture.getText().equals(\"\")) {\n\t\t\tif ( currentProfile != null ) {\n\t\t\t\t//Tries to open the given image fileName from user, throws an error if unable to open file.\n\t\t\t\tGImage image = null;\n\t\t\t\ttry {\n\t\t\t\t\timage = new GImage(picture.getText());\n\t\t\t\t} catch (ErrorException ex) {\n\t\t\t\t\tthrow ex;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Sets the currentProfile picture to the opened image and informs the user accordingly\n\t\t\t\tcurrentProfile.setImage(image);\n\t\t\t\tcanvas.displayProfile(currentProfile);\n\t\t\t\tcanvas.showMessage(\"Picture updated\");\n\t\t\t} else {\n\t\t\t\tcanvas.showMessage(\"Please select a profile to change picture\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tString name = file.getName().split(\"\\\\.\")[0].trim(); //获取当前图片的名字\n\t\t\tif(name.equals(answerText.getText().trim())) {\n\t\t\t\tanswerText.setText(\"\");\n\t\t\t\tresultText.setText(\"回答正确!\");\n\t\t\t\tfile = files[new Random().nextInt(files.length)];\n\t\t\t\ttry {\n\t\t\t\t\tpicturePanel.image = getImage(file);\n\t\t\t\t\tpicturePanel.repaint();\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tanswerText.setText(\"\");\n\t\t\t\tresultText.setText(\"回答错误!\");\n\t\t\t}\n\t\t}", "@Override\r\n\tpublic void pictureUpdated() {\r\n\t\tif(mDialog != null)\r\n\t\t\tmDialog.loadPicture();\r\n\t\t\r\n\t}", "@Test\r\n public void testGetImagePath() {\r\n System.out.println(\"getImagePath\");\r\n \r\n String expResult = \"\";\r\n String result = instance.getImagePath();\r\n assertEquals(expResult, result);\r\n \r\n \r\n }", "public void clickChangeButtonInPictureTab(){\r\n\t\t\t\r\n\t\t\tMcsElement.getElementByXpath(driver, \"//div[contains(@class,'x-panel-noborder') and not(contains(@class,'x-hide-display'))]//div[contains(@class,'x-panel-bbar')]//button[contains(text(),'Change...')]\").click();\r\n\t\t\t\r\n\t\t\tReporter.log(\"Clicked on Change button in Picture Tab\", true);\r\n\t\t}", "public void restaura(){ \n super.restauraE();\n setImage(\"FrtEA1.png\"); \n check = false; \n }", "public void testCopyImage() {\n System.out.println(\"copyImage\");\n String from = \"\";\n String formatName = \"\";\n File output = null;\n boolean expResult = false;\n boolean result = IOUtil.copyImage(from, formatName, output);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public void changePhoto(ActionEvent actionEvent) {\n FileChooser fileChooser = new FileChooser();\n fileChooser.setTitle(\"Picture Chooser\");\n // Sets up the initial directory as user folder when filechooser is opened\n fileChooser.setInitialDirectory(new File(System.getProperty(\"user.home\")));\n\n // Sets the file type options\n fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\"PNG and JPG files\", \"*.png\",\"*.jpg\",\"*.jpeg\"));\n\n userPhotoFile = fileChooser.showOpenDialog(null);\n\n if( userPhotoFile != null)\n {\n // Upload button's text is changed and the display image is changed to the selected image\n accountPhoto.setImage(new Image(userPhotoFile.toURI().toString()));\n changePhotoButton.setText(\"Change Photo\");\n }\n }", "@OnClick(R.id.iv_add_profile_picture)\n public void changePicture() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n int permissionCheck = ContextCompat.checkSelfPermission(getApplicationContext(),\n android.Manifest.permission.READ_EXTERNAL_STORAGE);\n if (permissionCheck == PackageManager.PERMISSION_GRANTED) {\n selectImageFromGallery();\n } else {\n Toast.makeText(getApplicationContext(),\n getString(R.string.permission_denied), Toast.LENGTH_SHORT).show();\n }\n } else {\n selectImageFromGallery();\n }\n }", "@MediumTest\n public void test_1314_3() throws Exception {\n String imagePath = Environment.getExternalStorageDirectory()+\"/LeCoder_Image/if_without_false.png\";\n //Load the file and process it\n activity.loadImageFile(imagePath);\n activity.processImage();\n //Generate the nodes and construct the graph\n activity.generateNodes();\n activity.generateGraph();\n //Print all nodes\n activity.printAllNodes();\n //Check whether the flowchart has no start point\n assertFalse(activity.checkAllNodes());\n }", "@Test\n public void pictureLargeTest() {\n // TODO: test pictureLarge\n }", "@Test\n\tpublic void testGetImage() {\n\n\t\tip = new ImagePlus();\n\t\t//assertNull(ip.img);\n\t\tassertNull(ip.getImage());\n\n\t\tip = new ImagePlus(DataConstants.DATA_DIR + \"gray8-3x2-sub1.tif\");\n\t\t//assertNull(ip.img);\n\t\tassertNotNull(ip.getImage());\n\t}", "@Test\n\tpublic void test3_checkButtons() throws GeneralLeanFtException{\n\t\t\n\t\ttry{\n\t\t\t\n\t\t\tSystem.out.println(\"Test 3 - Check Buttons Started\");\n\t\t\t\n\t\t\t//Check that the Main window should exist\n\t\t\tassertTrue(mySet.appExistsorNot());\t\t\t\n\t\t\t\n\t\t\t//Toolbar Object\n\t\t\tToolBar toolbar = mySet.OR.MainWindow().ToolBar(); \n\n\t\t\t// Clicking the JButton displays the required frame\n\t\t\ttoolbar.getButton(\"JButton\").press();\n\t\t\t\n\t\t\t//Getting the Image Buttons in the Panel\n\t\t\tButton[] imgButtons = mySet.OR.MainWindow().ImageButtonsPanelUiObject()\n\t\t\t .findChildren(Button.class,new ButtonDescription.Builder().nativeClass(\"javax.swing.JButton\").build());\n\t\t\t \n\t\t\t//There should be 3 Image Buttons\n\t\t\tassertEquals(3, imgButtons.length);\n\t\t\t\n\t\t\t//Trigger the Mouse Entered Event for the each button in the Panel\t\t\t\t\n\t\t\tRobot robo = new Robot();\t\t\t\n\t\t\tfor(Button btn : imgButtons)\n\t\t\t{\t\t\t\t\n\t\t\t\trobo.mouseMove(btn.getAbsoluteLocation().x,btn.getAbsoluteLocation().y);\n\t\t\t\tThread.sleep(500);\n\t\t\t}\n\t\t\t\n\t\t\t//Store the Original Dimension\n\t\t\tDimension orginalDimension = mySet.OR.MainWindow().ImageButtonsPanelUiObject().getSize();\n\t\t\t\n\t\t\t//Increase the Size by Selecting the Pad Radio Button\n\t\t\tmySet.OR.MainWindow().Pad10RadioButton().click();\n\t\t\t\n\t\t\t//Verify that the radio button is checked\n\t\t\tassertTrue(mySet.OR.MainWindow().Pad10RadioButton().isChecked()==true);\n\t\t\t\n\t\t\t//Store the New Dimension\n\t\t\tDimension newDimension = mySet.OR.MainWindow().ImageButtonsPanelUiObject().getSize();\n\t\t\t\n\t\t\t//Assert that Height Increases and Width Decreases\n\t\t\tassertTrue((newDimension.width < orginalDimension.width) && (newDimension.height > orginalDimension.height));\n\t\t\t\n\t\t\t//Click the Enabled Check box\n\t\t\tmySet.OR.MainWindow().EnabledCheckBox().click();\n\t\t\t\n\t\t\t//Check that the Check Box has been unchecked \n\t\t\tassertTrue(mySet.OR.MainWindow().EnabledCheckBox().getState()==CheckedState.UNCHECKED);\n\t\t\t\n\t\t\t//Check that all Image Buttons are disabled\n\t\t\tfor(Button btn : imgButtons)\n\t\t\t{\n\t\t\t\tassertTrue(btn.isEnabled()==false);\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\t\t\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unexpected Error Occurred. Message = \" + e.getMessage() + \"Stack Trace = \");\n\t\t\te.printStackTrace();\n\t\t\tassertTrue(false);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tSystem.out.println(\"Test 3 - Check Buttons Finished\");\n\t\t}\n\t\t\n\t}", "public void compareTwoImages(WebDriver driver, String expectedImageFileName) throws Throwable {\n\t\t\n\t\tBufferedImage expectedImages = ImageIO.read(new File(constantValues.getSavedImagesFolderPath() + \"\\\\\" + expectedImageFileName + \".png\"));\n\t\t\n\t\tRandom randomVal = new Random();\n\t\tboolean comapareReturnValue = Shutterbug.shootPage(driver, ScrollStrategy.WHOLE_PAGE).withName(String.valueOf(randomVal.nextInt(1000))).equals(expectedImages);\n\t\tAssert.assertTrue(comapareReturnValue);\n\t\tlogger.info(\"Both imanges are matching as expected\");\n\t}", "public void changePicture() {\n ImageView imgView = (ImageView)findViewById(R.id.poll_object_btn_image);\n Resources res = getContext().getResources();\n if(type == \"generic\") {\n //add the new picture for the generic type\n Bitmap bitmap = BitmapFactory.decodeResource(res,R.drawable.generic_view);\n imgView.setImageBitmap(bitmap);\n }\n else if(type == \"location\") {\n //add the new picture for the location type\n Bitmap bitmap = BitmapFactory.decodeResource(res,R.drawable.generic_view);\n imgView.setImageBitmap(bitmap);\n }\n else if(type == \"picture\"){\n //add the new picture for the picture type\n Bitmap bitmap = BitmapFactory.decodeResource(res,R.drawable.generic_view);\n imgView.setImageBitmap(bitmap);\n }\n }", "public boolean testPixel(EIfcpixeltexture type) throws SdaiException;", "private void change_im_tool4(int boo){\r\n if(boo == 0){ //IMAGEN SI EL USUARIO ESTA INHABILITADO\r\n im_tool4.setImage(new Image(getClass().getResourceAsStream(\"/Images/img07.png\")));\r\n }else{ //IMAGEN PARA HABILITAR AL USUARIO\r\n im_tool4.setImage(new Image(getClass().getResourceAsStream(\"/Images/img06.png\")));\r\n }\r\n }", "@Override\r\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\r\n //jika image picker membawa sebuah data berupa foto maka\r\n if (ImagePicker.shouldHandle(requestCode, resultCode, data)) {\r\n //ambil data foto yang dipilih\r\n Image image = ImagePicker.getFirstImageOrNull(data);\r\n //ambil path/lokasi dari foto/gambar yang dipilih\r\n File imgFile = new File(image.getPath());\r\n if (imgFile.exists()) {\r\n //convert path ke bitmap dan tampilkan pada imageview\r\n Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());\r\n imgTranscript.setImageBitmap(myBitmap);\r\n\r\n //set variabel change true karena gambar telah diupdate\r\n isPicChange = true;\r\n }\r\n }\r\n\r\n super.onActivityResult(requestCode, resultCode, data);\r\n }", "public void updateImage(final Image image) { //The Reason that we have Set the Image to final over here is because once we fetch the Image from the AbsolutePath then after scaling this should be the Final Image in which we detect the Faces \n\t\timagelabel.setIcon(new ImageIcon(scaleImage(image))); \n\t}", "@Test\n public void imageButtonCamera() {\n onView(withId(R.id.image_button))\n .perform(click());\n\n //Make sure fragment is loaded\n onView(withText(\"Take Photo\"))\n .check(matches(isDisplayed()));\n }", "boolean canTakeNewPhoto();", "@Test\n public void shouldNotScaleImageWhenSameSize() {\n givenIHaveAnImage();\n\n whenIScaleImageWidthTo(14.999f);\n\n thenTheImageWidthIs(15);\n }", "public void testCase1_RequestImageFromFilePath() throws IllegalArgumentException,\n InstantiationException, IllegalAccessException, InvocationTargetException,\n NoSuchFieldException, NoSuchMethodException, InterruptedException {\n Logger.d(TAG, \"testCase1_RequestImageFromFilePath() entry\");\n MockOnLoadImageFinishListener listener = new MockOnLoadImageFinishListener();\n MockOnLoadImageFinishListener listenerNext = new MockOnLoadImageFinishListener();\n String filePath = getFilePath(0);\n String filePathNext = getFilePath(1);\n assertNotSame(filePath, filePathNext);\n assertNotNull(filePath);\n Bitmap bitmap = ImageLoader.requestImage(filePath, listener);\n ImageLoader.requestImage(filePathNext, listenerNext);\n getInstrumentation().waitForIdleSync();\n ImageLoader.interrupt(filePathNext);\n assertNull(bitmap);\n listener.waitForImage();\n bitmap = ImageLoader.requestImage(filePath);\n assertNotNull(bitmap);\n Map imageMap = getImageMap(filePath, bitmap);\n assertEquals(IMAGE_SIZE, imageMap.size());\n bitmap = ImageLoader.requestImage(filePath);\n assertNotNull(bitmap);\n ImageLoader.getInstance().clearImageMap();\n ImageLoader.requestImage(filePath, listener);\n ImageLoader.requestImage(filePathNext, listenerNext);\n listener.waitForImage();\n ImageLoader.interrupt(filePath);\n ImageLoader.interrupt(filePathNext);\n ImageLoader.interrupt();\n getInstrumentation().waitForIdleSync();\n ImageLoader.getInstance().clearImageMap();\n ImageLoader.requestImage(filePath, listener);\n ImageLoader.requestImage(filePathNext, listenerNext);\n ImageLoader.interrupt();\n getInstrumentation().waitForIdleSync();\n }", "@Override\n\t\tpublic void propertyChange(PropertyChangeEvent evt) {\n\t\t\ttry {\n\t\t\t\tFile file = fileChooser.getSelectedFile();\n\n\t\t\t\tif (file != null && file.exists()) {\n\t\t\t\t\t// change\n\t\t\t\t\tif (fileChooser.getMode() == GeoGebraFileChooser.MODE_DATA) {\n\t\t\t\t\t\tupdateDataPreview(file);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tupdateImage(file);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t\tioe.printStackTrace();\n\t\t\t}\n\t\t}", "@MediumTest\n public void test_1314_4() throws Exception {\n String imagePath = Environment.getExternalStorageDirectory()+\"/LeCoder_Image/if_without_true.png\";\n //Load the file and process it\n activity.loadImageFile(imagePath);\n activity.processImage();\n //Generate the nodes and construct the graph\n activity.generateNodes();\n activity.generateGraph();\n //Print all nodes\n activity.printAllNodes();\n //Check whether the flowchart has no start point\n assertFalse(activity.checkAllNodes());\n }", "@Test\n\tpublic void test4_verifyImage_VRI() throws GeneralLeanFtException {\n\t\t\t\t\n\t\ttry\n\t\t{\n\t\t\tSystem.out.println(\"Test 4 - Verify Insight & VRI Started\");\n\t\t\t\n\t\t\t//App should exist \n\t\t\tassertTrue(mySet.appExistsorNot());\t\t\n\t\t\tWindow mainWindow = Desktop.describe(Window.class, new WindowDescription.Builder()\n\t\t\t.title(\"SwingSet2\").index(0).build());\n\n\t\t\t// Create a description for the top-level menu item: File\n\t\t\tMenu fileMenu = mainWindow.describe(Menu.class, new MenuDescription.Builder().label(\"File\").build());\n\n\t\t\t//Select About Menu option\n\t\t\tfileMenu.selectSubMenu(\"About\");\n\t\t\t\n\t\t\tDialog about = mainWindow.describe(Dialog.class, new DialogDescription.Builder()\n\t\t\t.title(\"About Swing!\").build());\n\t\t\t\n\t\t\t//Access the Swing Image in the Resources folder\n\t\t\t//ClassLoader classLoader = getClass().getClassLoader();\n\t\t\t//File imgFile = new File(classLoader.getResource(\"SwingImage.PNG\").getFile());\n\t\t\tFile imgFile = new File(\"resources\\\\SwingImage.PNG\");\n\t RenderedImage image = ImageIO.read(imgFile);\n\t \n\t //Create Insight Object with 100% similarity\n\t InsightObject swingImage = about.describe(InsightObject.class, new InsightDescription(image,90));\n\t \n\t //Highlight the Object if present\n\t assertTrue(swingImage.exists(5));\n\t swingImage.highlight();\n\t \n\t //Close the Dialog\n\t about.close();\n\t \n\t ToolBar toolbar = mainWindow.describe(ToolBar.class, new ToolBarDescription.Builder()\n\t\t\t.nativeClass(\"SwingSet2$ToggleButtonToolBar\").build());\n\t \n\t toolbar.getButton(\"JDesktop\").press();\n\t \n\t\t\t\n\t //Maximizable checkbox in the Internal Frame\n\t CheckBox maximizable = mainWindow.describe(InternalFrame.class, new InternalFrameDescription.Builder()\n\t\t\t.title(\"Internal Frame Generator\").index(0).build()).describe(CheckBox.class, new CheckBoxDescription.Builder()\n\t\t\t.attachedText(\"Maximizable\").build());\n\t \n\t //Create Visual Relation Object and Set the Relation with the Test Object\n\t VisualRelation vr = new VisualRelation();\n\t vr.setTestObject(maximizable);\n\t vr.setVerticalRelation(VerticalVisualRelation.BELOW_AND_INLINE);\n\t \n\t //Create Description for Checkbox which is above the Maximizable checkbox\n\t CheckBox above = mainWindow.describe(InternalFrame.class, new InternalFrameDescription.Builder()\n\t\t\t.label(\"Internal Frame Generator\").build()).describe(CheckBox.class, new CheckBoxDescription.Builder()\n\t\t\t.nativeClass(\"javax.swing.JCheckBox\").vri(vr).build());\n\t \n\t //Check for Existence\n\t assertTrue(\"Checkbox above Maximizable should exist\",above.exists(5));\t \n\t above.highlight();\n\t \n\t //Get name of the Checkbox\n\t System.out.println(\"Name of the Checkbox above Maximizable CheckBox = \" + above.getAttachedText());\n\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unexpected Error Occurred. Message = \" + e.getMessage());\n\t\t\tassertTrue(false);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tSystem.out.println(\"Test 4 - Verify Insight & VRI finished\");\n\t\t}\n\t\t\n\t}", "private boolean isImageGiven(){\n return captureImage.getDrawable() != null;\n }", "public Boolean testImage(String url) {\r\n\t\ttry {\r\n\t\t\tBufferedImage image = ImageIO.read(new URL(url));\r\n\t\t\tif (image != null) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t} catch (MalformedURLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tSystem.err.println(\"URL error with image\");\r\n\t\t\treturn false;\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"IO error with image\");\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private void setImage(Bitmap image) {\n }", "boolean saveImage(Image img) {\r\n\t\treturn true;\r\n\t}", "@Test\n public void largePicTest() {\n // TODO: test largePic\n }", "private void setImage(){\n if(objects.size() <= 0)\n return;\n\n IImage img = objects.get(0).getImgClass();\n boolean different = false;\n \n //check for different images.\n for(IDataObject object : objects){\n IImage i = object.getImgClass();\n \n if((img == null && i != null) || \n (img != null && i == null)){\n different = true;\n break;\n }else if (img != null && i != null){ \n \n if(!i.getName().equals(img.getName()) ||\n !i.getDir().equals(img.getDir())){\n different = true;\n break;\n }\n } \n }\n \n if(!different){\n image.setText(BUNDLE.getString(\"NoImage\"));\n if(img != null){\n imgName = img.getName();\n imgDir = img.getDir();\n image.setImage(img.getImage());\n }else{\n image.setImage(null);\n }\n }else{\n image.setText(BUNDLE.getString(\"DifferentImages\"));\n }\n \n image.repaint();\n }", "private static void testREsizeImage() throws IOException {\n\t\tresizeImage(\n\t\t\tnew File(\"/opt/bitnami/files/img/contabilidad.jpg\"),\n\t\t\tnew File(\"/opt/bitnami/files/img/contabilidad_100x100.jpg\"),\n\t\t\t\"jpg\", 100, 100, UtilImage.FIT_BOTH);\n\t}", "public boolean hasImage() { return ImageResource != NO_IMAGE_PROVIDED; }", "public static void VerifyChildComponent_ImageShape(String renderControl, int ImageShape){\n\t\t\t\tString actualChildComponentDataImage=\"\";\n\t\t\t\tString expectedChildComponentDataImage = expectedData.getProperty(\"FourItemsWithInset_InsetImageShape\"+ImageShape);\n\t\t\t\ttry{\n\t\t\t\t\tactualChildComponentDataImage=sitecoreObj.childComponentImageShape.getAttribute(\"class\");\n\t\t\t\t\tif(ImageShape==0){\n\t\t\t\t\t\tAssert.assertEquals(actualChildComponentDataImage, \"twoitems_sidebyside_item \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tAssert.assertEquals(actualChildComponentDataImage, \"twoitems_sidebyside_item \" + expectedChildComponentDataImage);\n\t\t\t\t\t}\n\t\t\t\t\tlog.info(\"The Actual AboutUs \" + renderControl + \" Image- \" + actualChildComponentDataImage);\n\t\t\t\t\tlog.info(\"The Expected AboutUs \" + renderControl + \" Image- \" + \"twoitems_sidebyside_item \" + expectedChildComponentDataImage);\n\t\t\t\t\tlog.info(\"TEST PASSED: The Actual and Expected AboutUs \" + renderControl + \" Images are Same\");\n\t\t\t\t}catch(AssertionError e){\n\t\t\t\t\tlog.error(\"The Actual AboutUs \" + renderControl + \" Image- \" + actualChildComponentDataImage);\n\t\t\t\t\tlog.error(\"The Expected AboutUs \" + renderControl + \" Image- \" + \"twoitems_sidebyside_item \" + expectedChildComponentDataImage); \n\t\t\t\t\tlog.error(\"TEST FAILED: The Actual and Expected AboutUs \" + renderControl + \" Images are NOT same\");\n\t\t\t\t}catch(org.openqa.selenium.NoSuchElementException e){\n\t\t\t\t\tlog.error(\"TEST FAILED: There is No Images On ChildComponent Container\");\n\t\t\t\t}\n\t\t\t}", "public void changeTeamLogo(ActionEvent actionEvent) {\n FileChooser fileChooser = new FileChooser();\n fileChooser.setTitle(\"Picture Chooser\");\n // Sets up the initial directory as user folder when filechooser is opened\n fileChooser.setInitialDirectory(new File(System.getProperty(\"user.home\")));\n\n // Sets the file type options\n fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\"PNG and JPG files\", \"*.png\",\"*.jpg\",\"*.jpeg\"));\n\n editTeamLogoFile = fileChooser.showOpenDialog(null);\n\n if( editTeamLogoFile != null)\n {\n // Upload button's text is changed and the display image is changed to the selected image\n uploadTeamLogoButton.setText(\"Change Photo\");\n logoChangeImage.setImage(new Image(editTeamLogoFile.toURI().toString()));\n }\n }", "public boolean isSetImg() {\n return this.img != null;\n }" ]
[ "0.71969694", "0.71115124", "0.70957047", "0.69852084", "0.6721921", "0.6666879", "0.6615813", "0.6515836", "0.64264274", "0.6391096", "0.6370214", "0.63460714", "0.62992865", "0.6266291", "0.6260678", "0.6252752", "0.6221631", "0.62197363", "0.6202694", "0.6197687", "0.61444503", "0.6125788", "0.611942", "0.611575", "0.609768", "0.60784924", "0.60622746", "0.604364", "0.60309196", "0.60156345", "0.60086966", "0.5997179", "0.5966094", "0.5893452", "0.58931184", "0.58747846", "0.5873064", "0.5854558", "0.58195806", "0.58187157", "0.58187157", "0.58019954", "0.5790917", "0.577856", "0.57766", "0.57721597", "0.57691544", "0.5761206", "0.5756066", "0.57409453", "0.57277405", "0.5727248", "0.5726035", "0.5703546", "0.567985", "0.5678698", "0.5678698", "0.56781965", "0.56749487", "0.5673812", "0.56709945", "0.56667256", "0.56638116", "0.56598485", "0.56559587", "0.5654973", "0.5637102", "0.5603263", "0.5594902", "0.55943197", "0.55908203", "0.5590364", "0.5579543", "0.5574323", "0.5570151", "0.55643934", "0.55520177", "0.5551576", "0.5544376", "0.554029", "0.55350554", "0.5521356", "0.55209106", "0.54981744", "0.5495706", "0.5494915", "0.54894876", "0.54878795", "0.54852206", "0.54828393", "0.54799145", "0.5466138", "0.54535353", "0.54528445", "0.545118", "0.54425687", "0.54390574", "0.5436151", "0.5431615", "0.542917" ]
0.7698335
0
Converts the given arithmetic expression into postfix.
public String convert(ArithmeticExpression expression) { String expressionString = expression.getExpression(); String convertedExpression = ""; Stack<String> OpStack = new Stack<>(); int startIndex = 0; while(startIndex < expressionString.length()) { if(isOperand(nextToken(expressionString,startIndex))) { convertedExpression += nextToken(expressionString,startIndex); convertedExpression += " "; } if(Brackets.isLeftBracket(nextToken(expressionString,startIndex))) { OpStack.push(nextToken(expressionString,startIndex)); } if(Brackets.isRightBracket(nextToken(expressionString,startIndex))) { String topOp = OpStack.pop(); while(!Brackets.isLeftBracket(topOp)) { convertedExpression += topOp; convertedExpression += " "; topOp = OpStack.pop(); } } if(Operator.isOperator(nextToken(expressionString,startIndex))) { Operator temp = Operator.of(nextToken(expressionString,startIndex)); if(OpStack.isEmpty()) { OpStack.push(nextToken(expressionString, startIndex)); } else { Operator topOp = Operator.of(OpStack.peek()); while (topOp.getRank() <= temp.getRank()) { convertedExpression += OpStack.pop(); convertedExpression += " "; topOp = Operator.of(OpStack.peek()); } OpStack.push(nextToken(expressionString, startIndex)); } } if(isOperand(nextToken(expressionString,startIndex))) startIndex += nextToken(expressionString,startIndex).length(); else startIndex++; } while(!OpStack.isEmpty()) { convertedExpression += OpStack.pop(); convertedExpression += " "; } return convertedExpression; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic String infixToPostfix(String expression) {\r\n\t\tStringBuilder pf = new StringBuilder(); // the postfix expression \r\n\t\texpression = removespaces(expression); \r\n\t\texpression = CheckInputValidation(expression);\r\n\t\texpression = DummyZero(expression);\r\n\t\tString e = expression;\r\n\t\tfor(i1 = 0 ; i1 < e.length() ;i1++) { \r\n\t\t\t//take operand and append it to the string\r\n\t\t\tif(Character.isDigit(e.charAt(i1)) || Character.isLetter(e.charAt(i1))) { //check if the character is letter or number\r\n\t\t\t\tint j =0; //counter to know how many digits in the following operand \r\n\t\t\t\twhile (i1 != e.length() &&e.charAt(i1) != '+' &&e.charAt(i1) != '-' && e.charAt(i1) != '/' && e.charAt(i1) != '*'&&e.charAt(i1) != ')'&&e.charAt(i1) != '(' ) {\r\n\t\t\t\t\tj++;\r\n\t\t\t\t\ti1++;\r\n\t\t\t\t}\r\n\t\t\t\tif(j>0) {\r\n\t\t\t\t\tString s = e.substring(i1-j, i1);\r\n\t\t\t\t\tpf.append( s ).append(' ');\r\n\t\t\t\t}\r\n\t\t\t\ti1--;\r\n\t\t\t\tif(i1 == e.length()-1 ) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (e.charAt(i1)=='(') {\r\n\t\t\t\topt.push(e.charAt(i1));\r\n\t\t\t}\r\n\t\t\telse if(e.charAt(i1)=='-'||e.charAt(i1)=='/'||e.charAt(i1)=='+'||e.charAt(i1)=='*') {\r\n\t\t\t\twhile(!(opt.isEmpty()) && higherpres(e.charAt(i1)) && (char)opt.peek() !='(') {\r\n\t\t\t\t\tpf.append( opt.pop() ).append(' ');\r\n\t\t\t\t}\r\n\t\t\t\topt.push(e.charAt(i1));\r\n\t\t\t}\r\n\t\t\telse if (e.charAt(i1)==')') {\r\n\t\t\t\twhile((char)opt.peek() != '(') {\r\n\t\t\t\t\tpf.append( opt.pop() ).append(' ');\r\n\t\t\t\t}\r\n\t\t\t\topt.pop();\r\n\t\t\t}\r\n\t\t}\r\n\t\twhile(!(opt.isEmpty()) ) {\r\n\t\t\tif((char)opt.peek() != '(') {\r\n\t\t\t\tpf.append(opt.pop()).append(' ');}\r\n\t\t\telse if((char)opt.peek()=='(') {\r\n\t\t\t\topt.pop();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn pf.toString();\r\n\t\t\r\n\t}", "public void evalPostfix(String postfix){\r\n char ch;\r\n\r\n for(int i = 0; i < postfix.length() ; i++) //parses postfix string and performs operations based on operator found\r\n {\r\n ch = postfix.charAt(i);\r\n \r\n if(ch == '+')\r\n {\r\n int y = ((int)numbers.pop());\r\n int x = ((int)numbers.pop());\r\n numbers.push(x+y);\r\n \r\n }\r\n \r\n \r\n else if(ch == '-')\r\n {\r\n int y = ((int)numbers.pop());\r\n int x = ((int)numbers.pop());\r\n numbers.push(x-y);\r\n \r\n }\r\n \r\n else if(ch == '*')\r\n {\r\n int y = ((int)numbers.pop());\r\n int x = ((int)numbers.pop());\r\n numbers.push(x*y);\r\n \r\n }\r\n \r\n else if(ch == '/')\r\n {\r\n int y = ((int)numbers.pop());\r\n int x = ((int)numbers.pop());\r\n numbers.push(x/y);\r\n \r\n }\r\n \r\n else if(ch == '^')\r\n {\r\n int y = ((int)numbers.pop());\r\n int x = ((int)numbers.pop());\r\n numbers.push((int)Math.pow(x,y));\r\n \r\n } \r\n \r\n else if(ch >= '0' || ch <= '9')\r\n {\r\n numbers.push((int)(ch - '0'));\r\n }\r\n }\r\n }", "public String infixToPostfix(String expression) {\n\t\tStack oPSt = new Stack();\n\t\tStack Sign = new Stack();\n\t\tStringBuilder PFE = new StringBuilder();\n\t\tString n = \"\";\n\t\t// flag -> marks adding new operator to the stack with or without removing the\n\t\t// previous one\n\t\tboolean flag = true;\n\t\t//negflag -> if (true) previous character was operator thus next(-) is negative sign\n\t\t//\t\t\t if (false) previous character was operand thus next (-) is operator\n\t\tboolean negflag = true; \n\t\tint counter = 0; // expresses number of open parenthesis at the moment and if it matches the\n\t\t// counter inside Sign Stack it means that the Sign was changed at this Counter\n\t\tString open = \"(\", closed = \")\";\n\t\tfor (int i = 0; i < expression.length(); i++) {\n\t\t\tString x = expression.substring(i, i + 1);\n\t\t\tStringBuilder longIntegers = new StringBuilder();\n\t\t\tif (x.equals(\"-\") && !expression.substring(i + 1, i + 2).equals(\" \")) {\n\t\t\t\tif(negflag) {\n\t\t\t\tif (n.equals(\"\"))\n\t\t\t\t\tn = \"-\";\n\t\t\t\telse\n\t\t\t\t\tn = \"\";\n\t\t\t\tSign.push(counter);\n\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tint counter2 = 0;\n\t\t\t\twhile (counter2 + i < expression.length()\n\t\t\t\t\t\t&& (isChar(expression.substring(i + counter2, i + counter2 + 1))\n\t\t\t\t\t\t\t\t|| isNum(expression.substring(i + counter2, i + counter2 + 1)))\n\t\t\t\t\t\t&& isNotOperator(expression.substring(i + counter2, i + counter2 + 1))) {\n\t\t\t\t\tlongIntegers.append(expression.substring(i + counter2, i + 1 + counter2));\n\t\t\t\t\tcounter2++;\n\t\t\t\t}\n\t\t\t\ti = i + counter2;\n\t\t\t\tif (counter2 > 0) {\n\t\t\t\t\ti--;\n\t\t\t\t\tx = longIntegers.toString();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// end of taking the expression\n\n\t\t\t// testing the expression\n\n\t\t\t// if the char. is an open parenthesis\n\t\t\tif (x.equals(open)) {\n\t\t\t\toPSt.push(x);\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t\t// if the char is a close parenthesis\n\t\t\telse if (x.equals(closed)) {\n\t\t\t\tif (counter == 0)\n\t\t\t\t\tthrow new RuntimeException(\"Invalid Input: Redundant \\\")\\\" \");\n\t\t\t\twhile (!((String) oPSt.peek()).equals(open)) {\n\t\t\t\t\tPFE.append(\" \");\n\t\t\t\t\tPFE.append(oPSt.pop());\n\t\t\t\t}\n\t\t\t\toPSt.pop();\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t\t// checks if char was an operator\n\t\t\telse if (x.equals(\"*\") || x.equals(\"+\") || x.equals(\"/\") || x.equals(\"-\")) {\n\t\t\t\tnegflag = true;\n\t\t\t\twhile (!oPSt.isEmpty() && !((String) oPSt.peek()).equals(\"(\")) {\n\t\t\t\t\t// see which character has higher precedence\n\t\t\t\t\tflag = highOrLow(((String) oPSt.peek()).charAt(0), x.charAt(0));\n\t\t\t\t\tif (flag)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\telse {\n\t\t\t\t\t\tPFE.append(\" \");\n\t\t\t\t\t\tPFE.append(oPSt.pop());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toPSt.push(x);\n\t\t\t}\n\t\t\t// if the char is space then check if the previous was space to avoid having two\n\t\t\t// spaces after each other\n\t\t\t// if the char was a new space/wasn't a space then it's definitely a\n\t\t\t// number/variable and will be pushed to PFE\n\t\t\telse if (!x.equals(\" \") || (PFE.length() > 0 && (char) PFE.charAt(PFE.length() - 1) != ' ')) {\n\t\t\t\tPFE.append(\" \");\n\t\t\t\tif (!x.equals(\" \")) {\n\t\t\t\t\tnegflag = false;\n\t\t\t\t\tPFE.append(n + x);\n\t\t\t}else \n\t\t\t\t\tPFE.append(x);\n\t\t\t\t\n\t\t\t}\n\t\t\twhile (!Sign.isEmpty() && counter == (int) Sign.peek()) {\n\t\t\t\tif (n.equals(\"\"))\n\t\t\t\t\tn = \"-\";\n\t\t\t\telse\n\t\t\t\t\tn = \"\";\n\t\t\t\tSign.pop();\n\t\t\t}\n\t\t}\n\t\t// add all the operator remaining in stack to the PFE except if '(' was found\n\t\t// then there's an runtime exception\n\t\twhile (!oPSt.isEmpty()) {\n\t\t\tif (((String) oPSt.peek()).equals(\"(\"))\n\t\t\t\tthrow new RuntimeException(\"Invalid Input : Redundant \\\"(\\\" \");\n\t\t\tPFE.append(\" \");\n\t\t\tPFE.append(oPSt.pop());\n\t\t}\n\t\t// replace any two consecutive spaces with only one\n\t\tint i = 0;\n\t\twhile (PFE.charAt(i) == ' ' && i < PFE.length() - 1) {\n\t\t\tPFE.deleteCharAt(i);\n\t\t}\n\t\tfor (i = 0; i < PFE.length() - 1; i++) {\n\t\t\tif (PFE.charAt(i) == ' ' && PFE.charAt(i + 1) == ' ') {\n\t\t\t\tPFE.deleteCharAt(i);\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\treturn PFE.toString();\n\n\t}", "private static String infixToPostfix(String expression)\r\n {\r\n String result = \"\";\r\n char current_char = ' ';\r\n int index = 0;\r\n StackInterface<Character> operand_stack = new ArrayStack<>();\r\n switch(stack_type)\r\n {\r\n case(\"vector\"):\r\n operand_stack = new VectorStack<>();\r\n break;\r\n \r\n case(\"linked\"):\r\n operand_stack = new LinkedListStack<>();\r\n break;\r\n }\r\n\r\n //iterates through every character and puts them in the stack or the result accordingly\r\n while(index < expression.length())\r\n {\r\n current_char = expression.charAt(index);\r\n switch(current_char)\r\n {\r\n //checks if the character is an operand and if so checks if it should pop the previous input or not\r\n case '+': case '-': case '*': case '/':\r\n if(!operand_stack.isEmpty())\r\n {\r\n while(!operand_stack.isEmpty() && getOperandImportance(current_char) <= getOperandImportance(operand_stack.peek()))\r\n {\r\n result += operand_stack.pop();\r\n }\r\n operand_stack.push(current_char);\r\n }\r\n else\r\n {\r\n operand_stack.push(current_char);\r\n }\r\n break;\r\n\r\n //exponents are always pushed onto the stack\r\n case '^':\r\n operand_stack.push(current_char);\r\n break;\r\n\r\n //if an open delimiter is there, we add it to the stack\r\n case '(': case '{': case '[':\r\n operand_stack.push(current_char);\r\n break;\r\n \r\n //if the delimiter is closing we pop until we find the open equivalent\r\n case ')': case '}': case ']':\r\n while(operand_stack.peek() != delimiterEquivalent(current_char))\r\n {\r\n result += operand_stack.pop();\r\n }\r\n operand_stack.pop();\r\n break;\r\n\r\n case ' ':\r\n break;\r\n\r\n default: \r\n result += current_char;\r\n break;\r\n }\r\n index++;\r\n }\r\n\r\n //pops everything left in the stack to the result at the end\r\n while(!operand_stack.isEmpty())\r\n {\r\n result += operand_stack.pop();\r\n }\r\n\r\n return result;\r\n }", "public static String convertInfixToPostfix(String infixExpression) {\r\n //Initializing final return string\r\n String postfix = \"\";\r\n //String Array of all elements\r\n String[] expElements = infixExpression.split(\" \");\r\n //New String Array for the numbers\r\n String[] operands = new String[infixExpression.length()];\r\n //New expressions for operators\r\n Expressions operators = new Expressions();\r\n //New stack for operators\r\n Stack operatorStack = new Stack();\r\n \r\n //Trackers for parentheses\r\n int openParenthesis = 0;\r\n int closedParenthesis = 0;\r\n \r\n //Iterate through for length of array of all expressions\r\n for(int i = 0; i < expElements.length; i++) {\r\n //If operator than push to stack\r\n if(expElements[i].equals(\"*\")||expElements[i].equals(\"/\")\r\n ||expElements[i].equals(\"+\")||expElements[i].equals(\"-\")) {\r\n operatorStack.push(new Expressions(expElements[i]));\r\n }\r\n //if open parenthesis add to count\r\n else if(expElements[i].equals(\"(\")) {\r\n openParenthesis++;\r\n }\r\n //if closed parenthesis add to count and pop operator\r\n else if(expElements[i].equals(\")\")) {\r\n closedParenthesis++;\r\n postfix += \" \" + operatorStack.pop();\r\n }\r\n //otherwise it is an integer, add it to array of operands\r\n else {\r\n operands[i] = expElements[i];\r\n postfix += \" \" + operands[i];\r\n }\r\n \r\n }\r\n //Error detection for not enough matching parentheses.\r\n if(openParenthesis!=closedParenthesis){\r\n postfix = \"Parenthesis not equal error.\";\r\n }\r\n //return final expression in postfix notation, delimited by spaces\r\n return postfix; \r\n }", "private static String convertToPostfix(String str) {\n Stack<Character> stack = new Stack<>();\n StringBuilder postfix = new StringBuilder();\n\n\n for (int index = 0; index < str.length(); index++) {\n char c = str.charAt(index);\n\n //if c is a digit, an algebraic variable, a dot, or blank (String formatting helper) it is added to\n //the postfix expression\n if ( Character.isLetterOrDigit(c) || c == '.' || c == ' ' ) {\n postfix.append(c);\n\n //if c is a left parenthesis it is added to the stack and a blank (string format helper) is appended\n //to postfix expression.\n } else if ( c == '(' ) {\n stack.push(c);\n postfix.append(\" \");\n\n //if c is an operator the stack is pop and added to the postfix expression only if c's precedence is\n // smaller or equal to the topmost operator in the stack. Otherwise, c is just added to the stack\n } else if ( isOperator(c) ) {\n while (!stack.isEmpty() && precedence(c) <= precedence(stack.peek()) ) {\n postfix.append(stack.pop()).append(\" \");\n }\n stack.push(c);\n\n //if c is a right parenthesis and the stack is not empty, the stack is then popped and added to the\n //postfix expression until a left parenthesis is encountered. If there is no left parenthesis then an\n //exception is thrown with a misplaced parenthesis statement\n } else if ( c == ')') {\n boolean hasLeftParenthesis = false;\n while ( !stack.isEmpty() ) {\n char popped = stack.pop();\n if ( popped == '(' ) {\n hasLeftParenthesis = true;\n break;\n } else {\n postfix.append(popped).append(\" \");\n }\n }//end of inner-loop\n if ( !hasLeftParenthesis ) {\n throw new ArithmeticException(\"Misplaced parenthesis\");\n }\n }\n }//end of for-loop\n\n //If stack is not empty, the stack is then popped and added to the postfix expression. If a left parenthesis is\n //found then an exception is thrown with a misplaced parenthesis statement;\n while (!stack.isEmpty()) {\n if (stack.peek() == '(') {\n throw new ArithmeticException(\"Misplaced parenthesis\");\n }\n postfix.append(stack.pop()).append(\" \");\n }\n\n //String is trimmed, double spaces are replaced by single spaces, and returned\n return postfix.toString().trim().replaceAll(\" \", \" \");\n }", "public static String infixToPostfix(String expression) {\n if (expression.contains(\" \"))\n {\n String newExpression = expression.replaceAll(\" \", \"\");\n expression = newExpression;\n }\n\n // Check for correct parentheses placement\n int lp = 1, rp = 0;\n String errorMessage = \"\";\n for (int i = 1; i < expression.length(); i++)\n {\n if (expression.charAt(i) == '(') lp++;\n if (expression.charAt(i) == ')') rp++;\n\n if (lp == rp && i < expression.length()-1)\n {\n // Error extra parentheses\n errorMessage = \"Error: Extra parentheses\";\n return errorMessage;\n }\n else if (lp < rp)\n {\n // Error misplaced closing parentheses\n errorMessage = \"Error: Misplaced closing parentheses\";\n return errorMessage;\n }\n else if (lp > rp && i == expression.length()-1)\n {\n // Error missing closing parentheses\n errorMessage = \"Error: Missing closing parentheses\";\n return errorMessage;\n }\n }\n\n // Add implied multiplication\n String impliedMulOptions = \"123456789.)\";\n for (int i = 1; i < expression.length(); i++)\n {\n char c = expression.charAt(i);\n String prevChar = \"\";\n prevChar += expression.charAt(i-1);\n if (c == '(')\n {\n if (impliedMulOptions.contains(prevChar))\n {\n String pre = expression.substring(0, i);\n String post = expression.substring(i);\n expression = pre + '*' + post;\n }\n }\n\n // Also check for multiple subtraction signs can convert\n if (c == '-')\n {\n if (c == prevChar.charAt(0))\n {\n String pre = expression.substring(0, i-1);\n String post = expression.substring(i+1);\n if (expression.charAt(i-2) == '(')\n {\n expression = pre + post;\n i--;\n }\n else expression = pre + '+' + post;\n }\n }\n }\n\n // Handle functions within the expression\n while (expression.contains(\"s\") || expression.contains(\"c\") || expression.contains(\"t\") || expression.contains(\"l\")) {\n if (expression.charAt(0) == 'E') return expression;\n expression = functionPresent(expression);\n }\n\n\n // ----- Create RPN -----\n // Variables to store results\n Stack<String> rpn = new Stack<String>();\n Stack<String> stack = new Stack<String>();\n\n // Define all operators possible in the question\n String operators = \"^*/+-()\";\n\n for (int pos = 0; pos < expression.length(); pos++) {\n char c = expression.charAt(pos);\n\n // If a number, find the end of it and add to stack\n if (Character.isDigit(c)) {\n int endpos = 0;\n for (int i = pos; i < expression.length(); i++) {\n char seekChar = expression.charAt(i);\n if (Character.isDigit(seekChar) || seekChar == '.') {\n continue;\n } else {\n endpos = i;\n break;\n }\n }\n rpn.push(expression.substring(pos, endpos));\n pos = endpos - 1;\n continue;\n }\n\n // If a negative number, find end of it and add to stack\n if (c == '-' && operators.contains(expression.substring(pos-1, pos)))\n {\n int endpos = 0;\n for (int i = pos; i < expression.length(); i++) {\n char seekChar = expression.charAt(i);\n if (Character.isDigit(seekChar) || seekChar == '.' || seekChar == '-') {\n continue;\n } else {\n endpos = i;\n break;\n }\n }\n rpn.push(expression.substring(pos, endpos));\n pos = endpos - 1;\n continue;\n }\n\n // If opening a set of parentheses, push it to stack.\n if (c == '(') {\n stack.push(\"(\");\n continue;\n }\n\n // If closing a set of parentheses, pop to rpn until opening parentheses occurs.\n if (c == ')') {\n while (!stack.isEmpty() && stack.peek() != \"(\") {\n rpn.push(stack.pop());\n }\n // Once we hit the open parentheses, pop it and exit loop\n stack.pop();\n continue;\n }\n\n // When an operand has been found\n else {\n while (!stack.isEmpty() && pemdas(c) <= pemdas(stack.peek())) {\n rpn.push(stack.pop());\n }\n String operandString = new String();\n operandString += c;\n stack.push(operandString);\n }\n\n }\n\n // ----- Solve RPN -----\n // Grab the RPN from the stack and turn it into an array to access it properly\n String[] rpnArray = new String[rpn.size()];\n for (int i = rpn.size() - 1; i > -1; i--) {\n rpnArray[i] = rpn.pop();\n }\n\n // If array is just one number, return it\n if (rpnArray.length == 1) return rpnArray[0];\n\n\n\n // Create stack for solving the problem\n Stack<String> solvingStack = new Stack<String>();\n\n for (int i = 0; i < rpnArray.length; i++) {\n // If it is a number, add to stack\n if (!operators.contains(rpnArray[i])) {\n solvingStack.push(rpnArray[i]);\n continue;\n }\n else if (rpnArray[i].charAt(0) == '-' && rpnArray[i].length() > 1)\n {\n solvingStack.push(rpnArray[i]);\n continue;\n }\n // Otherwise we do the math\n else\n {\n // Popping B first because of subtraction, division, and exponent\n double b = Double.parseDouble(solvingStack.pop());\n double a = Double.parseDouble(solvingStack.pop());\n int operator = operators.indexOf(rpnArray[i]);\n double result = 0;\n String resultStr = new String();\n switch (operator) {\n // Exponent\n case 0:\n result = Math.pow(a, b);\n break;\n\n // Multiplication\n case 1:\n result = (a * b);\n break;\n\n // Division\n case 2:\n if (b == 0) return \"Error: Cannot divide by zero\";\n result = (a / b);\n break;\n\n // Addition\n case 3:\n result = (a + b);\n break;\n\n // Subtraction\n case 4:\n result = (a - b);\n break;\n }\n resultStr += result;\n solvingStack.push(resultStr);\n }\n }\n\n\n //double answer = Double.parseDouble(solvingStack.pop());\n return solvingStack.pop();\n }", "public void convertInfixToPostfix() {\n\t\t// Create operator stack\n\t\tStack<String> op_stack = new Stack<String>();\n\n\t\t// Prepare the input string\n\t\tprepareInput();\n\t\t\n\t\t// Split the expression \n\t\tString[] tokens = input.split(\"(?<=[^\\\\.a-zA-Z\\\\d])|(?=[^\\\\.a-zA-Z\\\\d])\");\n\t\t\n\t\t//For each token\n\t\tfor (String t : tokens) {\n\t\t\t// If the token is empty, skip it\n\t\t\tif(t.equals(\"\") || t.equals(\" \")) continue;\n\t\t\t\n\t\t\t// If operator (o1)\n\t\t\tif (Operator.isOperator(t)) {\n\n\t\t\t\t// While there is an operator (o2) an the stack and\n\t\t\t\t// (o1 is left associative AND o2 precedence is higher or equal to o1 precedence)\n\t\t\t\t// OR\n\t\t\t\t// (o1 is right associative AND o2 precedence is higher than o1 precedence)\n\t\t\t\twhile (!op_stack.empty()\n\t\t\t\t\t\t&& Operator.isOperator(op_stack.peek())\n\t\t\t\t\t\t&& (\n\t\t\t\t\t\t\t((Operator.getAssociativity(t) == Operator.LEFT) && Operator.comparePrec(op_stack.peek(), t) >= 0) \n\t\t\t\t\t\t\t|| \n\t\t\t\t\t\t\t((Operator.getAssociativity(t) == Operator.RIGHT) && Operator.comparePrec(op_stack.peek(), t) > 0)\n\t\t\t\t\t\t )\n\t\t\t\t ) \n\t\t\t\t{\n\t\t\t\t\t// add o2 to the output\n\t\t\t\t\toutput.add(op_stack.pop());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Push o1 on to the stack.\n\t\t\t\top_stack.push(t);\n\t\t\t}\n\n\t\t\telse if (t.equals(\"(\")) {\n\t\t\t\top_stack.push(t);\n\t\t\t}\n\n\t\t\telse if (t.equals(\")\")) {\n\t\t\t\t// While there is not a left parenthesis, add the top token from the stack to the output\n\t\t\t\twhile (!op_stack.peek().equals(\"(\")) {\n\t\t\t\t\toutput.add(op_stack.pop());\n\t\t\t\t}\n\n\t\t\t\t// Pop out the left parenthesis\n\t\t\t\top_stack.pop();\n\t\t\t\t\n\t\t\t\t// While there is a function on the top of the stack, add it to the output\n\t\t\t\tif(!op_stack.empty() && Function.isFunction(op_stack.peek())) output.add(op_stack.pop());\n\t\t\t}\n\t\t\telse if(Function.isFunction(t)){\n\t\t\t\top_stack.push(t);\n\t\t\t}\n\t\t\telse if(isNumeric(t) || isVariable(t)){\n\t\t\t\toutput.add(t);\n\t\t\t}\n\t\t}\n\n\t\t// Finally empty the stack, by adding all remaining tokens to the output.\n\t\twhile (!op_stack.empty()) {\n\t\t\toutput.add(op_stack.pop());\n\t\t}\n\t}", "public String convertPostfix(String string){\r\n\r\n \t\tStack<Character> operatorStack = new Stack<Character>();\r\n\r\n \t\tStringBuffer postfix = new StringBuffer();\r\n\r\n \t\tCharacter topOperator;\r\n\t\tfor (int i = 0; i < string.length(); i++) {\r\n\t\t\tchar c = string.charAt(i);\r\n\r\n\t\t\tif (Character.isDigit(c)) {\r\n\t\t\t\tpostfix.append(c);\r\n\r\n\r\n\r\n\t\t\t\t// fixing bug to test next character before adding a space\r\n\t\t\t\t// if next character is not a digit add a space\r\n\t\t\t\tif (i + 1 >= string.length() || !Character.isDigit(string.charAt(i + 1)))\r\n\t\t\t\t\tpostfix.append(\" \");\r\n\r\n \t\t\t}\r\n \t\t\telse\r\n \t\t\t{\r\n \t\t\t\t\r\n \t\t\t\tswitch(c){\r\n \t\t\t\t /////// add a minus to stack without a space\r\n \t\t\t\t\tcase'!':\r\n \t\t\t\t boolean Debug = true;\r\n\r\n\t\t\t\t\tif (Debug)\r\n\t\t\t\t\t\tSystem.out.println(\"Bugs\");\r\n\r\n\t\t\t\t\tpostfix.append('-');\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n \t\t\t\t\tbreak;\r\n \r\n \t\t\t\t\t\r\n \t\t\t\tcase '^':\r\n \t\t\t\t\toperatorStack.push (c);\r\n \t\t\t\t\tbreak;\r\n \t\t\t\tcase '.':\r\n \t\t\t\t\toperatorStack.push (c);\r\n \t\t\t\t\tbreak;\r\n \t\t\t\tcase '+':\r\n \t\t\t\tcase '-':\r\n \t\t\t\tcase '*':\r\n \t\t\t\tcase '/':\r\n \t\t\t\t\twhile (!operatorStack.isEmpty () &&\r\n \t\t\t\t\t\t\tgetPrecedence(c) <= getPrecedence(operatorStack.peek()))\r\n \t\t\t\t\t{\r\n \t\t\t\t\t\tpostfix.append(operatorStack.peek() + \" \");\r\n \t\t\t\t\t\toperatorStack.pop();\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t}\r\n \t\t\t\t\toperatorStack.push (c);\r\n \t\t\t\t\tbreak;\r\n\r\n \t\t\t\tcase '(':\r\n \t\t\t\t\toperatorStack.push (c);\r\n \t\t\t\t\tbreak;\r\n\r\n \t\t\t\tcase ')': \r\n\t\t\t\t\ttopOperator = operatorStack.pop();\r\n\t\t\t\t\twhile ((topOperator != '(') && !operatorStack.isEmpty())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tpostfix.append(topOperator);\r\n\t\t\t\t\t\tpostfix.append(\" \");\r\n\t\t\t\t\t\ttopOperator = operatorStack.pop();\r\n\t\t\t\t\t}// end while\r\n\r\n\t\t\t\t\t/* if(!operatorStack.isEmpty() && operatorStack.peek().equals('(')){\r\n\t\t operatorStack.pop(); // pop/remove left parenthesis \r\n\t\t }*/\r\n\t\t\t\t\tbreak;\r\n \t\t\t\tdefault:\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t} \r\n\t\t/*\r\n\t\t * popping off any final operators\r\n\t\t */\r\n \t\t\twhile (!operatorStack.isEmpty())\r\n \t\t\t{\r\n \t\t\t\ttopOperator = operatorStack.pop();\r\n \t\t\t\tpostfix.append(topOperator + \" \");\r\n \t\t\t\t\r\n \t\t\t}\r\n \t\t\treturn postfix.toString();\r\n\r\n \t\t}", "public static String convertInfixToPostfix(String infix) throws InvalidNotationFormatException {\n\t\tNotationQueue<String> postfix = new NotationQueue<String>(infix.length());\n\t\tNotationStack<String> eval = new NotationStack<String>(infix.length());\n\t\tchar[] expr = infix.toCharArray();\n\t\tfor (int i = 0; i < expr.length; i++) {\n\t\t\tif (Character.isDigit(expr[i])) {\n\t\t\t\ttry {\n\t\t\t\t\tpostfix.enqueue(String.valueOf(expr[i]));\n\t\t\t\t}catch(QueueOverflowException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}else if (expr[i] == '(') {\n\t\t\t\ttry {\n\t\t\t\t\teval.push(String.valueOf(expr[i]));\n\t\t\t\t}catch(StackOverflowException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}else if (expr[i]=='+'||expr[i]=='-'||expr[i]=='*'||expr[i]=='/') {\n\t\t\t\ttry {\n\t\t\t\t\twhile(!eval.isEmpty() && eval.top().charAt(0)!='(' && prec(expr[i]) <= prec(eval.top().charAt(0))){\n\t\t\t\t\t\tString pop1 = eval.pop();\n\t\t\t\t\t\tpostfix.enqueue(pop1);\n\t\t\t\t\t}\n\t\t\t\t\teval.push(String.valueOf(expr[i]));\n\t\t\t\t}catch (StackUnderflowException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}catch (QueueOverflowException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}catch (StackOverflowException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}else if (expr[i]==')') { \n\t\t\t\ttry {\n\t\t\t\t\twhile(!eval.isEmpty() && eval.top().charAt(0)!='(') {\n\t\t\t\t\t\tString pop1 = eval.pop();\n\t\t\t\t\t\tpostfix.enqueue(pop1);\n\t\t\t\t\t}\n\t\t\t\t\tif(eval.size()==0){\n\t\t\t\t\t\tthrow new InvalidNotationFormatException();\n\t\t\t\t\t}else {\n\t\t\t\t\t\teval.pop();\n\t\t\t\t\t}\n\t\t\t\t}catch (StackUnderflowException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}catch (QueueOverflowException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\twhile(!eval.isEmpty()) {\n\t\t\t\tString pop1 = eval.pop();\n\t\t\t\tpostfix.enqueue(pop1);\n\t\t\t}\n\t\t}catch (StackUnderflowException e) {\n\t\t\te.printStackTrace();\n\t\t}catch (QueueOverflowException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn postfix.toString();\n\t}", "public int evalPostfix(String exp) \n { \n exp = exp.replaceAll(\"\\\\s\", \"\");\n \n if (exp == \"**Invalid Expression**\")\n return 0;\n // Scan all characters one by one \n for(int i=0;i<exp.length();i++) \n { \n char c=exp.charAt(i); \n \n // If the scanned character is an operand (number here), \n // push it to the stack. \n if(Character.isDigit(c)) \n finalStack.push(c - '0'); \n \n // If the scanned character is an operator, pop two \n // elements from stack apply the operator \n else\n { \n try{\n int val1 = (int) finalStack.pop(); \n int val2 = (int) finalStack.pop(); \n\n switch(c) \n { \n case '+': \n finalStack.push(val2+val1); \n break; \n\n case '-': \n finalStack.push(val2- val1); \n break; \n\n case '/': \n finalStack.push(val2/val1); \n break; \n\n case '*': \n finalStack.push(val2*val1); \n break;\n\n case '%':\n finalStack.push(val2%val1);\n break;\n } \n }\n catch(NullPointerException nullException){\n postfixExp = \"**Invalid Expression**\";\n throw nullException;\n \n }\n } \n } \n return (int) finalStack.pop(); \n }", "private CustomQueue<String> evaluatePostFix(CustomQueue<String>postfix){\r\n CustomStack<String> numberStack = new CustomStack();\r\n CustomQueue<String> result = new CustomQueue();\r\n \r\n while (postfix.isEmpty() == false){\r\n String value = postfix.remove();\r\n if (isOperator(value)){\r\n //First popped value should be on the right hand side of the operator\r\n double val2 = Double.parseDouble(numberStack.pop());\r\n //Second popped value should be on the left hand side of the operator\r\n double val1 = Double.parseDouble(numberStack.pop());\r\n String operation_result = calculate(val1, val2, value);\r\n numberStack.push(operation_result);\r\n }\r\n else{\r\n //It should be a number\r\n numberStack.push(value);\r\n }\r\n }\r\n \r\n if (numberStack.empty())\r\n result.add(\"0\");\r\n else\r\n result.add(numberStack.pop());\r\n \r\n return result;\r\n }", "static String infixToPostfix(String txt) \n\t{\n\t\tString postfix = new String(\"\");\n Stack<Character> stack = new Stack<>();\n \n for (int i = 0; i<txt.length(); ++i)\n {\n char c = txt.charAt(i);\n \n // Ist das eingescannte Zeichen c ein Operand, addiere es zur Ausgabe hinzu\n if (Character.isLetterOrDigit(c)) \n {\n \tpostfix += c;\n }\n \n \n // Ist das eingescannte Zeichen c eine offene Klammer, lege es auf den Stapel\n else if (c == '(') \n {\n \tstack.push(c);\n }\n \n // Ist das eingescannte Zeichen c eine schließende Klammer, pop es aus dem Stapel bis eine öffnende Klammer erscheint\n else if (c == ')')\n {\n while (!stack.isEmpty() && stack.peek() != '(') \n {\n \tpostfix += stack.pop();\n stack.pop();\n } \n }\n else //falls es ein Operator ist\n {\n while (!stack.isEmpty() && precedence(c) < precedence(stack.peek()))\n {\n postfix += stack.pop();\n }\n stack.push(c);\n }\n }\n \n // pop all the operators from the stack\n while (!stack.isEmpty())\n {\n postfix += stack.pop();\n }\n return postfix;\n\n\t}", "private String infixToPostfixPlusPrecedence(String infix) {\n\t\tString postfix = \"\";\n\t\tStack<Character> stack = new Stack<>();\n\n\t\tfor (int i = 0; i < infix.length(); i++) {\n\t\t\tchar currentChar = infix.charAt(i);\n\t\t\tif (currentChar == '+' || currentChar == '*') {\n\t\t\t\tif (stack.isEmpty() || stack.peek() == '(') {\n\t\t\t\t\tstack.push(currentChar);\n\t\t\t\t} else if (precedence(stack.peek()) >= precedence(currentChar)) {\n\t\t\t\t\tpostfix = postfix + stack.pop();\n\t\t\t\t\tstack.push(currentChar);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(currentChar);\n\t\t\t\t}\n\t\t\t} else if (currentChar == '(') {\n\t\t\t\tstack.push(currentChar);\n\t\t\t} else if (currentChar == ')') {\n\n\t\t\t\twhile (stack.peek() != '(') {\n\t\t\t\t\tpostfix = postfix + stack.pop();\n\t\t\t\t}\n\t\t\t\tstack.pop();\n\n\t\t\t} else if (currentChar != ' ') {\n\t\t\t\tpostfix = postfix + currentChar;\n\t\t\t}\n\n\t\t}\n\n\t\twhile (!stack.isEmpty()) {\n\t\t\tpostfix = postfix + stack.pop();\n\t\t}\n\n\t\treturn postfix;\n\t}", "public String convertPostfixToInfix(String postfixstring)\n {\n//implementing stack\n Stack<String> s = new Stack<>();\n//iterates over the postfix expression\n for (int i = 0; i < postfixstring.length(); i++)\n {\n//reading a character at a time\n char ch = postfixstring.charAt(i);\n//inside the if-statement we have called the user-defined function that checks whether the character is operator or not\n if (isOperator(ch))\n {\n String b = s.pop();\n String a = s.pop();\n//push the character (operator) into stack in between the string a and b\n s.push(\"(\" + a + ch + b + \")\");\n }\n else\n//push character into the stack\n s.push(\"\" + ch);\n }\n//pop character from the stack and returns the same\n return s.pop();\n }", "public String parsePrefixToPostfix(String exp) throws SyntaxError {\n \tif (exp.length() == 0) {\n \t\tthrow new SyntaxError(\"No expression has been entered.\");\n \t}\n //parser accepts user input into exp\n \tScanner parser = new Scanner(exp);\n int element;\n String operator;\n String entity;\n String postfixExpression = \"\"; \n String firstOperand, secondOperand;\n int result = 0;\n \n //tokenize prefix string and set up 2 stacks\n Stack<String> operandStack = new Stack<String>();\n Stack<String> reverseOperatorStack = new Stack<String>();\n //while statement to push onto the reversal stack if there are more tokens\n while (parser.hasNext()) {\n entity = parser.next();\n // unless there is a space\n if (!entity.equals(\" \"))\n reverseOperatorStack.push(entity);\n }\n try { \n \t// while statement to pop to reversal stack if it is not empty\n \twhile (!reverseOperatorStack.isEmpty()) {\n //peek to retrieve the token at the top of the stack\n \t\tentity = reverseOperatorStack.peek();\n \t\t//pop to take the token off the stack\n\t reverseOperatorStack.pop();\n\t \n\t // if it is an operand\n\t if (Character.isDigit(entity.charAt(0))) {\n\t \t//push token onto the operand stack\n\t \toperandStack.push(entity);\n\t }\n\t // if it is an operator\n\t else if (entity.equals(\"/\") || entity.equals(\"*\") \n\t \t\t|| entity.equals(\"+\") || entity.equals(\"-\")) {\n\t \t//retrieve, then pop first operand off the stack\n\t \tfirstOperand = operandStack.peek();\n\t operandStack.pop();\n\t //retrieve, then pop second operand off the stack\n\t secondOperand = operandStack.peek();\n\t operandStack.pop();\n\t // formats miniExpression String with the 2 operands followed by the operator \n\t String miniExpression = firstOperand + \" \" + secondOperand + \" \" + entity;\n\t //push the string onto the operand stack\n\t operandStack.push(miniExpression);\n\t }\n \t}\n \t //throws error if there is an incorrect entry improperly formatted \t\n } catch (Exception e) {\n throw new SyntaxError(\"You have entered an improper expression. Check your input.\");\n }\n //retrieve, then pop the postfix expression off the stack\n postfixExpression = operandStack.peek();\n operandStack.pop();\n //return postfix - holding the converted expression\n return postfixExpression; \n }", "public static String infixToPostfix(String infix) throws PostFixException{\n\t\t//Create a new stack object to hold operators from infix expression\n\t\tStack<String> operatorStack = new Stack<String>();\n\t\tString postfix = \"\";\n\t\tString curToken = \"\";\n\t\tScanner getToken = new Scanner(infix);\n\t\t//holds the previous token type as a string\n\t\tString previousTokenType = \"first token\";\n\t\t\n\t\t//Iterate over all tokens in expression\n\t\twhile(getToken.hasNext()){\n\t\t\tcurToken = getToken.next();\n\t\t\t\n\t\t\t//if the token is an operand (meaning it is an integer), add to postfix expression\n\t\t\tif(isPositiveInteger(curToken)){\n\t\t\t\t//if the token sequence is valid, add the current token to the psotfix expression\n\t\t\t\tif(checkValidTokenSequence(\"operand\", previousTokenType)){\n\t\t\t\t\tpostfix += (curToken + \" \");\n\t\t\t\t\tpreviousTokenType = \"operand\";\n\t\t\t\t}\n\t\t\t\telse{ //otherwise throw an exception\n\t\t\t\t\tthrow new PostFixException(\"Invalid token sequence\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if the current token is a left bracket check that the token sequence is valid and push the\n\t\t\t//token on the stack\n\t\t\telse if(curToken.equals(\"(\")){\n\t\t\t\tif(checkValidTokenSequence(\"left bracket\", previousTokenType)){\n\t\t\t\t\toperatorStack.push(curToken);\n\t\t\t\t\tpreviousTokenType = \"left bracket\";\n\t\t\t\t}\n\t\t\t\telse{//if the token sequence is invalid throw and exception\n\t\t\t\t\tthrow new PostFixException(\"Invalid token sequence\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if the token is an operator, check sequence validity\n\t\t\telse if(curToken.equals(\"+\")||curToken.equals(\"-\")||curToken.equals(\"*\")||curToken.equals(\"/\")){\n\t\t\t\t//if the token is an operator and it is the first token, the expression is invalid\n\t\t\t\tif(previousTokenType.equals(\"first token\")){\n\t\t\t\t\tthrow new PostFixException(\"Invalid operator placement\");\n\t\t\t\t}\n\t\t\t\t//if the token sequence is valid, add all operator on stack with lower or equal precedence to\n\t\t\t\t//to the prefix expression\n\t\t\t\tif(checkValidTokenSequence(\"operator\", previousTokenType)){\n\t\t\t\t\twhile(!operatorStack.empty() && checkPrecedence(operatorStack.peek(),curToken)){\n\t\t\t\t\t\tpostfix += (operatorStack.pop() + \" \");\n\t\t\t\t\t}\n\t\t\t\t\t//push the current token on the operator stack\n\t\t\t\t\toperatorStack.push(curToken);\n\t\t\t\t\tpreviousTokenType = \"operator\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//if the token sequence is invalid, throw exception\n\t\t\t\t\tthrow new PostFixException(\"Invalid token sequence\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//if the token is a right bracket, check that token sequence is valid\n\t\t\telse if(curToken.equals(\")\")){\n\t\t\t\t\n\t\t\t\t//if the token sequence is valid, add all operators on operator stack \n\t\t\t\t//to the prefix expression until the matching left bracket is reached\n\t\t\t\tif(checkValidTokenSequence(\"right bracket\", previousTokenType)){\n\t\t\t\t\tboolean hasMatchingBracket = false;\n\t\t\t\t\t\n\t\t\t\t\twhile(!operatorStack.empty()){\n\t\t\t\t\t\tif(!operatorStack.peek().equals(\"(\")){\n\t\t\t\t\t\t\tpostfix += (operatorStack.pop() + \" \");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\toperatorStack.pop();\n\t\t\t\t\t\t\thasMatchingBracket = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//If the right bracket does not have a matching left bracket, throw an exception\n\t\t\t\t\tif(!hasMatchingBracket){\n\t\t\t\t\t\tthrow new PostFixException(\"Missing left bracket\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tpreviousTokenType = \"right bracket\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//If the token sequence is invalid throw an exception\n\t\t\t\telse{\n\t\t\t\t\tthrow new PostFixException(\"Invalid token sequence\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if the current token is not a valid token, throw an exception\n\t\t\telse{\n\t\t\t\tthrow new PostFixException(\"Invalid token: \" + curToken);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Check to see if the last token was an operator, if so throw an exception\n\t\tif(curToken.equals(\"+\")||curToken.equals(\"-\")||curToken.equals(\"*\")||curToken.equals(\"/\")){\n\t\t\tthrow new PostFixException(\"Invalid operator placement\");\n\t\t}\n\t\t\n\t\t//while there operator stack is not empty, pop whatever is in the stack and append\n\t\twhile(!operatorStack.empty()){\n\t\t\t//if there is a bracket left in the stack, then the infix expression is invalid\n\t\t\tif(operatorStack.peek().equals(\"(\") || operatorStack.peek().equals(\")\")){\n\t\t\t\tthrow new PostFixException(\"Bracket mismatch\");\n\t\t\t}\n\t\t\t\tpostfix += (operatorStack.pop() + \" \");\n\t\t}\n\t\t\n\t\tgetToken.close();\n\t\t\n\t\t//return the postfix expression\n\t\treturn postfix;\n\t}", "public String solve(String postfixExp) {\n Stack<String> stack = new Stack<String>();\n char ch;\n int inputLength = postfixExp.length();\n\n for (int i = 0; i < inputLength; i++) {\n ch = postfixExp.charAt(i);\n\n if (ch == ' ') {\n // Do nothing, space found.\n }\n else if (isOperand(ch)) {\n int n = 0; // This will eventually hold our final value.\n\n while (isOperand(ch)) {\n n = (n * 10) + (int) (ch - '0');\n i++;\n ch = postfixExp.charAt(i);\n }\n i--;\n\n stack.push(Integer.toString(n));\n }\n else {\n double tempOne = Double.parseDouble(stack.pop());\n double tempTwo = Double.parseDouble(stack.pop());\n\n switch (ch) {\n case '+':\n stack.push(Double.toString(tempTwo + tempOne));\n break;\n case '-':\n stack.push(Double.toString(tempTwo - tempOne));\n break;\n case '*':\n stack.push(Double.toString(tempTwo * tempOne));\n break;\n case '/':\n if (tempOne == 0) {\n return \"Error: Division by 0\";\n } else {\n stack.push(Double.toString(tempTwo / tempOne));\n }\n break;\n case '^':\n double temp3 = (double)(Math.pow(tempTwo, tempOne));\n stack.push(Double.toString(temp3));\n break;\n }\n }\n }\n\n String evaluation = stack.pop();\n\n return evaluation;\n }", "public String transformInfixToPostfix(String input) {\n\n List<String> outputQueue = new LinkedList<>();\n\n Stack<Operation> operationStack = new Stack<>();\n final String[] splitedEquation = input.split(\" \");\n for (String token : splitedEquation) {\n if (isOperator(token)) {\n OperatorParser operatorParser = new OperatorParser(outputQueue, operationStack,\n token).invoke();\n outputQueue = operatorParser.getOutputQueue();\n operationStack = operatorParser.getOperationStack();\n } else {\n outputQueue = addImmutable(outputQueue, token);\n }\n }\n\n outputQueue = addOperationsToOutputQueue(outputQueue, operationStack);\n\n return Stream.of(outputQueue)\n .collect(Collectors.joining(\" \"));\n }", "String convertToPostfix(String input);", "private String toReversePolishNotation(String expr) {\n\t\tString output = \"\";\n\t\tStack<String> operatorStack = new Stack<String>();\n\n\t\tfor(String token : expr.split(\"\\\\s+\")) {\n\t\t\tif(isNumber(token)) {\n\t\t\t\toutput += token + \" \";\n\t\t\t}\n\t\t\telse if(isMatrix(token)) {\n\t\t\t\toutput += token + \" \";\n\t\t\t}\n\t\t\telse if(isOperator(token)) {\n\t\t\t\tint precidenceToken = getPrecidence(token);\n\t\t\t\tint precidenceNext;\n\t\t\t\twhile(!operatorStack.isEmpty()) {\n\t\t\t\t\tprecidenceNext = getPrecidence(operatorStack.peek());\n\t\t\t\t\tif(precidenceNext >= precidenceToken) output += operatorStack.pop() + \" \";\n\t\t\t\t\telse break;\n\t\t\t\t}\n\t\t\t\toperatorStack.push(token);\n\t\t\t}\n\t\t\telse if(token.equals(\"(\")) {\n\t\t\t\toperatorStack.push(token);\n\t\t\t}\n\t\t\telse if(token.equals(\")\")) {\n\t\t\t\twhile(!operatorStack.peek().equals(\"(\")) output += operatorStack.pop() + \" \";\n\t\t\t\toperatorStack.pop();\n\t\t\t}\n\t\t\telse throw new IllegalArgumentException(INVALID_CHARACTER_MESSAGE);\n\t\t}\n\t\twhile(!operatorStack.isEmpty()) output += operatorStack.pop() + \" \";\n\n\t\treturn output;\n\t}", "private static String getPostfix(String s) {\n\t\tif(s.length() == 0){\n\t\t\treturn null;\n\t\t}\n\t\tString[] expression = s.split(\" \");\n\t\tStack stack = new Stack();\n\t\tString result = null;\n\t\tfor(int i = 0; i<expression.length;i++){\n\t\t\tString temp = expression[i];\n\t\t\tif(temp.equals(\"+\") || temp.equals(\"-\") || temp.equals(\"*\") || temp.equals(\"/\") || temp.equals(\"%\")){\n\t\t\t\twhile(!stack.isEmpty() && hasHigherPriority(stack.top(),temp)){\n\t\t\t\t\tif(result == null){\n\t\t\t\t\t\tthrow new IllegalArgumentException(\"Expression is not infix\");\n\t\t\t\t\t}\n\t\t\t\t\tresult = result + stack.pop();\n\t\t\t\t}\n\t\t\t\tstack.push(temp);\n\t\t\t}else{\n\t\t\t\tif(result == null){\n\t\t\t\t\tresult = temp;\n\t\t\t\t}else{\n\t\t\t\t\tresult = result + temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\twhile(!stack.isEmpty()){\n\t\t\tresult = result + stack.pop();\n\t\t}\n\t\treturn result;\n\t}", "public String convertInfix (String exp) throws NumberFormatException \n {\n \n initStack.clear();\n queue.clear();\n finalStack.clear();\n postfixExp = \"\";\n \n for (int i = 0; i<exp.length(); ++i){\n char c = exp.charAt(i); \n if(i > 0){\n char previous = exp.charAt(i-1);\n if((isNumber(c) && isNumber(previous)) || isBalanced(exp) == false){\n throw new NumberFormatException(\"**Invalid Expression**\");\n }\n }\n \n if (Precedence(c) > 0)\n {\n while(initStack.isEmpty() == false && Precedence((char) initStack.top()) >= Precedence(c))\n {\n queue.insertBack(initStack.pop());\n }\n initStack.push(c);\n }\n else if (c ==')')\n {\n char x = (char) initStack.pop();\n while(x!= '(')\n {\n queue.insertBack(x);\n x = (char) initStack.pop();\n }\n }\n else if (c == '(')\n {\n initStack.push(c);\n }\n else\n {\n queue.insertBack(c);\n }\n }\n while (!initStack.isEmpty()) \n {\n queue.insertBack(initStack.pop());\n }\n postfixExp = queue.postFixString();\n postfixExp = postfixExp.replaceAll(\"\\\\s\",\"\");\n return postfixExp;\n }", "@Override\n\tpublic String toPostfixNotation() {\n\t\tint num;\n\t\tExpressionTree left, right;\n\n\t\ttry {\n\t\t\tnum = Integer.parseInt(EMPTY + this.getValue());\n\t\t\treturn EMPTY + num;\n\t\t}\n\t\tcatch(NumberFormatException n) {\n\t\t\tleft = new ExpressionTree(getLeft());\n\t\t\tright = new ExpressionTree(getRight());\n\t\t\t\n\t\t\treturn left.toPostfixNotation() + SPACE + right.toPostfixNotation() + SPACE \n\t\t\t\t+ getValue();\n\t\t}\n\t}", "public static double evaluatePostfixExpression (String postfixExpr) throws InvalidNotationFormatException {\n\t\tNotationStack<Double> eval = new NotationStack<Double>(postfixExpr.length());\n\t\tchar[] expr = postfixExpr.toCharArray();\n\t\tfor (int i = 0; i < expr.length; i++) {\n\t\t\tif (Character.isDigit(expr[i])) {\n\t\t\t\tdouble d = expr[i]-'0';\n\t\t\t\ttry {\n\t\t\t\t\teval.push(d);\n\t\t\t\t} catch (StackOverflowException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\tif(eval.size() < 2) {\n\t\t\t\t\tthrow new InvalidNotationFormatException();\n\t\t\t\t}\n\t\t\t\tDouble pop1=0.0, pop2=0.0, result=0.0;\n\t\t\t\ttry {\n\t\t\t\t\tpop2 = eval.pop();\n\t\t\t\t\tpop1 = eval.pop();\n\t\t\t\t}catch(StackUnderflowException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tswitch(expr[i]) {\n\t\t\t\tcase '+' : result = pop1 + pop2;\n\t\t\t\tbreak;\n\t\t\t\tcase '-' : result = pop1 - pop2;\n\t\t\t\tbreak;\n\t\t\t\tcase '*' : result = pop1 * pop2;\n\t\t\t\tbreak;\n\t\t\t\tcase '/' : result = pop1 / pop2;\n\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\teval.push(result);\n\t\t\t\t} catch (StackOverflowException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (eval.size() > 1) {\n\t\t\tthrow new InvalidNotationFormatException();\n\t\t}\n\t\tDouble output=0.0;\n\t\ttry {\n\t\t\toutput = eval.pop();\n\t\t} catch (StackUnderflowException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn output;\n\t}", "public static int evalPostfix(String postfix) throws PostFixException{\n\t\t//MyStack instance to store results of evaluation\n\t\tStack<Integer> result = new Stack<Integer>();\n\t\t\n\t\t//Scanner instance to scan tokens\n\t\tScanner getToken = new Scanner(postfix);\n\t\t\n\t\twhile(getToken.hasNext()){\n\t\t\t\n\t\t\tString curToken = getToken.next();\n\t\t\t//if the token is a valid operator, push it onto stack as a Double object\n\t\t\tif(isPositiveInteger(curToken)){\n\t\t\t\tresult.push(Integer.parseInt(curToken));\n\t\t\t}\n\t\t\t\n\t\t\t//if the current token is an operator\n\t\t\telse if(curToken.equals(\"+\")||curToken.equals(\"-\")||curToken.equals(\"*\")||curToken.equals(\"/\")){\n\t\t\t\ttry{\n\t\t\t\t\t//Get the operands from the stack\n\t\t\t\t\tint operand2 = result.pop().intValue();\n\t\t\t\t\tint operand1 = result.pop().intValue();\n\t\t\t\t\t\n\t\t\t\t\t//find the operator and perform the arithmetic\n\t\t\t\t\tswitch(curToken){\n\t\t\t\t\t\tcase \"+\": result.push(operand1 + operand2);\n\t\t\t\t\t\t\t\t break;\n\t\t\t\t\t\tcase \"-\": result.push(operand1 - operand2);\n\t\t\t\t\t\t\t\t break;\n\t\t\t\t\t\tcase \"*\": result.push(operand1 * operand2);\n\t\t\t\t\t\t\t\t break;\n\t\t\t\t\t\tcase \"/\": result.push(operand1 / operand2);\n\t\t\t\t\t\t\t\t break;\n\t\t\t\t\t\tdefault: throw new PostFixException(\"Invalid token: \" + curToken);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//if the stack is empty when attempting to pop, throw a PostFixException\n\t\t\t\tcatch(EmptyStackException e){\n\t\t\t\t\tthrow new PostFixException(\"Not enough operands\");\n\t\t\t\t}\n\t\t\t\t//If there is an ArithMetic Exception, rethrow it\n\t\t\t\tcatch(ArithmeticException e){\n\t\t\t\t\tthrow new ArithmeticException(\"Divide by 0\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//if the token is not an operand or operator it is invalid,\n\t\t\t//throw a PostFixException\n\t\t\telse{\n\t\t\t\tthrow new PostFixException(\"Invalid token: \" + curToken);\n\t\t\t}\n\t\t}\n\t\t\n\t\tgetToken.close();\n\t\t\n\t\t//if the result is not in the stack\n\t\tif(result.empty()){\n\t\t\tthrow new PostFixException(\"Not enough operands\");\n\t\t}\n\t\t\n\t\tint resultNum = result.pop().intValue();\n\t\t\n\t\t//If there are still operands in the stack\n\t\tif(!result.empty()){\n\t\t\tthrow new PostFixException(\"Too many operands\");\n\t\t}\n\t\t\n\t\treturn resultNum;\n\t}", "@Override\n\tpublic int postfixEval(String[] exp) {\n\t\t\n\t\tStack<Integer> stk = new Stack<Integer>();\n\t\t\n\t\tfor(String part: exp) {\n\t\t\tif(part.equals(EMPTY))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\ttry {\n\t\t\t\tstk.push(Integer.parseInt(part));\n\t\t\t}\n\t\t\tcatch (NumberFormatException n) {\n\t\t\t\tif(part.equals(PLUS_SIGN))\n\t\t\t\t\tstk.push(stk.pop() + stk.pop());\n\t\t\t\telse\n\t\t\t\t\tstk.push(stk.pop() * stk.pop());\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn stk.pop();\n\t}", "public int evalPostfixExpression(String[] input) {\r\n\t\tStack<Integer> result = new Stack<Integer>();\r\n\t\tint num = 0;\r\n\t\tfor (String s: input) {\r\n\t\t\ttry {\r\n\t\t\t\tnum = Integer.parseInt(s);\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\tint y = result.pop();\r\n\t\t\t\tint x = result.pop();\r\n\t\t\t\tif (s.equals(\"+\"))\r\n\t\t\t\t\tnum = x + y;\r\n\t\t\t\telse if (s.equals(\"-\"))\r\n\t\t\t\t\tnum = x - y;\r\n\t\t\t\telse if (s.equals(\"*\"))\r\n\t\t\t\t\tnum = x * y;\r\n\t\t\t\telse if (s.equals(\"/\"))\r\n\t\t\t\t\tnum = x / y;\r\n\t\t\t}\r\n\t\t\tresult.push(num);\r\n\t\t}\r\n\t\treturn result.pop();\r\n\t}", "public double processPostfix(String postfix){\n char[] postfixArr = postfix.toCharArray(); //Convert string to Char Array\n\n //loop through the array, looking at each value\n for(int i = 0; i < postfixArr.length; i++){\n\n //If digit, push it into the stack\n if(Character.isDigit(postfixArr[i])){\n s.push(postfixArr[i]);\n }\n else{\n double d1 = convertToDbl(s.pop()); //convert to double\n double d2 = convertToDbl(s.pop());\n\n //switch to determine what operation should be performed - printed out for testing\n switch(postfixArr[i]){\n case '+':\n System.out.println(d2 + \" + \" + d1); s.push(d2+d1); System.out.println(\"= \" + (d2+d1)); break;\n case '-':\n System.out.println(d2 + \" - \" + d1); s.push(d2-d1); System.out.println(\"= \" + (d2-d1)); break;\n case '*':\n System.out.println(d2 + \" * \" + d1); s.push(d2 * d1); System.out.println(\"= \" + (d2*d1));break;\n case '/':\n System.out.println(d2 + \"/\" + d1); s.push(d2/d1); System.out.println(\"= \" + (d2/d1));break;\n case '^':\n System.out.println(d2 + \" ^ \" + d1); s.push(Math.pow(d2, d1)); System.out.println(\"= \" + (Math.pow(d2,d1))); break;\n default:\n System.out.println(\"ERROR IN CODE!\");\n }\n }\n\n\n }\n\n double result = convertToDbl(s.top()); //return the item at top of the stack (converted to a double)\n s.pop();\n return result;\n }", "public String parsePostfixToPrefix(String exp) throws SyntaxError {\n \t// throws error message if there is no expression entered\n \tif (exp.length() == 0) {\n \t\tthrow new SyntaxError(\"No expression has been entered.\");\n \t}\n Scanner parser = new Scanner(exp);\n String entity;\n //tokenize the string containing the postfix expression\n Stack<String> operandStack = new Stack<String>();\n String firstOperand, secondOperand;\n // try-catch to validate data has been entered\n try {\n\t \t//while there are more tokens\n \t\twhile (parser.hasNext()) {\n\t entity = parser.next();\n\t // if it is a space, skip it\n\t if (entity.equals(\" \"));\n\t // if it is a operand, push it onto the operand stack\n\t if (Character.isDigit(entity.charAt(0)))\n\t operandStack.push(entity);\n\t // if it is an operator\n\t else if (entity.equals(\"/\") || entity.equals(\"*\") \n\t || entity.equals(\"+\") || entity.equals(\"-\")) {\n\t \t//retrieve, then pop operand 1 off the operand stack\n\t \tsecondOperand = operandStack.peek();\n\t operandStack.pop();\n\t //retrieve, then pop operand 2 off the operand stack\n\t firstOperand = operandStack.peek();\n\t operandStack.pop();\n\t // formats miniExpression String with the operator followed by 2 operands\n\t String miniExpression = entity + \" \" + firstOperand + \" \" + secondOperand;\n\t //push the miniExpression string onto the operand stack\n\t operandStack.push(miniExpression);\n\t }\n\t }\n\t //throws error if there is an incorrect entry improperly formatted \t\n } catch (Exception e) {\n \tthrow new SyntaxError(\"You have entered an improper expression. Check your input.\");\n }\n //retrieve, then pop the prefix expression off the operand stack\n String prefix = operandStack.peek();\n operandStack.pop();\n //return prefix - holding the converted expression\n return prefix;\n }", "public double evaluate(String expression) throws InvalidExpressionException {\n assertProperExpression(expression);\n \n // creating postfix\n String postfix = \"\";\n while (expression.length() > 0) {\n char item = expression.charAt(0);\n expression = expression.substring(1);\n // disregard spaces by\n if (item == ' ') continue;\n // add digits straight to postfix expression\n else if (isDigit(item)) postfix += item;\n // always push '(' on stack no matter what\n else if (item == '(') postfixStack.push('(');\n // dump stack until you hit end parenthesis which is voided\n else if (item == ')') {\n while (postfixStack.peek() != '(') {\n postfix += postfixStack.pop();\n }\n postfixStack.pop();\n continue;\n }\n // item must be operator, so push onto stack after removing higher precedents below it\n else if (isOperator(item)) {\n while (!postfixStack.isEmpty() &&\n isOperator(item) &&\n precedenceOf(postfixStack.peek()) >= precedenceOf(item)) postfix += postfixStack.pop();\n postfixStack.push(item);\n }\n }\n while (!postfixStack.isEmpty()) postfix += postfixStack.pop();\n\n // solving the postfix expression \n while (postfix.length() > 0) {\n char item = postfix.charAt(0);\n postfix = postfix.substring(1);\n\n if (isDigit(item)) solutionStack.push((double) (item - '0'));\n if (isOperator(item)) {\n double y = solutionStack.pop();\n double x = solutionStack.pop();\n if (item == '^') solutionStack.push(Math.pow(x, y));\n if (item == '*') solutionStack.push(x * y);\n if (item == '/') solutionStack.push(x / y);\n if (item == '+') solutionStack.push(x + y);\n if (item == '-') solutionStack.push(x - y);\n }\n }\n\n Double solution = solutionStack.pop();\n return solution;\n }", "public static String convertPostfixToInfix(String postfix) throws InvalidNotationFormatException {\n\t\tNotationStack<String> eval = new NotationStack<String>(postfix.length());\n\t\tchar[] expr = postfix.toCharArray();\n\t\tfor (int i = 0; i < expr.length; i++) {\n\t\t\tif (Character.isDigit(expr[i])) {\n\t\t\t\ttry {\n\t\t\t\t\teval.push(String.valueOf(expr[i]));\n\t\t\t\t}catch(StackOverflowException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\tif (eval.size() < 2) {\n\t\t\t\t\tthrow new InvalidNotationFormatException();\n\t\t\t\t}\n\t\t\t\tString pop1=\"\", pop2=\"\", result=\"\";\n\t\t\t\ttry {\n\t\t\t\t\tpop2 = eval.pop();\n\t\t\t\t\tpop1 = eval.pop();\n\t\t\t\t\tresult += \"(\" + pop1 + String.valueOf(expr[i]) + pop2 + \")\";\n\t\t\t\t\teval.push(result);\n\t\t\t\t}catch(StackUnderflowException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}catch(StackOverflowException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (eval.size() > 1) {\n\t\t\tthrow new InvalidNotationFormatException();\n\t\t}\n\t\treturn eval.toString();\n\t}", "public static String infixToPostfix(String regex) {\n String postfix = new String();\n\n Stack<Character> stack = new Stack<>();\n\n String formattedRegEx = formatRegEx(regex);\n\n for (Character c : formattedRegEx.toCharArray()) {\n switch (c) {\n case '(': {\n stack.push(c);\n break;\n }\n case ')': {\n while (!stack.peek().equals('(')) {\n postfix += stack.pop();\n }\n stack.pop();\n break;\n }\n default: {\n while (stack.size() > 0) {\n Character topChar = stack.peek();\n\n Integer topCharPrecedence = getPrecedence(topChar);\n Integer actualCharPrecedence = getPrecedence(c);\n\n if (topCharPrecedence >= actualCharPrecedence) {\n postfix += stack.pop();\n } else {\n break;\n }\n }\n stack.push(c);\n break;\n }\n }\n }\n while (stack.size() > 0) {\n postfix += stack.pop();\n }\n\n return postfix;\n }", "public static int evaluate(Math impl, String[] postfix) throws StackOverflowError, MalformedPostfixException {\n\n // a stack for implementing the evaluation\n Stack<Integer> stack = new Stack<Integer>();\n\n try {\n \n for (int i = 0; i < postfix.length; i++) {\n\n if (postfix[i].length() == 1 && !Character.isDigit(postfix[i].charAt(0))) {\n\n // if the first character of the element is not a digit then we \n // assume it is an operator\n\n String operator = postfix[i];\n\t\t\n if (operator.equals(\"<\")) {\n int rhs = stack.pop();\n int lhs = stack.pop();\n int result = impl.lshift(lhs, rhs);\n stack.add(result);\n } else if (operator.equals(\">\")) {\n int rhs = stack.pop();\n int lhs = stack.pop();\n int result = impl.rshift(lhs, rhs);\n stack.add(result);\n } else if (operator.equals(\"+\")) {\n int rhs = stack.pop();\n int lhs = stack.pop();\n int result = impl.add(lhs, rhs);\n stack.add(result);\n } else if (operator.equals(\"-\")) {\n int rhs = stack.pop();\n int lhs = stack.pop();\n int result = impl.sub(lhs, rhs);\n stack.add(result);\n } else if (operator.equals(\"*\")) {\n int rhs = stack.pop();\n int lhs = stack.pop();\n int result = impl.mul(lhs, rhs);\n stack.add(result);\n } else if (operator.equals(\"/\")) {\n int rhs = stack.pop();\n int lhs = stack.pop();\n int result = impl.div(lhs, rhs);\n stack.add(result);\n } else if (operator.equals(\"^\")) {\n int rhs = stack.pop();\n int lhs = stack.pop();\n int result = impl.pow(lhs, rhs);\n stack.add(result);\n } else if (operator.equals(\"!\")) {\n int num = stack.pop();\n int result = impl.fac(num);\n stack.add(result);\n } // if\n\n } else {\n\n // otherwise we assume it is an operand and add it to the stack\n stack.add(Integer.parseInt(postfix[i]));\n\n } // if\n\n } // for\n\n } catch (Exception e) {\n \n // propogate as a malformed postfix exception\n throw new MalformedPostfixException(postfix);\n \n } // try\n \n // if the stack size is not 1, then the expression is malformed\n if (stack.size() != 1) {\n throw new MalformedPostfixException(postfix);\n } // if\n\n // the only element left in the stack will be the result of the evaluation\n return stack.pop();\n\n }", "private String evaluate(String expression) {\n String separators = \"()*+/-\";\n String result;\n // Stack for using in algorithm\n Stack<String> stackOperations = new Stack<String>();\n // Stack for RPN - reverse polish notation\n Stack<String> stackRPN = new Stack<String>();\n // Stack for evaluating answer\n Stack<String> stackTemp = new Stack<String>();\n //splitting expression into tokens\n StringTokenizer stringTokenizer = new StringTokenizer(updateUnaryMinus(expression), separators, true);\n\n while (stringTokenizer.hasMoreTokens()) {\n String token = stringTokenizer.nextToken();\n if (isNumber(token)) {\n stackRPN.push(token);\n } else if (isOpenBracket(token)) {\n stackOperations.push(token);\n } else if (isCloseBracket(token)) {\n while (!isOpenBracket(stackOperations.lastElement())) {\n stackRPN.push(stackOperations.pop());\n }\n stackOperations.pop();\n } else if (isOperator(token)) {\n while (!stackOperations.empty() && isOperator(stackOperations.lastElement())\n && getPrecedence(stackOperations.lastElement()) > getPrecedence(token)) {\n stackRPN.push(stackOperations.pop());\n }\n stackOperations.push(token);\n }\n }\n while (!stackOperations.empty()) {\n stackRPN.push(stackOperations.pop());\n }\n Collections.reverse(stackRPN);\n\n // Evaluation if RPN expression\n while (!stackRPN.empty()) {\n if (isNumber(stackRPN.lastElement())) stackTemp.push(stackRPN.pop());\n else stackTemp.push(makeOperation(stackRPN.pop(), stackTemp.pop(), stackTemp.pop()));\n }\n result = stackTemp.pop();\n return result;\n }", "private String infixToPostfixNoPrecedence(String infix) {\n\t\tString postfix = \"\";\n\t\tStack<Character> stack = new Stack<>();\n\n\t\tfor (int i = 0; i < infix.length(); i++) {\n\t\t\tchar currentChar = infix.charAt(i);\n\t\t\tif (currentChar == '+' || currentChar == '*') {\n\t\t\t\tif (stack.isEmpty()) {\n\t\t\t\t\tstack.push(currentChar);\n\t\t\t\t} else if (stack.peek() == '+' || stack.peek() == '*') {\n\t\t\t\t\tpostfix = postfix + stack.pop();\n\t\t\t\t\tstack.push(currentChar);\n\t\t\t\t} else {\n\t\t\t\t\tstack.push(currentChar);\n\t\t\t\t}\n\t\t\t} else if (currentChar == '(') {\n\t\t\t\tstack.push(currentChar);\n\t\t\t} else if (currentChar == ')') {\n\n\t\t\t\twhile (stack.peek() != '(') {\n\t\t\t\t\tpostfix = postfix + stack.pop();\n\t\t\t\t}\n\n\t\t\t\tstack.pop();\n\n\t\t\t} else if (currentChar != ' ') {\n\t\t\t\tpostfix = postfix + currentChar;\n\t\t\t}\n\n\t\t}\n\n\t\twhile (!stack.isEmpty()) {\n\t\t\tpostfix = postfix + stack.pop();\n\t\t}\n\n\t\treturn postfix;\n\t}", "static String infixToPostfix(String infix) {\n final String ops = \"-+/*^\";\n \n StringBuilder sb = new StringBuilder();\n Stack<Integer> s = new Stack<>();\n \n for (String token : infix.split(\"\\\\s\")) {\n if (token.isEmpty())\n continue;\n char c = token.charAt(0);\n int idx = ops.indexOf(c);\n \n // check for operator\n if (idx != -1) {\n if (s.isEmpty())\n s.push(idx);\n \n else {\n while (!s.isEmpty()) {\n int prec2 = s.peek() / 2;\n int prec1 = idx / 2;\n if (prec2 > prec1 || (prec2 == prec1 && c != '^'))\n sb.append(ops.charAt(s.pop())).append(' ');\n else break;\n }\n s.push(idx);\n }\n } \n else if (c == '(') {\n s.push(-2); // -2 stands for '('\n } \n else if (c == ')') {\n // until '(' on stack, pop operators.\n while (s.peek() != -2)\n sb.append(ops.charAt(s.pop())).append(' ');\n s.pop();\n }\n else {\n sb.append(token).append(' ');\n }\n }\n while (!s.isEmpty())\n sb.append(ops.charAt(s.pop())).append(' ');\n return sb.toString();\n }", "public static String[] infixToPostfix(String[] infix) {\n\n // a list for the resulting postfix expression\n List<String> postfix = new ArrayList<String>();\n\n // a stack for implementing the conversion\n Stack<String> operatorStack = new Stack<String>();\n\n // check the length of the expression\n if (infix.length != 0) {\n \n for (int i = 0; i < infix.length; i++) {\n \n // precedence is null for operands\n Integer precedence = precedenceMap.get(infix[i]);\n\n if (precedence != null) {\n\n // then the current token is an operator\n while (!operatorStack.isEmpty()) {\n String opFromStack = operatorStack.pop();\n if (precedenceMap.get(opFromStack) < precedence) {\n operatorStack.push(opFromStack);\n break;\n } else {\n postfix.add(opFromStack);\n } // if\n } // while\n \n operatorStack.push(infix[i]);\n \n } else { \n // current token is not an operator\n postfix.add(infix[i]);\n } // if\n \n } // for\n \n // add the remaining operators to the postfix expression\n while (!operatorStack.isEmpty()) {\n postfix.add(operatorStack.pop());\n } // while\n \n } // if\n \n return postfix.toArray(new String[postfix.size()]);\n\n }", "public static String infixToPostfix(String input) {\r\n\t\tStack<Object> infixStack = new Stack<>();\t\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tboolean digitPreviously = false;\r\n\r\n\t\tfor (int i = 0; i < input.length(); i++) {\r\n\t\t\tchar temp = input.charAt(i);\r\n\r\n\t\t\t// CASE 1 : handling digits\r\n\t\t\tif (priority(temp) < 0) {\r\n\t\t\t\tsb.append(temp);\r\n\t\t\t\tdigitPreviously = true;\r\n\t\t\t// CASE 2 : handling (, )\r\n\t\t\t} else if (priority(temp) == 0) {\r\n\t\t\t\tif (temp == '(') {\r\n\t\t\t\t\tinfixStack.push(temp);\r\n\t\t\t\t\tdigitPreviously = false;\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tboolean foundOpener = false;\r\n\t\t\t\t\twhile (!infixStack.empty()) {\r\n\t\t\t\t\t\tif ((char)infixStack.peek() == '(') {\r\n\t\t\t\t\t\t\tfoundOpener = true;\r\n\t\t\t\t\t\t\tinfixStack.pop();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\tchar top = (char)infixStack.pop();\r\n\t\t\t\t\t\tif (digitPreviously) sb.append(' ');\r\n\t\t\t\t\t\tsb.append(top);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdigitPreviously = true;\t\r\n\t\t\t\t\tif (!foundOpener) {\r\n\t\t\t\t\t\t// invalid case : different number of ( and )\r\n\t\t\t\t\t\tthrow new IllegalArgumentException();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// CASE 3 : handling operators\r\n\t\t\telse if (priority(temp) > 0) {\r\n\t\t\t\tif (infixStack.empty()) {\r\n\t\t\t\t\tif (!digitPreviously && temp == '-') {\r\n\t\t\t\t\t\ttemp = '~';\r\n\t\t\t\t\t}\r\n\t\t\t\t\tinfixStack.push(temp);\r\n\t\t\t\t\tif (digitPreviously) sb.append(' ');\r\n\t\t\t\t} else {\r\n\t\t\t\t\twhile (!infixStack.empty()) {\r\n\t\t\t\t\t\tif (!digitPreviously && temp == '-') {\r\n\t\t\t\t\t\t\ttemp = '~';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (priority((char)infixStack.peek()) < priority(temp) || temp == '^' || temp == '~') {\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tchar top = (char)infixStack.pop();\r\n\t\t\t\t\t\tif (digitPreviously) sb.append(' ');\r\n\t\t\t\t\t\tsb.append(top);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tinfixStack.push(temp);\r\n\t\t\t\t\tif (digitPreviously) sb.append(' ');\r\n\t\t\t\t}\r\n\t\t\t\tdigitPreviously = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// pop remaining chars\r\n\t\twhile (!infixStack.empty()) {\r\n\t\t\tchar temp = (char)infixStack.pop();\r\n\t\t\tif (temp == '(') {\r\n\t\t\t\t// invalid case : different number of ( and )\r\n\t\t\t\tthrow new IllegalArgumentException();\r\n\t\t\t} else {\r\n\t\t\t\tsb.append(' ');\r\n\t\t\t\tsb.append(temp);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn sb.toString();\r\n\t}", "public int eval(String expression) {\n String token;\n // The 3rd argument is true to indicate that the delimiters should be used\n // as tokens, too. \n this.tokenizer = new StringTokenizer(expression, DELIMITERS, true);\n\n //initialized with # operator, used as bogus to compare priorities and detect end of operatorStack.\n operatorStack.push(new PoundOperator());\n\n //Checks whether there are more tokens to be pushed in stacks\n while (this.tokenizer.hasMoreTokens()) {\n // filter out spaces\n if (!(token = this.tokenizer.nextToken()).equals(\" \")) {\n // check if token is an operand\n if (Operand.check(token)) {\n operandStack.push(new Operand(token));\n\n } else {\n if (!Operator.check(token)) {\n System.out.println(\"*****invalid token******\");\n System.exit(1);\n }\n\n //Gets a newOperator it matches from hashmap.\n Operator newOperator = Operator.getToken(token);\n\n //Processes only, when there is greater priority in stack and there are no '('\n while (operatorStack.peek().priority() >= newOperator.priority() && !newOperator.equals(Operator.getToken(\"(\"))) {\n\n //If the token read is ), then there is already '(' which is inserted in the operator stack.\n if (token.equals(\")\")) {\n //Perform until, the '(' is on top of the stack.\n while (!operatorStack.peek().equals(Operator.getToken(\"(\"))) {\n Operator oldOpr = operatorStack.pop();\n Operand op2 = operandStack.pop();\n Operand op1 = operandStack.pop();\n operandStack.push(oldOpr.execute(op1, op2));\n\n }\n\n //If '(' found on top, pop and break, to continue to read more takens\n if (operatorStack.peek().equals(Operator.getToken(\"(\"))) {\n operatorStack.pop();\n break;\n }\n\n } \n //if ')' not found, it means either its in '(' or there are no parenthesis\n else {\n Operator oldOpr = operatorStack.pop();\n Operand op2 = operandStack.pop();\n Operand op1 = operandStack.pop();\n operandStack.push(oldOpr.execute(op1, op2));\n }\n }\n //Pushes the operator, when the operator!=')'\n if (!newOperator.equals(Operator.getToken(\")\"))) {\n operatorStack.push(newOperator);\n }\n }\n }\n }\n // No more tokens to be read. All the tokens are in stacks, gets processed.\n if (!this.tokenizer.hasMoreTokens()) {\n //Keeps processing, until it reaches #\n while (operatorStack.size() != 1) {\n Operator oldOpr = operatorStack.pop();\n //Checks if there are operand left to be used,\n if (!operandStack.empty()) {\n Operand op2 = operandStack.pop();\n Operand op1 = operandStack.pop();\n operandStack.push(oldOpr.execute(op1, op2));\n } else {\n System.exit(1);\n }\n }\n }\n // Returns, the final result\n return operandStack.pop().getValue();\n }", "public static void main(String[] args) {\n\t\tPostFix aux,courant, racine;\r\n\t\t\r\n\t\t sc = new Scanner(System.in);\r\n\t\t System.out.println(\"Entrer l'expression postfixée--->\");\r\n\t\t ArrayList<String> list ; \r\n\t\t String PostEntre = sc.nextLine();\r\n\t\t \r\n\t\t list = new ArrayList<>(Arrays.asList(PostEntre.split(\" \")));\r\n\t\t \r\n\t\t ArrayDeque<PostFix> pil = new ArrayDeque<PostFix>();\r\n\t\t for (String s : list){\r\n\t\t\t courant = new PostFix(s);\r\n\t\t\t if (isOperator(s)){\r\n\t\t\t\t aux = pil.pop();\r\n\t\t\t\t courant.setfilsgauche(pil.pop());\r\n\t\t\t\t courant.setfilsdroit(aux);\r\n\t\t\t }\r\n\t\t\t pil.push(courant);\r\n\t\t\t \r\n\t\t }\r\n\t\t racine = pil.pop();\r\n\t\t System.out.println(\"L'arbre est : \" );\r\n\t\t System.out.println(racine + \"\\n\" );\r\n\t\t // racine.Afficher(racine);\r\n\t\t \r\n\t\t //----------------------------to prefix------------------------\r\n\t\t String s1,s2,sor;\r\n\t\t \r\n\t\t ArrayDeque<String> operst = new ArrayDeque<String>();\r\n\t\t for (String n : list){\r\n\t\t\t if (!isOperator(n))\r\n\t\t\t\t operst.push(n);\r\n\t\t\t else{\r\n\t\t\t\ts2 = operst.pop();\r\n\t\t\t \ts1 = operst.pop();\r\n\t\t\t \tsor = n +\" \"+ s1 +\" \"+ s2;\r\n\t\t\t operst.push(sor);\r\n\t\t\t }\r\n\t\t\t \t\t\t \r\n\t\t }\r\n\t\t System.out.println(\"L'expression prefixee donne: \");\r\n\t\t System.out.println(operst.pop()+\"\\n\");\r\n\t\t //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r\n\t\t \r\n\t\t \r\n\t\t //-----------------------------evaluation-----------------------\r\n\t\t Double oper1, oper2,result;\r\n\t\t ArrayDeque<Double> abc = new ArrayDeque<Double>();\r\n\t\t for (String n : list){\r\n\t\t\t if (!isOperator(n))\r\n\t\t\t\t abc.push(Double.valueOf(n));\t\t\t\r\n\t\t\t else{\r\n\t\t\t\t oper2 = abc.pop();\t\t\t \t\r\n\t\t\t\t oper1 = abc.pop();\r\n\t\t\t \tresult = operate(oper1,oper2,n);\t\t\t \r\n\t\t\t \t\tabc.push(result);\r\n\t\t\t }\r\n\t\t\t \t\t\t \r\n\t\t }\r\n\t\t System.out.println(\"l'evaluation donne: \");\r\n\t\t System.out.println(abc.pop());\r\n\t\t //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r\n\r\n\t}", "public double evaluatePostfix(double x) {\n\n\t\tScanner scan = new Scanner(postFix);\n\t\tString s;\n\t\tLinkedList<Double> stack = new LinkedList<Double>();\n\t\tdouble temp;\n\t\tdouble partSum = 0;\n\n\t\twhile (scan.hasNext()) {\n\t\t\ts = scan.next();\n\t\t\tif (s.matches(\"\\\\p{Alpha}\")) {\n\t\t\t\ts = x + \"\";\n\t\t\t}\n\n\t\t\tif (s.matches(\"(^-?\\\\d*\\\\.\\\\d+|^-?\\\\d+\\\\.\\\\d*$|^-?\\\\d+)|(\\\\d*\\\\.\\\\d+|-?\\\\d+\\\\.\\\\d*$|\\\\d+)\")) {\n\t\t\t\tstack.push(Double.parseDouble(s));\n\t\t\t} else if (s.matches(\"\\\\+|\\\\-(?<!\\\\d)|\\\\*|\\\\/|\\\\^\")) {\n\t\t\t\ttemp = stack.peek();\n\t\t\t\tstack.pop();\n\t\t\t\tif (s.equals(\"+\")) {\n\t\t\t\t\tpartSum = stack.peek() + temp;\n\t\t\t\t\tstack.pop();\n\t\t\t\t} else if (s.equals(\"-\")) {\n\t\t\t\t\tpartSum = stack.peek() - temp;\n\t\t\t\t\tstack.pop();\n\t\t\t\t} else if (s.equals(\"*\")) {\n\t\t\t\t\tpartSum = stack.peek() * temp;\n\t\t\t\t\tstack.pop();\n\t\t\t\t} else if (s.equals(\"/\")) {\n\t\t\t\t\tpartSum = stack.peek() / temp;\n\t\t\t\t\tstack.pop();\n\t\t\t\t} else if (s.equals(\"^\")) {\n\t\t\t\t\tpartSum = Math.pow(stack.peek(), temp);\n\t\t\t\t\tstack.pop();\n\t\t\t\t}\n\t\t\t\tstack.push(partSum);\n\t\t\t}\n\t\t}\n\n\t\treturn stack.peek();\n\t}", "public String processInfix(char[] input) {\n String result = \"\"; //Initialize the string. This will be the postfix formatted input.\n\n for (int i = 0; i < input.length; i++) {\n\n //If it is a digit it is sent straight to the result\n if (Character.isDigit(input[i])) {\n result += input[i];\n }\n\n //If it is an open bracket it is pushed into the stack.\n else if (input[i] == '(') {\n s.push(input[i]);\n }\n\n //If it is a closed bracket, all items in the stack are popped until an open bracket is found.\n //Both brackets are then discarded\n else if (input[i] == ')') {\n\n while (!s.isEmpty() && (char)s.top() != '(') {\n result += (char)s.pop();\n }\n\n if (!s.isEmpty() && (char)s.top() != '(') {\n System.out.println(\"Invalid Expression. A '(' character must be followed by a ')' in the Expression.\");\n } else {\n s.pop(); //get rid of ( from the eq.\n }\n }\n\n //Else it must be an operand...\n else {\n //loop checks:\n // 1. that the stack is not empty and\n // 2. that the current token is less or equal in priority to the one on the top of the stack\n // If it both are true then the operator is sent to the result\n while(!s.isEmpty() && getPriority(input[i]) <= getPriority((char)s.top())){\n result += (char)s.pop();\n }\n s.push(input[i]);\n }\n }\n\n //Pop the remainder of the stack to the result\n while(!s.isEmpty()){\n result += (char)s.pop();\n }\n\n return result;\n }", "public Polynomial postfixEval(List<Token> postfixtokenList){\n ArrayDeque<Token> stack = new ArrayDeque<Token>(); \n\n Polynomial result = new Polynomial(); \n for (Token token : postfixtokenList){\n if (token instanceof Polynomial)\n stack.push(token); \n else if (token instanceof Operator){\n Polynomial op2 = (Polynomial) stack.pop(); \n Polynomial op1 = (Polynomial) stack.pop(); \n result = ((Operator) token).operate(op1, op2);\n if (result == null) //for division by 0\n return null;\n stack.push(result); \n }\n }\n result = (Polynomial) stack.pop(); \n if (storingVar != ' '){\n memory.put(storingVar, result); \n storingVar = ' ';\n }\n return result; \n }", "public static int evaluateExpression(String expression) {\r\n // Create operandStack of ints to store operands\r\n Stack<Integer> operandStack = new Stack<>();\r\n \r\n // Create operatorStack of characters to store operators\r\n Stack<Character> operatorStack = new Stack<>();\r\n \r\n // Insert Blanks\r\n expression = insertBlanks(expression);\r\n \r\n // Extract operands and operators by splitting around blanks\r\n String[] tokens = expression.split(\" \");\r\n \r\n /* Phase 1: Scan tokens\r\n Enhanced for loop, puts every element of tokens in token each time\r\n Like writing token = tokens[i] every time\r\n */\r\n for (String token: tokens) { \r\n if(token.length() == 0) // It's a blank\r\n continue; // Go to the while loop\r\n else if (token.charAt(0) == '+' || token.charAt(0) == '-') {\r\n // process all +, -, *, / in the top of the operator stack\r\n while (!operatorStack.isEmpty() && // While stack isn't empty\r\n (operatorStack.peek() == '+' || // and has an operator on top\r\n operatorStack.peek() == '-' || // Like if you had (2 * 3) + 5 \r\n operatorStack.peek() == '*' || // Or if you had (2 - 3) + 5, do that last no matter what b/c +- is lowest priority\r\n operatorStack.peek() == '/' ||\r\n operatorStack.peek() == '^')) {\r\n processAnOperator(operandStack, operatorStack);\r\n }\r\n \r\n // After processing the all the previous operations, push the +- operator onto the stack\r\n operatorStack.push(token.charAt(0));\r\n }\r\n else if (token.charAt(0) == '*' || token.charAt(0) == '/') {\r\n // Proess all *, / in the top of the operator stack\r\n while(!operatorStack.isEmpty() &&\r\n (operatorStack.peek() == '*' ||\r\n operatorStack.peek() == '/' ||\r\n operatorStack.peek() == '^')) {\r\n processAnOperator(operandStack, operatorStack);\r\n }\r\n \r\n //Push the * or / onto the stack\r\n operatorStack.push(token.charAt(0));\r\n }\r\n else if (token.charAt(0) == '^') {\r\n // Proess all ^ in the top of the operator stack\r\n while(!operatorStack.isEmpty() &&\r\n (operatorStack.peek() == '^')) {\r\n processAnOperator(operandStack, operatorStack);\r\n }\r\n \r\n //Push the ^ onto the stack\r\n operatorStack.push(token.charAt(0));\r\n }\r\n else if(token.trim().charAt(0) == '(') {\r\n operatorStack.push('(');\r\n } \r\n else if(token.trim().charAt(0) == ')') {\r\n while(operatorStack.peek() != '(') {\r\n processAnOperator(operandStack, operatorStack);\r\n }\r\n operatorStack.pop(); // pop\r\n }\r\n else {\r\n operandStack.push(new Integer(token));\r\n }\r\n }\r\n // Phase two: process everything left over\r\n while (!operatorStack.isEmpty()) {\r\n processAnOperator(operandStack, operatorStack);\r\n }\r\n \r\n return operandStack.pop(); \r\n }", "private static String infixToPrefix(String expression)\r\n {\r\n String result = \"\";\r\n String reverse_expression = \"\";\r\n int expression_length = expression.length();\r\n Character current_char = ' ';\r\n\r\n //turns the expression around\r\n for(int index = expression_length - 1; index >= 0; index--)\r\n {\r\n current_char = expression.charAt(index);\r\n switch(current_char)\r\n {\r\n case '{':\r\n current_char = '}';\r\n break;\r\n case '}':\r\n current_char = '{';\r\n break;\r\n case '[':\r\n current_char = ']';\r\n break;\r\n case ']':\r\n current_char = '[';\r\n break;\r\n case '(':\r\n current_char = ')';\r\n break;\r\n case ')':\r\n current_char = '(';\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n reverse_expression += current_char;\r\n }\r\n\r\n //gets the postfix expression of the reversed expression\r\n String postfix_expression = infixToPostfix(reverse_expression);\r\n expression_length = postfix_expression.length();\r\n\r\n //reverses the postfix expression of the reversed expression\r\n for(int index = expression_length - 1; index >= 0; index--)\r\n {\r\n result += postfix_expression.charAt(index);\r\n }\r\n\r\n return result;\r\n }", "private Expr unaryPost(Position pos, X10Unary_c.Operator op, Expr e) throws SemanticException {\n Type ret = e.type();\n Expr one = getLiteral(pos, ret, 1);\n Assign.Operator asgn = (op == X10Unary_c.POST_INC) ? Assign.ADD_ASSIGN : Assign.SUB_ASSIGN;\n X10Binary_c.Operator bin = (op == X10Unary_c.POST_INC) ? X10Binary_c.SUB : X10Binary_c.ADD;\n Expr incr = assign(pos, e, asgn, one);\n incr = visitAssign((Assign) incr);\n return visitBinary((X10Binary_c) xnf.Binary(pos, incr, bin, one).type(ret));\n }", "public static UnaryExpression postIncrementAssign(Expression expression) {\n return makeUnary(ExpressionType.PostIncrementAssign, expression, expression.getType());\n }", "public String evaluate(ArrayList<String> expression)\n {\n Stack<String> Values = new Stack<String>(), Operations = new Stack<String>();\n\n for (int i = 0; i < expression.size(); i++)\n\t\t{\n\t\t\tif (expression.get(i).equals(\"(\"))\n Operations.push(expression.get(i));\n else if (expression.get(i).equals(\")\"))\n {\n while (Operations.peek().equals(\"(\"))\n Values.push(apply(Operations.pop(), Values.pop(), Values.pop()));\n Operations.pop();\n }\n else if (expression.get(i).equals(\"+\") || expression.get(i).equals(\"-\") || expression.get(i).equals(\"*\") || expression.get(i).equals(\"/\"))\n {\n while (!Operations.empty() && precedence(expression.get(i), Operations.peek()))\n Values.push(apply(Operations.pop(), Values.pop(), Values.pop()));\n Operations.push(expression.get(i));\n }\n\t\t\telse\n\t\t\t{\n\t\t\t\tValues.push(expression.get(i));\n\t\t\t}\n }\n while (!Operations.empty())\n Values.push(apply(Operations.pop(), Values.pop(), Values.pop()));\n return Values.pop();\n }", "public static String inFixToPostFix(String equation) {\n\t\tString postFix = \"\";\n\n\t\tequation = equation.replaceAll(\"\\\\s+\", \"\");\n\n\t\tPattern pattern = Pattern.compile(\"\\\\d+\\\\p{Alpha}\");\n\t\tMatcher match = pattern.matcher(equation);\n\n\t\tequation = equation.replaceAll(\"(?<=\\\\p{Alpha})(?=\\\\d)|(?<=\\\\d)(?=\\\\p{Alpha})\", \"*\");\n\t\tequation = equation.replaceAll(\"^-|\\\\-(?=\\\\()\", \"-1*\");\n\t\tequation = equation.replaceAll(\"\\\\)\\\\(\",\")*(\");\n\t\tequation = equation.replaceAll(\"-x\", \"-1*x\");\n//\t\tequation = equation.replaceAll(\"(?<=\\\\^)\\\\-\", \"(-\");\n\n\t\t// context of \"-\"\n\n\t\t// finding 3*x or 3/x\n\t\tString vars = \"(\\\\p{Alpha})\";\n\n\t\t// letters without coefficients\n\t\tString coeff = \"(\\\\d*\\\\.?\\\\d*\\\\.?\\\\d+|^\\\\-\\\\d+|(?<=\\\\()\\\\-\\\\d+)|(?<=\\\\p{Punct})\\\\-\\\\d+\";\n//\t\tString coeffDec = \"\\\\d+\";\n\t\t\n\t\t\n\t\t// operators\n\t\tString oper = \"\\\\+|(?<!^)\\\\-|\\\\*|\\\\/|\\\\^\";\n\t\tString oper2 = \"\\\\+|\\\\-|\\\\*|\\\\/|\\\\^\";\n\n\t\tString brackets = \"\\\\(|\\\\)\";\n\n\t\tpattern = Pattern.compile(vars + \"|\" + coeff + \"|\" + oper + \"|\" + brackets);\n\t\tmatch = pattern.matcher(equation);\n\n\t\tLinkedList<String> stack = new LinkedList<String>();\n\n\t\tHashtable<String, Integer> priority = new Hashtable<String, Integer>();\n\n\t\tpriority.put(\"+\", 0);\n\t\tpriority.put(\"-\", 0);\n\t\tpriority.put(\"/\", 1);\n\t\tpriority.put(\"*\", 1);\n\t\tpriority.put(\"^\", 2);\n\n\t\tpriority.put(\"(\", 2);\n\t\tpriority.put(\")\", 2);\n\t\tboolean first = true;\n\t\twhile (match.find()) {\n//\t\t\tSystem.out.println(match.group());\n\t\t\tif (match.group().matches(vars + \"|\" + coeff)) {\n\n\t\t\t\tpostFix = postFix + match.group() + \" \";\n\n\t\t\t} else if (match.group().matches(oper2) || match.group().matches(\"\\\\(\")) {\n\n\t\t\t\tif (stack.isEmpty()) {\n\t\t\t\t\tstack.push(match.group());\n\t\t\t\t\tfirst = true;\n\n\t\t\t\t} else if (priority.get(match.group()).intValue() < priority.get(stack.peek()).intValue()) {\n\n\t\t\t\t\twhile (!stack.isEmpty() && !stack.peek().matches(brackets)) {\n\t\t\t\t\t\t// //System.out.println(stack.peek());\n\t\t\t\t\t\tpostFix = postFix + stack.peek() + \" \";\n\t\t\t\t\t\tstack.pop();\n\t\t\t\t\t\t// //System.out.println(stack.peek());\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!first) {\n\t\t\t\t\tstack.push(match.group());\n\n\t\t\t\t}\n\t\t\t\tfirst = false;\n\t\t\t} else if (match.group().matches(\"\\\\)\")) {\n\t\t\t\twhile (!stack.peek().matches(\"\\\\(\")) {\n\t\t\t\t\t// //System.out.println(stack.peek());\n\t\t\t\t\tpostFix = postFix + stack.peek() + \" \";\n\t\t\t\t\tstack.pop();\n\t\t\t\t\t// //System.out.println(stack.peek());\n\t\t\t\t}\n\t\t\t\tstack.pop();\n\t\t\t}\n\n\t\t}\n\t\tif (!stack.isEmpty()) {\n\t\t\twhile (!stack.isEmpty()) {\n\t\t\t\tpostFix = postFix + stack.peek() + \" \";\n\t\t\t\tstack.pop();\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(equation);\n\t\t//System.out.println(postFix);\n\t\treturn postFix;\n\t}", "private String translateInfixExpression(InfixExpression e) {\n String left = translateExpression(e.getLeft());\n String right = translateExpression(e.getRight());\n return String.format(\"(%s %s %s)\", left, e.getOp(), right);\n }", "public static UnaryExpression postDecrementAssign(Expression expression) {\n return makeUnary(ExpressionType.PostDecrementAssign, expression, expression.getType());\n }", "public void printEval()\r\n {\r\n eval = ((int)numbers.pop());\r\n System.out.println(\"Postfix Evaluation: \" + eval);\r\n pw.println(\"Postfix Evaluation: \" + eval);\r\n}", "public void infixToPostFix() {\n for (String str : infixList) {\n if (str.equals(\"(\")) {\n leftParenthesis(str);\n } else if (str.equals(\")\")) {\n rightParenthesis();\n } else if (OperatorOperand.isOperator(str)) {\n operator(str);\n } else {\n operand(str);\n }\n }\n clearTheStack();\n }", "public final void rule__XCastedExpression__Group__0__Impl() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:7725:1: ( ( ruleXPostfixOperation ) )\r\n // InternalDroneScript.g:7726:1: ( ruleXPostfixOperation )\r\n {\r\n // InternalDroneScript.g:7726:1: ( ruleXPostfixOperation )\r\n // InternalDroneScript.g:7727:2: ruleXPostfixOperation\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXCastedExpressionAccess().getXPostfixOperationParserRuleCall_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleXPostfixOperation();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXCastedExpressionAccess().getXPostfixOperationParserRuleCall_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 double calculate(String expression) {\n\t\tString[] inputs = expression.split(\" \");\n\t if(debug) {\n\t\tSystem.out.print(\"Input array: \");\n\t\tfor(String value : inputs) {\n\t\t\tSystem.out.print(value + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t }\t\n\t\t\n\t\t// Go through the string array and pop operators onto the\n\t\t// operators stack and operands onto the the operands stack\n\t\tfor(String value : inputs) {\n\t\t if(debug) System.out.println(\"Evaluating: \" + value);\n\t\t\tif(value.equals(\"*\") || value.equals(\"/\") || value.equals(\"+\") || value.equals(\"-\")) {\n\t\t\t\t// If stack is empty push onto stack\n\t\t\t\tif(operand.empty()) {\n\t\t\t\t\toperand.push(value);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// If new operator is higher than old push onto\n\t\t\t\t// stack\n\t\t\t\telse if(value.equals(\"*\") || value.equals(\"/\")) {\n\t\t\t\t\tString old = (String)operand.peek();\n\t\t\t\t\tif(old.equals(\"*\")) {\n\t\t\t\t\t\tdouble a = (Double)operators.pop();\n\t\t\t\t\t\tdouble b = (Double)operators.pop();\n\t\t\t\t\t if(debug) {\n\t\t\t\t\t\tSystem.out.println(a + old + b);\n\t\t\t\t\t }\n\t\t\t\t\t \ta = a*b;\n\t\t\t\t\t\toperators.push(a);\n\t\t\t\t\t\told = (String)operand.pop();\n\t\t\t\t\t\toperand.push(value);\n\t\t\t\t\t}\n\t\t\t\t\telse if(old.equals(\"/\")) {\n\t\t\t\t\t\tdouble a = (Double)operators.pop();\n\t\t\t\t\t\tdouble b = (Double)operators.pop();\n\t\t\t\t\t if(debug) {\n\t\t\t\t\t\tSystem.out.println(a + old + b);\n\t\t\t\t\t }\n\t\t\t\t\t \ta = b/a;\n\t\t\t\t\t\toperators.push(a);\n\t\t\t\t\t\told = (String)operand.pop();\n\t\t\t\t\t\toperand.push(value);\n\t\t\t\t\t}\n\t\t\t\t\telse operand.push(value);\n\t\t\t\t}\n\n\t\t\t\t// Else pop old operator and evaluate top two\n\t\t\t\t// elements on operand stack then push new\n\t\t\t\t// operator onto stack\n\t\t\t\telse {\n\t\t\t\t\tdouble a = (Double)operators.pop();\n\t\t\t\t\tdouble b = (Double)operators.pop();\n\t\t\t\t\tString old = (String)operand.pop();\n\t\t\t\t if(debug) {\n\t\t\t\t\tSystem.out.println(a + old + b);\n\t\t\t\t }\n\t\t\t\t\tif(old.equals(\"*\")) a = a*b;\n\t\t\t\t\telse if(old.equals(\"/\")) a = b/a;\n\t\t\t\t\telse if(old.equals(\"+\")) a = a+b;\n\t\t\t\t\telse a = b-a;\n\t\t\t\t\toperators.push(a);\n\t\t\t\t\toperand.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Put operators into operators stack\n\t\t\telse {\n\t\t\t try {\n\t\t\t\tDouble num = Double.parseDouble(value);\n\t\t\t\toperators.push(num);\n\t\t\t }\n\t\t\t catch(NumberFormatException e) {\n\t\t\t\t System.out.println(\"NumberFormatException: Something besides a number or operator entered\");\n\t\t\t }\n\t\t\t}\n\t\t}\n\t\t// Finish up everything left over in stack\n\t\tString old;\n\t\tdouble a;\n\t\tdouble b;\n\t\twhile(!operand.empty()) {\n\t\t\told = (String)operand.pop();\n\t\t\ta = (Double)operators.pop();\n\t\t\tb = (Double)operators.pop();\n\t\t\tif(old.equals(\"*\")) a = a*b;\n\t\t\telse if(old.equals(\"/\")) a = b/a;\n\t\t\telse if(old.equals(\"+\")) a = a+b;\n\t\t\telse a = b-a;\n\t\t\toperators.push(a);\n\t\t}\n\t\treturn (Double)operators.peek();\n\t}", "public final void rule__XPostfixOperation__FeatureAssignment_1_0_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:17747:1: ( ( ( ruleOpPostfix ) ) )\r\n // InternalDroneScript.g:17748:2: ( ( ruleOpPostfix ) )\r\n {\r\n // InternalDroneScript.g:17748:2: ( ( ruleOpPostfix ) )\r\n // InternalDroneScript.g:17749:3: ( ruleOpPostfix )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXPostfixOperationAccess().getFeatureJvmIdentifiableElementCrossReference_1_0_1_0()); \r\n }\r\n // InternalDroneScript.g:17750:3: ( ruleOpPostfix )\r\n // InternalDroneScript.g:17751:4: ruleOpPostfix\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXPostfixOperationAccess().getFeatureJvmIdentifiableElementOpPostfixParserRuleCall_1_0_1_0_1()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleOpPostfix();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXPostfixOperationAccess().getFeatureJvmIdentifiableElementOpPostfixParserRuleCall_1_0_1_0_1()); \r\n }\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXPostfixOperationAccess().getFeatureJvmIdentifiableElementCrossReference_1_0_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 }", "int parseExpression() {\r\n\t\t\t\tint x = parseTerm();\r\n\t\t\t\tfor (;;) {\r\n\t\t\t\t\tif (eat('+'))\r\n\t\t\t\t\t\tx += parseTerm(); // addition\r\n\t\t\t\t\telse if (eat('-'))\r\n\t\t\t\t\t\tx -= parseTerm(); // subtraction\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn x;\r\n\t\t\t\t}\r\n\t\t\t}", "public static String evaluate( String expr ) \n {\n\tString[] arr = expr.split(\"\\\\s+\");\n\tLLStack<String> nums = new LLStack<String>();\n\tLLStack<String> noClose = new LLStack<String>();\n\tint op = 0;\n\n\tfor(String i : arr){ \n\t if(i.equals(\")\")){ //when you reach the closing parenthesis\n\t\tString top = noClose.pop(); //start going through this part of the expression\n\t\tnums.push(i); //add ( to stack for unload\n\t\t\n\t\twhile(!top.equals(\"(\")){ //until you reach the (, where the expression ends\n\t\t\t \n\t\t if(top.equals(\"+\")) op = 1;\n\t\t else if(top.equals(\"-\")) op = 2;\n\t\t else if(top.equals(\"*\")) op = 3;\n\n\t\t else nums.push(top); //if it's not an operand\n\n\t\t top = noClose.pop();\n\t\t}\n\n\t\tnoClose.push(unload(op, nums));\n\t }\n\t \n\t else noClose.push(i); //pushed into a stack of what's in this ()\n \n\t}//end of for loop \n \n\treturn noClose.peek();\n }", "public static List<Element> Exp2Rpn(String expression) {\r\n\t\tList<String> tokenList = tokenize(expression);\r\n\t\tList<Element> rpn = new LinkedList<Element>();\r\n\t\tStack<Element> stack = new Stack<Element>();\r\n\r\n\t\tfor (String token : tokenList) {\r\n\t\t\tElement currentElement = string2Element(token);\r\n\r\n\t\t\tif (currentElement.isOperator()) {\r\n\t\t\t\twhile (!stack.empty() && precedence(stack.peek(), currentElement) == 1) {\r\n\t\t\t\t\trpn.add(stack.pop());\r\n\t\t\t\t}\r\n\t\t\t\tstack.push(currentElement);\r\n\t\t\t} else if (currentElement.isNumber()) {\r\n\t\t\t\trpn.add(currentElement);\r\n\t\t\t} else if (currentElement.isLeftParenthesis()) {\r\n\t\t\t\tstack.push(currentElement);\r\n\t\t\t} else if (currentElement.isRightParenthesis()) {\r\n\t\t\t\twhile (!stack.peek().isLeftParenthesis()) {\r\n\t\t\t\t\trpn.add(stack.pop());\r\n\t\t\t\t}\r\n\t\t\t\tstack.pop(); // pops '('\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twhile (!stack.empty()) {\r\n\t\t\trpn.add(stack.pop());\r\n\t\t}\r\n\r\n\t\treturn rpn;\r\n\t}", "public static String parseExpressionForOperator(String expression) {\n int space = expression.indexOf(\" \");\n String frac1 = expression.substring(0, space);\n String operator = expression.substring(space + 1, space + 2);\n return operator;\n }", "private void postfix(ExpressionNodes root, StringBuilder sb)\n\t {\n\t \tif (root.left != null) // if there is a left child\n\t \t{ \n\t \t\tpostfix(root.left, sb); // run recursive method\n\t \t}\n\t \t\n\t \tif (root.right != null) // if there is a right child\n\t \t{ \n\t \t\tpostfix(root.right, sb); // run recursive method \n\t \t}\n\t \t\n\t \t// add the string of this node to the the string builder \n\t \tsb.append(root.data);\n\t \t\n\t \t// add a space in between nodes for clarity.\n\t \tsb.append(\" \");\n\t }", "public int calculate(String s) {\n Deque<Integer> stack = new ArrayDeque<>();\n\n // Init\n int result = 0; // For the on-going result\n int sign = 1; // 1 means positive, -1 means negative\n int operand = 0;\n\n // 1 + 2 + 1\n // The tricky part is that we find an operator/sign first, then we know\n // the operand after that. We save the sign first, and when we evaluate the\n // expression so far, we use that sign.\n\n // Go through the expression string character by character.\n // Evaluate to the left when we find '+', '-', ')', or end of loop.\n // We use a stack when we find parenthesis.\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (Character.isDigit(c)) {\n // Form operand, since it could be more than one digit.\n operand = 10 * operand + (c - '0');\n } else if (c == '+') {\n // We can evaluate the expression to the left,\n // with result, sign, operand\n result += sign * operand;\n // Save the recently encountered '+' sign\n sign = 1;\n // Reset operand\n operand = 0;\n } else if (c == '-') {\n // We can evaluate the expression to the left,\n result += sign * operand;\n // Save the '-' sign.\n sign = -1;\n operand = 0;\n } else if (c == '(') {\n // Push the result so far and sign onto the stack, for later use.\n // We push the result first, then sign in the stack.\n stack.push(result);\n stack.push(sign);\n // Reset result, sign, and operand, as if new evaluation begins for the new\n // sub-expression\n result = 0;\n sign = 1;\n operand = 0;\n } else if (c == ')') {\n // We can evaluate the sub-expression to the left.\n result += sign * operand;\n // Now that we know the sub-expression ended, we can also evaluate to the left.\n // First we take the sign out of the stack, and then add the result we saved\n // before to the result of the sub-expression.\n result *= stack.pop();\n result += stack.pop();\n // Reset sign and operand.\n sign = 1;\n operand = 0;\n }\n }\n\n // We need to evaluate again.\n result += sign * operand;\n\n return result;\n }", "public Double postfixEvaluate(String postfix) {\r\n\t \tStack<Double> valueStack = new Stack<Double> ();\r\n\t\t\r\n\t\t@SuppressWarnings(\"resource\")\r\n\t\tScanner tokens = new Scanner(postfix);\r\n\t\t\r\n\t\twhile (tokens.hasNext()) {\r\n\t\t\tif (tokens.hasNextInt()) {\r\n\t\t\t\tvalueStack.push(tokens.nextDouble());\r\n\t\t\t} else {\r\n\t\t\t\tdouble operandTwo = valueStack.pop();\r\n\t\t\t\tdouble operandOne = valueStack.pop();\r\n\t\t\t\tString function = tokens.next();\r\n\t\t\t\t\r\n\t\t\t\t switch (function)\r\n\t\t\t\t {\r\n\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t\t case \"+\":\r\n\t\t\t\t \tvalueStack.push(operandOne + operandTwo);\r\n\t\t\t\t \tbreak;\r\n\t\t\t\t case \"-\":\r\n\t\t\t\t \tvalueStack.push(operandOne - operandTwo);\r\n\t\t\t\t \tbreak;\r\n\t\t\t\t case \"*\":\r\n\t\t\t\t \tvalueStack.push(operandOne * operandTwo);\r\n\t\t\t\t \tbreak;\r\n\t\t\t\t case \"/\":\r\n\t\t\t\t \tvalueStack.push(operandOne / operandTwo);\r\n\t\t\t\t \tbreak;\r\n\t\t\t\t case \"^\":\r\n\t\t\t\t \tvalueStack.push( (double) Math.pow(operandOne, operandTwo));\r\n\t\t\t\t \tbreak;\r\n\t\t\t\t \t//working on decimal point calculations. also give it a precedence of 4\r\n\t\t\t\t case \".\":\r\n\t\t\t\t \tdouble temp = operandTwo/10;\r\n\t\t\t\t \tvalueStack.push(operandOne = (temp + operandOne));\r\n\t\t\t\t \tbreak;\r\n\t\t\t\t \r\n\t\t\t\t default:\r\n\t\t\t\t break;\r\n\t\t\t\t }// end of switch\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t}// end of else\r\n\t\t}// end of while\r\n\t\treturn valueStack.peek();\r\n }", "public void visit(PostfixExpression n) {\n n.f0.accept(this);\n n.f1.accept(this);\n }", "private static String evaluate(ArrayList<String> operators, ArrayList<String> operands) {\n\n /* Check for valid input. There should be one more operand than operator. */\n if (operands.size() != operators.size()+1)\n return \"Invalid Input\";\n\n String current;\n int value;\n int numMultiply = 0;\n int numAdd = 0;\n int currentOperator = 0;\n\n /* Get the number of multiplications in the operators list. */\n for (int i = 0; i < operators.size(); i++) {\n\n if (operators.get(i).equals(\"*\"))\n numMultiply++;\n }\n\n /* Get the number of addition and subtraction in the operators list. */\n for (int i = 0; i < operators.size(); i++) {\n\n if (operators.get(i).equals(\"-\") || operators.get(i).equals(\"+\"))\n numAdd++;\n }\n\n /* Evaluate multiplications first, from left to right. */\n while (numMultiply > 0){\n\n current = operators.get(currentOperator);\n if (current.equals(\"*\")) {\n\n /* When multiplication is found in the operators, get the associative operands from the operands list.\n Associative operands are found in the operands list at indexes current operator and current operator + 1.\n */\n value = Integer.parseInt(operands.get(currentOperator)) * Integer.parseInt(operands.get(currentOperator+1));\n\n /* Remove the operands and the operator since they have been evaluated and add the evaluated answer back in the operands. */\n operators.remove(currentOperator);\n operands.remove(currentOperator);\n operands.remove(currentOperator);\n operands.add(currentOperator, Integer.toString(value));\n\n numMultiply--;\n }\n else\n currentOperator++;\n }\n\n currentOperator = 0;\n\n /* Next evaluate the addition and subtraction, from left to right. */\n while (numAdd > 0){\n current = operators.get(currentOperator);\n if (current.equals(\"+\")) {\n\n value = Integer.parseInt(operands.get(currentOperator)) + Integer.parseInt(operands.get(currentOperator+1));\n operators.remove(currentOperator);\n operands.remove(currentOperator);\n operands.remove(currentOperator);\n operands.add(currentOperator, Integer.toString(value));\n numAdd--;\n }\n\n else if (current.equals(\"-\")) {\n\n value = Integer.parseInt(operands.get(currentOperator)) - Integer.parseInt(operands.get(currentOperator+1));\n operators.remove(currentOperator);\n operands.remove(currentOperator);\n operands.remove(currentOperator);\n operands.add(currentOperator, Integer.toString(value));\n numAdd--;\n }\n else\n currentOperator++;\n }\n\n /* When all the operations have been evaluated, the final answer will be in the first element of the operands list. */\n return operands.get(0);\n }", "static String infixToRP(String[] str){\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tStack<String> s = new Stack<String>();\n\t\t\t\n\t\t\tfor(int i=0; i<str.length ; i++){\n\t\t\t\tif(str[i] == \"(\"){\n\t\t\t\t\ts.push(\"(\");\n\t\t\t\t}\n\t\t\t\telse if(str[i] == \")\"){\n\t\t\t\t\twhile(!s.isEmpty()){\n\t\t\t\t\t\tString temp = s.pop();\n\t\t\t\t\t\tif(temp == \"(\"){\n\t\t\t\t\t\t\ts.push(\"(\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsb.append(temp);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(str[i] == \"+\" || str[i] == \"-\"){\n\t\t\t\t\tString top = s.peek();\n\t\t\t\t\tif(top == \"/\" || top == \"*\"||top == \"(\"){\n\t\t\t\t\t\tsb.append(str[i]);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ts.push(str[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tString top = s.peek();\n\t\t\t\t\tif(top == \"+\" || top == \"-\"){\n\t\t\t\t\t\ts.push(str[i]);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsb.append(str[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn sb.toString();\n\t\t}", "public void postfix(TokenType token, int precedence) {\n register(token, new PostfixOperatorParselet(precedence));\n }", "public String postfix()\n\t {\n\t \t// create an empty string builder // \n\t \tStringBuilder sb = new StringBuilder();\n\t \t\n\t \t// fill the string builder//\n\t \tpostfix(root, sb);\n\t \t\n\t \treturn sb.toString().trim();\n\t }", "public static int Evaluate(String post){\n\t\tObjectStack postfix =new ObjectStack();\n\t\t\n\t\tfor (int i = 0; i < post.length(); i++) {\n\t\t\tchar ch = post.charAt(i);\n\t\t\tif (ch >= '0' && ch <= '9') {\n\t\t\t\tint number = ch - '0';\n\t\t\t\tpostfix.push(number);\n\t\t\t} else if ((ch == '*' || ch == '/' || ch == '+' || ch == '-' || ch == '^')) {\n\t\t\t\tint top2 = (Integer) postfix.pop();\n\t\t\t\tint top1 = (Integer) postfix.pop();\n\t\t\t\tchar operator = ch;\n\t\t\t\tif (operator == '+')\n\t\t\t\t\tpostfix.push(top1 + top2);\n\t\t\t\telse if (operator == '-')\n\t\t\t\t\tpostfix.push(top1 - top2);\n\t\t\t\telse if (operator == '*')\n\t\t\t\t\tpostfix.push(top1 * top2);\n\t\t\t\telse if (operator == '/')\n\t\t\t\t\tpostfix.push(top1 / top2);\n\t\t\t\telse if (operator == '^')\n\t\t\t\t\tpostfix.push((int) Math.pow(top1, top2));\n\t\t\t}\n\t\t}\n\t\treturn (Integer) postfix.pop();\n\t\n}", "public final void rule__AstExpressionUnary__ExpressionAssignment_0_2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:25471:1: ( ( ruleAstExpressionPostfix ) )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:25472:1: ( ruleAstExpressionPostfix )\n {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:25472:1: ( ruleAstExpressionPostfix )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:25473:1: ruleAstExpressionPostfix\n {\n before(grammarAccess.getAstExpressionUnaryAccess().getExpressionAstExpressionPostfixParserRuleCall_0_2_0()); \n pushFollow(FOLLOW_ruleAstExpressionPostfix_in_rule__AstExpressionUnary__ExpressionAssignment_0_251177);\n ruleAstExpressionPostfix();\n\n state._fsp--;\n\n after(grammarAccess.getAstExpressionUnaryAccess().getExpressionAstExpressionPostfixParserRuleCall_0_2_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public void operator(String str) {\n if (!(emptyStack()) && (OperatorOperand.operatorPrecedence(str)\n <= OperatorOperand.operatorPrecedence(expStack.lastElement()))) {\n String stackTop = expStack.lastElement();\n while ((!(stackTop.equals(\"(\"))) || (OperatorOperand.operatorPrecedence(str)\n <= OperatorOperand.operatorPrecedence(expStack.lastElement()))) {\n postFix.add(stackTop);\n expStack.pop();\n if (!(emptyStack())) {\n stackTop = expStack.lastElement();\n continue;\n }\n break;\n }\n }\n expStack.push(str);\n }", "private boolean postFixEvalution(char operator) throws ArithmeticException{\n //Pre: Validar que el stack no este vacio y que los operandos sean numeros.\n //Post: Realizar la operacion indicada\n try{\n if(!stack.empty()){\n //Se obtienen los dos operandos mas recientes del stack.\n Integer op2 = stack.pop();\n Integer op1 = stack.pop();\n\n //Se determina la operacion por hacer.\n if(op1 != null && op2 != null){\n switch (operator){\n case '+':\n stack.push(op1 + op2);\n break;\n case '-':\n stack.push(op1 - op2);\n break;\n case '*':\n stack.push(op1 * op2);\n break;\n case '/':\n stack.push(op1 / op2);\n break;\n }\n return true;\n }\n else\n return false;\n }\n else{\n return false;\n }\n }\n catch (ArithmeticException e){\n String ex = \"Error: Division por 0\";\n throw new ArithmeticException(ex);\n }\n }", "public final EObject ruleUnaryExpression() throws RecognitionException {\n EObject current = null;\n\n EObject this_PostfixExpression_0 = null;\n\n Enumerator lv_operator_2_0 = null;\n\n EObject lv_operand_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:4071:6: ( (this_PostfixExpression_0= rulePostfixExpression | ( () ( (lv_operator_2_0= ruleUnaryOperator ) ) ( (lv_operand_3_0= rulePostfixExpression ) ) ) ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:4072:1: (this_PostfixExpression_0= rulePostfixExpression | ( () ( (lv_operator_2_0= ruleUnaryOperator ) ) ( (lv_operand_3_0= rulePostfixExpression ) ) ) )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:4072:1: (this_PostfixExpression_0= rulePostfixExpression | ( () ( (lv_operator_2_0= ruleUnaryOperator ) ) ( (lv_operand_3_0= rulePostfixExpression ) ) ) )\n int alt60=2;\n int LA60_0 = input.LA(1);\n\n if ( ((LA60_0>=RULE_ID && LA60_0<=RULE_STRING)||LA60_0==13||LA60_0==25||LA60_0==33||(LA60_0>=55 && LA60_0<=57)||(LA60_0>=76 && LA60_0<=77)) ) {\n alt60=1;\n }\n else if ( (LA60_0==61||LA60_0==74) ) {\n alt60=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"4072:1: (this_PostfixExpression_0= rulePostfixExpression | ( () ( (lv_operator_2_0= ruleUnaryOperator ) ) ( (lv_operand_3_0= rulePostfixExpression ) ) ) )\", 60, 0, input);\n\n throw nvae;\n }\n switch (alt60) {\n case 1 :\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:4073:5: this_PostfixExpression_0= rulePostfixExpression\n {\n \n currentNode=createCompositeNode(grammarAccess.getUnaryExpressionAccess().getPostfixExpressionParserRuleCall_0(), currentNode); \n \n pushFollow(FOLLOW_rulePostfixExpression_in_ruleUnaryExpression6936);\n this_PostfixExpression_0=rulePostfixExpression();\n _fsp--;\n\n \n current = this_PostfixExpression_0; \n currentNode = currentNode.getParent();\n \n\n }\n break;\n case 2 :\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:4082:6: ( () ( (lv_operator_2_0= ruleUnaryOperator ) ) ( (lv_operand_3_0= rulePostfixExpression ) ) )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:4082:6: ( () ( (lv_operator_2_0= ruleUnaryOperator ) ) ( (lv_operand_3_0= rulePostfixExpression ) ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:4082:7: () ( (lv_operator_2_0= ruleUnaryOperator ) ) ( (lv_operand_3_0= rulePostfixExpression ) )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:4082:7: ()\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:4083:5: \n {\n \n temp=factory.create(grammarAccess.getUnaryExpressionAccess().getUnaryExpressionAction_1_0().getType().getClassifier());\n current = temp; \n temp = null;\n CompositeNode newNode = createCompositeNode(grammarAccess.getUnaryExpressionAccess().getUnaryExpressionAction_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:4093:2: ( (lv_operator_2_0= ruleUnaryOperator ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:4094:1: (lv_operator_2_0= ruleUnaryOperator )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:4094:1: (lv_operator_2_0= ruleUnaryOperator )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:4095:3: lv_operator_2_0= ruleUnaryOperator\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getUnaryExpressionAccess().getOperatorUnaryOperatorEnumRuleCall_1_1_0(), currentNode); \n \t \n pushFollow(FOLLOW_ruleUnaryOperator_in_ruleUnaryExpression6972);\n lv_operator_2_0=ruleUnaryOperator();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getUnaryExpressionRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"operator\",\n \t \t\tlv_operator_2_0, \n \t \t\t\"UnaryOperator\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:4117:2: ( (lv_operand_3_0= rulePostfixExpression ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:4118:1: (lv_operand_3_0= rulePostfixExpression )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:4118:1: (lv_operand_3_0= rulePostfixExpression )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:4119:3: lv_operand_3_0= rulePostfixExpression\n {\n \n \t currentNode=createCompositeNode(grammarAccess.getUnaryExpressionAccess().getOperandPostfixExpressionParserRuleCall_1_2_0(), currentNode); \n \t \n pushFollow(FOLLOW_rulePostfixExpression_in_ruleUnaryExpression6993);\n lv_operand_3_0=rulePostfixExpression();\n _fsp--;\n\n\n \t if (current==null) {\n \t current = factory.create(grammarAccess.getUnaryExpressionRule().getType().getClassifier());\n \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t }\n \t try {\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"operand\",\n \t \t\tlv_operand_3_0, \n \t \t\t\"PostfixExpression\", \n \t \t\tcurrentNode);\n \t } catch (ValueConverterException vce) {\n \t\t\t\thandleValueConverterException(vce);\n \t }\n \t currentNode = currentNode.getParent();\n \t \n\n }\n\n\n }\n\n\n }\n\n\n }\n break;\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 int evaluate(String expression) {\n\t\tStack oPSt = new Stack();\n\t\tfor (int i = 0; i < expression.length(); i++) {\n\t\t\tString x = expression.substring(i, i + 1);\n\t\t\tStringBuilder longIntegers = new StringBuilder();\n\t\t\tif (x.equals(\" \"))\n\t\t\t\tcontinue;\n\t\t\telse {\n\t\t\t\tint counter = 0;\n\t\t\t\twhile (counter + i < expression.length()\n\t\t\t\t\t\t&& !expression.substring(i + counter, i + counter + 1).equals(\" \")) {\n\t\t\t\t\tlongIntegers.append(expression.substring(i + counter, i + 1 + counter));\n\t\t\t\t\tcounter++;\n\t\t\t\t}\n\t\t\t\ti = i + counter;\n\t\t\t}\n\t\t\tx = longIntegers.toString();\n\t\t\tif (isNum(x)) {\n\t\t\t\toPSt.push(Float.parseFloat(x));\n\t\t\t} else if (x.equals(\"*\") || x.equals(\"+\") || x.equals(\"/\") || x.equals(\"-\")) {\n\t\t\t\tFloat num1 = (Float) oPSt.pop(), num2 = (Float) oPSt.pop();\n\t\t\t\tif (x.equals(\"+\"))\n\t\t\t\t\toPSt.push(num1 + num2);\n\t\t\t\telse if (x.equals(\"*\"))\n\t\t\t\t\toPSt.push(num1 * num2);\n\t\t\t\telse if (x.equals(\"/\"))\n\t\t\t\t\toPSt.push(num2 / num1);\n\t\t\t\telse\n\t\t\t\t\toPSt.push(num2 - num1);\n\t\t\t} else\n\t\t\t\tthrow new RuntimeException(\"Invalid Input\");\n\n\t\t}\n\t\tif (oPSt.size() == 0)\n\t\t\treturn 0;\n\t\treturn (int)Math.round((Float) oPSt.pop());\n\t}", "public interface Expression {\n\t\n\t/**\n\t * Evaluates an arithmetic expression.\n\t * \n\t * @return the value to which this expression evaluates\n\t */\n\tdouble eval();\n\t\n\t/**\n\t * Creates a String representation of an arithmetic expression.\n\t * \n\t * @return this expression in standard form, suitable for inclusion\n\t * in a program or text document (e.g., \"(2 - 4 * (7 + 2))\"). Note\n\t * that the string can have \"unnecessary\" parentheses as this (toy)\n\t * system does not know about operator precedence. \n\t */\n\tString toString();\n\n}", "public static UnaryExpression decrement(Expression expression) { throw Extensions.todo(); }", "public CustomQueue<String> calculate (CustomQueue<String> infixQueue){\r\n InfixToPostfixConverter converter = new InfixToPostfixConverter();\r\n \r\n CustomQueue<String> postFix = converter.convertToPostFix(infixQueue);\r\n CustomQueue<String> result = evaluatePostFix(postFix);\r\n return result;\r\n }", "Double postfixCalc(PostFixReturn returnValue){\r\n //data initialization\r\n Stack<Character> input = returnValue.postFix;\r\n\r\n char event;\r\n Stack<Double> Values = new Stack<>();\r\n String numStr=\"\";\r\n double number1,number2,number;\r\n double result = 0.0000;\r\n Long temp;\r\n //main loop\r\n while (!input.empty()){\r\n //detects numerics and converts it into doubles and place it within stack\r\n if(input.peek()=='|'){\r\n input.pop();\r\n while(input.peek()!='|'){\r\n Character c = input.pop();\r\n numStr += c;\r\n }\r\n input.pop();\r\n //detects strings as keys\r\n if(map.containsKey(numStr)){\r\n number = map.get(numStr);\r\n }\r\n else {\r\n number = Double.valueOf(numStr);\r\n }\r\n// number = Double.valueOf(numStr);\r\n Values.push(number);\r\n numStr = deleteString();\r\n }\r\n // checks operand and uses the last 2 numerics as input\r\n else if(operator(input.peek())){\r\n //checks events and does calculations\r\n event = input.pop();\r\n number1= Values.pop();\r\n System.out.println(\"Operand1: \" + number1);\r\n number2 = Values.pop();\r\n System.out.println(\"Operand2: \" + number2);\r\n System.out.println(\"Operator: \" + event);\r\n if (event == '+'){\r\n result = number2 + number1;\r\n }\r\n else if (event == '-'){\r\n result = number2 - number1;\r\n }\r\n else if (event == '*'){\r\n result = number2 * number1;\r\n }\r\n else if (event == '/'){\r\n result = number2 / number1;\r\n }\r\n else if (event == '^') {\r\n result = Math.pow(number2, number1);\r\n }\r\n System.out.println(\"result: \"+result);\r\n Values.push(result);\r\n }\r\n\r\n else{\r\n input.pop();\r\n }\r\n }\r\n result = Values.pop();\r\n //places into hashmap\r\n if (returnValue.status){\r\n map.put(returnValue.key,result);\r\n }\r\n\r\n return result;\r\n }", "private double processExpression() throws ParsingException {\n double result = processTerm();\n\n while (true) {\n if (tryCaptureChar('+')) {\n result += processTerm();\n } else if (tryCaptureChar('-')) {\n result -= processTerm();\n } else {\n break;\n }\n }\n return result;\n }", "public List<Token> InfixToPostfixConverter(List<Token> tokenList){\n ArrayDeque<Token> stack = new ArrayDeque<Token>(); \n List<Token> output = new ArrayList<Token>(); \n\n for (Token token : tokenList){\n if (token instanceof Polynomial)\n output.add(token); \n else if (token instanceof OpenParenthesis)\n stack.push(token); \n else if (token instanceof CloseParenthesis){\n while (!stack.isEmpty() && !(stack.peek() instanceof OpenParenthesis))\n output.add(stack.pop()); \n if (stack.isEmpty()){ \n throw new PolyFormatException(\"Mismatched right parenthesis\");\n }\n stack.pop(); // throw away left parenthesis\n }\n else if (token instanceof Operator){\n Operator tokenOperator = (Operator) token; // cast Token to Operator\n Operator peekStackOp = new AddOperator();\n if (!(stack.peek() instanceof OpenParenthesis))\n peekStackOp = (Operator) stack.peek(); // cast Token to Operator\n while (!stack.isEmpty() && !(stack.peek() instanceof OpenParenthesis)\n && (peekStackOp.getPriority() >= tokenOperator.getPriority()))\n output.add(stack.pop()); \n stack.push(token);\n }\n }\n // empty out the stack at the end \n\n while (!stack.isEmpty()){\n Token token = stack.pop(); \n if (token instanceof OpenParenthesis){\n throw new PolyFormatException(\"Mismatched left parenthesis\");\n }\n output.add(token); \n }\n\n return output;\n }", "@Test\n public void unaryTest() {\n UnaryOperator<String> postfix = (a) -> a + \"postfix\";\n UnaryOperator<Integer> increment = (a) -> a + 1;\n\n Assert.assertEquals(\"valuepostfix\", postfix.apply(\"value\"));\n Assert.assertEquals(new Integer(2), increment.apply(1));\n }", "public final Expr addExpr() throws RecognitionException {\r\n Expr result = null;\r\n\r\n int addExpr_StartIndex = input.index();\r\n\r\n Token op=null;\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, 15) ) { 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:121:5: (lhs= mulExpr (op= ( '+' | '-' ) rhs= mulExpr )* )\r\n // C:\\\\Users\\\\caytekin\\\\Documents\\\\GitHub\\\\sea-of-ql\\\\caytekin\\\\QLJava/src/org/uva/sea/ql/parser/antlr/QL.g:121:9: lhs= mulExpr (op= ( '+' | '-' ) rhs= mulExpr )*\r\n {\r\n pushFollow(FOLLOW_mulExpr_in_addExpr674);\r\n lhs=mulExpr();\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:121:46: (op= ( '+' | '-' ) rhs= mulExpr )*\r\n loop10:\r\n do {\r\n int alt10=2;\r\n int LA10_0 = input.LA(1);\r\n\r\n if ( ((LA10_0 >= 24 && LA10_0 <= 25)) ) {\r\n alt10=1;\r\n }\r\n\r\n\r\n switch (alt10) {\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:121:48: op= ( '+' | '-' ) rhs= mulExpr\r\n \t {\r\n \t op=(Token)input.LT(1);\r\n\r\n \t if ( (input.LA(1) >= 24 && input.LA(1) <= 25) ) {\r\n \t input.consume();\r\n \t state.errorRecovery=false;\r\n \t state.failed=false;\r\n \t }\r\n \t else {\r\n \t if (state.backtracking>0) {state.failed=true; return result;}\r\n \t MismatchedSetException mse = new MismatchedSetException(null,input);\r\n \t throw mse;\r\n \t }\r\n\r\n\r\n \t pushFollow(FOLLOW_mulExpr_in_addExpr692);\r\n \t rhs=mulExpr();\r\n\r\n \t state._fsp--;\r\n \t if (state.failed) return result;\r\n\r\n \t if ( state.backtracking==0 ) { \r\n \t if ((op!=null?op.getText():null).equals(\"+\")) {\r\n \t result = new Add(result, rhs);\r\n \t }\r\n \t if ((op!=null?op.getText():null).equals(\"-\")) {\r\n \t result = new Sub(result, rhs); \r\n \t }\r\n \t }\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop10;\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, 15, addExpr_StartIndex); }\r\n\r\n }\r\n return result;\r\n }", "private int parseExpression(Queue<String> exp) {\n int value = parseTerm(exp);\n while (exp.peek().equals(\"+\") || exp.peek().equals(\"-\")) {\n String op = exp.dequeue().getData().toString();\n if (op.equals(\"+\")) {\n value = value + parseTerm(exp);\n } else {\n value = value - parseTerm(exp);\n }\n }\n return value;\n }", "public boolean postfix_expr(PostfixExpr pe) {\n \n if (lexer.token == Symbol.IDENT) {\n Symbol temp = lexer.checkNextToken();\n if (temp == Symbol.LPAR) {\n return call_expr(pe);\n } else {\n return primary(pe);\n }\n } else {\n return primary(pe);\n }\n }", "public String inToPost(String userInput){\n // Pre-Check for Valid Expression:\n if(!validate(userInput)){\n return \"Error!\";\n }\n\n StringBuffer postfixInput = new StringBuffer(userInput.length());\n Stack<Character> stack = new Stack<Character>();\n char ch;\n int inputLength = userInput.length();\n\n // Adaptation of the Shunting Yard Algorithm:\n for(int i = 0; i < inputLength; i++){\n ch = userInput.charAt(i);\n\n if(ch == ' '){\n // Do nothing\n }\n else if(isOperand(ch) || ch == '.'){\n postfixInput.append(ch);\n }\n else if(ch == '('){\n stack.push(ch);\n }\n else if(ch == ')'){\n while((!stack.isEmpty()) && (stack.peek() != '(')){\n postfixInput.append(stack.pop());\n }\n\n if(!stack.isEmpty()){\n stack.pop();\n }\n else{\n return \"Parentheses Error!\";\n }\n }\n else if(isOperator(ch)){\n postfixInput.append(' ');\n\n while((!stack.isEmpty()) && (getPrecedence(stack.peek()) >= getPrecedence(ch))){\n postfixInput.append(stack.pop());\n }\n\n stack.push(ch);\n }\n else{\n return \"Input Error!\";\n }\n }\n\n while(!stack.isEmpty()){\n postfixInput.append(stack.pop());\n }\n\n String finalAnswer = postfixInput.toString();\n return solve(finalAnswer);\n }", "public static int calculator(String expression) {\n int res = 0;\n char[] arr = expression.toCharArray();\n Integer operand = null;\n char operator = '+';\n int[] index = new int[1];\n for (int i = 0; i < arr.length; i++) {\n index[0] = i;\n if (!Character.isDigit(arr[i])) {\n operator = arr[i];\n } else {\n operand = getOperand(arr, index);\n i = index[0] - 1;\n if (operator == '+') {\n res = res + operand;\n } else if (operator == '-') {\n res = res - operand;\n }\n }\n }\n return res;\n }", "@Override\r\n\tpublic int evaluate(String expression) {\r\n\t\tString e =expression;\r\n\t\tfloat result=0; //the returned result \r\n\t\tif(e.length()==2) {\r\n\t\t\te = removespaces(e);\r\n\t\t\tint z =Integer.parseInt(e);\r\n\t\t\treturn z;\r\n\t\t}\r\n\t\tfor(int i =0 ;i<expression.length();i++){\r\n\t\t\tif(Character.isLetter(e.charAt(i))){\r\n\t\t\t\tthrow new RuntimeException(\"You Can't evaluate letters\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i =0 ;i<expression.length()-1;i++) {\r\n\t\t\twhile(e.charAt(i) != '+' &&e.charAt(i) != '/' &&e.charAt(i) != '-' &&e.charAt(i) != '*' ) {\r\n\t\t\t\tint j = 0;\r\n\t\t\t\twhile(e.charAt(i) != ' ' ) {\r\n\t\t\t\t\tj++;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t\tif(j>0) {\r\n\t\t\t\t\tString k = e.substring(i-j, i);\r\n\t\t\t\t\tk = removespaces(k);\r\n\t\t\t\t\tfloat z = Integer.parseInt(k);\r\n\t\t\t\t\topr.push(z);}\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\tif(e.charAt(i)== '+') {\r\n\t\t\t\tfloat x = (float)opr.pop();\r\n\t\t\t\tresult = (float)opr.pop();\r\n\t\t\t\tresult = result + x;\r\n\t\t\t\topr.push(result);\r\n\t\t\t}\r\n\t\t\telse if(e.charAt(i)== '*') {\r\n\t\t\t\tfloat x = (float)opr.pop();\r\n\t\t\t\tresult = (float)opr.pop();\r\n\t\t\t\tresult = result * x;\r\n\t\t\t\topr.push(result);\r\n\t\t\t}\r\n\t\t\telse if(e.charAt(i)== '-') {\r\n\t\t\t\tfloat x = (float)opr.pop();\r\n\t\t\t\tresult = (float)opr.pop();\r\n\t\t\t\tresult = result - x;\r\n\t\t\t\topr.push(result);\r\n\t\t\t}\r\n\t\t\telse if(e.charAt(i)== '/') {\r\n\t\t\t\tfloat x = (float)opr.pop();\r\n\t\t\t\tresult = (float)opr.pop();\r\n\t\t\t\tresult = result / x;\r\n\t\t\t\topr.push(result);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\treturn (int)result;\r\n\r\n\t}", "public static int evaluate(String expression) {\n\n\t\tchar[] tokens = expression.toCharArray();\n\t\t// Stack for numbers: 'values'\n\t\tStack<Integer> values = new Stack<Integer>();\n\t\t// Stack for Operators: 'operators'\n\t\tStack<Character> operators = new Stack<Character>();\n\n\t\tfor (int i = 0; i < tokens.length; i++) {\n\t\t\t// Current token is a whitespace, skip it\n\t\t\tif (tokens[i] == ' ')\n\t\t\t\tcontinue;\n\t\t\t// Current token is a number, push it to stack for numbers\n\t\t\tif (tokens[i] >= '0' && tokens[i] <= '9') {\n\t\t\t\tStringBuffer stringBuffer = new StringBuffer();\n\t\t\t\t// There may be more than one digits in number\n\t\t\t\twhile (i < tokens.length && tokens[i] >= '0' && tokens[i] <= '9') {\n\t\t\t\t\tstringBuffer.append(tokens[i++]);\n\t\t\t\t}\n\t\t\t\tvalues.push(Integer.parseInt(stringBuffer.toString()));\n\t\t\t i--;\n\t\t\t} else if (tokens[i] == '(') {\n\t\t\t // Current token is an opening brace, push it to 'operators'\n\t\t\t\toperators.push(tokens[i]);\n\t\t\t} else if (tokens[i] == ')') {\n\t\t\t // Closing brace encountered, solve entire brace\n\t\t\t\twhile (operators.peek() != '(') {\n\t\t\t\t values.push(applyOperation(operators.pop(), values.pop(), values.pop()));\n\t\t\t }\n\t\t\t\toperators.pop();\n\t\t\t} else if (tokens[i] == '+' || tokens[i] == '-' ||tokens[i] == '*' || tokens[i] == '/') {\n\t\t\t // Current token is an operator.\n\t\t\t\twhile (!operators.empty() && hasPrecedence(tokens[i], operators.peek())) {\n\t\t\t\t values.push(applyOperation(operators.pop(), values.pop(),values.pop()));\n\t\t\t // System.out.println(values.peek());\n\t\t\t }\n\t\t\t\t// Push current token to 'operators'.\n\t\t\t\toperators.push(tokens[i]);\n\t\t\t}\n\t\t}\n\t\t// Entire expression has been parsed at this point, apply remaining operators to remaining values\n\t\twhile (!operators.empty()) {\n\t\t\tvalues.push(applyOperation(operators.pop(), values.pop(), values.pop()));\n\t\t}\n\t\t// Top of 'values' contains result, return it\n\t\treturn values.pop();\n\t}", "Unary expr(Expr e);", "private double parseExpression() {\n\t\tdouble value = parseTerm();\n\t\twhile (true) {\n\t\t\tif (token.getType().equals(Token.Type.PLUS)) { // addition\n\t\t\t\ttoken=lexer.getNextToken();\n\t\t\t\tvalue += parseTerm();\n\t\t\t} else if (token.getType().equals(Token.Type.MINUS)) { // subtraction\n\t\t\t\ttoken = lexer.getNextToken();\n\t\t\t\tvalue -= parseTerm();\n\t\t\t} else {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic String toInfixNotation() {\n\t\tint num;\n\t\tExpressionTree left, right;\n\n\t\ttry {\n\t\t\tnum = Integer.parseInt(EMPTY + this.getValue());\n\t\t\treturn EMPTY + num;\n\t\t}\n\t\tcatch(NumberFormatException n) {\n\t\t\tleft = new ExpressionTree(getLeft());\n\t\t\tright = new ExpressionTree(getRight());\n\t\t\t\n\t\t\treturn OPEN_PAREN + left.toInfixNotation() + SPACE + getValue() \n\t\t\t\t\t+ SPACE + right.toInfixNotation() + CLOSED_PAREN;\n\t\t}\n\t}", "@Override\n\tpublic String visitExpr(MicroParser.ExprContext ctx) {\n\t\tString prefix = visit(ctx.expr_prefix());\n\t\tString expr = prefix + visit(ctx.term());\n\t\t\n\t\t//System.out.println(\"in visit expr: \"+expr);\n\t\t//System.out.println(\"in visit expr: prefix is: \"+prefix);\n\t\tif((prefix.contentEquals(\"\"))) return expr;\n\t\tString op1, op2, result;\n\t\tString type = currentType;\n\t\tString[] ids = expr.split(\"\\\\-|\\\\+\");\n\t List<String> operands = new ArrayList<String>();\n\t List<Character> addops = new ArrayList<Character>();\n\t \n\t for(int i=0;i<expr.length();i++) {\n\t \tif(expr.charAt(i)=='+' || expr.charAt(i)=='-')\n\t \t\taddops.add(expr.charAt(i));\n\t }\n\t //create a list of addops\n\t \n\t //create a list of operands \n\t for(String i:ids) \n\t \t operands.add(i);\n\t \n\t op1 = operands.get(0);\n\t op2 = operands.get(1);\n\t temp = new Temporary(type);\n\t result = temp.fullName;\n\t tempList.addT(temp);\n\t //System.out.println(\"in visit expr, ops are: \"+op1+\" \"+ op2);\n\t //System.out.println(\"in visit expr, result is: \"+ result);\n\t if(addops.get(0)=='+') {\n\t \tglobalIR.addStmt(IRStatement.generateArithmetic(type, \"ADD\", op1, op2, result));\n\t \toperands.remove(0); operands.remove(0); addops.remove(0);\n\t }\n\t \t\n\t else {\n\t \tglobalIR.addStmt(IRStatement.generateArithmetic(type, \"SUB\", op1, op2, result));\n\t \toperands.remove(0); operands.remove(0); addops.remove(0);\n\t }\n\t \n\t \t\n\t if(operands.size()==0) return result;\n\t \n\t for(int i=0; i<operands.size();i++) {\n\t \top1 = result;\n\t \top2 = operands.get(i);\n\t \ttemp = new Temporary(type);\n\t \tresult = temp.fullName;\n\t \ttempList.addT(temp);\n\t \tif(addops.get(0)=='+') {\n\t\t \tglobalIR.addStmt(IRStatement.generateArithmetic(type, \"ADD\", op1, op2, result));\n\t\t \taddops.remove(0);\n\t \t}\n\t\t \t\n\t\t else {\n\t\t \tglobalIR.addStmt(IRStatement.generateArithmetic(type, \"SUB\", op1, op2, result));\n\t\t \taddops.remove(0);\n\t\t }\n\t\t \t\n\t }\n\t return result; \n\t\t\n\t}", "private IMathExpr parseOperator(String expr, MathBinOper operator,\r\n boolean processLeft2Right) throws InvalidMathExprException {\r\n int startPos, endPos, step;\r\n \r\n if (processLeft2Right) { // Parse expression forwards.\r\n startPos = 0;\r\n endPos = expr.length();\r\n step = 1;\r\n } else { // Parse expression backwards.\r\n startPos = expr.length() - 1;\r\n endPos = -1; // Going backwards, even 0 index counts.\r\n step = -1;\r\n }\r\n \r\n int i = startPos;\r\n while (i != endPos) {\r\n if (this.isOutsideOfBracket(expr, i)) {\r\n char c = expr.charAt(i);\r\n \r\n if (c == operator.getSign()) {\r\n IMathExpr left = new MathExpr(expr.substring(0, i));\r\n IMathExpr right = new MathExpr(expr.substring(i + 1,\r\n expr.length()));\r\n \r\n return MathBinOper.buildBinaryOper(operator, left, right);\r\n }\r\n }\r\n \r\n i += step;\r\n }\r\n \r\n return null;\r\n }", "public static UnaryExpression PostIncrementAssign(Expression expression, Method method) {\n return makeUnary(ExpressionType.PostIncrementAssign, expression, expression.getType(), method);\n }", "public Node expression()\r\n\t{\r\n\t\tNode lhs = term();\r\n\t\tif(lhs!=null)\r\n\t\t{\r\n\t\t\tint index = lexer.getPosition();\r\n\t\t\tLexer.Token token = lexer.getToken();\r\n\t\t\twhile(token == Lexer.Token.PLUS\r\n\t\t\t\t||token == Lexer.Token.MINUS)\r\n\t\t\t{\r\n\t\t\t\tNode rhs = term(); \r\n\t\t\t\tif(rhs!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(token == Lexer.Token.PLUS)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlhs = new Add(lhs,rhs);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(token == Lexer.Token.MINUS)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlhs = new Sub(lhs,rhs);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tindex = lexer.getPosition();\r\n\t\t\t\t\ttoken = lexer.getToken();\r\n\t\t\t\t}\r\n\t\t\t\telse break;\r\n\t\t\t}\r\n\t\t\tlexer.setPosition(index);\r\n\t\t}\r\n\t\treturn lhs;\r\n\t}", "public static UnaryExpression postDecrementAssign(Expression expression, Method method) {\n return makeUnary(ExpressionType.PostDecrementAssign, expression, expression.getType(),method);\n }", "private Object eval(SimpleExpr expr) {\n Object res = eval(expr.getExpr().get(0));\n\n for (int i = 1; i < expr.getExpr().size(); i++) {\n Object res2 = eval(expr.getExpr().get(i));\n String opt = expr.getOpt().get(i - 1);\n\n if (\"+\".equals(opt)) {\n if (res instanceof Double && res2 instanceof Double) {\n res = (Double) res + (Double) res2;\n } else if (res instanceof Double && res2 instanceof String) {\n res = \"\" + res + res2;\n } else if (res instanceof Boolean && res2 instanceof String) {\n res = \"\" + res + res2;\n } else if (res instanceof String && res2 instanceof String) {\n res = \"\" + res + res2;\n } else if (res instanceof String && res2 instanceof Double) {\n res = \"\" + res + res2;\n } else if (res instanceof String && res2 instanceof Boolean) {\n res = \"\" + res + res2;\n } else {\n throw new RaydenScriptException(\"Expression error: SimpleExpr error\");\n }\n } else if (\"-\".equals(opt)) {\n if (res instanceof Double && res2 instanceof Double) {\n res = (Double) res - (Double) res2;\n } else {\n throw new RaydenScriptException(\"Expression error: SimpleExpr error\");\n }\n } else {\n throw new RaydenScriptException(\"Expression error: Invalid operator '\" + opt + \"'.\");\n }\n }\n\n return res;\n }", "private String evaluateExpr(String expr){\n\t\t//bigdecimal used for long user inputs\n\t\tBigDecimal num1, num2, ans, temp = new BigDecimal(\"0\");\n\t\tint check = 1;\n\t\t//find the position of function\n\t\twhile(Character.isDigit(expr.charAt(check)) || expr.charAt(check) == '.')\n\t\t\tcheck++;\n\t\t//extract numbers from expression\n\t\tnum1 = new BigDecimal(expr.substring(0,check));\n\t\tnum2 = new BigDecimal(expr.substring(check + 1,expr.length()));\n\t\t//division by zero error\n\t\tif(num2.compareTo(temp) == 0 && expr.charAt(check) == '/')\n\t\t\treturn \"Invalid\";\n\t\t//evaluate functions\n\t\tif(expr.charAt(check) == '*')\n\t\t\tans = num1.multiply(num2);\n\t\telse if(expr.charAt(check) == '+')\n\t\t\tans = num1.add(num2);\n\t\telse if(expr.charAt(check) == '/')\n\t\t\tans = num1.divide(num2, MathContext.DECIMAL32);\n\t\telse\n\t\t\tans = num1.subtract(num2);\n\t\treturn ans.toString();\n\t}", "protected void operation(String operator){\n if (this.tail<2){\n this.arr[tail++] = this.value;\n this.arr[tail++] = operator;\n } else{\n if (this.peek() != \")\"){\n this.arr[this.tail++] = this.value;\n }\n this.arr[this.tail++] = operator;\n }\n this.value=\"\"; // reset tracking variables\n this.decimalUsed = false;\n }" ]
[ "0.76751375", "0.73644567", "0.7325168", "0.7259476", "0.72468233", "0.7172934", "0.7142685", "0.69703263", "0.6944551", "0.69337535", "0.68352497", "0.6802134", "0.67926496", "0.6760693", "0.6741181", "0.6724233", "0.6675502", "0.6672828", "0.6636893", "0.66261625", "0.6617741", "0.6585365", "0.65775985", "0.6550913", "0.6522098", "0.65115994", "0.64960325", "0.64669555", "0.6456763", "0.64492685", "0.64437175", "0.6406779", "0.6337824", "0.631972", "0.62998635", "0.6294201", "0.6292951", "0.6275346", "0.623625", "0.6175418", "0.61551535", "0.6137775", "0.6130364", "0.607933", "0.60764325", "0.60731053", "0.6034529", "0.601254", "0.596877", "0.59408784", "0.5922921", "0.5886686", "0.588032", "0.58694977", "0.58661497", "0.5846421", "0.58350676", "0.58308977", "0.58256984", "0.581745", "0.5815307", "0.5808857", "0.5787676", "0.5786866", "0.57803065", "0.57597405", "0.5759367", "0.5752274", "0.57350916", "0.57324994", "0.5722408", "0.57177347", "0.57089317", "0.5686131", "0.56504285", "0.5644338", "0.5628876", "0.5624574", "0.5620701", "0.5609506", "0.5599905", "0.55894494", "0.55795395", "0.5575024", "0.55749", "0.55659366", "0.55320203", "0.5529128", "0.5522096", "0.5494677", "0.54931", "0.54926425", "0.5481028", "0.54802364", "0.5468397", "0.54599476", "0.5457206", "0.54462236", "0.54425985", "0.5423005" ]
0.63084906
34
This method receives a string and an index and returns the next token starting at that index.
public String nextToken(String s, int start) { TokenBuilder token = new TokenBuilder(); char[] temp = s.toCharArray(); int count = start; if(Operator.isOperator(temp[start]) || Brackets.isLeftBracket(temp[start]) || Brackets.isRightBracket(temp[start])) { return temp[start] + ""; } while(count < temp.length && isOperand(temp[count] + "")) { token.append(temp[count]); count++; } return token.build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final public Token getToken(int index) {\n Token t = jj_lookingAhead ? jj_scanpos : token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) t = t.next;\n else t = t.next = token_source.getNextToken();\n }\n return t;\n }", "static final public Token getToken(int index) {\n Token t = token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) t = t.next;\n else t = t.next = token_source.getNextToken();\n }\n return t;\n }", "static final public Token getToken(int index) {\n Token t = token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) t = t.next;\n else t = t.next = token_source.getNextToken();\n }\n return t;\n }", "static final public Token getToken(int index) {\n Token t = token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) t = t.next;\n else t = t.next = token_source.getNextToken();\n }\n return t;\n }", "public String nextToken()\n\t{\n\t\tif (current >\tmax) return\t\"\";\n\t\t\n\t\tcurrentToken++;\n\t\t\n\t\tif (current == max) return str.substring(current,++current);\n\n\t\tint nextDel=this.str.indexOf(this.firstDelimiters, current);\n\t\t\n\t\tString returnString;\n\t\t\n\t\tif (nextDel < 0)\n\t\t{\n\t\t\treturnString=this.str.substring(current, this.str.length());\n\t\t\tcurrent=max+1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturnString=this.str.substring(current, nextDel);\n\t\t\tcurrent=nextDel+1;\n\t\t}\n\t\treturn returnString;\n\t}", "final public Token getToken(int index) {\n Token t = token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) t = t.next;\n else t = t.next = token_source.getNextToken();\n }\n return t;\n }", "final public Token getToken(int index) {\n Token t = token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) t = t.next;\n else t = t.next = token_source.getNextToken();\n }\n return t;\n }", "final public Token getToken(int index) {\n Token t = token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) t = t.next;\n else t = t.next = token_source.getNextToken();\n }\n return t;\n }", "final public Token getToken(int index) {\n Token t = token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) t = t.next;\n else t = t.next = token_source.getNextToken();\n }\n return t;\n }", "final public Token getToken(int index) {\n Token t = token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) t = t.next;\n else t = t.next = token_source.getNextToken();\n }\n return t;\n }", "final public Token getToken(int index) {\n Token t = token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) t = t.next;\n else t = t.next = token_source.getNextToken();\n }\n return t;\n }", "final public Token getToken(int index) {\n Token t = token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) t = t.next;\n else t = t.next = token_source.getNextToken();\n }\n return t;\n }", "final public Token getToken(int index) {\n Token t = token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) t = t.next;\n else t = t.next = token_source.getNextToken();\n }\n return t;\n }", "final public Token getToken(int index) {\n Token t = token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) t = t.next;\n else t = t.next = token_source.getNextToken();\n }\n return t;\n }", "final public Token getToken(int index) {\n Token t = token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) t = t.next;\n else t = t.next = token_source.getNextToken();\n }\n return t;\n }", "final public Token getToken(int index) {\n Token t = token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) t = t.next;\n else t = t.next = token_source.getNextToken();\n }\n return t;\n }", "final public Token getToken(int index) {\n Token t = token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) t = t.next;\n else t = t.next = token_source.getNextToken();\n }\n return t;\n }", "static final public Token getToken(int index) {\n Token t = token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) {\n t = t.next;\n } else {\n t = t.next = token_source.getNextToken();\n }\n }\n return t;\n }", "final public Token getToken(int index) {\r\n Token t = token;\r\n for (int i = 0; i < index; i++) {\r\n if (t.next != null) t = t.next;\r\n else t = t.next = token_source.getNextToken();\r\n }\r\n return t;\r\n }", "final public Token getToken(int index) {\r\n Token t = token;\r\n for (int i = 0; i < index; i++) {\r\n if (t.next != null) t = t.next;\r\n else t = t.next = token_source.getNextToken();\r\n }\r\n return t;\r\n }", "final public Token getToken(int index) {\r\n Token t = token;\r\n for (int i = 0; i < index; i++) {\r\n if (t.next != null) t = t.next;\r\n else t = t.next = token_source.getNextToken();\r\n }\r\n return t;\r\n }", "public Token nextToken() throws TokenNotFoundException {\n\n\t\tinputString = inputString.trim();\n\n\t\tif (pushBack) {\n\t\t\tpushBack = false;\n\t\t\treturn lastToken;\n\t\t}\n\n\t\tif (inputString.isEmpty()) {\n\t\t\treturn new Token(\"\", TokenType.EMPTY);\n\t\t}\n\n\t\tfor (TokenIdentifier tokenIdentifier: listTokenIdentifier) {\n\t\t\tMatcher matcher = tokenIdentifier.getPattern().matcher(inputString);\n\n\t\t\tif (matcher.find()) {\n\t\t\t\tString token = matcher.group().trim();\n\t\t\t\tinputString = matcher.replaceFirst(\"\");\n\n\t\t\t\tif (tokenIdentifier.getType() == TokenType.STRING_LITERAL){\n\t\t\t\t\tlastToken = new Token(token.substring(1, token.length()-1), TokenType.STRING_LITERAL);\n\t\t\t\t\treturn lastToken;\n\t\t\t\t} else {\n\t\t\t\t\tlastToken = new Token(token, tokenIdentifier.getType());\n\t\t\t\t\treturn lastToken;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// If token not matched by any token patterns\n\t\tthrow new TokenNotFoundException(inputString);\n\t}", "final public Token getToken(int index) {\n\t Token t = token;\n\t for (int i = 0; i < index; i++) {\n\t if (t.next != null) t = t.next;\n\t else t = t.next = token_source.getNextToken();\n\t }\n\t return t;\n }", "final public Token getToken(int index) {\n\t Token t = token;\n\t for (int i = 0; i < index; i++) {\n\t if (t.next != null) t = t.next;\n\t else t = t.next = token_source.getNextToken();\n\t }\n\t return t;\n }", "final public Token getToken(int index) {\n Token t = token;\n for (int i = 0; i < index; i++) {\n if (t.next != null) {\n t = t.next;\n } else {\n t = t.next = token_source.getNextToken();\n }\n }\n return t;\n }", "public Token nextToken() throws LexerException { \n \n trimWhitespaces();\n \n if(currentIndex > dataLength) {\n throw new LexerException(\"No more tokens! EOF!\");\n }\n \n if(currentIndex == dataLength) {\n token = new Token(TokenType.EOF, null);\n currentIndex++;\n return token;\n } \n \n if(data[currentIndex] == '#') {\n token = new Token(TokenType.SYMBOL, data[currentIndex]);\n \n currentIndex++;\n stringToken = new StringBuilder();\n \n return token;\n }\n \n if(state == LexerState.BASIC) {\n return nextTokenBasic();\n }\n return nextTokenExtended();\n }", "public String nextToken()\n {\n\n if (currentPosition >= maxPosition)\n {\n throw new NoSuchElementException();\n }\n\n int start = currentPosition;\n\n while ((currentPosition < maxPosition)\n && Character.isLetterOrDigit(str.charAt(currentPosition)))\n {\n currentPosition++;\n }\n\n if ((start == currentPosition)\n && (!Character.isLetterOrDigit(str.charAt(currentPosition))))\n {\n currentPosition++;\n }\n\n return str.substring(start, currentPosition);\n }", "public Token getNextToken() {\n\t\tToken token = null;\n\t\twhile (index < text.length() && token == null) {\n\t\t\tchar ch = text.charAt(index);\n\t\t\tif (isLetter(ch)) {\n\t\t\t\ttoken = readNameOrKeyword();\n\t\t\t}\n\t\t\telse if (isDigit(ch)) {\n\t\t\t\ttoken = readNumber();\n\t\t\t}\n\t\t\telse if (isOperator(ch)) {\n\t\t\t\ttoken = readOperator();\n\t\t\t}\n\t\t\telse if (ch == '\"') {\n\t\t\t\ttoken = readStringLiteral();\n\t\t\t}\n\t\t\telse if (this.isParenthesis(ch)) {\n\t\t\t\ttoken = new Token(TokenType.PARENTHESIS, \"\" + ch);\n\t\t\t}\n\t\t\telse if (this.isBracket(ch)) {\n\t\t\t\ttoken = new Token(TokenType.BRACKET, \"\" + ch);\n\t\t\t}\n\t\t\telse if (this.isBrace(ch)) {\n\t\t\t\ttoken = new Token(TokenType.BRACE, \"\" + ch);\n\t\t\t}\n\t\t\telse if (ch == ';') {\n\t\t\t\ttoken = new Token(TokenType.SEMICOLON, \"\" + ch);\n\t\t\t}\n\t\t\tindex += 1;\n\t\t}\n\t\treturn token;\n\t}", "private Token peekToken(int index) {\n return scanner.peekToken(index);\n }", "public static Token getNextToken() {\n Token matchedToken;\n int curPos = 0;\n\n EOFLoop:\n for (; ; ) {\n try {\n curChar = input_stream.BeginToken();\n } catch (java.io.IOException e) {\n jjmatchedKind = 0;\n jjmatchedPos = -1;\n matchedToken = jjFillToken();\n return matchedToken;\n }\n\n for (; ; ) {\n switch (curLexState) {\n case 0:\n try {\n input_stream.backup(0);\n while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)\n curChar = input_stream.BeginToken();\n } catch (java.io.IOException e1) {\n continue EOFLoop;\n }\n jjmatchedKind = 0x7fffffff;\n jjmatchedPos = 0;\n curPos = jjMoveStringLiteralDfa0_0();\n break;\n case 1:\n jjmatchedKind = 0x7fffffff;\n jjmatchedPos = 0;\n curPos = jjMoveStringLiteralDfa0_1();\n if (jjmatchedPos == 0 && jjmatchedKind > 10) {\n jjmatchedKind = 10;\n }\n break;\n }\n if (jjmatchedKind != 0x7fffffff) {\n if (jjmatchedPos + 1 < curPos)\n input_stream.backup(curPos - jjmatchedPos - 1);\n if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) {\n matchedToken = jjFillToken();\n if (jjnewLexState[jjmatchedKind] != -1)\n curLexState = jjnewLexState[jjmatchedKind];\n return matchedToken;\n } else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) {\n if (jjnewLexState[jjmatchedKind] != -1)\n curLexState = jjnewLexState[jjmatchedKind];\n continue EOFLoop;\n }\n if (jjnewLexState[jjmatchedKind] != -1)\n curLexState = jjnewLexState[jjmatchedKind];\n curPos = 0;\n jjmatchedKind = 0x7fffffff;\n try {\n curChar = input_stream.readChar();\n continue;\n } catch (java.io.IOException e1) {\n }\n }\n int error_line = input_stream.getEndLine();\n int error_column = input_stream.getEndColumn();\n String error_after = null;\n boolean EOFSeen = false;\n try {\n input_stream.readChar();\n input_stream.backup(1);\n } catch (java.io.IOException e1) {\n EOFSeen = true;\n error_after = curPos <= 1 ? \"\" : input_stream.GetImage();\n if (curChar == '\\n' || curChar == '\\r') {\n error_line++;\n error_column = 0;\n } else\n error_column++;\n }\n if (!EOFSeen) {\n input_stream.backup(1);\n error_after = curPos <= 1 ? \"\" : input_stream.GetImage();\n }\n throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);\n }\n }\n }", "public Token tokenAt(int i) {\n\treturn tokens[i];\n}", "private String getItemAt(String s, int index) {\n\t\tString temp = new String();\n\t\tStringTokenizer st = new StringTokenizer(s);\n\t\t\n\t\tif(index > st.countTokens()) {\n\t\t\tSystem.exit(-1);\n\t\t}\n\t\t\n\t\tfor(int j = 1; j<=index; j++) {\n\t\t\ttemp = st.nextToken();\n\t\t}\n\t\t\n\t\treturn temp;\n\t}", "LexedPair nextToken() {\n int oldInd = index;\n // end of input reached\n if (index >= length) {\n throw new NoSuchElementException();\n }\n char c = source.charAt(index);\n // brackets and delimiters and operators\n if (\"(){}+-*/\".indexOf(c) != -1) {\n index++;\n return new LexedPair(String.valueOf(c), TokenType.charToTok(c));\n }\n // only integers (floating point numbers are represented by fractions)\n else if (Character.isDigit(c)) {\n StringBuilder sb = new StringBuilder(String.valueOf(c));\n while (++index < length && Character.isDigit((c = source.charAt(index)))) {\n sb.append(c);\n }\n return new LexedPair(sb.toString(), TokenType.NUM);\n }\n // functions\n else if (c == '\\\\') {\n while (++index < length\n && (Character.isAlphabetic(source.charAt(index)) || source.charAt(index) == '_'));\n return new LexedPair(source.substring(oldInd, index), TokenType.FUNC);\n }\n\n return new LexedPair(\"error\", TokenType.NONE);\n }", "public static int nextIndexOf(String string, String characters, int index) {\n int retInd = string.length();\n int auxIndex = -1;\n \n for (int i = 0; i < characters.length(); i++) {\n auxIndex = string.substring(index + 1).indexOf(characters.charAt(i));\n if ((auxIndex > -1) && (auxIndex + index + 1 < retInd)) {\n retInd = auxIndex + index + 1;\n }\n }\n return retInd;\n }", "private Token nextToken() throws ParseException {\n String str;\n int line;\n int column;\n\n try {\n lastMatch.clear();\n stringDfaMatcher.match(buffer, lastMatch);\n nfaMatcher.match(buffer, lastMatch);\n regExpMatcher.match(buffer, lastMatch);\n if (lastMatch.length() > 0) {\n line = buffer.lineNumber();\n column = buffer.columnNumber();\n str = buffer.read(lastMatch.length());\n return newToken(lastMatch.pattern(), str, line, column);\n } else if (buffer.peek(0) < 0) {\n return null;\n } else {\n line = buffer.lineNumber();\n column = buffer.columnNumber();\n throw new ParseException(ParseException.UNEXPECTED_CHAR_ERROR,\n buffer.read(1),\n line,\n column);\n }\n } catch (IOException e) {\n throw new ParseException(ParseException.IO_ERROR,\n e.getMessage(),\n -1,\n -1);\n }\n }", "public Token nextToken() {\r\n\t\treturn tokens.get(nextTokenPos++);\r\n\t}", "public static Token getNextToken() \n{\n Token matchedToken;\n int curPos = 0;\n\n EOFLoop :\n for (;;)\n {\n try\n {\n curChar = input_stream.BeginToken();\n }\n catch(java.io.IOException e)\n {\n jjmatchedKind = 0;\n matchedToken = jjFillToken();\n return matchedToken;\n }\n\n for (;;)\n {\n switch(curLexState)\n {\n case 0:\n try { input_stream.backup(0);\n while (curChar <= 32 && (0x100002200L & (1L << curChar)) != 0L)\n curChar = input_stream.BeginToken();\n }\n catch (java.io.IOException e1) { continue EOFLoop; }\n jjmatchedKind = 0x7fffffff;\n jjmatchedPos = 0;\n curPos = jjMoveStringLiteralDfa0_0();\n break;\n case 1:\n jjmatchedKind = 0x7fffffff;\n jjmatchedPos = 0;\n curPos = jjMoveStringLiteralDfa0_1();\n if (jjmatchedPos == 0 && jjmatchedKind > 6)\n {\n jjmatchedKind = 6;\n }\n break;\n }\n if (jjmatchedKind != 0x7fffffff)\n {\n if (jjmatchedPos + 1 < curPos)\n input_stream.backup(curPos - jjmatchedPos - 1);\n if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)\n {\n matchedToken = jjFillToken();\n if (jjnewLexState[jjmatchedKind] != -1)\n curLexState = jjnewLexState[jjmatchedKind];\n return matchedToken;\n }\n else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)\n {\n if (jjnewLexState[jjmatchedKind] != -1)\n curLexState = jjnewLexState[jjmatchedKind];\n continue EOFLoop;\n }\n if (jjnewLexState[jjmatchedKind] != -1)\n curLexState = jjnewLexState[jjmatchedKind];\n curPos = 0;\n jjmatchedKind = 0x7fffffff;\n try {\n curChar = input_stream.readChar();\n continue;\n }\n catch (java.io.IOException e1) { }\n }\n int error_line = input_stream.getEndLine();\n int error_column = input_stream.getEndColumn();\n String error_after = null;\n boolean EOFSeen = false;\n try { input_stream.readChar(); input_stream.backup(1); }\n catch (java.io.IOException e1) {\n EOFSeen = true;\n error_after = curPos <= 1 ? \"\" : input_stream.GetImage();\n if (curChar == '\\n' || curChar == '\\r') {\n error_line++;\n error_column = 0;\n }\n else\n error_column++;\n }\n if (!EOFSeen) {\n input_stream.backup(1);\n error_after = curPos <= 1 ? \"\" : input_stream.GetImage();\n }\n throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);\n }\n }\n}", "public Token nextToken(){\n if(currentToken+1 >= tokens.size())\n return null; \n return tokens.get(++currentToken);\n }", "public Token getToken(int index) {\n return Token.cast(get(index));\n }", "public Token nextToken ()\n throws ParseException\n {\n return getNextToken();\n }", "Token next();", "public Token nextToken() {\n\t\tif(currentToken != null && currentToken.getType() == TokenType.EOF)\n\t\t\tthrow new LexerException(\"No more tokens\");\n\t\t\n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\twhile(currentIndex < text.length) {\n\t\t\tchar currentChar = text[currentIndex++];\n\t\t\t\n\t\t\tif(sb.length() == 0 && Character.isWhitespace(currentChar)) continue;\n\t\t\t\n\t\t\tif(sb.length() != 0 && Character.isWhitespace(currentChar))\n\t\t\t\tthrow new LexerException(\"Illegal token: \" + sb.toString());\n\t\t\t\n\t\t\tsb.append(currentChar);\n\t\t\t\n\t\t\tToken token = tokenize(sb.toString());\n\t\t\t\n\t\t\tif(token != null) {\n\t\t\t\tcurrentToken = token;\n\t\t\t\treturn token;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(sb.length() == 0) {\n\t\t\tcurrentToken = EOF_TOKEN;\n\t\t\treturn EOF_TOKEN;\n\t\t}\n\t\t\n\t\tthrow new LexerException(\"Illegal token: \" + sb.toString());\n\t}", "public Token getToken(int index){\n return tokens.get(index);\n }", "private Token tokenize(String string) {\n\t\t\tswitch(string) {\n\t\t\tcase \"<\":\n\t\t\t\tif(text[currentIndex] == '=') {\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t\treturn new Token(TokenType.OPERATOR, ComparisonOperators.LESS_OR_EQUALS);\n\t\t\t\t}\n\t\t\t\treturn new Token(TokenType.OPERATOR, ComparisonOperators.LESS);\n\t\t\tcase \">\":\n\t\t\t\tif(text[currentIndex] == '=') {\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t\treturn new Token(TokenType.OPERATOR, ComparisonOperators.GREATER_OR_EQUALS);\n\t\t\t\t}\n\t\t\t\treturn new Token(TokenType.OPERATOR, ComparisonOperators.GREATER);\n\t\t\tcase \"=\":\n\t\t\t\treturn new Token(TokenType.OPERATOR, ComparisonOperators.EQUALS);\n\t\t\tcase \"!=\":\n\t\t\t\treturn new Token(TokenType.OPERATOR, ComparisonOperators.NOT_EQUALS);\n\t\t\tcase \"LIKE\":\n\t\t\t\treturn new Token(TokenType.OPERATOR, ComparisonOperators.LIKE);\n\t\t\tcase \"jmbag\":\n\t\t\t\treturn new Token(TokenType.FIELD, FieldValueGetters.JMBAG);\n\t\t\tcase \"lastName\":\n\t\t\t\treturn new Token(TokenType.FIELD, FieldValueGetters.LAST_NAME);\n\t\t\tcase \"firstName\":\n\t\t\t\treturn new Token(TokenType.FIELD, FieldValueGetters.FIRST_NAME);\n\t\t\tcase \"\\\"\":\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\t\n\t\t\t\twhile(currentIndex < text.length) {\n\t\t\t\t\tchar currentChar = text[currentIndex++];\n\t\t\t\t\t\n\t\t\t\t\tif(currentChar == '\"') {\n\t\t\t\t\t\treturn new Token(TokenType.STRING_LITERAL, sb.toString());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tsb.append(currentChar);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthrow new LexerException(\"String literal not closed! It was: \" + sb.toString());\n\t\t}\n\t\t\t\n\t\tif(string.toLowerCase().equals(\"and\"))\n\t\t\treturn new Token(TokenType.AND, null);\n\t\t\n\t\treturn null;\n\t}", "@Override\n public Token next() throws IOException {\n\n if (hasNext()) {\n String next = splits.get(current++);\n if (isString(next)) {\n return new StringToken(next.substring(1, next.length() - 1));\n }\n if (isNumber(next)) {\n return new NumberToken(Double.parseDouble(next));\n }\n if (isSymbol(next)) {\n return new SymbolToken(next.charAt(0));\n }\n if (isName(next)) {\n return new NameToken(next);\n }\n throw new IOException(\"Invalid input.\");\n }\n\n return null;\n }", "public int nextIndexOf(String identifier){\n Token token;\n int tempCurrentToken = currentToken, result;\n \n nextTokenOf(identifier);\n result = currentToken;\n currentToken = tempCurrentToken;\n return result;\n }", "public int nextIndexOf(List<Token> delimiters){\n Token token;\n int tempCurrentToken = currentToken, result;\n\n nextTokenOf(delimiters);\n result = currentToken;\n currentToken = tempCurrentToken;\n return result;\n }", "public Token nextToken() {\n if (currentIndex == this.data.length) {\n this.token = new Token(TokenType.EOF, null);\n currentIndex++;\n return this.token;\n }\n\n if (currentIndex > this.data.length) {\n throw new LexerException(\"There aren't any more tokens to be generated\");\n }\n\n char currChar = data[currentIndex];\n\n if (currChar == '{') {\n if (data[currentIndex + 1] == '$') {\n currentIndex += 2;\n this.state = LexerState.TAG_NAME;\n this.token = new Token(TokenType.OPEN_TAG, \"{$\");\n } else {\n throw new LexerException(\"Expected $, but didn't find it\");\n }\n } else if (this.state == LexerState.TAG_NAME) {\n this.token = getTagName();\n this.state = LexerState.TAG_ELEMENTS;\n } else if (this.state == LexerState.TAG_ELEMENTS) {\n this.token = getTagElement();\n } else if (this.state == LexerState.TEXT) {\n this.token = getNextText();\n }\n\n\n return this.token;\n }", "private Token getNextString() {\n StringBuilder sb = new StringBuilder();\n sb.append(this.data[currentIndex++]);\n\n while (currentIndex < this.data.length) {\n char currChar = this.data[currentIndex];\n\n if (currChar == '\\\\') {\n char nextChar = this.data[currentIndex + 1];\n\n if (nextChar == '\\\"') {\n sb.append(\"\\\"\");\n currentIndex += 2;\n } else if (nextChar == 'r' || nextChar == 't' || nextChar == 'n') {\n sb.append(currChar).append(nextChar);\n currentIndex += 2;\n } else {\n throw new LexerException(\"Invalid sequence starting with \\\\\");\n }\n\n continue;\n }\n\n sb.append(currChar);\n currentIndex++;\n\n if (currChar == '\\\"') {\n break;\n }\n }\n\n return new Token(TokenType.STRING, sb.toString());\n }", "private Token nextToken() {\n Token token = scanner.nextToken();\n lastSourcePosition = token.location.end;\n return token;\n }", "protected int getNextToken(){\n if( currentToken == 1){\n currentToken = -1;\n }else{\n currentToken = 1;\n }\n return currentToken;\n }", "private String next(Stack<String> stack, AtomicInteger index) {\n\t\tint next = index.incrementAndGet();\n\t\tif (next < stack.size())\n\t\t\treturn stack.get(next);\n\t\telse\n\t\t\treturn null;\n\t}", "@Override\n\tprotected Token findNextToken() {\n\t\tLocatedChar ch = nextNonWhitespaceChar();\n\t\tif(isCommentStart(ch)) {\n\t\t\tscanComment(ch);\n\t\t\treturn findNextToken();\n\t\t}\n\t\tif(ch.isDigit()) {\n\t\t\treturn scanNumber(ch);\n\t\t}\n\t\telse if(isIdentifierStart(ch)) {\n\t\t\treturn scanIdentifier(ch);\n\t\t}\n\t\telse if(isPunctuatorStart(ch)) {\n\t\t\treturn PunctuatorScanner.scan(ch, input);\n\t\t}\n\t\telse if(isCharStart(ch)) {\n\t\t\treturn scanChar(ch);\n\t\t}\n\t\telse if(isStrStart(ch)) {\n\t\t\treturn scanString(ch);\n\t\t}\n\t\telse if(isEndOfInput(ch)) {\n\t\t\treturn NullToken.make(ch);\n\t\t}\n\t\telse {\n\t\t\tlexicalError(ch);\n\t\t\treturn findNextToken();\n\t\t}\n\t}", "public Token getNextToken() {\r\n \r\n // if no next token, abort\r\n if (!this.hasNextToken()) return null;\r\n \r\n // get the current character\r\n char c = this.stream.peek();\r\n \r\n // comment\r\n if (c==this.charComment) {\r\n // read the line and return the token\r\n this.current = new Token(this.getUntilMeetChar('\\n'));\r\n return this.current;\r\n }\r\n \r\n // !\r\n if (c==this.charSize) {\r\n this.stream.next(); // consume the character\r\n this.current = new Token(String.valueOf(this.charSize)); // and build the token\r\n return this.current;\r\n }\r\n \r\n // else\r\n this.current = new Token(this.getUntilMeetChar(this.charSeparator)); // extract until a charSeparator is met\r\n return this.current;\r\n \r\n }", "private Token nextTokenBasic() throws LexerException {\n \n if( Character.isLetter( data[currentIndex] ) || data[currentIndex] == '\\\\' ) {\n if(data[currentIndex] == '\\\\' ) {\n backslash();\n }\n stringToken.append( data[ currentIndex++ ] );\n \n type = TokenType.WORD;\n \n while( currentIndex < dataLength \n && ( Character.isLetter( data[currentIndex] ) || data[currentIndex] == '\\\\' ) ) {\n if(data[currentIndex] == '\\\\' ) {\n backslash();\n }\n \n stringToken.append( data[ currentIndex++ ] );\n\n }\n \n token = new Token(type, stringToken.toString());\n stringToken = new StringBuilder();\n \n \n return token;\n \n } else if( Character.isDigit( data[currentIndex] ) ) {\n\n stringToken.append( data[ currentIndex++ ] );\n type = TokenType.NUMBER;\n\n while( currentIndex < dataLength && Character.isDigit( data[currentIndex] ) ) {\n \n stringToken.append( data[ currentIndex++ ] );\n\n }\n \n try {\n token = new Token( type, Long.parseLong( stringToken.toString() ) );\n stringToken = new StringBuilder();\n return token;\n } catch(NumberFormatException e) {\n throw new LexerException(\"Too big Long type.\");\n }\n } else {\n token = new Token(TokenType.SYMBOL, data[ currentIndex++ ]);\n stringToken = new StringBuilder();\n return token;\n }\n }", "public int nextIndexOf(Type type){\n Token token;\n int tempCurrentToken = currentToken, result;\n \n nextTokenOf(type);\n result = currentToken;\n currentToken = tempCurrentToken;\n return result;\n }", "@Override\n public String nextString() {\n last = (last + 1) % str.length;\n return str[last];\n }", "public Token next() {\r\n\t\tif (i >= s.length()) {\r\n\t\t\treturn new Token(Type.EOF, \"\");\r\n\t\t}\r\n\t\t\r\n\t\tswitch (s.charAt(i)) {\r\n\t\t\tcase '_' :\r\n\t\t\t\t++i;\r\n\t\t\t\treturn new Token(Type.UNDERLINE, \"_\");\r\n\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tint start = i;\r\n\t\t\t\twhile (i < s.length() && s.charAt(i) != '_') {\r\n\t\t\t\t\t++i;\r\n\t\t\t\t}\r\n\t\t\t\tint end = i;\r\n\t\t\t\treturn new Token(Type.TEXT, s.substring(start, end));\r\n\t\t}\r\n\t}", "StringToken getStringToken(\n String value\n ){\n StringToken token = findStringToken(value);\n if(token == null) {\n try {\n int index = super.size();\n token = new StringToken(index, true);\n target.write(value);\n target.write('\\u0000');\n target.flush();\n this.cache.put(value, Integer.valueOf(index));\n return token;\n } catch (IOException exception) {\n return null;\n }\n } else {\n return token;\n }\n }", "private Token advance() {\n if(!isAtEnd()) current++;\n return previous();\n }", "public Token getNextToken() \n{\n Token specialToken = null;\n Token matchedToken;\n int curPos = 0;\n\n EOFLoop :\n for (;;)\n {\n try\n {\n curChar = input_stream.BeginToken();\n }\n catch(java.io.IOException e)\n {\n jjmatchedKind = 0;\n matchedToken = jjFillToken();\n matchedToken.specialToken = specialToken;\n return matchedToken;\n }\n image = jjimage;\n image.setLength(0);\n jjimageLen = 0;\n\n for (;;)\n {\n switch(curLexState)\n {\n case 0:\n jjmatchedKind = 0x7fffffff;\n jjmatchedPos = 0;\n curPos = jjMoveStringLiteralDfa0_0();\n if (jjmatchedPos == 0 && jjmatchedKind > 121)\n {\n jjmatchedKind = 121;\n }\n break;\n case 1:\n jjmatchedKind = 0x7fffffff;\n jjmatchedPos = 0;\n curPos = jjMoveStringLiteralDfa0_1();\n break;\n case 2:\n jjmatchedKind = 0x7fffffff;\n jjmatchedPos = 0;\n curPos = jjMoveStringLiteralDfa0_2();\n if (jjmatchedPos == 0 && jjmatchedKind > 9)\n {\n jjmatchedKind = 9;\n }\n break;\n case 3:\n jjmatchedKind = 0x7fffffff;\n jjmatchedPos = 0;\n curPos = jjMoveStringLiteralDfa0_3();\n if (jjmatchedPos == 0 && jjmatchedKind > 9)\n {\n jjmatchedKind = 9;\n }\n break;\n }\n if (jjmatchedKind != 0x7fffffff)\n {\n if (jjmatchedPos + 1 < curPos)\n input_stream.backup(curPos - jjmatchedPos - 1);\n if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)\n {\n matchedToken = jjFillToken();\n matchedToken.specialToken = specialToken;\n TokenLexicalActions(matchedToken);\n if (jjnewLexState[jjmatchedKind] != -1)\n curLexState = jjnewLexState[jjmatchedKind];\n return matchedToken;\n }\n else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)\n {\n if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)\n {\n matchedToken = jjFillToken();\n if (specialToken == null)\n specialToken = matchedToken;\n else\n {\n matchedToken.specialToken = specialToken;\n specialToken = (specialToken.next = matchedToken);\n }\n SkipLexicalActions(matchedToken);\n }\n else\n SkipLexicalActions(null);\n if (jjnewLexState[jjmatchedKind] != -1)\n curLexState = jjnewLexState[jjmatchedKind];\n continue EOFLoop;\n }\n MoreLexicalActions();\n if (jjnewLexState[jjmatchedKind] != -1)\n curLexState = jjnewLexState[jjmatchedKind];\n curPos = 0;\n jjmatchedKind = 0x7fffffff;\n try {\n curChar = input_stream.readChar();\n continue;\n }\n catch (java.io.IOException e1) { }\n }\n int error_line = input_stream.getEndLine();\n int error_column = input_stream.getEndColumn();\n String error_after = null;\n boolean EOFSeen = false;\n try { input_stream.readChar(); input_stream.backup(1); }\n catch (java.io.IOException e1) {\n EOFSeen = true;\n error_after = curPos <= 1 ? \"\" : input_stream.GetImage();\n if (curChar == '\\n' || curChar == '\\r') {\n error_line++;\n error_column = 0;\n }\n else\n error_column++;\n }\n if (!EOFSeen) {\n input_stream.backup(1);\n error_after = curPos <= 1 ? \"\" : input_stream.GetImage();\n }\n throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);\n }\n }\n}", "private Token scanString(LocatedChar firstChar) {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tappendSubsequentString(buffer);\n\t\tLocatedChar ch = input.peek();\n\t\tif(ch.matchChar('\"')) {\n\t\t\tinput.next();\n\t\t\treturn StringToken.make(firstChar, buffer.toString());\n\t\t} else {\n\t\t\tlexicalError(ch, \"malformed string\");\n\t\t\treturn findNextToken();\n\t\t}\n\t}", "public String getToken(int index) {\n\t\treturn this.tokenList.get(index);\n\t}", "static final public Token getNextToken() {\n if (token.next != null) token = token.next;\n else token = token.next = token_source.getNextToken();\n jj_ntk = -1;\n jj_gen++;\n return token;\n }", "static final public Token getNextToken() {\n if (token.next != null) token = token.next;\n else token = token.next = token_source.getNextToken();\n jj_ntk = -1;\n jj_gen++;\n return token;\n }", "static final public Token getNextToken() {\n if (token.next != null) token = token.next;\n else token = token.next = token_source.getNextToken();\n jj_ntk = -1;\n jj_gen++;\n return token;\n }", "private Token nextRawToken() throws NoSuchElementException {\n\t\t// Location of the char after the current projected token.\n\t\tint sLoc = 0;\n\n\t\twhile (latestLine.trim().isEmpty()) {\n\t\t\tlatestLine = fileScanner.nextLine();\n\t\t}\n\n\t\t// Find the next end segment\n\t\twhile (latestLine.length() != sLoc + 1\n\t\t\t\t&& latestLine.charAt(sLoc + 1) != ' ') {\n\t\t\t// && getType(document.substring(0, sLoc + 1)) == TokenType.INVALID)\n\t\t\t// {\n\t\t\tsLoc++;\n\t\t}\n\n\t\t// End indices of the token, inclusive.\n\t\tint endTestToken = sLoc;\n\n\t\t/*\n\t\t * Determine the longest sub-token by starting from the end and working\n\t\t * backwards.\n\t\t */\n\t\tboolean valid = false;\n\t\tfor (int i = endTestToken; i >= 0; i--) {\n\t\t\tString testToken = latestLine.substring(0, i + 1);\n\t\t\tif (getType(testToken) != TokenType.INVALID) {\n\t\t\t\tsLoc = i;\n\t\t\t\tvalid = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!valid) {\n\t\t\tsLoc = 0;\n\t\t}\n\n\t\tString token = latestLine.substring(0, sLoc + 1);\n\n\t\tToken t = new Token(token, getType(token));\n\t\trunDiagnostic(t);\n\n\t\t// Consume the token form the document\n\t\tlatestLine = latestLine.substring(sLoc + 1).trim();\n\n\t\treturn t;\n\t}", "public Token next() {\n \tcurrent = peek;\n \tpeek = extractToken();\n \treturn current;\n }", "public static Token getNextToken()\n{\n Token matchedToken;\n int curPos = 0;\n\n EOFLoop :\n for (;;)\n {\n try\n {\n curChar = input_stream.BeginToken();\n }\n catch(java.io.IOException e)\n {\n jjmatchedKind = 0;\n jjmatchedPos = -1;\n matchedToken = jjFillToken();\n return matchedToken;\n }\n image = jjimage;\n image.setLength(0);\n jjimageLen = 0;\n\n switch(curLexState)\n {\n case 0:\n jjmatchedKind = 0x7fffffff;\n jjmatchedPos = 0;\n curPos = jjMoveStringLiteralDfa0_0();\n break;\n case 1:\n jjmatchedKind = 0x7fffffff;\n jjmatchedPos = 0;\n curPos = jjMoveStringLiteralDfa0_1();\n if (jjmatchedPos == 0 && jjmatchedKind > 8)\n {\n jjmatchedKind = 8;\n }\n break;\n case 2:\n jjmatchedKind = 0x7fffffff;\n jjmatchedPos = 0;\n curPos = jjMoveStringLiteralDfa0_2();\n if (jjmatchedPos == 0 && jjmatchedKind > 8)\n {\n jjmatchedKind = 8;\n }\n break;\n }\n if (jjmatchedKind != 0x7fffffff)\n {\n if (jjmatchedPos + 1 < curPos)\n input_stream.backup(curPos - jjmatchedPos - 1);\n if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)\n {\n matchedToken = jjFillToken();\n TokenLexicalActions(matchedToken);\n if (jjnewLexState[jjmatchedKind] != -1)\n curLexState = jjnewLexState[jjmatchedKind];\n return matchedToken;\n }\n else\n {\n SkipLexicalActions(null);\n if (jjnewLexState[jjmatchedKind] != -1)\n curLexState = jjnewLexState[jjmatchedKind];\n continue EOFLoop;\n }\n }\n int error_line = input_stream.getEndLine();\n int error_column = input_stream.getEndColumn();\n String error_after = null;\n boolean EOFSeen = false;\n try { input_stream.readChar(); input_stream.backup(1); }\n catch (java.io.IOException e1) {\n EOFSeen = true;\n error_after = curPos <= 1 ? \"\" : input_stream.GetImage();\n if (curChar == '\\n' || curChar == '\\r') {\n error_line++;\n error_column = 0;\n }\n else\n error_column++;\n }\n if (!EOFSeen) {\n input_stream.backup(1);\n error_after = curPos <= 1 ? \"\" : input_stream.GetImage();\n }\n throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);\n }\n}", "public Token toToken(String s);", "static final public Token getNextToken() {\n if (token.next != null) {\n token = token.next;\n } else {\n token = token.next = token_source.getNextToken();\n }\n jj_ntk = -1;\n jj_gen++;\n return token;\n }", "final public Token getNextToken() {\n if (token.next != null) token = token.next;\n else token = token.next = token_source.getNextToken();\n jj_ntk = -1;\n return token;\n }", "public Token getNextToken() \n{\n Token specialToken = null;\n Token matchedToken;\n int curPos = 0;\n\n EOFLoop :\n for (;;)\n {\n try\n {\n curChar = input_stream.BeginToken();\n }\n catch(java.io.IOException e)\n {\n jjmatchedKind = 0;\n jjmatchedPos = -1;\n matchedToken = jjFillToken();\n matchedToken.specialToken = specialToken;\n return matchedToken;\n }\n image = jjimage;\n image.setLength(0);\n jjimageLen = 0;\n\n for (;;)\n {\n switch(curLexState)\n {\n case 0:\n jjmatchedKind = 0x7fffffff;\n jjmatchedPos = 0;\n curPos = jjMoveStringLiteralDfa0_0();\n if (jjmatchedPos == 0 && jjmatchedKind > 204)\n {\n jjmatchedKind = 204;\n }\n break;\n case 1:\n jjmatchedKind = 0x7fffffff;\n jjmatchedPos = 0;\n curPos = jjMoveStringLiteralDfa0_1();\n if (jjmatchedPos == 0 && jjmatchedKind > 12)\n {\n jjmatchedKind = 12;\n }\n break;\n case 2:\n jjmatchedKind = 0x7fffffff;\n jjmatchedPos = 0;\n curPos = jjMoveStringLiteralDfa0_2();\n if (jjmatchedPos == 0 && jjmatchedKind > 12)\n {\n jjmatchedKind = 12;\n }\n break;\n case 3:\n jjmatchedKind = 0x7fffffff;\n jjmatchedPos = 0;\n curPos = jjMoveStringLiteralDfa0_3();\n if (jjmatchedPos == 0 && jjmatchedKind > 12)\n {\n jjmatchedKind = 12;\n }\n break;\n }\n if (jjmatchedKind != 0x7fffffff)\n {\n if (jjmatchedPos + 1 < curPos)\n input_stream.backup(curPos - jjmatchedPos - 1);\n if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)\n {\n matchedToken = jjFillToken();\n matchedToken.specialToken = specialToken;\n if (jjnewLexState[jjmatchedKind] != -1)\n curLexState = jjnewLexState[jjmatchedKind];\n return matchedToken;\n }\n else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)\n {\n if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)\n {\n matchedToken = jjFillToken();\n if (specialToken == null)\n specialToken = matchedToken;\n else\n {\n matchedToken.specialToken = specialToken;\n specialToken = (specialToken.next = matchedToken);\n }\n SkipLexicalActions(matchedToken);\n }\n else\n SkipLexicalActions(null);\n if (jjnewLexState[jjmatchedKind] != -1)\n curLexState = jjnewLexState[jjmatchedKind];\n continue EOFLoop;\n }\n MoreLexicalActions();\n if (jjnewLexState[jjmatchedKind] != -1)\n curLexState = jjnewLexState[jjmatchedKind];\n curPos = 0;\n jjmatchedKind = 0x7fffffff;\n try {\n curChar = input_stream.readChar();\n continue;\n }\n catch (java.io.IOException e1) { }\n }\n int error_line = input_stream.getEndLine();\n int error_column = input_stream.getEndColumn();\n String error_after = null;\n boolean EOFSeen = false;\n try { input_stream.readChar(); input_stream.backup(1); }\n catch (java.io.IOException e1) {\n EOFSeen = true;\n error_after = curPos <= 1 ? \"\" : input_stream.GetImage();\n if (curChar == '\\n' || curChar == '\\r') {\n error_line++;\n error_column = 0;\n }\n else\n error_column++;\n }\n if (!EOFSeen) {\n input_stream.backup(1);\n error_after = curPos <= 1 ? \"\" : input_stream.GetImage();\n }\n throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);\n }\n }\n}", "LexicalUnit getNextLexicalUnit();", "private Token basicNextWordToken() {\n\t\t \n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\twhile(currentIndex < data.length) {\n\t\t\t\t\n\t\t\tif( Character.isLetter(data[currentIndex]) ) {\n\t\t\t\tsb.append(data[currentIndex]);\n\t\t\t\t\n\t\t\t} else if (data[currentIndex] == '\\\\') {\n\t\t\t\t\t\n\t\t\t\t//the following condition is here to ensure that the '\\' char is\n\t\t\t\t//not the last element in the data array, or that the char after\n\t\t\t\t//the '\\' is not a letter because that is the invalid escape\n\t\t\t\tif(currentIndex + 1 >= data.length || \n\t\t\t\t\t\tCharacter.isLetter(data[currentIndex + 1])) {\n\t\t\t\t\t\n\t\t\t\t\tthrow new LexerException(\"Invalid escape sequence!\");\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcurrentIndex++;\n\t\t\t\tsb.append(data[currentIndex]);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t}\n\t\t\tcurrentIndex++;\n\t\t}\n\t\t\n\t\treturn new Token(TokenType.WORD, sb.toString());\n\t }", "final public Token getNextToken() {\r\n if (token.next != null) token = token.next;\r\n else token = token.next = token_source.getNextToken();\r\n jj_ntk = -1;\r\n return token;\r\n }", "public void advance(){\n\n if (hasMoreTokens()) {\n currentToken = tokens.get(pointer);\n pointer++;\n }else {\n throw new IllegalStateException(\"No more tokens\");\n }\n\n //System.out.println(currentToken);\n\n if (currentToken.matches(keyWordReg)){\n currentTokenType = TYPE.KEYWORD;\n }else if (currentToken.matches(symbolReg)){\n currentTokenType = TYPE.SYMBOL;\n }else if (currentToken.matches(intReg)){\n currentTokenType = TYPE.INT_CONST;\n }else if (currentToken.matches(strReg)){\n currentTokenType = TYPE.STRING_CONST;\n }else if (currentToken.matches(idReg)){\n currentTokenType = TYPE.IDENTIFIER;\n }else {\n\n throw new IllegalArgumentException(\"Unknown token:\" + currentToken);\n }\n\n }", "public String next()\r\n\t{\r\n\t\tif(st == null || !st.hasMoreTokens())\r\n\t\t\tnewst();\r\n\t\treturn st.nextToken();\r\n\t}", "final public Token getNextToken() {\n if (token.next != null) token = token.next;\n else token = token.next = token_source.getNextToken();\n jj_ntk = -1;\n jj_gen++;\n return token;\n }", "final public Token getNextToken() {\n if (token.next != null) token = token.next;\n else token = token.next = token_source.getNextToken();\n jj_ntk = -1;\n jj_gen++;\n return token;\n }", "final public Token getNextToken() {\n if (token.next != null) token = token.next;\n else token = token.next = token_source.getNextToken();\n jj_ntk = -1;\n jj_gen++;\n return token;\n }", "final public Token getNextToken() {\n if (token.next != null) token = token.next;\n else token = token.next = token_source.getNextToken();\n jj_ntk = -1;\n jj_gen++;\n return token;\n }", "final public Token getNextToken() {\n if (token.next != null) token = token.next;\n else token = token.next = token_source.getNextToken();\n jj_ntk = -1;\n jj_gen++;\n return token;\n }", "final public Token getNextToken() {\n if (token.next != null) token = token.next;\n else token = token.next = token_source.getNextToken();\n jj_ntk = -1;\n jj_gen++;\n return token;\n }", "final public Token getNextToken() {\n if (token.next != null) token = token.next;\n else token = token.next = token_source.getNextToken();\n jj_ntk = -1;\n jj_gen++;\n return token;\n }", "final public Token getNextToken() {\n if (token.next != null) token = token.next;\n else token = token.next = token_source.getNextToken();\n jj_ntk = -1;\n jj_gen++;\n return token;\n }", "final public Token getNextToken() {\n if (token.next != null) token = token.next;\n else token = token.next = token_source.getNextToken();\n jj_ntk = -1;\n jj_gen++;\n return token;\n }", "final public Token getNextToken() {\n if (token.next != null) token = token.next;\n else token = token.next = token_source.getNextToken();\n jj_ntk = -1;\n jj_gen++;\n return token;\n }", "final public Token getNextToken() {\n if (token.next != null) token = token.next;\n else token = token.next = token_source.getNextToken();\n jj_ntk = -1;\n jj_gen++;\n return token;\n }", "public Character next() {\n if (!hasNext())\n throw new NoSuchElementException();\n return string.charAt(index++);\n }", "final public Token getNextToken() {\n\t if (token.next != null) token = token.next;\n\t else token = token.next = token_source.getNextToken();\n\t jj_ntk = -1;\n\t jj_gen++;\n\t return token;\n }", "final public Token getNextToken() {\n\t if (token.next != null) token = token.next;\n\t else token = token.next = token_source.getNextToken();\n\t jj_ntk = -1;\n\t jj_gen++;\n\t return token;\n }", "public static void getNextToken() {\n if (currPos < tokens.size()) {\n currToken = tokens.get(currPos);\n //TODO del \n // System.out.println(currToken);\n currPos++;\n } else {\n// System.out.println(\"end of tokens reached\");\n currToken = new Token(Token.UNRECOGNIZED);\n }\n }", "final public Token getNextToken() {\r\n if (token.next != null) token = token.next;\r\n else token = token.next = token_source.getNextToken();\r\n jj_ntk = -1;\r\n jj_gen++;\r\n return token;\r\n }", "final public Token getNextToken() {\r\n if (token.next != null) token = token.next;\r\n else token = token.next = token_source.getNextToken();\r\n jj_ntk = -1;\r\n jj_gen++;\r\n return token;\r\n }", "public char getNextToken(){\n\t\treturn token;\n\t}", "final public Token getNextToken() {\n if (token.next != null) {\n token = token.next;\n } else {\n token = token.next = token_source.getNextToken();\n }\n jj_ntk = -1;\n jj_gen++;\n return token;\n }", "public Token nextToken() {\n\t\tif (token != null && token.getType() == TokenType.EOF) {\n\t\t\tthrow new LexerException(\n\t\t\t\t\t\"The end of file. No next token to generate.\");\n\t\t}\n\n\t\ttry {\n\t\t\tif (state == LexerState.BASIC) {\n\t\t\t\tbasicNext();\n\t\t\t} else {\n\t\t\t\textendedNext();\n\t\t\t}\n\t\t} catch (NumberFormatException e) {\n\t\t\tString message = \"\";\n\t\t\twhile (currentIndex > start) {\n\t\t\t\tmessage += data[start++];\n\t\t\t}\n\n\t\t\tthrow new LexerException(\"Error in token! \" + message\n\t\t\t\t\t+ \" that ends at \" + (currentIndex - 1));\n\t\t} catch (Exception e) {\n\t\t\tString message = \"\";\n\t\t\twhile (currentIndex > start) {\n\t\t\t\tmessage += data[start++];\n\t\t\t}\n\n\t\t\tthrow new LexerException(\"Error in generating \" + \"next token! \"\n\t\t\t\t\t+ message + \" that ends at \" + (currentIndex - 1) + \"\\n\"\n\t\t\t\t\t+ e.getMessage());\n\n\t\t}\n\t\t// System.out.println(token.getType());\n\t\treturn token;\n\n\t}", "public Token nextToken() {\n\t\tif (token != null && token.getType().equals(TokenType.EOF)) {\n\t\t\tthrow new SmartScriptLexerException();\n\t\t}\n\n\t\tif (currentIndex == data.length) {\n\t\t\tif (state.equals(LexerState.TAG)) {\n\t\t\t\tthrow new SmartScriptLexerException(\"Invalid syntax. Tags must be closed.\");\n\t\t\t}\n\t\t\ttoken = new Token(TokenType.EOF, null);\n\t\t\treturn token;\n\t\t}\n\n\t\tStringBuilder buffer = new StringBuilder();\n\t\tchar ch;\n\n\t\tswitch (state) {\n\t\tcase TEXT:\n\t\t\twhile (true) {\n\t\t\t\tif (currentIndex < data.length) {\n\t\t\t\t\tch = data[currentIndex];\n\t\t\t\t} else {\n\t\t\t\t\tif (tokenState.equals(TokenState.ESCAPE)) {\n\t\t\t\t\t\tthrow new SmartScriptLexerException(\"Invalid syntax. Tags must be closed.\");\n\t\t\t\t\t}\n\t\t\t\t\tch = '\\n';\n\t\t\t\t}\n\n\t\t\t\tswitch (tokenState) {\n\t\t\t\tcase WORD:\n\t\t\t\t\tif (currentIndex == data.length) {\n\t\t\t\t\t\ttoken = new Token(TokenType.TEXT, buffer.toString());\n\t\t\t\t\t\treturn token;\n\t\t\t\t\t} else if (ch == '{') {\n\t\t\t\t\t\ttokenState = TokenState.TAG_OPEN;\n\t\t\t\t\t} else if (ch == '\\\\') {\n\t\t\t\t\t\ttokenState = TokenState.ESCAPE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbuffer.append(ch);\n\t\t\t\t\t}\n\t\t\t\t\t++currentIndex;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ESCAPE:\n\t\t\t\t\tif (ch == '{' || ch == '\\\\') {\n\t\t\t\t\t\ttokenState = TokenState.WORD;\n\t\t\t\t\t\tbuffer.append(ch);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new SmartScriptLexerException(\"Invalid escape sequence.\");\n\t\t\t\t\t}\n\t\t\t\t\t++currentIndex;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TAG_OPEN:\n\t\t\t\t\tif (ch == '$') {\n\t\t\t\t\t\tstate = LexerState.TAG;\n\t\t\t\t\t\ttokenState = TokenState.TAG_NAME;\n\t\t\t\t\t\t++currentIndex;\n\t\t\t\t\t\tif (buffer.length() != 0) {\n\t\t\t\t\t\t\ttoken = new Token(TokenType.TEXT, buffer.toString());\n\t\t\t\t\t\t\treturn token;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn nextToken();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbuffer.append(\"{\");\n\t\t\t\t\t\ttokenState = TokenState.WORD;\n\t\t\t\t\t}\n\n\t\t\t\tcase INIT:\n\t\t\t\t\tif (ch == '{') {\n\t\t\t\t\t\ttokenState = TokenState.TAG_OPEN;\n\t\t\t\t\t\t++currentIndex;\n\t\t\t\t\t} else if (ch == '\\\\') {\n\t\t\t\t\t\ttokenState = TokenState.ESCAPE;\n\t\t\t\t\t\t++currentIndex;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttokenState = TokenState.WORD;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new SmartScriptLexerException(\"Irregular state.\");\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase TAG:\n\t\t\tskipWhitespaces();\n\t\t\twhile (true) {\n\t\t\t\tif (currentIndex < data.length) {\n\t\t\t\t\tch = data[currentIndex];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new SmartScriptLexerException(\"Invalid syntax. Tags must be closed.\");\n\t\t\t\t}\n\n\t\t\t\tswitch (tokenState) {\n\t\t\t\tcase TAG_NAME:\n\t\t\t\t\tif (ch == '=') {\n\t\t\t\t\t\ttokenState = TokenState.INIT;\n\t\t\t\t\t\t++currentIndex;\n\t\t\t\t\t\ttoken = new Token(TokenType.TAG, String.valueOf(ch));\n\t\t\t\t\t\treturn token;\n\t\t\t\t\t} else if (Character.isLetter(ch)) {\n\t\t\t\t\t\tbuffer.append(ch);\n\t\t\t\t\t} else if (buffer.length() != 0) {\n\t\t\t\t\t\tif (Character.isDigit(ch) || ch == '_') {\n\t\t\t\t\t\t\tbuffer.append(ch);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttokenState = TokenState.INIT;\n\t\t\t\t\t\t\ttoken = new Token(TokenType.TAG, buffer.toString());\n\t\t\t\t\t\t\treturn token;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new SmartScriptLexerException(\"Invalid tag name\");\n\t\t\t\t\t}\n\t\t\t\t\t++currentIndex;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase FUNCTION:\n\t\t\t\t\tif (Character.isLetter(ch)) {\n\t\t\t\t\t\tbuffer.append(ch);\n\t\t\t\t\t} else if (buffer.length() != 0) {\n\t\t\t\t\t\tif (Character.isDigit(ch) || ch == '_') {\n\t\t\t\t\t\t\tbuffer.append(ch);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttokenState = TokenState.INIT;\n\t\t\t\t\t\t\ttoken = new Token(TokenType.FUNCTION, buffer.toString());\n\t\t\t\t\t\t\treturn token;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new SmartScriptLexerException(\"Invalid tag name\");\n\t\t\t\t\t}\n\t\t\t\t\t++currentIndex;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase VAR:\n\t\t\t\t\tif (Character.isLetterOrDigit(ch) || ch == '_') {\n\t\t\t\t\t\tbuffer.append(ch);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttokenState = TokenState.INIT;\n\t\t\t\t\t\ttoken = new Token(TokenType.VAR, buffer.toString());\n\t\t\t\t\t\treturn token;\n\t\t\t\t\t}\n\t\t\t\t\t++currentIndex;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CONST_INT:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tbuffer.append(ch);\n\t\t\t\t\t} else if (ch == '.') {\n\t\t\t\t\t\tbuffer.append(ch);\n\t\t\t\t\t\t++currentIndex;\n\t\t\t\t\t\ttokenState = TokenState.CONST_DOUBLE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\ttokenState = TokenState.INIT;\n\t\t\t\t\t\t\tint number = Integer.valueOf(buffer.toString());\n\t\t\t\t\t\t\ttoken = new Token(TokenType.CONST_INT, number);\n\t\t\t\t\t\t\treturn token;\n\t\t\t\t\t\t} catch (NumberFormatException ex) {\n\t\t\t\t\t\t\tthrow new SmartScriptLexerException(\"Number too big.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t++currentIndex;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CONST_DOUBLE:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tbuffer.append(ch);\n\t\t\t\t\t} else if (buffer.toString().endsWith(\".\")) {\n\t\t\t\t\t\tthrow new SmartScriptLexerException(\"Invalid syntax.\");\n\t\t\t\t\t} else\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\ttokenState = TokenState.INIT;\n\t\t\t\t\t\t\tdouble number = Double.valueOf(buffer.toString());\n\t\t\t\t\t\t\ttoken = new Token(TokenType.CONST_DOUBLE, number);\n\t\t\t\t\t\t\treturn token;\n\t\t\t\t\t\t} catch (NumberFormatException ex) {\n\t\t\t\t\t\t\tthrow new SmartScriptLexerException(\"Number too big.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t++currentIndex;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MINUS:\n\t\t\t\t\tif (buffer.length() == 0) {\n\t\t\t\t\t\tbuffer.append(ch);\n\t\t\t\t\t\t++currentIndex;\n\t\t\t\t\t} else if (Character.isDigit(ch)) {\n\t\t\t\t\t\ttokenState = TokenState.CONST_INT;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttokenState = TokenState.INIT;\n\t\t\t\t\t\ttoken = new Token(TokenType.OPERATOR, buffer.toString());\n\t\t\t\t\t\treturn token;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase OPERATOR:\n\t\t\t\t\ttokenState = TokenState.INIT;\n\t\t\t\t\t++currentIndex;\n\t\t\t\t\ttoken = new Token(TokenType.OPERATOR, String.valueOf(ch));\n\t\t\t\t\treturn token;\n\n\t\t\t\tcase STRING:\n\t\t\t\t\tif (ch == '\\\"') {\n\t\t\t\t\t\tif (buffer.length() == 0) {\n\t\t\t\t\t\t\tthrow new SmartScriptLexerException(\"String cannot be empty.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttokenState = TokenState.INIT;\n\t\t\t\t\t\t++currentIndex;\n\t\t\t\t\t\ttoken = new Token(TokenType.STRING, buffer.toString());\n\t\t\t\t\t\treturn token;\n\t\t\t\t\t} else if (ch == '\\\\') {\n\t\t\t\t\t\ttokenState = TokenState.ESCAPE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbuffer.append(ch);\n\t\t\t\t\t}\n\t\t\t\t\t++currentIndex;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ESCAPE:\n\t\t\t\t\tif (ch == '\\\\' || ch == '\\\"') {\n\t\t\t\t\t\tbuffer.append(ch);\n\t\t\t\t\t} else if (ch == 'r') {\n\t\t\t\t\t\tbuffer.append('\\r');\n\t\t\t\t\t} else if (ch == 'n') {\n\t\t\t\t\t\tbuffer.append('\\n');\n\t\t\t\t\t} else if (ch == 't') {\n\t\t\t\t\t\tbuffer.append('\\t');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new SmartScriptLexerException(\"Invalid escape sequence.\");\n\t\t\t\t\t}\n\t\t\t\t\ttokenState = TokenState.STRING;\n\t\t\t\t\t++currentIndex;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TAG_CLOSED:\n\t\t\t\t\tif (ch == '}') {\n\t\t\t\t\t\tstate = LexerState.TEXT;\n\t\t\t\t\t\ttokenState = TokenState.INIT;\n\t\t\t\t\t\t++currentIndex;\n\t\t\t\t\t\ttoken = new Token(TokenType.END_TAG, null);\n\t\t\t\t\t\treturn token;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new SmartScriptLexerException(\"Invalid syntax.\");\n\t\t\t\t\t}\n\n\t\t\t\tcase INIT:\n\t\t\t\t\tif (Character.isLetter(ch)) {\n\t\t\t\t\t\ttokenState = TokenState.VAR;\n\t\t\t\t\t} else if (Character.isDigit(ch)) {\n\t\t\t\t\t\ttokenState = TokenState.CONST_INT;\n\t\t\t\t\t} else if (ch == '-') {\n\t\t\t\t\t\ttokenState = TokenState.MINUS;\n\t\t\t\t\t} else if (ch == '+' || ch == '*' || ch == '/' || ch == '^') {\n\t\t\t\t\t\ttokenState = TokenState.OPERATOR;\n\t\t\t\t\t} else if (ch == '@') {\n\t\t\t\t\t\ttokenState = TokenState.FUNCTION;\n\t\t\t\t\t\t++currentIndex;\n\t\t\t\t\t} else if (ch == '\\\"') {\n\t\t\t\t\t\ttokenState = TokenState.STRING;\n\t\t\t\t\t\t++currentIndex;\n\t\t\t\t\t} else if (ch == '$') {\n\t\t\t\t\t\ttokenState = TokenState.TAG_CLOSED;\n\t\t\t\t\t\t++currentIndex;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new SmartScriptLexerException(\"Invalid tag element.\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new SmartScriptLexerException(\"Irregular state.\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn token;\n\t}", "private Token nextToken() throws IOException {\n // Si hay lexemas en el buffer, leemos de ahi\n if (!bufferLocal.esVacia()) {\n return bufferLocal.extraer();\n }\n // Si no, leemos del Stream\n String lexemaActual = \"\";\n do {\n int lexema = tokens.nextToken();\n switch (lexema) {\n case StreamTokenizer.TT_WORD:\n lexemaActual = tokens.sval;\n break;\n case StreamTokenizer.TT_EOF:\n lexemaActual = \"fin\";\n break;\n default:\n lexemaActual = String.valueOf((char)tokens.ttype);\n break;\n }\n // Sumamos una linea en caso de haber salto de linea\n if (lexemaActual.equals(\"\\n\"))\n numeroLinea++;\n } while (lexemaActual.matches(\" |\\t|\\n|\\r\"));\n return new Token(lexemaActual,this.numeroLinea);\n }" ]
[ "0.6916688", "0.6846811", "0.6846811", "0.6846811", "0.68012327", "0.6760207", "0.6760207", "0.6760207", "0.6760207", "0.6760207", "0.6760207", "0.6760207", "0.6760207", "0.6760207", "0.6760207", "0.6760207", "0.6760207", "0.67578804", "0.6737953", "0.6737953", "0.6737953", "0.67375755", "0.67176634", "0.67176634", "0.66654545", "0.664631", "0.6642684", "0.65550596", "0.6495251", "0.6395583", "0.6324431", "0.63231283", "0.63186103", "0.6304864", "0.62486184", "0.6237706", "0.62323946", "0.62289023", "0.6223395", "0.6185318", "0.6128365", "0.61221963", "0.60953116", "0.60485137", "0.6047412", "0.60009575", "0.5993948", "0.59767765", "0.596445", "0.59581083", "0.59566617", "0.59306854", "0.59278816", "0.59172165", "0.5897419", "0.58794814", "0.58727336", "0.5856054", "0.58483994", "0.58317524", "0.5822577", "0.58124447", "0.58009356", "0.5783399", "0.5783399", "0.5783399", "0.57823473", "0.5781485", "0.57792723", "0.5759976", "0.5740138", "0.57387495", "0.5718433", "0.57159495", "0.5713459", "0.5704551", "0.56866425", "0.5675552", "0.56723195", "0.56723195", "0.56723195", "0.56723195", "0.56723195", "0.56723195", "0.56723195", "0.56723195", "0.56723195", "0.56723195", "0.56723195", "0.5671395", "0.56565416", "0.56565416", "0.56422454", "0.5635849", "0.5635849", "0.56328064", "0.56132907", "0.5612598", "0.56083304", "0.5606325" ]
0.6214276
39
This method checks whether the given string is a operator or a bracket, if not then it is a operand and returns true.
public boolean isOperand(String s) { return !Operator.isOperator(s) && !Brackets.isLeftBracket(s) && !Brackets.isRightBracket(s); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isOperator(String s) {\n\t\treturn (s.equals(\"+\") || s.equals(\"-\") || s.equals(\"*\") || s.equals(\"/\") || s.equals(\"^\"));\n\t}", "private boolean isOperator(String op){\n return (op.equals(\"+\") || op.equals(\"-\") || op.equals(\"*\") || op.equals(\"/\"));\n }", "private boolean isOperator(String input) {\n return new String(this.operator).contains(input);\n }", "private static boolean isOperator(String c)\n\t\t{\t\n\t\t\tif (c.equals(\"+\") || c.equals(\"-\") || c.equals(\"*\") || c.equals(\"/\") ) \n\t\t\t{\n\t\t\t\treturn true;\n\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}", "private boolean isOperator(String operator)\n {\n switch(operator)\n {\n case \"+\":\n case \"-\":\n case \"*\":\n case \"/\":\n case \"%\":\n return true;\n default:\n return false;\n }\n }", "private boolean isOperator(String value) {\r\n return value.equals(\"*\") || value.equals(\"/\") || value.equals(\"-\") || value.equals(\"+\") || value.equals(\"(\") || value.equals(\")\");\r\n }", "private boolean isOperator (String s){ \n for (int i = 0; i<operators.length; i++){\n if (s.equals(operators[i])){\n return true;\n }\n }\n return false;\n }", "private static boolean isOperator(String value){\r\n\t\tif (value.equals(\"+\") ||value.equals(\"-\")|| value.equals(\"*\")|| value.equals(\"/\"))\r\n\t\t\treturn true;\r\n\t\telse return false;\r\n\t}", "public boolean validOperator(char op){\n switch(op){\n case '+':\n case '-':\n case '*':\n case '/':\n case '^':\n case ')':\n case '(':\n return true;\n }\n\n return false;\n }", "private boolean isOperator(char ch)\n {\n if (ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '^')\n//returns true if either of the operator is found\n return true;\n//else returns false\n return false;\n }", "public static boolean isOperator(char c){\n return c == '+' || c == '-' || c == '*' || c == '/' || c == '%' \n || c == '(' || c == ')';\n }", "public boolean isOperator(char c){\n char[] operator = { '+', '-', '*', '/','^', ')', '(' };\r\n int temp = 0;\r\n for (int i = 0; i < operator.length; i++) {\r\n if (c == operator[i])\r\n temp +=1;\r\n }\r\n return temp != 0;\r\n }", "boolean operator(Character input){\r\n //detects operands\r\n if(input == '^'||input == '-'||input == '+'||input == '/'||input == '*'|| input =='('|| input ==')'){\r\n return true;\r\n }\r\n else\r\n return false;\r\n }", "public static boolean checkOperator(String inputChar){\r\n\t\tchar tempChar = inputChar.charAt(0);\r\n\t\t\r\n\t\tswitch(tempChar){\r\n\t\t\tcase '+': return true;\r\n\t\t\tcase '-': return true;\r\n\t\t\tcase '*': return true;\r\n\t\t\tcase '/': return true;\r\n\t\t\tcase '%': return true;\r\n\t\t\tcase '&': return true;\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "public boolean isOperator(char operator) {\r\n \tif (operator == '+' || operator == '-' ||\r\n \t\t\t\toperator == '*' || operator == '/' || \r\n \t\t\t\toperator == '^' || operator == '%') {\r\n \t\t\r\n \t\treturn true;\r\n \t} else {\r\n \t\treturn false;\r\n \t}\r\n \r\n }", "public boolean isOperator(char ch) {\n if (ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '^' || ch == '(' || ch == ')') {\n return true;\n }\n else {\n return false;\n }\n }", "private boolean isOperator(char input) {\n\t\tboolean isOperator = false;\n\t\t\n\t\tif((input == '+') || (input == '-') || (input == '*') || (input == '/'))\n\t\t{\n\t\t\tisOperator = true;\n\t\t}\n\t\t\n\t\treturn isOperator;\n\t}", "public boolean isOperator() {\n\t\treturn (letter == '+') || (letter == '*') ||\n\t\t\t (letter == '%') || (letter == '-') ? true : false;\n\t}", "public static boolean isOperator(String name) {\n if (name.length() == 0) {\n return false;\n }\n // Pieced together from various sources (JsYaccLexer, DefaultJsParser, ...)\n switch (name.charAt(0)) {\n case '+':\n return name.equals(\"+\") || name.equals(\"+@\");\n case '-':\n return name.equals(\"-\") || name.equals(\"-@\");\n case '*':\n return name.equals(\"*\") || name.equals(\"**\");\n case '<':\n return name.equals(\"<\") || name.equals(\"<<\") || name.equals(\"<=\") || name.equals(\"<=>\");\n case '>':\n return name.equals(\">\") || name.equals(\">>\") || name.equals(\">=\");\n case '=':\n return name.equals(\"=\") || name.equals(\"==\") || name.equals(\"===\") || name.equals(\"=~\");\n case '!':\n return name.equals(\"!=\") || name.equals(\"!~\");\n case '&':\n return name.equals(\"&\") || name.equals(\"&&\");\n case '|':\n return name.equals(\"|\") || name.equals(\"||\");\n case '[':\n return name.equals(\"[]\") || name.equals(\"[]=\");\n case '%':\n return name.equals(\"%\");\n case '/':\n return name.equals(\"/\");\n case '~':\n return name.equals(\"~\");\n case '^':\n return name.equals(\"^\");\n case '`':\n return name.equals(\"`\");\n default:\n return false;\n }\n }", "private boolean isOperator(char x) {\n return (x == '^' ||\n x == '*' ||\n x == '/' ||\n x == '+' ||\n x == '-');\n }", "private static boolean check_if_operator(char c)\n {\n return c == '+' || c == '-' || c == '*' || c == '/' || c == '^'|| c == 'r'\n || c == '(' || c == ')'|| c == 's' || c == 'c' || c == 't' || c == 'l';\n }", "private static boolean isOperator(char c) {\n return c == '+' ||\n c == '-' ||\n c == '*' ||\n c == '/';\n }", "public static boolean containLogicOperators(String str){\n return contains(str, logicOperatorPattern);\n }", "public boolean isValidOperator(String op)\n {\n return (normalizeOperator(op) != null);\n }", "private boolean isOperator(char ch) {\r\n\t\treturn (ch == '+' || ch == '-' || ch == '*' || ch == '/');\r\n\t}", "static boolean isOperator(char c) {\n return \"+\\u2212\\u00d7\\u00f7/*\".indexOf(c) != -1;\n }", "private boolean isOperator(char c) {\n\t\treturn c == '<' || c == '=' || c == '>' || c == '!';\n\t}", "public boolean isOperator(final char ch) {\n return (ch == '+' || ch == '-' \n || ch == '*' || ch == '/' \n || ch == '^');\n }", "public boolean isOperator(char character) {\n\t\tfor (int index= 0; index < JAVA_OPERATORS.length; index++) {\n\t\t\tif (JAVA_OPERATORS[index] == character)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "boolean hasOperator();", "public boolean isOperator(char ch) {\n\t\tString operatorPrefixes = \"=<>+*-/\";\n\t\tif (operatorPrefixes.indexOf(ch) != -1) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean isNotOperator(String substring) {\n\t\tString[] Operators = { \"*\", \"-\", \"+\", \"/\" };\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tif (substring.equals(Operators[i]))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private final boolean IsBinaryOp(String expression, String symbol, String leftExpression, String rightExpression) {\r\n boolean isBinaryOp = false;\r\n if (expression.contains(symbol)) {\r\n int openParanthesisCount = 0;\r\n int closeParanthesisCount = 0;\r\n for (int i = 0; (i < expression.length()); i++) {\r\n String currentChar = expression.substring(i, 1);\r\n if ((currentChar.equals(symbol) \r\n && (openParanthesisCount == closeParanthesisCount))) {\r\n leftExpression = expression.substring(0, i);\r\n rightExpression = expression.substring((i + 1), (expression.length() - (i - 1)));\r\n isBinaryOp = true;\r\n break;\r\n }\r\n else if (currentChar.equals(\"(\")) {\r\n openParanthesisCount++;\r\n }\r\n else if (currentChar.equals(\")\")) {\r\n closeParanthesisCount++;\r\n }\r\n \r\n }\r\n \r\n }\r\n \r\n return isBinaryOp;\r\n }", "public static boolean isOperator(String token) {\n if (Connective.getValueFromSymbol(token) == null) {\n return false;\n } else {\n return true;\n }\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 }", "private static boolean isOperator(String token) {\n\t\treturn OPERATORS.containsKey(token);\n\t}", "public boolean validCheck(String input) {\n\n int open= 0, closed = 0; //To count number of open and closed brackets\n\n if (input.length() >= 3 && input.length() <= 20) {\n inputArray = input.toCharArray(); //Convert the string to a Char Array\n\n if(!Character.isDigit(inputArray[0])) //If the first character isn't a number, it's not valid e.g +3*6\n return false;\n\n for (int i = 0; i < inputArray.length; i++) {\n\n if(inputArray[i] == '(') //if open bracket increment the open value..\n open +=1;\n if(inputArray[i] == ')') //same but with closed bracket\n closed+=1;\n\n if(i+1 < inputArray.length){ //to avoid array index out of bounds exception\n if (Character.isDigit(inputArray[i]) && Character.isDigit(inputArray[i + 1])) { //This makes sure no double digits\n return false;\n } else if ((validOperator(inputArray[i])) && (validOperator(inputArray[i + 1]) && inputArray[i+1] != '(')){ //no 2 operators in a row BUT ok if operator and open bracket\n if(inputArray[i] != ')'){ //To allow operand after a closed bracket e.g (3+1)+2\n return false;\n }\n\n }\n }\n if (!Character.isDigit(inputArray[i]) && !validOperator(inputArray[i])) { //not a number AND not a valid operator\n return false;\n }\n }\n\n if(open!= closed){ //Make sure the all open brackets are closed\n return false;\n }\n return true;\n\n }\n\n return false;\n }", "public static boolean isArithmeticOperand(char c)\n {\n return (c == '+') || (c == '-') || \n (c == '*') || (c == '/');\n }", "public boolean is(String strIn) {\n for (char ch: allOps) {\n if (strIn.equals(ch + \"\")){\n return true;\n }\n }\n return false;\n }", "public boolean validate(String userInput){\n int operandCount = 0, operatorCount = 0, leftParenCount = 0, rightParenCount = 0, inputLength = userInput.length();\n char ch;\n\n for(int i = 0; i < inputLength; i++){\n ch = userInput.charAt(i);\n\n if(ch == '('){\n leftParenCount++;\n }\n else if(ch == ')'){\n rightParenCount++;\n }\n\n if(isOperator(ch)){\n operatorCount++;\n }\n if(isOperand(ch)){\n operandCount++;\n }\n }\n\n for(int i = 0; i < inputLength - 1; i++){\n char ch1 = userInput.charAt(i);\n char ch2 = userInput.charAt(i + 1);\n if(isOperator(ch1) && isOperator(ch2)){\n return false;\n }\n }\n\n if(operandCount == 1 && operatorCount == 1){\n return false;\n }\n\n if((operandCount == 0) || (operatorCount == 0) || (leftParenCount != rightParenCount)){\n return false;\n }\n\n else if(isOperator(userInput.charAt(0)) && (userInput.charAt(0) != '(')){\n return false;\n }\n\n return true; // Validation Successful!\n }", "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}", "private boolean precedence(String input) {\n\t\tboolean complies = true;\n\t\t\n\t\tif(((input.equals(\"+\")) || (input.equals(\"-\"))) && (operationStack.empty() == false))\n\t\t{\n\t\t\tif((operationStack.peek().equals(\"*\")) || (operationStack.peek().equals(\"/\")))\n\t\t\t{\n\t\t\t\tcomplies = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn complies;\n\t}", "public void checkOperator (TextView tv){\n String s = tv.getText().toString().substring(tv.getText().length() - 1);\n if (s.equals(\")\") || s.equals(\"!\")) {\n //int a = 1;\n isOperator = false;\n } else if (Character.isDigit(tv.getText().toString().charAt(tv.getText().toString().length() - 1)))\n isOperator = false;\n else\n isOperator = true;\n }", "private boolean isSymbolOperatorAhead() {\r\n\t\treturn expression[currentIndex] == '*' || expression[currentIndex] == '+' || expression[currentIndex] == '!'\r\n\t\t\t\t|| (currentIndex + 2 < expression.length && expression[currentIndex] == ':'\r\n\t\t\t\t\t\t&& expression[currentIndex + 1] == '+' && expression[currentIndex + 2] == ':');\r\n\t}", "public static boolean hasPrecedence(char op1, char op2) {\n\n\t\tif (op2 == '(' || op2 == ')') {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ((op1 == '*' || op1 == '/') && (op2 == '+' || op2 == '-')){\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "private static boolean isOperand(char ch) {\n return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z');\n }", "public boolean isOperator(){\n return true;\n }", "static boolean isaNonMinusOperator(char s){\n boolean nonMinusOperator = false;\n switch (s){\n case '+':nonMinusOperator = true; break;\n case '*':nonMinusOperator = true; break;\n case '/':nonMinusOperator = true; break;\n case '^':nonMinusOperator = true; break;\n }\n return nonMinusOperator;\n }", "public boolean checkOperation(char operation) {\n boolean result = false;\n if (operation == '+' | operation == '-' | operation == '/' | operation == '*') {\n result = true;\n }\n return result;\n }", "static boolean validBrackets(String s){\n ArrayList<Character> arr = new ArrayList<Character>();\n for(int i = 0; i < s.length(); i++){\n if(s.charAt(i) == '{' || s.charAt(i) == '[' || s.charAt(i) == '('){\n arr.add(s.charAt(i));\n }else if(s.charAt(i) == '}'){\n if(arr.get(arr.size()-1) != '{'){\n return false;\n }\n arr.remove(arr.size()-1);\n }else if(s.charAt(i) == ']'){\n if(arr.get(arr.size()-1) != '['){\n return false;\n }\n arr.remove(arr.size()-1);\n }else if(s.charAt(i) == ')'){\n if(arr.get(arr.size()-1) != '('){\n return false;\n }\n arr.remove(arr.size()-1);\n }\n }\n return arr.isEmpty();\n }", "private boolean containsOperands(final String exp)\n {\n for (int i = 0; i < 10; i++) {\n if (exp.contains(\"\"+i))\n return true; //Expression contains a digit\n }\n return false; //Expression does not contain digits\n }", "private boolean isOperandsValid(String valueEntered, SearchOperator binaryOperator) {\n if (StringUtils.contains(valueEntered, binaryOperator.op())) {\n // using this split method to make sure we test both sides of the operator. Using String.split would\n // throw away empty strings, so e.g. \"&&100\".split(\"&&\") would return an array with one element, [\"100\"].\n String [] l = StringUtils.splitByWholeSeparatorPreserveAllTokens(valueEntered, binaryOperator.op());\n for(String value : l) {\n if (!isPassesDefaultValidation(value)) {\n return false;\n }\n }\n }\n\n return true;\n }", "private boolean isArithOp() throws IOException\n\t{\n\t\tboolean isValid = false;\n\t\t\n\t\tif(isRelation())\n\t\t{\n\t\t\tif(theNextToken.TokenType == TokenType.PLUS)\n\t\t\t{\n\t\t\t\tupdateToken();\n\t\t\t\tupdateToken();\n\t\t\t\t\n\t\t\t\tif(isArithOp())\n\t\t\t\t{\n\t\t\t\t\tisValid = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(theNextToken.TokenType == TokenType.MINUS)\n\t\t\t{\n\t\t\t\tupdateToken();\n\t\t\t\tupdateToken();\n\t\t\t\t\n\t\t\t\tif(isArithOp())\n\t\t\t\t{\n\t\t\t\t\tisValid = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tisValid = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn isValid;\n\t}", "private static boolean validOperation(String op) {\n\t\tfor (String goodOp : validOps) {\n\t\t\tif (goodOp.equalsIgnoreCase(op)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean isValid(String s) {\n Stack<Character> st = new Stack<>();\n for (int i = 0; i < s.length(); i++) {\n char input = s.charAt(i);\n if (input == '(' || input == '[' || input == '{') {\n st.push(input);\n } else {\n if (!st.isEmpty()) {\n char bracket = st.pop();\n switch (bracket) {\n case '[':\n if (input != ']') {\n return false;\n }\n break;\n case '(':\n if (input != ')') {\n return false;\n }\n break;\n default:\n if (input != '}') {\n return false;\n }\n\n }\n } else {\n return false;\n }\n }\n }\n return st.isEmpty();\n }", "public boolean parseBracket(String s) {\n return false;\n }", "public boolean isValid(String s) {\n if (s.isEmpty()) {\n return true;\n }\n\n HashMap<Character, Character> p = new HashMap<>();\n p.put('{', '}');\n p.put('(', ')');\n p.put('[', ']');\n\n Stack<Character> st = new Stack<>();\n\n for (char c : s.toCharArray()) {\n if (p.containsKey(c)) { // open\n st.push(p.get(c)); // lest push closed bracket to the stack\n } else { // close\n // we've got unexpected bracket\n if (st.empty() || !st.pop().equals(c)) {\n return false;\n }\n }\n }\n\n return st.empty();\n }", "public boolean matches(String value) {\n return matches(value, TokenType.OPERATOR);\n }", "public boolean isOperand(char ch) {\n if (Character.isDigit(ch)) {\n return true;\n }\n else {\n return false;\n }\n }", "private boolean dividingByZero(String operator){\n if (numStack.peek() == 0 && operator.equals(\"/\")){\n return true;\n }\n return false;\n }", "private static boolean checkValidTokenSequence(String curToken, String lastToken){\n\t\t//If an operand or right bracket comes directly before an operand return false\n\t\tif(curToken.equals(\"operand\") && (lastToken.equals(\"operand\") || lastToken.equals(\"right bracket\"))){\n\t\t\treturn false;\n\t\t}\n\t\t//If an operator or left bracket comes directly before an operator, return false\n\t\telse if(curToken.equals(\"operator\") && (lastToken.equals(\"operator\") || lastToken.equals(\"left bracket\"))){\n\t\t\treturn false;\n\t\t}\n\t\t//If a left bracket or operator comes directly before a right bracket return false\n\t\telse if(curToken.equals(\"right bracket\") && (lastToken.equals(\"left bracket\") || lastToken.equals(\"operator\"))){\n\t\t\treturn false;\n\t\t}\n\t\t//If an operand or right bracket comes directly before a left bracket, return false\n\t\telse if(curToken.equals(\"left bracket\") && (lastToken.equals(\"operand\") || lastToken.equals(\"right bracket\"))){\n\t\t\treturn false;\n\t\t}\n\n\t\t//Otherwise the sequence is valid\n\t\treturn true;\n\t}", "@Override\n public boolean isValidParenthesis(String str) {\n if (isEmptyOrNull(str)) {\n return true;\n }\n int counter = 0;\n int maxCounter = 0;\n for (char c : str.toCharArray()) {\n if (c == OPEN.getExpr()) {\n ++counter;\n ++maxCounter;\n }\n if (c == CLOSE.getExpr()) {\n if (counter > 0) {\n --counter;\n }\n --maxCounter;\n }\n if (c == WILDCHAR.getExpr()) {\n if (counter > 0) {\n --counter;\n }\n ++maxCounter;\n }\n if (maxCounter < 0) {\n return false; // too many CLOSE\n }\n }\n return (counter == 0);\n }", "private boolean isExpression() throws IOException\n\t{\n\t\tboolean isValid = false;\n\t\t\n\t\tif(isArithOp())\n\t\t{\n\t\t\tif(theNextToken.TokenType == TokenType.AND)\n\t\t\t{\n\t\t\t\tupdateToken();\n\t\t\t\tupdateToken();\n\t\t\t\t\n\t\t\t\tif(isExpression())\n\t\t\t\t{\n\t\t\t\t\tisValid = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(theNextToken.TokenType == TokenType.OR)\n\t\t\t{\n\t\t\t\tupdateToken();\n\t\t\t\tupdateToken();\n\t\t\t\t\n\t\t\t\tif(isExpression())\n\t\t\t\t{\n\t\t\t\t\tisValid = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tisValid = true;\n\t\t\t}\n\t\t}\n\t\telse if(theCurrentToken.TokenType == TokenType.NOT)\n\t\t{\n\t\t\tupdateToken();\n\t\t\tif(isArithOp())\n\t\t\t{\n\t\t\t\tisValid = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn isValid;\n\t}", "public void operator(String str) {\n if (!(emptyStack()) && (OperatorOperand.operatorPrecedence(str)\n <= OperatorOperand.operatorPrecedence(expStack.lastElement()))) {\n String stackTop = expStack.lastElement();\n while ((!(stackTop.equals(\"(\"))) || (OperatorOperand.operatorPrecedence(str)\n <= OperatorOperand.operatorPrecedence(expStack.lastElement()))) {\n postFix.add(stackTop);\n expStack.pop();\n if (!(emptyStack())) {\n stackTop = expStack.lastElement();\n continue;\n }\n break;\n }\n }\n expStack.push(str);\n }", "public static boolean balancedBrackets(String str) {\n Hashtable < Character, Character > lookUpClosingBracket = new Hashtable < Character, Character > ();\n lookUpClosingBracket.put('{', '}');\n lookUpClosingBracket.put('(', ')');\n lookUpClosingBracket.put('[', ']');\n\n Stack < Character > stack = new Stack < Character > ();\n\n for (int i = 0; i < str.length(); i++) {\n char currentBracket = str.charAt(i);\n\n if (currentBracket == '{' || currentBracket == '(' || currentBracket == '[')\n stack.push(currentBracket);\n else if (currentBracket == '}' || currentBracket == ')' || currentBracket == ']') {\n if (stack.isEmpty())\n return false;\n\n char openingBracket = (Character) stack.pop();\n\n char expectedClosingBracket = lookUpClosingBracket.get(openingBracket);\n\n if (currentBracket != expectedClosingBracket)\n return false;\n }\n\n }\n\n if (!stack.isEmpty())\n return false;\n\n return true;\n }", "private static boolean balancedBrackets(String str) {\n String openingBrackets = \"({[\";\n String closingBrackets = \")}]\";\n HashMap<Character, Character> matchingBrackets = new HashMap<>();\n matchingBrackets.put(')', '(');\n matchingBrackets.put('}', '{');\n matchingBrackets.put(']', '[');\n Stack<Character> stack = new Stack<>();\n for (int i = 0; i < str.length(); i++) {\n char c = str.charAt(i);\n if (openingBrackets.indexOf(c) != -1) {\n stack.push(c);\n } else if (closingBrackets.indexOf(c) != -1) {\n if (stack.isEmpty()) return false;\n if (stack.pop() != matchingBrackets.get(c)) return false;\n }\n }\n return stack.isEmpty();\n }", "public static boolean isBalancedParentheses(String str) {\r\n\t\tStack<Character> stk = new Stack<Character>();\r\n\t\tfor (int i = 0; i < str.length(); i++) {\r\n\t\t\tchar ch = str.charAt(i);\r\n\t\t\tif (ch == '(' || ch == '[') {\r\n\t\t\t\tstk.push(ch);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (ch == ')' || ch == ']') {\r\n\t\t\t\tif (!stk.isEmpty() && (stk.peek() == '(' || stk.peek() == '[')) {\r\n\t\t\t\t\tstk.pop();\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tstk.push(ch);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn stk.isEmpty();\r\n\t}", "public static boolean checkOperand(String inputChar){\r\n\t\tchar tempChar = inputChar.charAt(0);\r\n\t\t\r\n\t\tif(tempChar >= 48 && tempChar <= 57)\r\n\t\t\treturn true;\r\n\t\telse if(tempChar == 'x' || tempChar == 'X')\r\n\t\t\treturn true;\r\n\t\t\r\n\t\treturn false;\r\n\t}", "public static boolean operationValidator(String str) {\n final Pattern pattern = Pattern.compile(\".\");\n\n return pattern.matcher(str).matches();\n\n }", "private boolean isBracketAhead() {\r\n\t\treturn expression[currentIndex] == '(' || expression[currentIndex] == ')';\r\n\t}", "private static boolean Question5(String s) {\n\t\t// take a empty stack of characters\n\t\tStack<Character> st = new Stack<Character>();\n\t\t\n\t\t// traverse the input expression\n\t\tfor(int i=0, n = s.length(); i<n ; i++) {\n\t\t\t\n\t\t\tchar curr = s.charAt(i);\n\t\t\t\n\t\t\t// if current char in the expression is a opening brace,\n\t\t\t// push it to the stack\n\t\t\tif(curr == '(' || curr == '{' || curr == '[' ) {\n\t\t\t\tst.push(curr);\n\t\t\t}\t\t\t\n\t\t\telse { // Its } or ) or ]\n\t\t\t\t\n\t\t\t\t// return false if mismatch is found (i.e. if stack is\n\t\t\t\t// empty, the number of opening braces is less than number\n\t\t\t\t// of closing brace, so expression cannot be balanced)\n\t\t\t\tif(st.isEmpty())\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t\t// pop character from the stack\n\t\t\t\tchar top = st.pop();\n\t\t\t\tif( top == '(' && curr != ')' ||\n\t\t\t\t\ttop == '[' && curr != ']' ||\n\t\t\t\t\ttop == '{' && curr != '}' )\n\t\t\t\t\treturn false;\t\t\t\n\t\t\t}\n\t\t}\n\t\t// expression is balanced only if stack is empty at this point\n\t\treturn st.isEmpty();\n\t}", "protected boolean isAddOp(char c) {\r\n\t\treturn (c == '+' || c == '-');\r\n\t}", "private void processOperator() {\r\n\t\tif (expression[currentIndex] == '*') {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.AND_STRING);\r\n\t\t} else if (expression[currentIndex] == '+') {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.OR_STRING);\r\n\t\t} else if (expression[currentIndex] == '!') {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.NOT_STRING);\r\n\t\t} else {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.XOR_STRING);\r\n\t\t\t// xor operator has 2 characters more than any other operator.\r\n\t\t\tcurrentIndex += 2;\r\n\t\t}\r\n\r\n\t\tcurrentIndex++;\r\n\t}", "private static char getOperator() throws ParseError {\n TextIO.skipBlanks(); // Skip past any blanks in the input.\n\n char op = TextIO.peek();\n\n if ( op == '+' || op == '-' || op == '*' || op == '/' )\n TextIO.getAnyChar(); // Read the operator.\n else\n throw new ParseError( \"Found \" + op + \" instead of an operator.\" );\n\n return op;\n\n }", "private boolean isParenthesis(char x) {\n return x == '(' || x == ')';\n }", "private boolean peekedHasPrecedence(\tchar peeked,\r\n\t\t\t\t\t\t\t\t\t\t\tchar current )\r\n\t{\r\n\t\tif ( ( peeked == '+' || peeked == '-' ) && ( current == '*' || current == '/' ) )\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}//end if\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}//end else\r\n\t}", "public boolean balancedparantheses(String exp) {\n\t\tStack<Character> stack = new Stack<Character>();\n\t\tfor (int i = 0; i < exp.length(); i++) {\n\t\t\tchar charValue = exp.charAt(i);\n\t\t\tif (charValue == '[' || charValue == '(' || charValue == '{') {\n\t\t\t\tstack.push(charValue);\n\t\t\t} else if (charValue == ']') {\n\t\t\t\tif (stack.isEmpty()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (stack.pop() != '[') {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else if (charValue == ')') {\n\t\t\t\tif (stack.isEmpty()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (stack.pop() != '(') {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else if (charValue == '}') {\n\t\t\t\tif (stack.isEmpty()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (stack.pop() != '{') {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn stack.isEmpty();\n\t}", "public boolean validOperands()\r\n {\r\n boolean returnValue = true;\r\n\r\n if (leftOperand == null || leftOperand.trim().equals(\"\") || rightOperand == null\r\n || rightOperand.trim().equals(\"\"))\r\n {\r\n returnValue = false;\r\n }\r\n\r\n return returnValue;\r\n }", "public boolean isValid(String s) {\n if (s.charAt(0) == ')' || s.charAt(0) == ']' || s.charAt(0) == '}') {\n return false;\n }\n Stack<Character> stack = new Stack<>();\n for (char c : s.toCharArray()) {\n switch (c) {\n case '(':\n case '[':\n case '{':\n stack.push(c);\n break;\n case ')':\n if (stack.isEmpty() || stack.pop() != '(') {\n return false;\n }\n break;\n case '}':\n if (stack.isEmpty() || stack.pop() != '{') {\n return false;\n }\n break;\n case ']':\n if (stack.isEmpty() || stack.pop() != '[') {\n return false;\n }\n break;\n }\n }\n return stack.isEmpty();\n }", "public static boolean isValid(String str) {\n\n if (null == str || \"\".equals(str.trim()))\n return false;\n\n Stack<Character> stack = new Stack();\n\n for (char ch : str.toCharArray()) {\n if (ch == '(' || ch == '[' || ch == '{') {\n stack.push(ch);\n }\n if (ch == ')' || ch == ']' || ch == '}') {\n if (stack.isEmpty()) return false;\n switch (ch) {\n case ')':\n ch = '(';\n break;\n case ']':\n ch = '[';\n break;\n case '}':\n ch = '{';\n break;\n }\n if (stack.peek() != ch) {\n return false;\n } else {\n stack.pop();\n }\n }\n }\n return stack.isEmpty();\n }", "boolean isOp();", "private boolean isSign( char in )\r\n\t{\r\n\t\treturn ( in=='*' || in=='/' || in=='+' || in=='-' );\r\n\t}", "public static boolean isExpression(String expr) {\r\n return expr != null && expr.startsWith(\"%{\") && expr.endsWith(\"}\");\r\n }", "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 }", "private boolean isOutsideOfBracket(String expr, int pos) {\r\n int level = 0;\r\n \r\n for (int i = 0; i < expr.length(); i++) {\r\n char c = expr.charAt(i);\r\n \r\n if (c == BRACKET_OPEN) {\r\n level++;\r\n } else if (c == BRACKET_CLOSE) {\r\n level--;\r\n }\r\n \r\n if (i == pos) {\r\n return level == 0;\r\n }\r\n }\r\n \r\n return true;\r\n }", "public String operator( String op);", "private boolean temMaisQueUmOperador(String currentResult) {\n int contador = 1;\n\n if (currentResult.contains(\"+\")) {\n contador = contador + 1;\n }\n\n if (currentResult.contains(\"-\")) {\n contador = contador + 1;\n }\n\n if (currentResult.contains(\"*\")) {\n contador = contador + 1;\n }\n\n if (contador > 1) {\n return true;\n }\n\n return false;\n }", "public boolean isValid_(String s) {\n\n if (s.length() % 2 != 0){\n return false;\n }\n\n Stack st = new Stack();\n\n for (int i = 0; i < s.length(); i++){\n\n String cur = String.valueOf(s.charAt(i));\n\n if (cur.equals(\"(\")){\n st.push(\")\");\n continue;\n }\n else if (cur.equals(\"{\")){\n st.push(\"}\");\n continue;\n }\n else if (cur.equals(\"[\")){\n st.push(\"]\");\n continue;\n }\n else{\n if (st.empty()){\n return false;\n }else{\n String _cur = (String) st.pop();\n if (!_cur.equals(cur)){\n return false;\n }\n }\n }\n\n }\n return true ? st.empty() : false;\n }", "public static boolean isParentheses(char c)\n {\n return (c == '(') || (c == ')');\n }", "private boolean isSpaceOrBracket(char c) {\n\t\t\treturn (c == '\\t' || c == '\\n' || c == ' ' || c == '(' || c == ')');\n\t\t}", "static boolean checkingBalanceBrackets(String brac) {\r\n\t\t\r\n\t\tStack <Character> inputString = new Stack<Character>();\r\n\t\t\r\n\t\tfor(int i=0;i<brac.length();i++) {\r\n\t\t\tchar bracChar = brac.charAt(i);\r\n\t\t\tif(bracChar == '(' || bracChar == '{' || bracChar == '[') {\r\n\t\t\t\tinputString.push(bracChar);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\t\r\n\t\t\tif(inputString.isEmpty()) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t//Check if we had inputed closing braces and start check for matching Open braces\r\n\t\t\tchar localChar;\r\n\t\t\tswitch(bracChar) \r\n\t\t\t{\r\n\t\t\t\tcase')' :\r\n\t\t\t\t{\r\n\t\t\t\t\tlocalChar = inputString.pop();\r\n\t\t\t\t\tif(localChar == '{' || localChar == '[') {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\t\r\n\t\t\t\t}\r\n\t\t\t\tcase '}' :\r\n\t\t\t\t{\r\n\t\t\t\t\tlocalChar = inputString.pop();\r\n\t\t\t\t\tif(localChar == '(' || localChar == '[') \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak; \r\n\t\t\t\t}\r\n\t\t\t\tcase ']' :\r\n\t\t\t\t{\r\n\t\t\t\t\tlocalChar = inputString.pop();\r\n\t\t\t\t\tif(localChar == '(' || localChar == '{') \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak; \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\r\n\t\t\r\n\t\treturn (inputString.isEmpty());\r\n\t}", "private boolean isRightParen(char input)\n\t\t{\n\t\t\tboolean isRightParen = false;\n\t\t\t\n\t\t\tif(input == ')')\n\t\t\t{\n\t\t\t\tisRightParen = true;\n\t\t\t}\n\t\t\t\n\t\t\treturn isRightParen;\n\t\t}", "public boolean isOp(){\n return opSet.contains(symbol());\n }", "private boolean postFixEvalution(char operator) throws ArithmeticException{\n //Pre: Validar que el stack no este vacio y que los operandos sean numeros.\n //Post: Realizar la operacion indicada\n try{\n if(!stack.empty()){\n //Se obtienen los dos operandos mas recientes del stack.\n Integer op2 = stack.pop();\n Integer op1 = stack.pop();\n\n //Se determina la operacion por hacer.\n if(op1 != null && op2 != null){\n switch (operator){\n case '+':\n stack.push(op1 + op2);\n break;\n case '-':\n stack.push(op1 - op2);\n break;\n case '*':\n stack.push(op1 * op2);\n break;\n case '/':\n stack.push(op1 / op2);\n break;\n }\n return true;\n }\n else\n return false;\n }\n else{\n return false;\n }\n }\n catch (ArithmeticException e){\n String ex = \"Error: Division por 0\";\n throw new ArithmeticException(ex);\n }\n }", "private boolean parseOpeningBracket() {\n if (index < end && source.charAt(index) == '[') {\n index++;\n return true;\n }\n return false;\n }", "@Override\r\n\tpublic boolean visit(QualifiedName node) {\r\n\t\toperand(node,node.getFullyQualifiedName());\r\n\t\treturn false;\r\n\t}", "public static Expr parse(String str) {\r\n\t\tExprBinary at = new ExprBinary(null, null); // the root of the tree\r\n\t\tStringBuilder opstore = new StringBuilder(); // stores operator characters\r\n\t\tStringBuilder adder = new StringBuilder(); // stores value characters\r\n\t\tboolean text = false; // whether inside of a string\r\n\r\n\t\tfor (int i = 0; i < str.length(); i++) {\r\n\t\t\tchar c = str.charAt(i);\r\n\t\t\tboolean add = (c != '\\\\'); // whether to add the char to adder. ignore escape char\r\n\t\t\tboolean leftSide = (opstore.length() == 0); // whether on the left side of the binary expression (before the operator)\r\n\t\t\tString adderStr = adder.toString();\r\n\t\t\tString opStr = opstore.toString();\r\n\r\n\t\t\tif (c == '\"') { // string\r\n\t\t\t\tif (i == 0 || str.charAt(i - 1) != '\\\\') {\r\n\t\t\t\t\ttext = !text; // ignore string contents\r\n\t\t\t\t}\r\n\t\t\t} else if (!text) {\r\n\t\t\t\tif (c == ' ') {\r\n\t\t\t\t\tadd = false; // ignore spaces\r\n\t\t\t\t} else if (c == '(') { // grouping or function\r\n\t\t\t\t\tint closeIndex = getExitIndex(str, i);\r\n\t\t\t\t\tString contents = str.substring(i + 1, closeIndex);\r\n\t\t\t\t\tExpr group; // the expression denoted by the parentheses group\r\n\r\n\t\t\t\t\tif (i > 0 && (!isReserved(str.charAt(i - 1)) || str.charAt(i - 1) == ')')) { // function\r\n\t\t\t\t\t\tif (adderStr.isEmpty()) { // function reference call ... func()()\r\n\t\t\t\t\t\t\tExpr leftLink = leftSide ? at.left() : at.right();\r\n\t\t\t\t\t\t\tExprCall rightLink = new ExprCall(null, contents); // a reference call is only a parameter group, null name\r\n\t\t\t\t\t\t\tgroup = new ExprCallChain(leftLink, rightLink);\r\n\r\n\t\t\t\t\t\t} else { // function call\r\n\t\t\t\t\t\t\tif (adderStr.startsWith(\".\")) { // function sub call ... func().subfunc()\r\n\t\t\t\t\t\t\t\tExpr leftLink = leftSide ? at.left() : at.right();\r\n\t\t\t\t\t\t\t\tExprCall rightLink = new ExprCall(adderStr.substring(1), contents);\r\n\t\t\t\t\t\t\t\tgroup = new ExprCallChain(leftLink, rightLink);\r\n\r\n\t\t\t\t\t\t\t} else { // standalone function ... func()\r\n\t\t\t\t\t\t\t\tif (Character.toString(adderStr.charAt(0)).equals(Operator.REF.op)) { // @func()\r\n\t\t\t\t\t\t\t\t\tgroup = new ExprFuncRef(adderStr.substring(1), contents);\r\n\t\t\t\t\t\t\t\t} else { // func()\r\n\t\t\t\t\t\t\t\t\tgroup = new ExprCall(adderStr, contents);\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} else { // parenthetical grouping\r\n\t\t\t\t\t\tchar cc = (adderStr.length() == 1 ? adderStr.charAt(0) : 0); // operator before parenthesis ... !()\r\n\t\t\t\t\t\tif (isReserved(cc)) { // operation on the group\r\n\t\t\t\t\t\t\tgroup = new ExprUnary(Operator.get(Character.toString(cc)), parse(contents));\r\n\t\t\t\t\t\t} else { // ignore character, not an operator\r\n\t\t\t\t\t\t\tgroup = parse(contents);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// add to tree\r\n\t\t\t\t\tif (leftSide) at.setLeft(group);\r\n\t\t\t\t\telse at.setRight(group);\r\n\r\n\t\t\t\t\tadder.setLength(0);\r\n\t\t\t\t\ti = closeIndex;\r\n\t\t\t\t\tadd = false;\r\n\r\n\t\t\t\t} else if (c == '{') { // array initializer ... {}\r\n\t\t\t\t\tint closeIndex = getExitIndex(str, i);\r\n\t\t\t\t\tExpr arr = new ExprArray(str.substring(i + 1, closeIndex), adderStr);\r\n\r\n\t\t\t\t\tif (adderStr.length() == 1 && isReserved(adderStr.charAt(0))) {\r\n\t\t\t\t\t\t// unary op done on array initializer ... !{}\r\n\t\t\t\t\t\tarr = new ExprUnary(Operator.get(Character.toString(adderStr.charAt(0))), arr);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (leftSide) at.setLeft(arr);\r\n\t\t\t\t\telse at.setRight(arr);\r\n\r\n\t\t\t\t\tadder.setLength(0);\r\n\t\t\t\t\ti = closeIndex;\r\n\t\t\t\t\tadd = false;\r\n\r\n\t\t\t\t} else if (isOp(c)) { // operator\r\n\t\t\t\t\t// add value used in operation to tree\r\n\t\t\t\t\tif (!adderStr.isEmpty()) {\r\n\t\t\t\t\t\tif (leftSide) { // ex: adderStr + ___\r\n\t\t\t\t\t\t\tat.setLeft(parseValue(adderStr));\r\n\t\t\t\t\t\t} else { // ex: (___ + adderStr) + ___\r\n\t\t\t\t\t\t\tat.setRight(parseValue(adderStr));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (opStr.equals(\"\") || (i > 0 && isOp(str.charAt(i - 1)))) { // accumulate operator from adjacent operator characters (ex: != consists of ! and =)\r\n\t\t\t\t\t\tif (!(adderStr.isEmpty() && (opStr + c).equals(\"-\")) && (Operator.get(opStr + c) != null || (opStr.isEmpty() && isOp(c)))) {// if the operator exists, then it is an operator character\r\n\t\t\t\t\t\t\tif (opStr.equals(\"-\") && c == '-') { // this and the above line handle negatives and double negatives\r\n\t\t\t\t\t\t\t\topStr = \"+\";\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\topStr += c;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tadd = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else { // existing operator operation must be added to tree ... in \"(a + b) * c\", \"(a+b)\" must be abstracted-out so we get \"x * c\"\r\n\t\t\t\t\t\tint endIndex = i + 1; // end index of operator\r\n\r\n\t\t\t\t\t\t// get entire operator if operator is more than 1 character long\r\n\t\t\t\t\t\tfor (int i2 = endIndex; i2 < str.length(); i2++) {\r\n\t\t\t\t\t\t\tif (isOp(str.charAt(i2))) endIndex++;\r\n\t\t\t\t\t\t\telse break;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tOperator nextOp = Operator.get(str.substring(i, endIndex)); // second (right-most) operator\r\n\t\t\t\t\t\tat.op = Operator.get(opStr); // first (left-most) operator\r\n\r\n\t\t\t\t\t\t// group values in operation by operator precedence\r\n\t\t\t\t\t\tint p1 = precedence(nextOp); // right-most op\r\n\t\t\t\t\t\tint p2 = precedence(at.op); // left-most op\r\n\r\n\t\t\t\t\t\tif (p1 > p2) { // group around the right-most op\r\n\t\t\t\t\t\t\tExprBinary right = new ExprBinary(at, nextOp);\r\n\t\t\t\t\t\t\tright.setLeft(at.right());\r\n\r\n\t\t\t\t\t\t\tat.setRight(right);\r\n\t\t\t\t\t\t\tat = right;\r\n\r\n\t\t\t\t\t\t} else if (p1 < p2) { // group around the left-most op\r\n\t\t\t\t\t\t\tExprBinary last = at;\r\n\t\t\t\t\t\t\tExprBinary match = at.parent();\r\n\r\n\t\t\t\t\t\t\t// correctly add to the binary tree based on precedence of operators\r\n\t\t\t\t\t\t\twhile (match instanceof ExprBinary && p1 < (p2 = precedence(((ExprBinary) match).op))) {\r\n\t\t\t\t\t\t\t\tlast = match;\r\n\t\t\t\t\t\t\t\tmatch = match.parent();\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tExprBinary tr = new ExprBinary(match, nextOp);\r\n\t\t\t\t\t\t\ttr.setLeft(last);\r\n\r\n\t\t\t\t\t\t\tif (match != null) {\r\n\t\t\t\t\t\t\t\tif (last == match.right()) match.setRight(tr);\r\n\t\t\t\t\t\t\t\telse match.setLeft(tr);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tat = tr;\r\n\r\n\t\t\t\t\t\t} else { // group from left to right (equal operator precedence)\r\n\t\t\t\t\t\t\tExprBinary left = new ExprBinary(at, at.op); // group existing values into left node, add right to open right node spot\r\n\t\t\t\t\t\t\tleft.setLeft(at.left());\r\n\t\t\t\t\t\t\tleft.setRight(at.right());\r\n\r\n\t\t\t\t\t\t\tat.op = nextOp;\r\n\t\t\t\t\t\t\tat.setLeft(left);\r\n\t\t\t\t\t\t\tat.setRight(null);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\topStr = nextOp.op;\r\n\t\t\t\t\t\ti = endIndex - 1;\r\n\t\t\t\t\t\tadd = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tadder.setLength(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// store valid value characters\r\n\t\t\tif (add) {\r\n\t\t\t\tadder.append(c);\r\n\r\n\t\t\t\t// if this is the last character, then add the stored value to the tree.\r\n\t\t\t\t// otherwise, would be incorrectly ignored because there is no next operator\r\n\t\t\t\tif (i + 1 == str.length()) {\r\n\t\t\t\t\tif (opstore.length() == 0) {\r\n\t\t\t\t\t\tat.setLeft(parseValue(adder.toString()));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tat.setRight(parseValue(adder.toString()));\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\t// initialize binary tree operator if not done so already\r\n\t\tif (at.op == null) {\r\n\t\t\tat.op = Operator.get(opstore.toString());\r\n\t\t}\r\n\r\n\t\t// after traversing the tree to some point, we need to get back to root so we can return the entire tree\r\n\t\twhile (at.parent() != null) {\r\n\t\t\tat = (ExprBinary) at.parent();\r\n\t\t}\r\n\r\n\t\t// the expression may not actually be a binary operation\r\n\t\tif (at.op == null && at.right() == NULL) {\r\n\t\t\tif (at.left() == NULL) return NULL; // the expression is empty\r\n\t\t\treturn at.left(); // the expression is a single value/unary-operation\r\n\t\t}\r\n\r\n\t\treturn at;\r\n\t}", "public boolean isParenth(String x){\n if (x.equals(\")\") || x.equals(\"(\")){\n return true;\n }\n \n return false;\n }", "private boolean hasValidCharacters(final String exp)\n {\n for(int i=0; i<exp.length(); i++)\n {\n /*\n If the character is not a part of an operand, an\n operator, or a space, then expression is invalid\n */\n if(!isNumPart(i,exp)\n && !isOperator(exp.charAt(i))\n && exp.charAt(i) != ' ')\n return false; //Invalid character detected\n }\n return true; //All characters are valid\n }", "static boolean areParanthesisBalanced(String str) \r\n\t\t{ \r\n\t\t\t// Using ArrayDeque is faster than using Stack class \r\n\t\t\tDeque<Character> stack = new ArrayDeque<Character>(); \r\n\t\t\tfor (int i = 0; i < str.length(); i++) {\r\n\t\t\tchar ch = str.charAt(i);\r\n\t\t\tif (ch == '[' || ch == '(' || ch == '{') {\r\n\t\t\t\tstack.push(ch);\r\n\t\t\t} else if ((ch == ']' || ch == '}' || ch == ')')\r\n\t\t\t\t\t&& (!stack.isEmpty())) {\r\n\t\t\t\tif (((char) stack.peek() == '(' && ch == ')')\r\n\t\t\t\t\t\t|| ((char) stack.peek() == '{' && ch == '}')\r\n\t\t\t\t\t\t|| ((char) stack.peek() == '[' && ch == ']')) {\r\n\t\t\t\t\tstack.pop();\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ((ch == ']' || ch == '}' || ch == ')')) {\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\t\t}\r\n\t\t\treturn (stack.isEmpty());\r\n\t\t\t}" ]
[ "0.8001847", "0.7897919", "0.769988", "0.7696501", "0.7627846", "0.7625451", "0.76241404", "0.75995886", "0.74659127", "0.73755175", "0.73656064", "0.73646337", "0.7339946", "0.7328608", "0.7281696", "0.7257773", "0.72532344", "0.722705", "0.72067446", "0.7205833", "0.7191026", "0.7187127", "0.716603", "0.7159954", "0.7101083", "0.708367", "0.70243984", "0.6963524", "0.69367164", "0.68643403", "0.6855142", "0.6848338", "0.6812094", "0.67746717", "0.67154664", "0.670423", "0.66149044", "0.6580334", "0.6527501", "0.6478444", "0.6473304", "0.6471064", "0.64546686", "0.6451747", "0.6405145", "0.6378685", "0.63648826", "0.63503164", "0.6347031", "0.6321167", "0.62811697", "0.6264665", "0.6186974", "0.61633205", "0.6156622", "0.6150773", "0.61445", "0.61399734", "0.61169755", "0.60761845", "0.6055909", "0.6043889", "0.6037035", "0.60231584", "0.5992123", "0.59711903", "0.594586", "0.5941173", "0.5939035", "0.5905972", "0.59037495", "0.5901794", "0.58753943", "0.5859919", "0.5857626", "0.5851082", "0.5829399", "0.58230084", "0.5804179", "0.5785942", "0.5779292", "0.57791686", "0.5778682", "0.5776602", "0.5769742", "0.575674", "0.5755666", "0.57381624", "0.57353926", "0.5732146", "0.5706428", "0.5704005", "0.56977093", "0.56804454", "0.5677287", "0.566743", "0.56672484", "0.5656065", "0.5647153", "0.56402194" ]
0.7715141
2
Sets Replayer settings. Adjusts saveDirectory etc. and loads map.
public void setSettings(final Properties settings) { this.settings = settings; replay = new Replay(settings); for(final MenuItem item : eventMenu.getItems()) { if (item instanceof CustomMenuItem) { final String event = item.getText(); final CustomMenuItem customItem = ((CustomMenuItem) item); if (customItem.getContent() instanceof CheckBox) { final CheckBox checkBox = (CheckBox) customItem.getContent(); checkBox.setSelected(replay.notableEvents.contains(event)); } } } zoomStep = Integer.parseInt(settings.getProperty("zoom.step", "100")); daysCombo.getItems().addAll(settings.getProperty("list.delta.per.tick", "1;30;365").split(";")); daysCombo.getSelectionModel().select(settings.getProperty("delta.per.tick", "1")); try { periodCombo.getSelectionModel().select(Integer.parseInt(settings.getProperty("period.per.tick", "0"))); } catch (NumberFormatException e) { periodCombo.getSelectionModel().selectFirst(); settings.setProperty("period.per.tick", "0"); } langCombo.getSelectionModel().select(settings.getProperty("locale.language", "en")); replay.drawBorders = "true".equals(settings.getProperty("borders", "false")); focusEdit.setText(settings.getProperty("focus", "")); saveDirectory = new File(settings.getProperty("save.dir", "")); if (!saveDirectory.exists() || !saveDirectory.isDirectory()) { saveDirectory = new File(Replay.DEFAULT_SAVE_DIR); if (!saveDirectory.exists() || !saveDirectory.isDirectory()) { saveDirectory = new File(System.getProperty("user.home"), "/"); } } serDirectory = new File(settings.getProperty("ser.dir", "")); if (!serDirectory.exists() || !serDirectory.isDirectory()) { serDirectory = new File(Replay.DEFAULT_SAVE_DIR); if (!serDirectory.exists() || !serDirectory.isDirectory()) { serDirectory = new File(System.getProperty("user.home"), "/"); } } subjectsCheckMenuItem.setSelected(replay.subjectsAsOverlords); gifMenu.setVisible(!settings.getProperty("gif", "false").equals("true")); gifLoopCheckMenuItem.setSelected(settings.getProperty("gif.loop", "true").equals("true")); gifWidthEdit.setText(settings.getProperty("gif.width", "0")); gifHeightEdit.setText(settings.getProperty("gif.height", "0")); gifBreakEdit.setText(settings.getProperty("gif.new.file", "0")); gifStepEdit.setText(settings.getProperty("gif.step", "100")); gifDateCheckMenuItem.setSelected(settings.getProperty("gif.date", "true").equals("true")); gifDateColorPicker.setValue(Color.web(settings.getProperty("gif.date.color", "0x000000"))); gifDateSizeEdit.setText(settings.getProperty("gif.date.size", "12")); gifDateXEdit.setText(settings.getProperty("gif.date.x", "60")); gifDateYEdit.setText(settings.getProperty("gif.date.y", "60")); gifSubimageCheckMenuItem.setSelected(settings.getProperty("gif.subimage", "false").equals("true")); gifSubimageXEdit.setText(settings.getProperty("gif.subimage.x", "0")); gifSubimageYEdit.setText(settings.getProperty("gif.subimage.y", "0")); gifSubimageWidthEdit.setText(settings.getProperty("gif.subimage.width", "")); gifSubimageHeightEdit.setText(settings.getProperty("gif.subimage.height", "")); bordersCheckMenuItem.setSelected(settings.getProperty("borders", "false").equals("true")); disableLog = settings.getProperty("log.disable", "false").equals("true"); eu4Directory = new File(settings.getProperty("eu4.dir")); try { lock.acquire(); loadData(); } catch (InterruptedException e) { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setMap()\n {\n gameManager.setMap( savedFilesFrame.getCurrent_index() );\n }", "public void loadMap(Player player) {\r\n\tregionChucks = RegionBuilder.findEmptyChunkBound(8, 8); \r\n\tRegionBuilder.copyAllPlanesMap(235, 667, regionChucks[0], regionChucks[1], 8);\r\n\t\r\n\t}", "public void reload() {\n\n\t\tPlayerCache.reloadFile(); // load /save playercache.dat\n\n\t\t// next, update all playercaches\n\n\t\tupdatePlayerCaches();\n\n\n\t}", "public void loadMap(){\n level= dataBase.getData(\"MAP\",\"PLAYER\");\n }", "private void loadMap(String path) {\n\t\ttry {\n\t\t\tfor(Player p : players)\tp.clear();\n\t\t\tmap.players = players;\n\t\t\tmap.setPlayerNumber(playerNumber);\n\t\t\tfor(Player p : map.players) {\n\t\t\t\tp.setMap(map);\n\t\t\t\tp.setArmies(map.getInitialArmiesNumber());\n\t\t\t}\n\t\t\tmap.setPlayerNumber(map.players.size());\n\t\t\tmap.load(path);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void loadMap() {\n\n try {\n new File(this.mapName).mkdir();\n FileUtils.copyDirectory(\n new File(this.plugin.getDataFolder() + \"/maps/\" + this.mapName), new File(this.mapName));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n WorldCreator wc = new WorldCreator(this.mapName);\n World world = wc.createWorld();\n world.setAutoSave(false);\n world.setPVP(false);\n world.setDifficulty(Difficulty.PEACEFUL);\n world.setGameRuleValue(\"doDaylightCycle\", \"false\");\n world.setGameRuleValue(\"mobGriefing\", \"false\");\n world.setGameRuleValue(\"doMobSpawning\", \"false\");\n world.setGameRuleValue(\"doFireTick\", \"false\");\n world.setGameRuleValue(\"keepInventory\", \"true\");\n world.setGameRuleValue(\"commandBlockOutput\", \"false\");\n world.setSpawnFlags(false, false);\n\n try {\n final JsonParser parser = new JsonParser();\n final FileReader reader =\n new FileReader(this.plugin.getDataFolder() + \"/maps/\" + this.mapName + \"/config.json\");\n final JsonElement element = parser.parse(reader);\n this.map = JumpyJumpMap.fromJson(element.getAsJsonObject());\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "private void setMapPos()\r\n {\r\n try\r\n {\r\n Thread.sleep(1000);//so that you can see players move\r\n }\r\n catch(Exception e){}\r\n int currentPlayer = worldPanel.getCurrentPlayer();\r\n int currentUnit = worldPanel.getCurrentUnit();\r\n int unitPos = 0;\r\n int firstX = 0;\r\n int firstY = 0;\r\n if (currentPlayer == 1)\r\n {\r\n unitPos = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n }\r\n if (currentPlayer == 2)\r\n {\r\n unitPos = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n }\r\n int tempX = unitPos % mapWidth;\r\n int tempY = unitPos - tempX;\r\n if (tempY == 0) {}\r\n else\r\n tempY = tempY / mapHeight;\r\n tempX = tempX - 11;\r\n tempY = tempY - 7;\r\n if (tempX >= 0)\r\n firstX = tempX;\r\n else\r\n firstX = tempX + mapWidth;\r\n if (tempY >= 0)\r\n firstY = tempY;\r\n else\r\n firstY = tempY + mapWidth;\r\n\r\n int drawWidth = worldPanel.getDrawWidth();\r\n int drawHeight = worldPanel.getDrawHeight();\r\n worldPanel.setNewXYPos(firstX, firstY);\r\n miniMap.setNewXY(firstX, firstY, drawWidth, drawHeight);\r\n }", "@Override\r\n\tpublic void saveReplay(GameEngine engine, int playerID, CustomProperties prop) {\r\n\t\tsaveOtherSetting(engine, owner.replayProp);\r\n\t\tsavePreset(engine, owner.replayProp, -1 - playerID, \"spf\");\r\n\r\n\t\tif(useMap[playerID] && (fldBackup[playerID] != null)) {\r\n\t\t\tsaveMap(fldBackup[playerID], owner.replayProp, playerID);\r\n\t\t}\r\n\r\n\t\towner.replayProp.setProperty(\"avalanchevs.version\", version);\r\n\t}", "public void setPlayer(Player _player) { // beallit egy ezredest az adott mapElementre, ha az rajta van\n player = _player;\n }", "public void load()\n\t{\n\t\tfor(String s : playerData.getConfig().getKeys(false))\n\t\t{\n\t\t\tPlayerData pd = new PlayerData(playerData, s);\n\t\t\tpd.load();\n\t\t\tdataMap.put(s, pd);\n\t\t}\n\t}", "public static Map load(Player player, String name) {\n\t\tif (!new File(\"save/\" + name + \"/chunk\").isDirectory())\n\t\t\treturn null;\n\t\t// Setting\n\t\ttry (DataInputStream dis = new DataInputStream(\n\t\t\t\tnew FileInputStream(new File(\"save/\" + name + \"/map.settings\")))) {\n\t\t\tplayer.getCamera().setPosition(new Vector3f(dis.readFloat(), dis.readFloat(), dis.readFloat())); // Player\n\t\t\tChunk.SIZE = dis.readInt();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t\t// Chunk\n\t\tMap map = new Map(name);\n\t\tfor (String fileName : new File(\"save/\" + name + \"/chunk\").list()) {\n\t\t\tString[] pos = fileName.substring(0, fileName.length() - 4).split(\"_\");\n\t\t\tint chunkX = Integer.parseInt(pos[0]);\n\t\t\tint chunkY = Integer.parseInt(pos[1]);\n\t\t\tif (!loadChunk(map, new Vector2i(chunkX, chunkY)))\n\t\t\t\treturn null;\n\t\t}\n\t\tSystem.out.println(\"[Info] Map \" + name + \" loaded\");\n\t\treturn map;\n\t}", "private void applySettingsOnMapView() {\n mapView.getMapSettings().setMapRotationEnabled(true);\n mapView.getMapSettings().setMapZoomingEnabled(true);\n mapView.getMapSettings().setMapPanningEnabled(true);\n mapView.getMapSettings().setZoomWithAnchorEnabled(true);\n mapView.getMapSettings().setInertiaRotatingEnabled(true);\n mapView.getMapSettings().setInertiaZoomingEnabled(true);\n mapView.getMapSettings().setInertiaPanningEnabled(true);\n }", "private void applySettingsOnMapView() {\n mapView.getMapSettings().setMapRotationEnabled(true);\n mapView.getMapSettings().setMapZoomingEnabled(true);\n mapView.getMapSettings().setMapPanningEnabled(true);\n mapView.getMapSettings().setZoomWithAnchorEnabled(true);\n mapView.getMapSettings().setInertiaRotatingEnabled(true);\n mapView.getMapSettings().setInertiaZoomingEnabled(true);\n mapView.getMapSettings().setInertiaPanningEnabled(true);\n }", "public void setMap01(){\n\t\tmapSelect = \"map01.txt\";\n\t\treloadMap(mapSelect);\n\t\tsetImg(mapSelect);\n\t}", "public void initMap(String path) {\n \tgameState = StateParser.makeGame(path);\n\t\tintel = gameState.getCtrlIntel();\t\n\t\tsnakes = gameState.getSnake();\n\t\tmap = gameState.getMap();\n }", "public static boolean save(Map map, Player player) {\n\t\tnew File(\"save/\" + map.getName() + \"/chunk\").mkdirs();\n\t\t// Chunk\n\t\tfor (Entry<Vector2i, Chunk> e : map.getChunks().entrySet())\n\t\t\tif (!saveChunk(map.getName(), e.getValue()))\n\t\t\t\treturn false;\n\t\t// Setting\n\t\ttry (DataOutputStream dos = new DataOutputStream(\n\t\t\t\tnew FileOutputStream(new File(\"save/\" + map.getName() + \"/map.settings\")))) {\n\t\t\t// Player\n\t\t\tdos.writeFloat(player.getCamera().getPosition().x);\n\t\t\tdos.writeFloat(player.getCamera().getPosition().y);\n\t\t\tdos.writeFloat(player.getCamera().getPosition().z);\n\t\t\t// Chunk\n\t\t\tdos.writeInt(Chunk.SIZE);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\tSystem.out.println(\"[Info] Map \" + map.getName() + \" saved\");\n\t\treturn true;\n\t}", "private void init_settings() {\n\t\tSettings.setDifficulty(Difficulty.NORMAL);\n\t\tSettings.setGravity(BowmanConstants.DEFAULT_GRAVITY);\n\t}", "protected void applyMapSettings() {\n if (gMap != null) {\n gMap.getUiSettings().setZoomControlsEnabled(false);\n gMap.setMapType(SettingsActivity.getMapStyle(this));\n }\n }", "public static void onReload(){\n\t\t\n\t\tfor(World w : Bukkit.getWorlds()){\n\t\t\tw.setGameRuleValue(\"doFireTick\", \"false\");\n\t\t\tw.setGameRuleValue(\"doDaylightCycle\", \"false\");\n\t\t}\n\t\t\n\t\tfor(World w : Bukkit.getWorlds()){\n\t\t\tfor(Player p : w.getPlayers()){\n\t\t\t\tif(w.getPlayers() != null){\n\t\t\t\t\t\n\t\t\t\t\t//add player to respawn HashMap\n\t\t\t\t\tHashMaps.respawn.put(p.getUniqueId(), 20);\n\t\t\t\t\t\n\t\t\t\t\t//sets player health\n\t\t\t\t\tif(p.hasPermission(Permissions.healthLvl1)){\n\t\t\t\t\t\tp.setHealthScale(12);\n\t\t\t\t\t}\n\t\t\t\t\tif(p.hasPermission(Permissions.healthLvl2)){\n\t\t\t\t\t\tp.setHealthScale(14);\n\t\t\t\t\t}\n\t\t\t\t\tif(p.hasPermission(Permissions.healthLvl3)){\n\t\t\t\t\t\tp.setHealthScale(16);\n\t\t\t\t\t}\n\t\t\t\t\tif(p.hasPermission(Permissions.healthLvl4)){\n\t\t\t\t\t\tp.setHealthScale(18);\n\t\t\t\t\t}\n\t\t\t\t\tif(p.hasPermission(Permissions.healthLvl5)){\n\t\t\t\t\t\tp.setHealthScale(20);\n\t\t\t\t\t}\n\t\t\t\t\t//create player data in config\n\t\t\t\t\tif(!Main.player.contains(\"Players.\" + p.getName())){\n\t\t\t\t\t\tPlayerConfig.createPlayerConfig(p);\n\t\t\t\t\t}\n\t\t\t\t\t//put player in HashMaps\n\t\t\t\t\tHashMaps.exp.put(p.getName(), Main.player.getInt(\"Players.\" + p.getName() + \".\" + \"Exp\"));\n\t\t\t\t\tHashMaps.check.put(p.getName(), 0);\n\t\t\t\t\tHashMaps.radio.put(p.getName(), Main.player.getDouble(\"Players.\" + p.getName() + \".\" + \"Rads\"));\n\t\t\t\t\tHashMaps.rads.put(p.getName(), 0);\n\t\t\t\t\tHashMaps.thirst.put(p.getName(), (double) Main.player.getDouble(\"Players.\" + p.getName() + \".\" + \"Thirst\"));\n\t\t\t\t\tHashMaps.temp.put(p.getName(), (double) Main.player.getDouble(\"Players.\" + p.getName() + \".\" + \"Temperature\"));\n\t\t\t\t\tHashMaps.mob_kill.put(p.getName(), Main.player.getInt(\"Players.\" + p.getName() + \".\" + \"MobsKilled\"));\n\t\t\t\t\tHashMaps.player_kill.put(p.getName(), Main.player.getInt(\"Players.\" + p.getName() + \".\" + \"PlayerKilled\"));\n\t\t\t\t\tHashMaps.travel.put(p.getName(), Main.player.getInt(\"Players.\" + p.getName() + \".\" + \"Travelled\"));\n\t\t\t\t\tHashMaps.bandage_use.put(p.getName(), Main.player.getInt(\"Players.\" + p.getName() + \".\" + \"BandagesUsed\"));\n\t\t\t\t\tHashMaps.break_leg.put(p.getName(), Main.player.getInt(\"Players.\" + p.getName() + \".\" + \"BreakeLeg\"));\n\t\t\t\t\t//create scoreboard\n\t\t\t\t\tCreateScoreboard.createScoreboard(p);\n\t\t\t\t\t//add scores to scoreboard\n\t\t\t\t\t//exp score\n\t\t\t\t\tif(!HashMaps.expscore.containsKey(p.getName())){\n\t\t\t\t\t\tHashMaps.expscore.put(p.getName(), CreateScoreboard.objective.getScore(\"CHECKING EXP\"));\n\t\t\t\t\t}\n\t\t\t\t\tHashMaps.expscore.get(p.getName()).setScore(6);\n\t\t\t\t\t//guild score\n\t\t\t\t\tif(!HashMaps.gscore.containsKey(p.getName())){\n\t\t\t\t\t\tHashMaps.gscore.put(p.getName(), CreateScoreboard.objective.getScore(\"CHECKING GUILD\"));\n\t\t\t\t\t}\n\t\t\t\t\tHashMaps.gscore.get(p.getName()).setScore(11);\n\t\t\t\t\t//money score\n\t\t\t\t\tif(!HashMaps.mscore.containsKey(p.getName())){\n\t\t\t\t\t\tHashMaps.mscore.put(p.getName(), CreateScoreboard.objective.getScore(\"CHECKING MONEY\"));\n\t\t\t\t\t}\n\t\t\t\t\tHashMaps.mscore.get(p.getName()).setScore(8);\n\t\t\t\t\t//radioactive score\n\t\t\t\t\tif(!HashMaps.rscore.containsKey(p.getName())){\n\t\t\t\t\t\tHashMaps.rscore.put(p.getName(), CreateScoreboard.objective.getScore(\"CHECKING RADS\"));\n\t\t\t\t\t}\n\t\t\t\t\tHashMaps.rscore.get(p.getName()).setScore(2);\n\t\t\t\t\t//thirst score\n\t\t\t\t\tif(!HashMaps.pscore.containsKey(p.getName())){\n\t\t\t\t\t\tHashMaps.pscore.put(p.getName(), CreateScoreboard.objective.getScore(\"CHECKING H2O\"));\n\t\t\t\t\t}\n\t\t\t\t\tHashMaps.pscore.get(p.getName()).setScore(0);\n\t\t\t\t\t//temperature score\n\t\t\t\t\tif(!HashMaps.tscore.containsKey(p.getName())){\n\t\t\t\t\t\tHashMaps.tscore.put(p.getName(), CreateScoreboard.objective.getScore(\"CHECKING TEMP\"));\n\t\t\t\t\t}\n\t\t\t\t\tHashMaps.tscore.get(p.getName()).setScore(4);\n\t\t\t\t\t//campfire limit\n\t\t\t\t\tHashMaps.stop.put(p.getName(), 0);\n\t\t\t\t\t\n//\t\t\t\t\tSetupEconomy.setupEconomy();\n\t\t\t\t\tCreateScoreboard.createScoreboard(p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void loadPersistencePreferences() {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);\n boolean persistent = sharedPreferences.getBoolean(\"TileCachePersistence\", true);\n Log.v(TAG, \"Cache Size: \" + sharedPreferences.getInt(\"TileCacheSize\", MapsActivity.FILE_SYSTEM_CACHE_SIZE_DEFAULT)\n + \", Persistent: \" + persistent);\n int capacity = Math.min(sharedPreferences.getInt(\"TileCacheSize\", MapsActivity.FILE_SYSTEM_CACHE_SIZE_DEFAULT),\n MapsActivity.FILE_SYSTEM_CACHE_SIZE_MAX);\n TileCache fileSystemTileCache = this.mapView.getFileSystemTileCache();\n\n fileSystemTileCache.setPersistent(persistent);\n fileSystemTileCache.setCapacity(capacity);\n // text size\n String textScaleDefault = getString(R.string.preferences_text_scale_default);\n this.mapView.setTextScale(Float.parseFloat(sharedPreferences.getString(\"mapTextScale\", textScaleDefault)));\n }", "public void initializeMap() {\n\t\tgameMap = new GameMap(GameMap.MAP_HEIGHT, GameMap.MAP_WIDTH);\n\t\tgameMap.initializeFields();\n\t}", "private void setPlayer() {\n player = Player.getInstance();\n }", "private void setupGoogleMapScreenSettings(GoogleMap mMap) {\n mMap.setBuildingsEnabled(true);\n mMap.setIndoorEnabled(true);\n UiSettings mUiSettings = mMap.getUiSettings();\n mUiSettings.setZoomControlsEnabled(true);\n mUiSettings.setCompassEnabled(true);\n mUiSettings.setMyLocationButtonEnabled(true);\n mUiSettings.setScrollGesturesEnabled(true);\n mUiSettings.setZoomGesturesEnabled(true);\n mUiSettings.setTiltGesturesEnabled(true);\n mUiSettings.setRotateGesturesEnabled(true);\n }", "@Override\r\n\tpublic void gameInit() \r\n\t{\r\n\t\tfont = new Font(\"Courier\", Font.BOLD, 14);\r\n\t\tfontInfo = this.getFontMetrics(font);\r\n\t\tkeys = new KeyValues();\r\n\t\t\r\n\t\tbackground.loadImage(\"/images/sky.png\");\r\n\t\ttileset = new TileSet(10,10,32,32);\r\n\t\ttileset.loadTiles(\"/images/test_tiles.png\");\r\n\t\tmap = new Map(tileset, 20, 50);\r\n\t\tmap.readMap(\"res/maps/testmap2.txt\");\r\n\t\t\r\n\t\tcamera.setDimensions(getScreenWidth(), getScreenHeight());\r\n\t\tcamera.setXRange(0, map.getWidth() - getScreenWidth());\r\n\t\tcamera.setYRange(0, map.getHeight() - getScreenHeight());\r\n\t}", "@Override\r\n\tpublic boolean onSetting(GameEngine engine, int playerID) {\r\n\t\t// Menu\r\n\t\tif((engine.getOwner().replayMode == false) && (engine.statc[4] == 0)) {\r\n\t\t\t// Configuration changes\r\n\t\t\t// Up\r\n\t\t\tif(engine.ctrl.isMenuRepeatKey(Controller.BUTTON_UP)) {\r\n\t\t\t\tmenuCursor--;\r\n\t\t\t\tif(menuCursor < 0){\r\n\t\t\t\t\tmenuCursor = 33;\r\n\t\t\t\t\tloadDropMapPreview(engine, playerID, DROP_PATTERNS[dropSet[playerID]][dropMap[playerID]]);\r\n\t\t\t\t}\r\n\t\t\t\telse if (menuCursor == 31)\r\n\t\t\t\t\tengine.field = null;\r\n\t\t\t\tengine.playSE(\"cursor\");\r\n\t\t\t}\r\n\t\t\t// Down\r\n\t\t\tif(engine.ctrl.isMenuRepeatKey(Controller.BUTTON_DOWN)) {\r\n\t\t\t\tmenuCursor++;\r\n\t\t\t\tif(menuCursor > 33) {\r\n\t\t\t\t\tmenuCursor = 0;\r\n\t\t\t\t\tengine.field = null;\r\n\t\t\t\t}\r\n\t\t\t\telse if (menuCursor == 32)\r\n\t\t\t\t\tloadDropMapPreview(engine, playerID, DROP_PATTERNS[dropSet[playerID]][dropMap[playerID]]);\r\n\t\t\t\tengine.playSE(\"cursor\");\r\n\t\t\t}\r\n\r\n\t\t\t// Configuration changes\r\n\t\t\tint change = 0;\r\n\t\t\tif(engine.ctrl.isMenuRepeatKey(Controller.BUTTON_LEFT)) change = -1;\r\n\t\t\tif(engine.ctrl.isMenuRepeatKey(Controller.BUTTON_RIGHT)) change = 1;\r\n\r\n\t\t\tif(change != 0) {\r\n\t\t\t\tengine.playSE(\"change\");\r\n\r\n\t\t\t\tint m = 1;\r\n\t\t\t\tif(engine.ctrl.isPress(Controller.BUTTON_E)) m = 100;\r\n\t\t\t\tif(engine.ctrl.isPress(Controller.BUTTON_F)) m = 1000;\r\n\r\n\t\t\t\tswitch(menuCursor) {\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\tengine.speed.gravity += change * m;\r\n\t\t\t\t\tif(engine.speed.gravity < -1) engine.speed.gravity = 99999;\r\n\t\t\t\t\tif(engine.speed.gravity > 99999) engine.speed.gravity = -1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tengine.speed.denominator += change * m;\r\n\t\t\t\t\tif(engine.speed.denominator < -1) engine.speed.denominator = 99999;\r\n\t\t\t\t\tif(engine.speed.denominator > 99999) engine.speed.denominator = -1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tengine.speed.are += change;\r\n\t\t\t\t\tif(engine.speed.are < 0) engine.speed.are = 99;\r\n\t\t\t\t\tif(engine.speed.are > 99) engine.speed.are = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\tengine.speed.areLine += change;\r\n\t\t\t\t\tif(engine.speed.areLine < 0) engine.speed.areLine = 99;\r\n\t\t\t\t\tif(engine.speed.areLine > 99) engine.speed.areLine = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 4:\r\n\t\t\t\t\tengine.speed.lineDelay += change;\r\n\t\t\t\t\tif(engine.speed.lineDelay < 0) engine.speed.lineDelay = 99;\r\n\t\t\t\t\tif(engine.speed.lineDelay > 99) engine.speed.lineDelay = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\tif (m >= 10) engine.speed.lockDelay += change*10;\r\n\t\t\t\t\telse engine.speed.lockDelay += change;\r\n\t\t\t\t\tif(engine.speed.lockDelay < 0) engine.speed.lockDelay = 999;\r\n\t\t\t\t\tif(engine.speed.lockDelay > 999) engine.speed.lockDelay = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 6:\r\n\t\t\t\t\tengine.speed.das += change;\r\n\t\t\t\t\tif(engine.speed.das < 0) engine.speed.das = 99;\r\n\t\t\t\t\tif(engine.speed.das > 99) engine.speed.das = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 7:\r\n\t\t\t\t\tengine.cascadeDelay += change;\r\n\t\t\t\t\tif(engine.cascadeDelay < 0) engine.cascadeDelay = 20;\r\n\t\t\t\t\tif(engine.cascadeDelay > 20) engine.cascadeDelay = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 8:\r\n\t\t\t\t\tengine.cascadeClearDelay += change;\r\n\t\t\t\t\tif(engine.cascadeClearDelay < 0) engine.cascadeClearDelay = 99;\r\n\t\t\t\t\tif(engine.cascadeClearDelay > 99) engine.cascadeClearDelay = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 9:\r\n\t\t\t\t\tojamaCounterMode[playerID] += change;\r\n\t\t\t\t\tif(ojamaCounterMode[playerID] < 0) ojamaCounterMode[playerID] = 2;\r\n\t\t\t\t\tif(ojamaCounterMode[playerID] > 2) ojamaCounterMode[playerID] = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 10:\r\n\t\t\t\t\tif (m >= 10) maxAttack[playerID] += change*10;\r\n\t\t\t\t\telse maxAttack[playerID] += change;\r\n\t\t\t\t\tif(maxAttack[playerID] < 0) maxAttack[playerID] = 99;\r\n\t\t\t\t\tif(maxAttack[playerID] > 99) maxAttack[playerID] = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 11:\r\n\t\t\t\t\trensaShibari[playerID] += change;\r\n\t\t\t\t\tif(rensaShibari[playerID] < 1) rensaShibari[playerID] = 20;\r\n\t\t\t\t\tif(rensaShibari[playerID] > 20) rensaShibari[playerID] = 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 12:\r\n\t\t\t\t\tengine.colorClearSize += change;\r\n\t\t\t\t\tif(engine.colorClearSize < 2) engine.colorClearSize = 36;\r\n\t\t\t\t\tif(engine.colorClearSize > 36) engine.colorClearSize = 2;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 13:\r\n\t\t\t\t\tif (m >= 10) ojamaRate[playerID] += change*100;\r\n\t\t\t\t\telse ojamaRate[playerID] += change*10;\r\n\t\t\t\t\tif(ojamaRate[playerID] < 10) ojamaRate[playerID] = 1000;\r\n\t\t\t\t\tif(ojamaRate[playerID] > 1000) ojamaRate[playerID] = 10;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 14:\r\n\t\t\t\t\tif (m > 10) hurryupSeconds[playerID] += change*m/10;\r\n\t\t\t\t\telse hurryupSeconds[playerID] += change;\r\n\t\t\t\t\tif(hurryupSeconds[playerID] < 0) hurryupSeconds[playerID] = 300;\r\n\t\t\t\t\tif(hurryupSeconds[playerID] > 300) hurryupSeconds[playerID] = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 15:\r\n\t\t\t\t\tdangerColumnDouble[playerID] = !dangerColumnDouble[playerID];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 16:\r\n\t\t\t\t\tdangerColumnShowX[playerID] = !dangerColumnShowX[playerID];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 17:\r\n\t\t\t\t\tojamaCountdown[playerID] += change;\r\n\t\t\t\t\tif(ojamaCountdown[playerID] < 1) ojamaCountdown[playerID] = 10;\r\n\t\t\t\t\tif(ojamaCountdown[playerID] > 10) ojamaCountdown[playerID] = 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 18:\r\n\t\t\t\t\tzenKeshiType[playerID] += change;\r\n\t\t\t\t\tif(zenKeshiType[playerID] < 0) zenKeshiType[playerID] = 2;\r\n\t\t\t\t\tif(zenKeshiType[playerID] > 2) zenKeshiType[playerID] = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 19:\r\n\t\t\t\t\tfeverMapSet[playerID] += change;\r\n\t\t\t\t\tif(feverMapSet[playerID] < 0) feverMapSet[playerID] = FEVER_MAPS.length-1;\r\n\t\t\t\t\tif(feverMapSet[playerID] >= FEVER_MAPS.length) feverMapSet[playerID] = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 20:\r\n\t\t\t\t\toutlineType[playerID] += change;\r\n\t\t\t\t\tif(outlineType[playerID] < 0) outlineType[playerID] = 2;\r\n\t\t\t\t\tif(outlineType[playerID] > 2) outlineType[playerID] = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 21:\r\n\t\t\t\t\tchainDisplayType[playerID] += change;\r\n\t\t\t\t\tif(chainDisplayType[playerID] < 0) chainDisplayType[playerID] = 3;\r\n\t\t\t\t\tif(chainDisplayType[playerID] > 3) chainDisplayType[playerID] = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 22:\r\n\t\t\t\t\tcascadeSlow[playerID] = !cascadeSlow[playerID];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 23:\r\n\t\t\t\t\tnewChainPower[playerID] = !newChainPower[playerID];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 24:\r\n\t\t\t\t\tuseMap[playerID] = !useMap[playerID];\r\n\t\t\t\t\tif(!useMap[playerID]) {\r\n\t\t\t\t\t\tif(engine.field != null) engine.field.reset();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tloadMapPreview(engine, playerID, (mapNumber[playerID] < 0) ? 0 : mapNumber[playerID], true);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 25:\r\n\t\t\t\t\tmapSet[playerID] += change;\r\n\t\t\t\t\tif(mapSet[playerID] < 0) mapSet[playerID] = 99;\r\n\t\t\t\t\tif(mapSet[playerID] > 99) mapSet[playerID] = 0;\r\n\t\t\t\t\tif(useMap[playerID]) {\r\n\t\t\t\t\t\tmapNumber[playerID] = -1;\r\n\t\t\t\t\t\tloadMapPreview(engine, playerID, (mapNumber[playerID] < 0) ? 0 : mapNumber[playerID], true);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 26:\r\n\t\t\t\t\tif(useMap[playerID]) {\r\n\t\t\t\t\t\tmapNumber[playerID] += change;\r\n\t\t\t\t\t\tif(mapNumber[playerID] < -1) mapNumber[playerID] = mapMaxNo[playerID] - 1;\r\n\t\t\t\t\t\tif(mapNumber[playerID] > mapMaxNo[playerID] - 1) mapNumber[playerID] = -1;\r\n\t\t\t\t\t\tloadMapPreview(engine, playerID, (mapNumber[playerID] < 0) ? 0 : mapNumber[playerID], true);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tmapNumber[playerID] = -1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 27:\r\n\t\t\t\t\tbigDisplay = !bigDisplay;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 28:\r\n\t\t\t\t\tbgmno += change;\r\n\t\t\t\t\tif(bgmno < 0) bgmno = BGMStatus.BGM_COUNT - 1;\r\n\t\t\t\t\tif(bgmno > BGMStatus.BGM_COUNT - 1) bgmno = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 29:\r\n\t\t\t\t\tenableSE[playerID] = !enableSE[playerID];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 30:\r\n\t\t\t\tcase 31:\r\n\t\t\t\t\tpresetNumber[playerID] += change;\r\n\t\t\t\t\tif(presetNumber[playerID] < 0) presetNumber[playerID] = 99;\r\n\t\t\t\t\tif(presetNumber[playerID] > 99) presetNumber[playerID] = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 32:\r\n\t\t\t\t\tdropSet[playerID] += change;\r\n\t\t\t\t\tif(dropSet[playerID] < 0) dropSet[playerID] = DROP_PATTERNS.length-1;\r\n\t\t\t\t\tif(dropSet[playerID] >= DROP_PATTERNS.length) dropSet[playerID] = 0;\r\n\t\t\t\t\tif(dropMap[playerID] >= DROP_PATTERNS[dropSet[playerID]].length) dropMap[playerID] = 0;\r\n\t\t\t\t\tloadDropMapPreview(engine, playerID, DROP_PATTERNS[dropSet[playerID]][dropMap[playerID]]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 33:\r\n\t\t\t\t\tdropMap[playerID] += change;\r\n\t\t\t\t\tif(dropMap[playerID] < 0) dropMap[playerID] = DROP_PATTERNS[dropSet[playerID]].length-1;\r\n\t\t\t\t\tif(dropMap[playerID] >= DROP_PATTERNS[dropSet[playerID]].length) dropMap[playerID] = 0;\r\n\t\t\t\t\tloadDropMapPreview(engine, playerID, DROP_PATTERNS[dropSet[playerID]][dropMap[playerID]]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Decision\r\n\t\t\tif(engine.ctrl.isPush(Controller.BUTTON_A) && (menuTime >= 5)) {\r\n\t\t\t\tengine.playSE(\"decide\");\r\n\r\n\t\t\t\tif(menuCursor == 30) {\r\n\t\t\t\t\tloadPreset(engine, owner.modeConfig, presetNumber[playerID], \"spf\");\r\n\t\t\t\t} else if(menuCursor == 31) {\r\n\t\t\t\t\tsavePreset(engine, owner.modeConfig, presetNumber[playerID], \"spf\");\r\n\t\t\t\t\treceiver.saveModeConfig(owner.modeConfig);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsaveOtherSetting(engine, owner.modeConfig);\r\n\t\t\t\t\tsavePreset(engine, owner.modeConfig, -1 - playerID, \"spf\");\r\n\t\t\t\t\treceiver.saveModeConfig(owner.modeConfig);\r\n\t\t\t\t\tengine.statc[4] = 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Cancel\r\n\t\t\tif(engine.ctrl.isPush(Controller.BUTTON_B)) {\r\n\t\t\t\tengine.quitflag = true;\r\n\t\t\t}\r\n\r\n\t\t\t// For previewMapRead\r\n\t\t\tif(useMap[playerID] && (menuTime == 0)) {\r\n\t\t\t\tloadMapPreview(engine, playerID, (mapNumber[playerID] < 0) ? 0 : mapNumber[playerID], true);\r\n\t\t\t}\r\n\r\n\t\t\t// Random map preview\r\n\t\t\tif(useMap[playerID] && (propMap[playerID] != null) && (mapNumber[playerID] < 0)) {\r\n\t\t\t\tif(menuTime % 30 == 0) {\r\n\t\t\t\t\tengine.statc[5]++;\r\n\t\t\t\t\tif(engine.statc[5] >= mapMaxNo[playerID]) engine.statc[5] = 0;\r\n\t\t\t\t\tloadMapPreview(engine, playerID, engine.statc[5], false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tmenuTime++;\r\n\t\t} else if(engine.statc[4] == 0) {\r\n\t\t\tmenuTime++;\r\n\t\t\tmenuCursor = 0;\r\n\r\n\t\t\tif(menuTime >= 300)\r\n\t\t\t\tengine.statc[4] = 1;\r\n\t\t\telse if (menuTime == 240)\r\n\t\t\t{\r\n\t\t\t\tmenuCursor = 32;\r\n\t\t\t\tloadDropMapPreview(engine, playerID, DROP_PATTERNS[dropSet[playerID]][dropMap[playerID]]);\r\n\t\t\t}\r\n\t\t\telse if(menuTime >= 180)\r\n\t\t\t\tmenuCursor = 24;\r\n\t\t\telse if(menuTime >= 120)\r\n\t\t\t\tmenuCursor = 17;\r\n\t\t\telse if(menuTime >= 60)\r\n\t\t\t\tmenuCursor = 9;\r\n\t\t} else {\r\n\t\t\t// Start\r\n\t\t\tif((owner.engine[0].statc[4] == 1) && (owner.engine[1].statc[4] == 1) && (playerID == 1)) {\r\n\t\t\t\towner.engine[0].stat = GameEngine.Status.READY;\r\n\t\t\t\towner.engine[1].stat = GameEngine.Status.READY;\r\n\t\t\t\towner.engine[0].resetStatc();\r\n\t\t\t\towner.engine[1].resetStatc();\r\n\t\t\t}\r\n\t\t\t// Cancel\r\n\t\t\telse if(engine.ctrl.isPush(Controller.BUTTON_B)) {\r\n\t\t\t\tengine.statc[4] = 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n private void newMap() throws IOException, ClassNotFoundException {\r\n this.music_map.clear();\r\n if (needNewMap()) {\r\n if (!save_file.exists()) {\r\n System.out.println(\"DIZIONARIO NON PRESENTE\");\r\n System.out.println(\"CREAZIONE NUOVO DIZIONARIO IN CORSO...\");\r\n\r\n this.setTarget();\r\n\r\n this.recoursiveMapCreation(this.music_root);\r\n this.saveMap();\r\n } else {\r\n System.out.println(\"DIZIONARIO NON AGGIORNATO\");\r\n if (!UtilFunctions.newDictionaryRequest(this.save_file, this.music_root)) {\r\n System.out.println(\"AGGIORNAMENTO DIZIONARIO RIFIUTATO\");\r\n FileInputStream f = new FileInputStream(this.save_file);\r\n ObjectInputStream o = new ObjectInputStream(f);\r\n this.music_map.putAll((Map<String, String[]>) o.readObject());\r\n current.set(ProgressDialog.TOTAL.get());\r\n } else {\r\n System.out.println(\"CREAZIONE NUOVO DIZIONARIO IN CORSO...\");\r\n this.setTarget();\r\n this.recoursiveMapCreation(this.music_root);\r\n this.saveMap();\r\n }\r\n }\r\n } else {\r\n System.out.println(\"DIZIONARIO GIA' PRESENTE\");\r\n FileInputStream f = new FileInputStream(this.save_file);\r\n ObjectInputStream o = new ObjectInputStream(f);\r\n this.music_map.putAll((Map<String, String[]>) o.readObject());\r\n current.set(ProgressDialog.TOTAL.get());\r\n }\r\n }", "private void setupMapView(){\n Log.d(TAG, \"setupMapView: Started\");\n\n view_stage_map = VIEW_MAP_FULL;\n cycleMapView();\n\n }", "private void setUpMap() {\n mMap.setMyLocationEnabled(true);\n }", "public void setMapFile(String mapName) {\n map = Map.loadFromJSON(mapName);\n }", "private void mapConfig(GoogleMap googleMap) {\n LatLng position=new LatLng(playerDetails.getLat(),playerDetails.getLongitude());\n\n googleMap.addMarker(new MarkerOptions().position(position).title(playerDetails.getWinnerName())).showInfoWindow();\n googleMap.moveCamera(CameraUpdateFactory.newLatLng(position));\n }", "private void setupMap() {\n int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getBaseContext());\n \t\tif ( status != ConnectionResult.SUCCESS ) {\n \t\t\t// Google Play Services are not available.\n \t\t\tint requestCode = 10;\n \t\t\tGooglePlayServicesUtil.getErrorDialog( status, this, requestCode ).show();\n \t\t} else {\n \t\t\t// Google Play Services are available.\n \t\t\tif ( this.googleMap == null ) {\n \t\t\t\tFragmentManager fragManager = this.getSupportFragmentManager();\n \t\t\t\tSupportMapFragment mapFrag = (SupportMapFragment) fragManager.findFragmentById( R.id.edit_gpsfilter_area_google_map );\n \t\t\t\tthis.googleMap = mapFrag.getMap();\n \n \t\t\t\tif ( this.googleMap != null ) {\n \t\t\t\t\t// The Map is verified. It is now safe to manipulate the map.\n \t\t\t\t\tthis.configMap();\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "private void setUpMap() {\n\t\t \n\t\tmMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);\n\t\t//mMap.setMyLocationEnabled(true);\n\t\t\t \n\t\tmMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(\n\t\t\t\tlatitude, longitude), 12.0f));\n\n\t}", "private void setUpMapIfNeeded() {\n if (map == null) {\n map = fragMap.getMap();\n if (map != null) {\n setUpMap();\n }\n }\n }", "public void setPlayer(ViewerManager2 player) {\n this.player = player;\n // the player is needed to be existent befor starting up the remote Server\n //startRemoteServer();\n\n }", "public void loadGame(File fileLocation, boolean replay);", "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 }", "@Override\r\n protected void saveStrings() {\r\n \r\n settings.setProperty(\"mfile\" , mfile);\r\n settings.setProperty( \"rmode\", rmode);\r\n settings.setProperty( \"cmap\" , cmap );\r\n settings.setProperty(\"cmapMin\", Double.toString( cmapMin ) ); \r\n settings.setProperty(\"cmapMax\", Double.toString( cmapMax ) ); \r\n \r\n }", "public void loadSavedConfigsMap() {\n\t\tfinal File folder = new File(serializePath);\n\t\tlistFilesForFolder(folder);\n\t}", "public void setLoadGame() {\n this.loadeGame = true;\n }", "@Override\n public void run(){\n Settings.setGameSettings(new Player(0,Color.RED,1800, \"Player 1\",true),\n new Player(1,Color.BLUE,1800, \"Player 2\",false),1800,25);\n MenuFrame menuFrame = new MenuFrame();\n }", "private void setup() {\n\t\t map.setMyLocationEnabled(true);\n\t \n\t CameraPosition cameraPosition = new CameraPosition.Builder()\n\t .target(USMP_LOCATION) // Sets the center of the map to\n\t // Golden Gate Bridge\n\t .zoom(16) // Sets the zoom\n\t .bearing(90) // Sets the orientation of the camera to east\n\t .tilt(60) // Sets the tilt of the camera to 30 degrees\n\t .build(); // Creates a CameraPosition from the builder\n\t \n\t CameraUpdate cameraUpdate=CameraUpdateFactory.newCameraPosition(\n\t \t cameraPosition);\n\t\t map.animateCamera(cameraUpdate);\n\t\t \n\t map.addMarker(new MarkerOptions()\n\t .position(USMP_LOCATION)\n\t .title(\"DevFest 2013 Season 2\"));\n\t}", "public static void restartPositions() {\r\n\t\tnew GameStats();\r\n\t\tMain.initPlayers();\r\n\t\tif (CustomizeFrame.getInstance() != null) {\r\n\t\t\t((Player) GameStats.getPlayers().get(0)).setCustomGraphics(64, 64);// set default custom\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// graphics\r\n\t\t}\r\n\t}", "public void saveMap(){\n dataBase.updateMap(level);\n }", "public void SetupMap()\n {\n mMap.setMyLocationEnabled(true);\n\n // GAME LatLng\n LatLng latLng = new LatLng(53.227668, -0.540038);\n\n // Create instantiate Marker\n MarkerOptions markerOptions = new MarkerOptions();\n markerOptions.position(latLng);\n markerOptions.draggable(false);\n markerOptions.title(\"GAME\");\n\n MapsInitializer.initialize(getActivity());\n // Create Marker at pos\n mMap.addMarker(markerOptions);\n // Position Map Camera to pos\n mMap.moveCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition(latLng, 100, 0, 0)));\n }", "static public void initSettings() {\n iSettings = BitmapSettings.getSettings();\n iSettings.load();\n }", "public void settings() {\r\n\t\tthis.size(PlayGame.WIDTH,PlayGame.HEIGHT);\r\n\t}", "public void cmdSetPlayer(User teller, Player player, String var, StringBuffer setting) throws MalformedURLException, InvalidNameException {\n String value = setting.toString();\n var = var.toLowerCase();\n if (ComparisionHelper.anyEquals(var, \"name\", \"fullname\")) {\n player.setRealName(value);\n } else if (ComparisionHelper.anyEquals(var, \"handle\", \"username\")) {\n String handle = setting.toString();\n player.setHandle(handle);\n } else if (ComparisionHelper.anyEquals(var, \"title\", \"titles\")) {\n Set<Title> titles = player.getTitles();\n titles.clear();\n String[] titleNames = CollectionHelper.split(value);\n List<Title> newTitles = titleService.lookupAll(titleNames);\n titles.addAll(newTitles);\n } else if (\"rating\".equals(var)) {\n Map<RatingCategory, Integer> ratings = player.ratings();\n if (value.isEmpty()) {\n ratings.remove(USCL_RATING);\n } else {\n int r = Integer.parseInt(value);\n ratings.put(USCL_RATING, r);\n }\n } else if (ComparisionHelper.anyEquals(var, \"web\", \"webpage\", \"website\")) {\n player.setWebsite(value);\n } else {\n command.tell(teller, \"Unknown variable: \" + var);\n return;\n }\n cmdShowPlayer(teller, player);\n cmdRefreshProfile(teller, player);\n tournamentService.updatePlayer(player);\n tournamentService.flush();\n }", "public void initializeMaps() {\n\t\t//can use any map\n\n\t\t//left map\n\t int x = 0, y = 0;\n\t int Lvalue;\n\t \n\t try {\n\t \t//***change to your local path for the map you want to test\n\t \tBufferedReader input = new BufferedReader(new FileReader(\"/Users/NeeCee/Classes/4444/MirrorUniverse/maps/g6maps/lessEasyLeft.txt\"));\n\t \tString line;\n\t \twhile((line = input.readLine()) != null) {\n\t \t\tString[] vals = line.split(\" \");\n\t \t\tfor(String str : vals) {\n\t \t\t\tLvalue = Integer.parseInt(str);\n\t \t\t\tleftMap[x][y] = Lvalue;\n\t \t\t\t++y;\n\t \t\t}\n\t \t\t\n\t \t\t++x;\n\t \t\ty = 0;\n\t \t}\n\t \t\n\t \tinput.close();\n\t } catch (IOException ioex) {\n\t \tSystem.out.println(\"error reading in map for testing\");\n\t }\n\t \n\t //right map\n\t x = 0;\n\t y = 0;\n\t int Rvalue;\n\t \n\t try {\n\t \t//***change to your local path for the map you want to test\n\t \t//change to map you want to test\n\t \tBufferedReader input = new BufferedReader(new FileReader(\"/Users/NeeCee/Classes/4444/MirrorUniverse/maps/g6maps/lessEasyRight.txt\"));\n\t \tString line;\n\t \twhile((line = input.readLine()) != null) {\n\t \t\tString[] vals = line.split(\" \");\n\t \t\tfor(String str : vals) {\n\t \t\t\tRvalue = Integer.parseInt(str);\n\t \t\t\trightMap[x][y] = Rvalue;\n\t \t\t\t++y;\n\t \t\t}\n\t \t\t++x;\n\t \t\ty = 0;\n\t \t}\n\t \t\n\t \tinput.close();\n\t } catch (IOException ioex) {\n\t \tSystem.out.println(\"error reading in map for testing\");\n\t }\n\t \n\t //print each map for testing\n\t for(int i = 0; i < leftMap.length; i++ )\n\t \tfor(int j = 0; j < leftMap[i].length; j++ )\n\t \t\tSystem.out.println(leftMap[i][j]);\n\t System.out.println(\"*-----------------*\");\n\t for(int i = 0; i < rightMap.length; i++ )\n\t \tfor(int j = 0; j < rightMap[i].length; j++ )\n\t \t\tSystem.out.println(rightMap[i][j]);\n\t}", "private void saveMap() {\r\n new Thread(() -> {\r\n try {\r\n FileOutputStream f = new FileOutputStream(this.save_file);\r\n ObjectOutputStream S = new ObjectOutputStream(f);\r\n S.writeObject(this.music_map);\r\n S.close();\r\n f.close();\r\n if (!this.save_file.setLastModified(this.music_root.lastModified())) {\r\n throw new IllegalStateException(\"Impossibile aggiornare il file dizionario\");\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }).start();\r\n }", "public void mapMode() {\n\t\ttheTrainer.setUp(false);\n\t\ttheTrainer.setDown(false);\n\t\ttheTrainer.setLeft(false);\n\t\ttheTrainer.setRight(false);\n\n\t\tinBattle = false;\n\t\tred = green = blue = 255;\n\t\tthis.requestFocus();\n\t}", "public void setPrefs(GamePreferences prefs) {\n\t\tthis.prefs = prefs;\n\t}", "public void startReloading() {\n reload.setTimeOffset(1);\n reload.play();\n }", "public void onEnable(){\n new File(getDataFolder().toString()).mkdir();\n playerFile = new File(getDataFolder().toString() + \"/playerList.txt\");\n commandFile = new File(getDataFolder().toString() + \"/commands.txt\");\n blockFile = new File(getDataFolder().toString() + \"/blockList.txt\");\n deathFile = new File(getDataFolder().toString() + \"/deathList.txt\");\n startupFile = new File(getDataFolder().toString() + \"/startupCommands.txt\");\n \n //Load the player file data\n playerCommandMap = new HashMap<String, String>();\n try{\n BufferedReader br = new BufferedReader(new FileReader(playerFile));\n StringTokenizer st;\n String input;\n String name;\n String command;\n while((input = br.readLine()) != null){\n if(input.compareToIgnoreCase(\"<Player> <Command>\") == 0){\n continue;\n }\n st = new StringTokenizer(input, \" \");\n name = st.nextToken();\n command = st.nextToken();\n playerCommandMap.put(name, command);\n }\n \n }catch(FileNotFoundException e){\n log.info(\"No original player command file, creating new one.\");\n }catch(IOException e){\n log.info(\"Error reading player command file\");\n }catch(Exception e){\n log.info(\"Incorrectly formatted player command file\");\n }\n \n //Load the block file data\n blockCommandMap = new HashMap<Location, String>();\n try{\n BufferedReader br = new BufferedReader(new FileReader(blockFile));\n StringTokenizer st;\n String input;\n String command;\n Location loc = null;\n \n while((input = br.readLine()) != null){\n if(input.compareToIgnoreCase(\"<Block Location> <Command>\") == 0){\n continue;\n }\n st = new StringTokenizer(input, \" \");\n loc = new Location(getServer().getWorld(UUID.fromString(st.nextToken())), Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()));\n command = st.nextToken();\n blockCommandMap.put(loc, command);\n }\n \n }catch(FileNotFoundException e){\n log.info(\"No original block command file, creating new one.\");\n }catch(IOException e){\n log.info(\"Error reading block command file\");\n }catch(Exception e){\n log.info(\"Incorrectly formatted block command file\");\n }\n \n //Load the player death file data\n deathCommandMap = new HashMap<String, String>();\n try{\n BufferedReader br = new BufferedReader(new FileReader(deathFile));\n StringTokenizer st;\n String input;\n String name;\n String command;\n while((input = br.readLine()) != null){\n if(input.compareToIgnoreCase(\"<Player> <Command>\") == 0){\n continue;\n }\n st = new StringTokenizer(input, \" \");\n name = st.nextToken();\n command = st.nextToken();\n deathCommandMap.put(name, command);\n }\n \n }catch(FileNotFoundException e){\n log.info(\"No original player death command file, creating new one.\");\n }catch(IOException e){\n log.info(\"Error reading player death command file\");\n }catch(Exception e){\n log.info(\"Incorrectly formatted player death command file\");\n }\n \n //Load the start up data\n startupCommands = \"\";\n try{\n BufferedReader br = new BufferedReader(new FileReader(startupFile));\n String input;\n while((input = br.readLine()) != null){\n if(input.compareToIgnoreCase(\"<Command>\") == 0){\n continue;\n }\n startupCommands += \":\" + input;\n }\n \n }catch(FileNotFoundException e){\n log.info(\"No original start up command file, creating new one.\");\n }catch(IOException e){\n log.info(\"Error reading start up command file\");\n }catch(Exception e){\n log.info(\"Incorrectly formatted start up command file\");\n }\n \n //Load the command file data\n commandMap = new HashMap<String, String>();\n try{\n BufferedReader br = new BufferedReader(new FileReader(commandFile));\n StringTokenizer st;\n String input;\n String args;\n String name;\n \n //Assumes that the name is only one token long\n while((input = br.readLine()) != null){\n if(input.compareToIgnoreCase(\"<Identifing name> <Command>\") == 0){\n continue;\n }\n st = new StringTokenizer(input, \" \");\n name = st.nextToken();\n args = st.nextToken();\n while(st.hasMoreTokens()){\n args += \" \" + st.nextToken();\n }\n commandMap.put(name, args);\n }\n \n }catch(FileNotFoundException e){\n log.info(\"No original command file, creating new one.\");\n }catch(IOException e){\n log.info(\"Error reading command file\");\n }catch(Exception e){\n log.info(\"Incorrectly formatted command file\");\n }\n \n placeBlock = false;\n startupDone = false;\n blockCommand = \"\";\n playerPosMap = new HashMap<String, Location>();\n \n //Set up the listeners\n PluginManager pm = this.getServer().getPluginManager();\n pm.registerEvent(Event.Type.PLAYER_INTERACT_ENTITY, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_INTERACT, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_MOVE, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLAYER_QUIT, playerListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.ENTITY_DEATH, entityListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Event.Priority.Normal, this);\n pm.registerEvent(Event.Type.PLUGIN_ENABLE, serverListener, Event.Priority.Normal, this);\n \n log.info(\"Autorun Commands v2.3 is enabled\");\n }", "public void setUp() throws IOException \n\t{\n\t\tMapSelectionView mapSelectionView = new MapSelectionView();\n\t\tplayerNumber = mapSelectionView.print(4);\t//4 max players\n\t\tmap.setPlayers(playerNumber);\n\t\tHashMap<Integer, String> possibleStrategies = new HashMap<Integer, String>();\n\t\tpossibleStrategies.put(1, \"Aggressive\");\n\t\tpossibleStrategies.put(2, \"Benevolent\");\n\t\tpossibleStrategies.put(3, \"Random\");\n\t\tpossibleStrategies.put(4, \"Cheater\");\n\t\t\n\t\tfor(Player p : map.players) {\n\t\t\tint strat = mapSelectionView.askTournamentStrategy(p.getNumber(), possibleStrategies);\n\t\t\t\n\t\t\tswitch(strat) {\n\t\t\t\tcase 1:\n\t\t\t\t\tp.setStrategy(new Aggressive());\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tp.setStrategy(new Benevolent());\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tp.setStrategy(new Random());\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tp.setStrategy(new Cheater());\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpossibleStrategies.remove(strat);\n\t\t}\n\t\tplayers = map.players;\t//Memorizing players of the tournament\n\t\t\n\t\tint mapNumber = mapSelectionView.askMapNumber();\n\t\t\n\t\tfor(int i = 1; i <= mapNumber; i++) {\n\t\t\tString mapFilePath = mapSelectionView.selectMap();\n\t\t\tMap map = new Map();\n\t\t\tmap.setPlayers(playerNumber);\n\t\t\tmap.load(mapFilePath);\t//Check if map is correct\n\t\t\tmaps.add(mapFilePath);\n\t\t}\n\t\t\n\t\tgamesNumber = mapSelectionView.askGameNumber();\n\t\tmaximumTurns = mapSelectionView.askGameMaxTurns();\n\t}", "private void ini_Sprites()\r\n\t{\r\n\t\tLogger.DEBUG(\"ini_Sprites\");\r\n\t\tResourceCache.LoadSprites(false);\r\n\t}", "private void setUpMapIfNeeded() {\n \tif (mMap == null) {\r\n \t\t//Instanciamos el objeto mMap a partir del MapFragment definido bajo el Id \"map\"\r\n \t\tmMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();\r\n \t\t// Chequeamos si se ha obtenido correctamente una referencia al objeto GoogleMap\r\n \t\tif (mMap != null) {\r\n \t\t\t// El objeto GoogleMap ha sido referenciado correctamente\r\n \t\t\t//ahora podemos manipular sus propiedades\r\n \t\t\t//Seteamos el tipo de mapa\r\n \t\t\tmMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);\r\n \t\t\t//Activamos la capa o layer MyLocation\r\n \t\t\tmMap.setMyLocationEnabled(true);\r\n \t\t\t\r\n \t\t\tAgregarPuntos();\r\n \t\t\t\r\n \t\t\t\r\n \t\t}\r\n \t}\r\n }", "private void loadGameFiles(){\n\t}", "void doOpenRecent(String fileName) {\r\n\t\tif (saveSettings == null) {\r\n\t\t\tsaveSettings = new MapSaveSettings();\r\n\t\t\tsaveSettings.buildings = true;\r\n\t\t\tsaveSettings.surface = true;\r\n\t\t}\r\n\t\tsaveSettings.fileName = new File(fileName);\r\n\t\tdoLoad();\r\n\t}", "@Override\n\tpublic void setPlayer(Player player) {\n\n\t}", "private void updateRoamingProfile(Map profileMap) {\n \t\tif (profileMap == null)\n \t\t\treturn;\n \t\tProfile selfProfile = (Profile) profileMap.get(self);\n \t\tif (selfProfile == null)\n \t\t\treturn;\n \t\t//only update if self is a roaming profile\n \t\tif (!Boolean.valueOf(selfProfile.getProperty(IProfile.PROP_ROAMING)).booleanValue())\n \t\t\treturn;\n \t\tLocation installLocation = (Location) ServiceHelper.getService(EngineActivator.getContext(), Location.class.getName(), Location.INSTALL_FILTER);\n \t\tFile location = new File(installLocation.getURL().getPath());\n \t\tboolean changed = false;\n \t\tif (!location.equals(new File(selfProfile.getProperty(IProfile.PROP_INSTALL_FOLDER)))) {\n \t\t\tselfProfile.setProperty(IProfile.PROP_INSTALL_FOLDER, location.getAbsolutePath());\n \t\t\tchanged = true;\n \t\t}\n \t\tif (!location.equals(new File(selfProfile.getProperty(IProfile.PROP_CACHE)))) {\n \t\t\tselfProfile.setProperty(IProfile.PROP_CACHE, location.getAbsolutePath());\n \t\t\tchanged = true;\n \t\t}\n \t\tif (changed)\n \t\t\tpersist();\n \t}", "public void Define() {\n manager = new Manager(); // Initialize other classes\n save = new Save();\n store = new Store();\n menu = new Menu();\n postgame = new PostGame();\n\n map = new ImageIcon(\"res/map.png\").getImage(); // Load background image\n \t\n \n // Load the track image\n track = new ImageIcon(\"res/TrackCorner.png\").getImage(); // Initialize the track image file\n \n // Load images for the towers\n tileset_towers[0] = new ImageIcon(\"res/redlasertower.png\").getImage();\n tileset_towers[1] = new ImageIcon(\"res/blueLaserTower.png\").getImage();\n tileset_towers[2] = new ImageIcon(\"res/goldLaserTower.png\").getImage();\n \n // Load images for the indicators\n tileset_indicators[0] = new ImageIcon(\"res/button.png\").getImage();\n tileset_indicators[1] = new ImageIcon(\"res/money.png\").getImage();\n tileset_indicators[2] = new ImageIcon(\"res/heart.png\").getImage();\n \n // Load images for the buttons\n tileset_buttons[0] = new ImageIcon(\"res/redLaserTower.png\").getImage();\n tileset_buttons[1] = new ImageIcon(\"res/blueLaserTower.png\").getImage();\n tileset_buttons[2] = new ImageIcon(\"res/goldLaserTower.png\").getImage();\n tileset_buttons[3] = new ImageIcon(\"res/trash.png\").getImage();\n \n // Load images for the solider\n tileset_soldier[0] = new ImageIcon(\"res/enemyD1.png\").getImage();\n tileset_soldier[1] = new ImageIcon(\"res/enemyD2.png\").getImage();\n \n tileset_soldier[2] = new ImageIcon(\"res/enemyR1.png\").getImage();\n tileset_soldier[3] = new ImageIcon(\"res/enemyR2.png\").getImage();\n \n tileset_soldier[4] = new ImageIcon(\"res/enemyL1.png\").getImage();\n tileset_soldier[5] = new ImageIcon(\"res/enemyL2.png\").getImage();\n \n tileset_soldier[6] = new ImageIcon(\"res/enemyU1.png\").getImage();\n tileset_soldier[7] = new ImageIcon(\"res/enemyU2.png\").getImage();\n \n // Save the configuration of the track\n save.loadSave(new File(\"save/mission.txt\"));\n save.loadHighScore();\n \n // Initialize enemy objects\n for(int i = 0; i < enemies.length; i++) {\n \tenemies[i] = new Enemy();\n }\n \n }", "protected void initVars() {\n prefFile = \"./server.ini\";\n mimeFile = \"./mime.ini\";\n }", "private void setPrefs( File build_file ) {\n if ( _settings != null )\n _settings.load( build_file );\n else\n _settings = new OptionSettings( build_file );\n _prefs = _settings.getPrefs();\n }", "public SettingsSaver() {\n set[0] = advModeUnlocked;\n set[1] = LIM_NOTESPERLINE;\n set[2] = LIM_96_MEASURES;\n set[3] = LIM_VOLUME_LINE;\n set[4] = LIM_LOWA;\n set[5] = LIM_HIGHD;\n set[6] = LOW_A_ON;\n set[7] = NEG_TEMPO_FUN;\n set[8] = LIM_TEMPO_GAPS;\n set[9] = RESIZE_WIN;\n set[10] = ADV_MODE;\n }", "@Override\r\n protected void loadStrings() {\r\n \r\n mfile = settings.getProperty( \"mfile\" );\r\n rmode = settings.getProperty( \"rmode\" );\r\n cmap = settings.getProperty( \"cmap\" );\r\n cmapMin = Double.parseDouble( settings.getProperty( \"cmapMin\" ) );\r\n cmapMax = Double.parseDouble( settings.getProperty( \"cmapMax\" ) );\r\n \r\n }", "private void initPlayMode() {\n initPlayModeView();\n initPlayModeController();\n }", "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 }", "@Override\n\tpublic void setMap(ServerMap map, Direction dir)\n\t{\n\t\tchar direction = 'n';\n\t\tif(dir != null)\n\t\t\tswitch(dir)\n\t\t\t{\n\t\t\t\tcase Up:\n\t\t\t\t\tdirection = 'u';\n\t\t\t\t\tbreak;\n\t\t\t\tcase Down:\n\t\t\t\t\tdirection = 'd';\n\t\t\t\t\tbreak;\n\t\t\t\tcase Left:\n\t\t\t\t\tdirection = 'l';\n\t\t\t\t\tbreak;\n\t\t\t\tcase Right:\n\t\t\t\t\tdirection = 'r';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\tsuper.setMap(map, dir);\n\t\tclearRequests();\n\t\t/* Send the map switch packet to the client. */\n\t\tServerMessage message = new ServerMessage(ClientPacket.SET_MAP_AND_WEATHER);\n\t\tmessage.addString(java.lang.Character.toString(direction));\n\t\tmessage.addInt(map.getX());\n\t\tmessage.addInt(map.getY());\n\t\tmessage.addInt(map.isWeatherForced() ? map.getWeatherId() : TimeService.getWeatherId());\n\t\tgetSession().Send(message);\n\t\tCharacter c;\n\t\tString packet = \"\";\n\t\t/* Send all player information to the client. */\n\t\tfor(Player p : map.getPlayers().values())\n\t\t{\n\t\t\tc = p;\n\t\t\tpacket = packet + c.getName() + \",\" + c.getId() + \",\" + c.getSprite() + \",\" + c.getX() + \",\" + c.getY() + \",\"\n\t\t\t\t\t+ (c.getFacing() == Direction.Down ? \"D\" : c.getFacing() == Direction.Up ? \"U\" : c.getFacing() == Direction.Left ? \"L\" : \"R\") + \",\" + p.getAdminLevel() + \",\";\n\t\t}\n\t\t/* Send all npc information to the client. */\n\t\tfor(int i = 0; i < map.getNpcs().size(); i++)\n\t\t{\n\t\t\tc = map.getNpcs().get(i);\n\t\t\tif(!c.getName().equalsIgnoreCase(\"NULL\"))\n\t\t\t\t/* Send no name to indicate NPC */\n\t\t\t\tpacket = packet + \"!NPC!,\" + c.getId() + \",\" + c.getSprite() + \",\" + c.getX() + \",\" + c.getY() + \",\"\n\t\t\t\t\t\t+ (c.getFacing() == Direction.Down ? \"D\" : c.getFacing() == Direction.Up ? \"U\" : c.getFacing() == Direction.Left ? \"L\" : \"R\") + \",0,\";\n\t\t}\n\t\t/* Only send the packet if there were players on the map */\n\t\t/* TODO: Clean this stuff up? */\n\t\tif(packet.length() > 2)\n\t\t{\n\t\t\tServerMessage initPlayers = new ServerMessage(ClientPacket.INIT_PLAYERS);\n\t\t\tinitPlayers.addString(packet);\n\t\t\tgetSession().Send(initPlayers);\n\t\t}\n\t}", "@Override\r\n\tpublic void playerInit(GameEngine engine, int playerID) {\r\n\t\towner = engine.getOwner();\r\n\t\treceiver = engine.getOwner().receiver;\r\n\t\tnumColors[playerID] = 4;\r\n\t\tojamaHard[playerID] = 4;\r\n\t\tcountdownDecremented[playerID] = true;\r\n\t\tojamaChecked[playerID] = false;\r\n\r\n\t\tif(engine.getOwner().replayMode == false) {\r\n\t\t\tloadOtherSetting(engine, engine.getOwner().modeConfig);\r\n\t\t\tloadPreset(engine, engine.getOwner().modeConfig, -1 - playerID, \"spf\");\r\n\t\t\tversion = CURRENT_VERSION;\r\n\t\t} else {\r\n\t\t\tloadOtherSetting(engine, engine.getOwner().replayProp);\r\n\t\t\tloadPreset(engine, engine.getOwner().replayProp, -1 - playerID, \"spf\");\r\n\t\t\tversion = owner.replayProp.getProperty(\"avalanchevs.version\", 0);\r\n\t\t}\r\n\t}", "public static void load()\n throws IOException, ClassNotFoundException {\n FileInputStream f_in = new\n FileInputStream (settingsFile);\n ObjectInputStream o_in = new\n ObjectInputStream(f_in);\n SettingsSaver loaded = (SettingsSaver) o_in.readObject();\n advModeUnlocked = loaded.set[0];\n LIM_NOTESPERLINE = loaded.set[1];\n LIM_96_MEASURES = loaded.set[2];\n LIM_VOLUME_LINE = loaded.set[3];\n LIM_LOWA = loaded.set[4];\n LIM_HIGHD = loaded.set[5];\n LOW_A_ON = loaded.set[6];\n NEG_TEMPO_FUN = loaded.set[7];\n LIM_TEMPO_GAPS = loaded.set[8];\n RESIZE_WIN = loaded.set[9];\n ADV_MODE = loaded.set[10];\n o_in.close();\n f_in.close();\n }", "@Override public void loadSettings(Map pProps, Map pSettings) {\n pSettings.put(getSourceTypeInternalName() + PATH, pProps.get(CDS_PATH));\n pSettings.put(IS_LOCAL + getSourceTypeInternalName(), pProps.get(LOCAL));\n pSettings.put(getSourceTypeInternalName() + HOST_MACHINE, pProps.get(HOST_MACHINE));\n pSettings.put(getSourceTypeInternalName() + PORT, pProps.get(PORT));\n }", "@SuppressWarnings(\"all\")\r\n\tpublic Map(String map, Location mapLocation){\r\n\t\tMapPreset preset = MapPreset.presets.get(map);\r\n\t\tif (preset != null){\r\n\t\t\t\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tfinal World world = mapLocation.getWorld();\r\n\t\t\t\tfinal double x = mapLocation.getX();\r\n\t\t\t\tfinal double y = mapLocation.getY();\r\n\t\t\t\tfinal double z = mapLocation.getZ();\r\n\t\t\t\tfinal float pitch = mapLocation.getPitch();\r\n\t\t\t\tfinal float yaw = mapLocation.getYaw();\r\n\t\t\t\t\t\t\r\n\t\t\t\tfinal Float[] alliesBase = preset.getSpawnAllies();\r\n\t\t\t\tfinal Float[] axisBase = preset.getSpawnAxis();\r\n\t\t\t\t\r\n\t\t\t\tfinal Float[] bombA = preset.getBombA();\r\n\t\t\t\tfinal Float[] bombB = preset.getBombB();\r\n\t\t\t\t\r\n\t\t\t\tfinal Float[] domA = preset.getDomA();\r\n\t\t\t\tfinal Float[] domB = preset.getDomB();\r\n\t\t\t\tfinal Float[] domC = preset.getDomC();\r\n\t\t\t\t\r\n\t\t\t\tmainSpawn = mapLocation;\r\n\t\t\t\talliesSpawn = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + alliesBase[0], \r\n\t\t\t\t\t\ty + alliesBase[1], \r\n\t\t\t\t\t\tz + alliesBase[2],\r\n\t\t\t\t\t\talliesBase[3], \r\n\t\t\t\t\t\talliesBase[4]);\r\n\t\t\t\t\r\n\t\t\t\taxisSpawn = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + axisBase[0], \r\n\t\t\t\t\t\ty + axisBase[1], \r\n\t\t\t\t\t\tz + axisBase[2],\r\n\t\t\t\t\t\taxisBase[3], \r\n\t\t\t\t\t\taxisBase[4]);\r\n\t\t\t\t\r\n\t\t\t\tthis.bombA = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + bombA[0], \r\n\t\t\t\t\t\ty + bombA[1], \r\n\t\t\t\t\t\tz + bombA[2],\r\n\t\t\t\t\t\tbombA[3], \r\n\t\t\t\t\t\tbombA[4]);\r\n\t\t\t\t\r\n\t\t\t\tthis.bombB = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + bombB[0], \r\n\t\t\t\t\t\ty + bombB[1], \r\n\t\t\t\t\t\tz + bombB[2],\r\n\t\t\t\t\t\tbombB[3], \r\n\t\t\t\t\t\tbombB[4]);\r\n\t\t\t\t\r\n\t\t\t\tthis.domA = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + domA[0], \r\n\t\t\t\t\t\ty + domA[1], \r\n\t\t\t\t\t\tz + domA[2],\r\n\t\t\t\t\t\tdomA[3], \r\n\t\t\t\t\t\tdomA[4]);\r\n\t\t\t\t\r\n\t\t\t\tthis.domB = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + domB[0], \r\n\t\t\t\t\t\ty + domB[1], \r\n\t\t\t\t\t\tz + domB[2],\r\n\t\t\t\t\t\tdomB[3], \r\n\t\t\t\t\t\tdomB[4]);\r\n\t\t\t\t\r\n\t\t\t\tthis.domC = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + domC[0], \r\n\t\t\t\t\t\ty + domC[1], \r\n\t\t\t\t\t\tz + domC[2],\r\n\t\t\t\t\t\tdomC[3], \r\n\t\t\t\t\t\tdomC[4]);\r\n\t\t\t\t\r\n\t\t\t\tfor (Float[] spawnpoint : preset.getSpawnpoints()){\r\n\t\t\t\t\tspawnsList.add(new Location(\r\n\t\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\t\tx + spawnpoint[0], \r\n\t\t\t\t\t\t\ty + spawnpoint[1], \r\n\t\t\t\t\t\t\tz + spawnpoint[2], \r\n\t\t\t\t\t\t\tspawnpoint[3], \r\n\t\t\t\t\t\t\tspawnpoint[4]));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tmapID = maps.size()+1;\r\n\t\t\t\tmapName = map;\r\n\t\t\t\tmapAvailable.add(mapID);\r\n\t\t\t\tmaps.put(maps.size()+1, this);\r\n\t\t\t} catch (Exception e){\r\n\t\t\t\tFPSCaste.log(\"Something went wrong! disabling map: \" + map, Level.WARNING);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tFPSCaste.log(\"Could not initialise the Map \" + map, Level.WARNING);\r\n\t\t}\r\n\t}", "public static void reinit() {\n\t\t// ApplicationControl must be initialized\n\t\tif (!isInit())\n\t\t\treturn;\n\n\t\t// initialize game & controller\n\t\tgame = new Game();\n\t\tcontroller = new GameController(game);\n\n\t\t// set the players username\n\t\tsetMe(getStringPref(\"pref_player\"));\n\t}", "private void setUpMap() {\n // Crear all map elements\n mGoogleMap.clear();\n // Set map type\n mGoogleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);\n // If we cant find the location now, we call a Network Provider location\n if (mLocation != null) {\n // Create a LatLng object for the current location\n LatLng latLng = new LatLng(mLocation.getLatitude(), mLocation.getLongitude());\n // Show the current location in Google Map\n mGoogleMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));\n // Draw the first circle in the map\n mCircleOptions = new CircleOptions().fillColor(0x5500ff00).strokeWidth(0l);\n // Zoom in the Google Map\n mGoogleMap.animateCamera(CameraUpdateFactory.zoomTo(15));\n\n // Zoom in the Google Map\n //icon = BitmapDescriptorFactory.fromResource(R.drawable.logo2);\n\n // Creation and settings of Marker Options\n mMarkerOptions = new MarkerOptions().position(latLng).title(\"You are here!\");//.icon(icon);\n // Creation and addition to the map of the Marker\n mMarker = mGoogleMap.addMarker(mMarkerOptions);\n // set the initial map radius and draw the circle\n drawCircle(RADIUS);\n }\n }", "public void loadGame(){\n if(gamePaused == false){ return; }\n // animationThread.stop();\n // JOptionPane.showMessageDialog(null, \"Game Loaded\", \"Message\", 1);\n replay.load();\n board = replay.autoReplay();\n level = replay.getLevel();\n if(muteMusic == false){\n music.stopPlayingAudio(\"All\");\n music.playAudio(\"LevelMusic\");\n }\n musicName = \"LevelMusic\";\n setTitle(\"Chip's Challenge: Level \" + level);\n timeRuunableThread.setDrawNumber(true);\n timeRuunableThread.setSecond(replay.getTime());\n gameStarted = true;\n gamePaused = false;\n timeRuunableThread.setPause(gamePaused);\n timeRuunableThread.setGameStart(gameStarted);\n infoCanvas.drawLevelNumber(level);\n keysize = 0;\n infoCanvas.drawChipsLeftNumber(board.getTreasureRemainingAmount());\n infoCanvas.drawSquares((Graphics2D) infoCanvas.getGraphics(), 14 * infoCanvas.getHeight() / 20, infoCanvas.getWidth(), infoCanvas.getHeight());\n try {\n infoCanvas.drawKeysChipsPics();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n renderer = new MazeRenderer(boardCanvas.getGraphics());\n renderer.redraw(board, boardCanvas.getWidth(), boardCanvas.getHeight());\n checkMovedRedraw();\n }", "public void setGuiHashMap() {\n\n gameMap.setGetGuiHashMapParameter(\"author\",\"Default authorName\");\n gameMap.setGetGuiHashMapParameter(\"warn\",\"Default warning\");\n gameMap.setGetGuiHashMapParameter(\"image\",\"Default image\");\n gameMap.setGetGuiHashMapParameter(\"wrap\",\"Default wrapping\");\n gameMap.setGetGuiHashMapParameter(\"scroll\",\"Default scrolling\");\n }", "public void onLoad()\n {\n saveDefaultConfig();\n\n // Get the lobby name\n chatManager = new ChatManager(this);\n lobby = getConfig().getString(\"lobby\");\n\n // Loading up needed classes\n worldManager = new WorldManager(this);\n\n boolean backupsFound = false;\n\n File backupDir = new File(getDataFolder(), \"backups\");\n if (!backupDir.exists()) {\n getLogger().info(\"No backup directory found; creating one now.\");\n getLogger().info(\"Place world folders you want to reset from in '.../plugins/SkyblockWarriors/backups'\");\n backupDir.mkdirs();\n } else {\n for (File backup : backupDir.listFiles()) {\n if ((backup.isDirectory()) && (backup.listFiles().length != 0)) {\n backupsFound = true;\n }\n }\n\n if (backupsFound) {\n getLogger().info(\"Found backup folder, attempting to reset the world..\");\n // Resetting the world\n worldManager.resetWorld();\n } else {\n if (!getConfig().getBoolean(\"arena-setup\") == false) {\n getLogger().info(\"The plugin should be setup, please copy the world into the backup folder\");\n getLogger().info(\"so the plugin can reset the world on each restart!\");\n }\n }\n }\n }", "public static void savePlayer(Player player){\n if (player != null){\n try {\n mapper.writeValue(new File(\"Data\\\\PlayerData\\\\\" + getFileName(player) + \".json\"), player);\n } catch ( Exception e ) {\n e.printStackTrace();\n }\n }\n }", "public void managePlayOptions() {\n\n Object mySavedGameState = GameStateFileStore.ReadObjectFromFile(\"GameState.ser\");\n GameState castedGameState = GameState.class.cast(mySavedGameState);\n currentLocation = castedGameState.getSavedPlayerLocation();\n LocationData[][] storedGameStateMap = castedGameState.getMapState();\n descriptionText = storedGameStateMap[currentLocation.x][currentLocation.y].getDescriptionText();\n System.out.println(descriptionText);\n\n AvailableMovements myMoveSet = new AvailableMovements(currentLocation, storedGameStateMap);\n myMoveSet.printStringDirections();\n availableDirections = myMoveSet.getDirectionalMap();\n choice = sc.nextLine();\n if (availableDirections.containsKey(choice)) {\n currentLocation = availableDirections.get(choice); //refactor this into walkToNewLocation\n castedGameState.setSavedPlayerLocation(currentLocation);\n GameStateFileStore.WriteObjectToFile(castedGameState);\n managePlayOptions();\n } else {\n System.out.println(\"Invalid option\");\n managePlayOptions();\n }\n\n }", "public void saveGame(){\n \tsaveOriginator.writeMap(this.map, this.getObjectives(), this.gameState);\n \tsaveGame.saveGame(saveOriginator);\n }", "@Override\n\tpublic void onResume() {\n\t\tsuper.onResume();\n\t\tif(map!=null)\n\t\t{\n\t\t\tsetup();\n\t\t}\n\t}", "boolean InitialisePlayer (String path_name);", "void setSettings(ControlsSettings settings);", "public void setMapPosition() {\n\t\txmap = levelState.getx();\n\t\tymap = levelState.gety();\n\t}", "private void setUpOverview() {\n mapInstance = GameData.getInstance();\n //get reference locally for the database\n db = mapInstance.getDatabase();\n\n //retrieve the current player and the current area\n currentPlayer = mapInstance.getPlayer();\n\n }", "@SuppressLint(\"MissingPermission\")\n @AfterPermissionGranted(PERMISSION_LOCATION_ID)\n private void setMapUISettings() {\n map.getUiSettings().setZoomControlsEnabled(true);\n map.getUiSettings().setCompassEnabled(true);\n map.getUiSettings().setAllGesturesEnabled(true);\n\n map.setOnMyLocationClickListener(new GoogleMap.OnMyLocationClickListener() {\n @Override\n public void onMyLocationClick(@NonNull Location location) {\n\n }\n });\n\n map.setOnMyLocationButtonClickListener(new GoogleMap.OnMyLocationButtonClickListener() {\n @Override\n public boolean onMyLocationButtonClick() {\n return false;\n }\n });\n\n if (EasyPermissions.hasPermissions(requireContext(), Manifest.permission.ACCESS_FINE_LOCATION))\n map.setMyLocationEnabled(true);\n else\n EasyPermissions.requestPermissions(this, \"Access fine location needed to get my location\", PERMISSION_LOCATION_ID, Manifest.permission.ACCESS_FINE_LOCATION);\n }", "public GameServer(ConcurrentMap<String, GameObject> scene, ConcurrentMap<String, Player> playerMap) {\n\t\t// TODO Auto-generated constructor stub\n\t\tthis.scene = scene;\n\t\tthis.playerMap = playerMap;\n\t\t// Default tic is at 60 meaning 60 frames in a sec\n\t}", "void loadOriginalGameState(String saveName, int level) throws IOException;", "public void setMap(String mn){\r\n mapName = mn;\r\n currentMap = new ImageIcon(mapName);\r\n }", "private void setPlayer()\t{\n\t\tgrid.setGameObject(spy, Spy.INITIAL_X, Spy.INITIAL_Y);\n\t}", "public void setPlayMode(PlayMode playMode) {\n // there can be a race condition where user tries to open file, this sets\n // playMode to PLAYBACK but run() method in ViewLoop sets it back to WAITING\n this.playMode = playMode;\n// log.info(\"set playMode=\"+playMode);\n }", "public void setMovSettings(MovSettings movSettings) {\n this.movSettings = movSettings;\n }", "private void setDataAndIcons() {\n isShakeEnable(userPreferences.enableShake());\n\n if (userPreferences.enableTap()) {\n mTextViewCurrentlyEnabledActionText.setText(\"\" + userPreferences.getEmergencyNumber().toUpperCase());\n } else if (userPreferences.enableEmergencyContact()) {\n mTextViewCurrentlyEnabledActionText.setText(getResources().getString(R.string.str_contact).toUpperCase());\n } else {\n mTextViewCurrentlyEnabledActionText.setText(getResources().getString(R.string.str_alert).toUpperCase());\n }\n\n // Record timer\n dateFormat = new SimpleDateFormat(getResources().getString(R.string.str_date_format));\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n timerCounter = null;\n timeCounter = UserPreferences.sharedInstance().recordTime() * 1000;\n\n // Assign location to video camera\n cameraView.setLocation(locationManager);\n\n try {\n MapsInitializer.initialize(getActivity());\n } catch (Exception ex) {\n Crittercism.logHandledException(ex);\n }\n\n mapView = getMapFragment();\n mapView.getMapAsync(this);\n mapView.getView().setVisibility(View.GONE);\n\n mTextViewInfoAboutVideoStreaming.setTypeface(FontUtils.getFontFabricGloberBold());\n mTextViewAuthoritiesAlertedText.setTypeface(FontUtils.getFontFabricGloberBold());\n mTextViewVideoSent.setTypeface(FontUtils.getFontFabricGloberBold());\n mTextViewCurrentlyEnabledActionText.setTypeface(FontUtils.getFontFabricGloberBold());\n mTextViewTapOrShakeText.setTypeface(FontUtils.getFontFabricGloberBold());\n mButtonCancel.setTypeface(FontUtils.getFontFabricGloberBold());\n\n if (googleMap != null) {\n googleMapSetLocationEnabled(googleMap);\n }\n\n if (locationManager == null) {\n locationManager = new FwiLocation(getActivity(), this);\n }\n\n LocalBroadcastManager.getInstance(getActivity()).registerReceiver(broadcastReceiver, new IntentFilter(UserPreferences.class.getName()));\n\n if (userPreferences.enableTorch()) {\n cameraView.torchOn();\n }\n }", "private void setUpMap() {\n mMap.getUiSettings().setZoomControlsEnabled(false);\n \n // Setting an info window adapter allows us to change the both the\n // contents and look of the\n // info window.\n mMap.setInfoWindowAdapter(new CustomInfoWindowAdapter(getLayoutInflater()));\n \n // Add lots of markers to the map.\n addMarkersToMap();\n \n }", "private void gameSetup(){\n\t\tboard.boardSetup();\n\t\tdirectionArray = setUpDirectionArray();\n\t\tcurrentPlayer = SharedConstants.PlayableItem.BLACK;\n\t\tcurrentState = SharedConstants.GameStatus.PLAYING;\n\t\tgameStateModel = new GameSateModel();\n\t\tloadGame = new GameStateRetriever();\n\t\tsaveGame = new GameStateWrter(connectFourModel.getGameStateModel());\n\t}", "void setMap(Map aMap);", "public void init() {\n if (!getLocation().isTileMap()) {\n //Debug.signal( Debug.NOTICE, null, \"PlayerImpl::init\");\n this.animation = new Animation(this.wotCharacter.getImage(), ClientDirector.getDataManager().getImageLibrary());\n this.sprite = (Sprite) this.wotCharacter.getDrawable(this);\n this.brightnessFilter = new BrightnessFilter();\n this.sprite.setDynamicImageFilter(this.brightnessFilter);\n }\n this.movementComposer.init(this);\n }", "@Override\r\n public void load()\r\n {\r\n\tLevel.openMap(\"maps/Level1.map\", _width, _height);\r\n\t_level = Level.getInstance();\r\n\tCamera.getInstance().setBounds(_level.getWorldBoundaries());\r\n\t_printText = new Text(TILESHEET_TEXTURE, \"0123456789xUPC\", 0, 244, 32, 37, 4, 24, 28);\r\n\t_coin = new Sprite(\"Coin\", 6, _height - 34, 24, 24, Tiles.get(COIN_ANIM), false);\r\n\t_1UP = new Sprite(\"1UP\", 200, _height - 42, 42, 42, Tiles.get(MUSHROOM_GREEN), false);\r\n\tSoundLibrary.getInstance().loop(MUSIC_LEVEL);\r\n\tMario.clearData();\r\n }", "public void load() throws IOException {\r\n File file = new File(this.filename);\r\n //if file exist.\r\n if (file.exists() && !file.isDirectory()) {\r\n ObjectInputStream is = null;\r\n try {\r\n //opening and reaind the source file\r\n is = new ObjectInputStream(new FileInputStream(this.filename));\r\n SettingsFile temp = (SettingsFile) is.readObject();\r\n //import the loaded file data to the current core.SettingsFile\r\n this.boardSize = temp.getBoardSize();\r\n this.firstPlayer = temp.getFirstPlayer();\r\n this.secondPlayer = temp.getSecondPlayer();\r\n this.player1Color = temp.getPlayer1Color();\r\n this.player2Color = temp.getPlayer2Color();\r\n } catch (IOException e) {\r\n System.out.println(\"Error while loading\");\r\n } catch (ClassNotFoundException e) {\r\n System.out.println(\"Problem with class\");\r\n } finally {\r\n if (is != null) {\r\n is.close();\r\n }\r\n }\r\n }\r\n //if no file, set default settings.\r\n else {\r\n save(SIZE, FIRST_PLAYER, SECOND_PLAYER, PLAYER1COLOR, PLAYER2COLOR);\r\n }\r\n }", "public void setLevel(Player player, PluginLevel level) {\n\n\t\tString playerName = player.getName();\n\n\t\tif (!entries.containsKey(playerName)) {\n\t\t\tPlayerConfiguration configuration = new PlayerConfiguration();\n\t\t\tconfiguration.setLevel(level);\n\t\t\tentries.put(playerName, configuration);\n\t\t} else {\n\t\t\tPlayerConfiguration config = entries.get(playerName);\n\t\t\tconfig.setLevel(level);\n\t\t}\n\t}" ]
[ "0.6612962", "0.6152002", "0.6029665", "0.58659613", "0.58552104", "0.58165205", "0.58145636", "0.5783099", "0.57824326", "0.5778288", "0.57619554", "0.57244956", "0.57244956", "0.56733817", "0.5593109", "0.55299497", "0.5519895", "0.5459495", "0.54286593", "0.5419571", "0.54139847", "0.53920096", "0.5386189", "0.5378376", "0.53508484", "0.53416073", "0.53082323", "0.53080964", "0.5302938", "0.5297949", "0.52917206", "0.52868384", "0.52826643", "0.5281855", "0.5276951", "0.5266032", "0.5265214", "0.5262114", "0.5251912", "0.525059", "0.5243783", "0.52354294", "0.5233839", "0.52328324", "0.5212445", "0.5198174", "0.51770264", "0.515875", "0.5151864", "0.5151349", "0.5147336", "0.51449287", "0.51384586", "0.5135926", "0.5130152", "0.5126479", "0.51264644", "0.51261955", "0.51228803", "0.5119708", "0.5116732", "0.5113411", "0.50999767", "0.5099435", "0.5098962", "0.5085448", "0.5081703", "0.50799996", "0.5079346", "0.50734204", "0.50721836", "0.50661844", "0.50631773", "0.5058866", "0.5058543", "0.50552535", "0.504711", "0.50447476", "0.5042381", "0.5040328", "0.50328636", "0.5031418", "0.5031373", "0.50260353", "0.50191534", "0.5016574", "0.50049156", "0.4999801", "0.49996245", "0.49892598", "0.4989135", "0.49858072", "0.49841395", "0.49786386", "0.49751973", "0.49694234", "0.49656507", "0.49645787", "0.49612126", "0.49605587" ]
0.54431367
18
Returns window of the root.
private Window getWindow() { return root.getScene().getWindow(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Window getWindow() {\n Window w = null;\n if(this instanceof Container) {\n Node root = ((Container)this).getRoot();\n Scene scene = root==null ? null : root.getScene();\n javafx.stage.Window stage = scene==null ? null : scene.getWindow();\n w = stage==null ? null : (Window)stage.getProperties().get(\"window\");\n }\n if(this instanceof Widget) {\n Node root = ((Widget)this).getGraphics();\n Scene scene = root==null ? null : root.getScene();\n javafx.stage.Window stage = scene==null ? null : scene.getWindow();\n w = stage==null ? null : (Window)stage.getProperties().get(\"window\");\n }\n return w==null ? Window.getActive() : w;\n }", "public Window getWindow() {\n\t\treturn selectionList.getScene().getWindow();\n\t}", "public static Window getWindow() {\r\n\t\treturn window;\r\n\t}", "public final TWindow getWindow() {\n return window;\n }", "public Window getWindow() {\r\n return window;\r\n }", "public Window getWindow() {\n return window;\n }", "public Window getWindow() { return window; }", "private int getCurrentWindow() {\n // Subscribe to window information\n AccessibilityServiceInfo info = mUiAutomation.getServiceInfo();\n info.flags |= AccessibilityServiceInfo.FLAG_RETRIEVE_INTERACTIVE_WINDOWS;\n mUiAutomation.setServiceInfo(info);\n\n AccessibilityNodeInfo activeWindowRoot = mUiAutomation.getRootInActiveWindow();\n\n for (AccessibilityWindowInfo window : mUiAutomation.getWindows()) {\n if (window.getRoot().equals(activeWindowRoot)) {\n return window.getId();\n }\n }\n throw new RuntimeException(\"Could not find active window\");\n }", "public JFrame getWindow() {\n\t\treturn window;\n\t}", "public static JFrame getWindow()\r\n {\r\n\treturn window;\r\n }", "BorderPane getRoot();", "public String getLegalWindow() {\n\t\tif(driver.getWindowHandles().isEmpty())\n\t\t\treturn null;\n\t\t\n\t\treturn driver.getWindowHandles().iterator().next();\n\t}", "public String getMainWindow() {\r\n\t\treturn null;\r\n\t}", "@Override\n public W representative(W window) {\n return window;\n }", "Window getParent();", "public void selectRootWindow() {\n\t\tList<String> listOfWindows = new ArrayList<>(SharedSD.getDriver().getWindowHandles());\n\t\tSharedSD.getDriver().switchTo().window(listOfWindows.get(0));\n\t}", "public final ResizeDDContainer getWindow() {\r\n\t\t\treturn (ResizeDDContainer) getSource();\r\n\t\t}", "public final ResizeDDContainer getWindow() {\r\n\t\t\treturn (ResizeDDContainer) getSource();\r\n\t\t}", "public JDialog getWindow() {\n\t\treturn window;\n\t}", "public Stage getWindow() {\n return primaryStage;\n }", "W getRootElement();", "public WindowState findFocusedWindow() {\n this.mTmpWindow = null;\n forAllWindows(this.mFindFocusedWindow, true);\n WindowState windowState = this.mTmpWindow;\n if (windowState != null) {\n return windowState;\n }\n if (WindowManagerDebugConfig.DEBUG_FOCUS_LIGHT) {\n Slog.v(TAG, \"findFocusedWindow: No focusable windows.\");\n }\n return null;\n }", "public SAPTopLevelTestObject getActiveWindow(){\n\t\treturn new SAPTopLevelTestObject(mainWnd);\n\t}", "public BorderPane getRoot() {\n\t\treturn _root;\n\t}", "public BorderPane getRoot() {\n\t\treturn _root;\n\t}", "public WindowState getParentWindow() {\n return this.mParentWindow;\n }", "public BorderPane getRoot() {\n\t\treturn root;\n\t}", "@Override\n public long getValidWindow() {\n return 0;\n }", "public Java2DGameWindow getGameWindow() {\r\n\t\t// if we've yet to create the game window, create the appropriate one\r\n\t\tif (window == null) {\r\n\t\t\twindow = new Java2DGameWindow();\r\n\t\t}\r\n\t\treturn window;\r\n\t}", "public synchronized IWorkbenchWindow getCurrentWindow() {\n return currentWindow;\n }", "public int getWindows() {\n\t\treturn windows;\n\t}", "protected double getWindowWidth() {\n\t\treturn m_windowWidth;\n\t}", "public Window getParentWindow() {\r\n\t\t// // I traverse the windows hierarchy to find this component's parent\r\n\t\t// window\r\n\t\t// // if it's in an application, then it'll be that frame\r\n\t\t// // if it's in an applet, then it'll be the browser window\r\n\r\n\t\t// // unfortunately if it's an applet, the popup window will have \"Java\r\n\t\t// Applet Window\" label\r\n\t\t// // at the bottom...nothing i can do (for now)\r\n\r\n\t\tWindow window = null;\r\n\r\n\t\tComponent component = this;\r\n\t\twhile (component.getParent() != null) {\r\n\r\n\t\t\tif (component instanceof Window)\r\n\t\t\t\tbreak;\r\n\t\t\tcomponent = component.getParent();\r\n\t\t}\r\n\r\n\t\tif (component instanceof Window)\r\n\t\t\twindow = (Window) component;\r\n\r\n\t\treturn (window);\r\n\t}", "public int getWindowID() {\n\t\treturn windowID;\n\t}", "public MainWindow getMainWindow() {\n\t\treturn mainWindow;\n\t}", "public SimpleCalculatorWindow getInputWindow(){\n\t\treturn this.theInputWindow;\n\t}", "public Integer getEventGenWindow() {\n return eventGenWindow;\n }", "public int getRoot() {\n return _root;\n }", "public static Color getWindowColor() {\n return WINDOW;\n }", "public window getWindow(String sname) {\n return (window) windows.getObject(sname);\n }", "public int getRoot(){\n\t\t\treturn root;\n\t\t}", "public Window getFullScreenWindow(){\n return vc.getFullScreenWindow();\n }", "protected abstract Widget getRootWidget();", "public Pane getRoot() {\n \treturn _root;\n }", "public static GameWindow getGame() {\n return _gameWindow;\n }", "public window getWindow(int i) {\n return (window) windows.getObject(i);\n }", "protected double getWindowLeftX() {\n\t\treturn this.m_windowLeftX;\n\t}", "protected Text getWorkspaceRootText() {\r\n\t\treturn workspaceRootText;\r\n\t}", "private HtmlElement getRoot()\n\t{\n\t\treturn getBaseRootElement( ROOT_BY );\n\t}", "public void calculateWindow()\n {\n Vector2 windowBottomLeftBounds = new Vector2(1000000, 1000000);\n Vector2 windowTopRightBounds = new Vector2(-1000000, -1000000);\n for (Element<?> e : children())\n {\n if (e.id() != null && (e.id().startsWith(id() + \"hBar\") || e.id().startsWith(id() + \"vBar\")))\n {\n continue;\n }\n for (Element<?> child : e)\n {\n Vector2 alignmentVector = child.alignment().alignmentVector();\n Vector2 bottomLeftBounds = new Vector2(child.x() - (alignmentVector.x * child.width()), child.y()\n - (alignmentVector.y * child.height()));\n Vector2 topRightBounds = new Vector2(bottomLeftBounds.x + child.width(), bottomLeftBounds.y + child.height());\n // left\n if (windowBottomLeftBounds.x > bottomLeftBounds.x)\n {\n windowBottomLeftBounds.x = bottomLeftBounds.x;\n }\n // bottom\n if (windowBottomLeftBounds.y > bottomLeftBounds.y)\n {\n windowBottomLeftBounds.y = bottomLeftBounds.y;\n }\n // right\n if (windowTopRightBounds.x < topRightBounds.x)\n {\n windowTopRightBounds.x = topRightBounds.x;\n }\n // top\n if (windowTopRightBounds.y < topRightBounds.y)\n {\n windowTopRightBounds.y = topRightBounds.y;\n }\n }\n }\n \n content = new CRectangle(windowBottomLeftBounds.x, windowBottomLeftBounds.y, windowTopRightBounds.x - windowBottomLeftBounds.x,\n windowTopRightBounds.y - windowBottomLeftBounds.y);\n content.origin = new Vector2(0, 0);\n \n calculateScrollSize();\n }", "public JPanel getWindow(String key)\r\n\t{\r\n\t\treturn aniWin.getWindow(key);\r\n\t}", "private IWorkspaceRoot getWorkspaceRoot() {\n\t\treturn ResourcesPlugin.getWorkspace().getRoot();\n\t}", "public Point getLocationInParentWindow() {\n return this.mLocationInParentWindow;\n }", "public String getRoot() {\n return root;\n }", "public Rect getRootViewRect() {\n return this.mRootViewRect;\n }", "public List<Window> getWindows(){\n\t\treturn windows;\n\t}", "public Element getDocument() {\n\t\t\n\t\tElement retval = getRoot();\n\t\t\n\t\tList<Element> children;\n\t\t\n\t\tif ( retval.getName().equals(\"ROOT\") && (children = retval.getAllChildren()).size() > 0 )\n\t\t\tretval = children.get(0);\n\t\t\n\t\treturn retval;\n\n\t}", "public abstract int getRootView();", "private Window getDialogOwner(final Node node)\n {\n if (node != null) {\n final Scene scene = node.getScene();\n if (scene != null) {\n final Window window = scene.getWindow();\n if (window != null) return window;\n }\n }\n return task.getPrimaryStage();\n }", "int getWindowSize();", "public String getRoot();", "public WAVLNode getRoot()\r\n\t {\r\n\t\t return this.root;\r\n\t }", "private JComponent getRootPane()\n\t{\n\t\treturn null;\n\t}", "public window get(String sname) {\n return getWindow(sname);\n }", "NativeWindow getWindowFromPoint(Point p);", "public DialogueNode getRoot() {\n\t\treturn root;\n\t}", "public String getCurrentHandle()\n\t{\n\t\treturn driver.getWindowHandle();\n\t}", "public final Node getRootContext() {\n return rootContext;\n }", "@Min(2)\n public int getWindowSize()\n {\n return windowSize;\n }", "@java.lang.Override\n public long getWindowSize() {\n return windowSize_;\n }", "public Integer getRoot(){\n\t\tif(root != null) {\n\t\t\treturn root.element;\n\t\t}\n\t\treturn null;\n\t}", "public abstract TargetWindowT getSideInputWindow(BoundedWindow mainWindow);", "public static Window getInstance() {\n if (mInstance == null) {\n mInstance = new Window();\n }\n return mInstance;\n }", "public String getRootElement() {\n int index = mRootElementCombo.getSelectionIndex();\n if (index >= 0) {\n return mRootElementCombo.getItem(index);\n }\n return null;\n }", "protected double getWindowRightX() {\n\t\treturn this.m_windowRightX;\n\t}", "@java.lang.Override\n public long getWindowSize() {\n return windowSize_;\n }", "public WAVLNode getRoot() // return the root of the tree\r\n {\r\n return root;\r\n }", "public Object getRoot(){\r\n\t\treturn _root;\r\n\t}", "public static Previous getPreviousWindow() {\n\t\treturn previousWindow;\n\t}", "public View getRootView(){\n return this.rootView;\n }", "NativeWindow getWindowById(long id);", "public MainWindow getMainWindow(){\n\t\treturn mainWindow;\n\t}", "public int getWinX() {\r\n return winX;\r\n }", "public window get(int i) {\n return getWindow(i);\n }", "public Pane<T> currentPane() {\n return currentPane(System.currentTimeMillis());\n }", "public AppWindowToken getAppWindowToken(IBinder binder) {\n WindowToken token = getWindowToken(binder);\n if (token == null) {\n return null;\n }\n return token.asAppWindowToken();\n }", "public String getRoot() {\n\t\treturn null;\n\t}", "public AVLNode getRoot() {\n return root;\n }", "public View getRootView() {\n return mRootView;\n }", "long getSignedBlocksWindow();", "public WindowManagerService getWindowManager() {\n return this.mService.mWindowManager;\n }", "protected BSTNode root() {\n\t\treturn root;\n\t}", "public TreeNode root() {\n\t\treturn root;\n\t}", "public Node getRoot() {\n return root;\n }", "public Object\tgetRoot() {\n \treturn root;\n }", "private Window getParentWindow(Component paramComponent) {\n/* 192 */ Window window = null;\n/* */ \n/* 194 */ if (paramComponent instanceof Window) {\n/* 195 */ window = (Window)paramComponent;\n/* */ }\n/* 197 */ else if (paramComponent != null) {\n/* 198 */ window = SwingUtilities.getWindowAncestor(paramComponent);\n/* */ } \n/* 200 */ if (window == null) {\n/* 201 */ window = new DefaultFrame();\n/* */ }\n/* 203 */ return window;\n/* */ }", "public Node getRoot() {\n return root;\n }", "public Node getRoot() {\n return root;\n }", "public Node getRoot() {\n return root;\n }", "public VBox get() {\n\t\treturn root;\n\t}" ]
[ "0.7461939", "0.7380816", "0.7249872", "0.71494025", "0.69917905", "0.69861746", "0.68683445", "0.68341935", "0.67218876", "0.6720993", "0.6620925", "0.6558101", "0.6548144", "0.65194356", "0.6444633", "0.6382332", "0.636714", "0.636714", "0.6340236", "0.6287254", "0.6279726", "0.6239206", "0.6228553", "0.6228348", "0.6228348", "0.6208719", "0.6208199", "0.62056565", "0.61973643", "0.61835456", "0.61780775", "0.6168389", "0.61616033", "0.6126195", "0.6121911", "0.6089792", "0.60848385", "0.60687196", "0.6061935", "0.6048405", "0.6028945", "0.5961402", "0.59538764", "0.5951101", "0.5940274", "0.58946574", "0.5884675", "0.5850624", "0.5849965", "0.58476096", "0.5838663", "0.58362406", "0.58349264", "0.5827005", "0.5817565", "0.5813911", "0.5810184", "0.5793066", "0.578968", "0.57777727", "0.5771511", "0.576828", "0.5767417", "0.5766645", "0.57647973", "0.5750952", "0.57361627", "0.57194453", "0.57056415", "0.5699348", "0.56965935", "0.5694516", "0.5685785", "0.56846607", "0.56822395", "0.56613636", "0.56498843", "0.5646104", "0.56449246", "0.56362957", "0.5633835", "0.5632668", "0.56275225", "0.56194514", "0.56116074", "0.5593531", "0.55924296", "0.5587871", "0.5577763", "0.55767757", "0.55748945", "0.5573662", "0.5568112", "0.55634606", "0.5562816", "0.556117", "0.5547652", "0.5547652", "0.5547652", "0.55432564" ]
0.75254536
0
Loads data in proper order.
private void loadData() { titleProperty.set(TITLE); imageView.setImage(null); scrollPane.setContent(null); final Task<Void> finisher = new Task<Void>() { @Override protected Void call() throws Exception { Platform.runLater(new Runnable() { @Override public void run() { buffer = replay.politicalBuffer; output = new WritableImage(replay.bufferWidth, replay.bufferHeight); output.getPixelWriter().setPixels(0, 0, replay.bufferWidth, replay.bufferHeight, PixelFormat.getIntArgbPreInstance(), buffer, 0, replay.bufferWidth); progressBar.progressProperty().unbind(); progressBar.setProgress(0); statusLabel.textProperty().unbind(); statusLabel.setText(l10n("replay.map.loaded")); scrollPane.setContent(null); imageView.setImage(output); scrollPane.setContent(imageView); int fitWidth = Integer.parseInt(settings.getProperty("map.fit.width", "0")); int fitHeight = Integer.parseInt(settings.getProperty("map.fit.height", "0")); imageView.setFitHeight(fitHeight); imageView.setFitWidth(fitWidth); lock.release(); } }); return null; } }; progressBar.progressProperty().bind(finisher.progressProperty()); statusLabel.textProperty().bind(finisher.titleProperty()); replay.loadData(finisher); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract void loadData();", "protected void loadData()\n {\n }", "void loadData();", "void loadData();", "public void loadData ( ) {\n\t\tinvokeSafe ( \"loadData\" );\n\t}", "public abstract void loadData();", "public abstract void loadData();", "public void loadData() {\n\t\tbookingRequestList = bookingRequestDAO.getAllBookingRequests();\n\t\tcabDetailList = cabDAO.getAllCabs();\n\t}", "public void loadData () {\n // create an ObjectInputStream for the file we created before\n ObjectInputStream ois;\n try {\n ois = new ObjectInputStream(new FileInputStream(\"DB/Guest.ser\"));\n\n int noOfOrdRecords = ois.readInt();\n Guest.setMaxID(ois.readInt());\n System.out.println(\"GuestController: \" + noOfOrdRecords + \" Entries Loaded\");\n for (int i = 0; i < noOfOrdRecords; i++) {\n guestList.add((Guest) ois.readObject());\n //orderList.get(i).getTable().setAvailable(false);\n }\n } catch (IOException | ClassNotFoundException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n }", "@Override\n\t\tvoid loadData() throws IOException {\n\t\t\tsuper.loadData();\n\t\t}", "private void loadData()\n {\n try\n {\n //Reads in the data from default file\n System.out.println(\"ATTEMPTING TO LOAD\");\n allGroups = (ArrayList<CharacterGroup>)serial.Deserialize(\"All-Groups.dat\");\n System.out.println(\"LOADED\");\n loadSuccessful = true;\n \n //If read is successful, save backup file in case of corruption\n try\n {\n System.out.println(\"SAVING BACKUP\");\n serial.Serialize(allGroups, \"All-Groups-backup.dat\");\n System.out.println(\"BACKUP SAVED\");\n } catch (IOException e)\n {\n System.out.println(\"FAILED TO WRITE BACKUP DATA\");\n }\n } catch (IOException e)\n {\n //If loading from default file fails, first try loading from backup file\n System.out.println(\"READING FROM DEFAULT FAILED\");\n try\n {\n System.out.println(\"ATTEMPTING TO READ FROM BACKUP\");\n allGroups = (ArrayList<CharacterGroup>)serial.Deserialize(\"All-Groups-backup\");\n System.out.println(\"READING FROM BACKUP SUCCESSFUL\");\n loadSuccessful = true;\n } catch (IOException ex)\n {\n //If reading from backup fails aswell generate default data\n System.out.println(\"READING FROM BACKUP FAILED\");\n allGroups = new ArrayList();\n } catch (ClassNotFoundException ex){}\n } catch (ClassNotFoundException e){}\n }", "public void loadFirstData() throws Exception {\n\t}", "private void loadData() {\n this.financeDataList = new ArrayList<>();\n }", "private void initDataLoader() {\n\t}", "private void loadData(){\n try (BufferedReader br = new BufferedReader(new FileReader(this.fileName))) {\n String line;\n while((line=br.readLine())!=null){\n E e = createEntity(line);\n super.save(e);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void loadData() {\n\t\tOptional<ServerData> loaded_data = dataSaver.load();\n\t\tif (loaded_data.isPresent()) {\n\t\t\tdata = loaded_data.get();\n\t\t} else {\n\t\t\tdata = new ServerData();\n\t\t}\n\t}", "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 }", "void loadData() throws SerializerException;", "private void loadData() {\r\n\t\talert(\"Loading data ...\\n\");\r\n \r\n // ---- categories------\r\n my.addCategory(new Category(\"1\", \"VIP\"));\r\n my.addCategory(new Category(\"2\", \"Regular\"));\r\n my.addCategory(new Category(\"3\", \"Premium\"));\r\n my.addCategory(new Category(\"4\", \"Mierder\"));\r\n \r\n my.loadData();\r\n \r\n\t }", "public void load()\n\t{\n\t\tfor(String s : playerData.getConfig().getKeys(false))\n\t\t{\n\t\t\tPlayerData pd = new PlayerData(playerData, s);\n\t\t\tpd.load();\n\t\t\tdataMap.put(s, pd);\n\t\t}\n\t}", "public void load() {\n handleLoad(false, false);\n }", "public void loadData() {\n\t\tempsList.add(\"Pankaj\");\r\n\t\tempsList.add(\"Raj\");\r\n\t\tempsList.add(\"David\");\r\n\t\tempsList.add(\"Lisa\");\r\n\t}", "private void loadData()\r\n\t{\r\n\t\taddProduct(\"Area\", \"Education\");\r\n\t\taddProduct(\"Area\", \"Environment\");\r\n\t\taddProduct(\"Area\", \"Health\");\r\n\r\n\t\taddProduct(\"Domain\", \"Documentation\");\r\n\t\taddProduct(\"Domain\", \"Project Activity\");\r\n\t\taddProduct(\"Domain\", \"Technology\");\r\n\r\n\t\taddProduct(\"City\", \"Bangalore\");\r\n\t\taddProduct(\"City\", \"Hyderabad\");\r\n\t\taddProduct(\"City\", \"Lucknow\");\r\n\r\n\t\taddProduct(\"Activity_Type\", \"Onsite\");\r\n\t\taddProduct(\"Activity_Type\", \"Offsite\");\r\n\r\n\t}", "private void loadDataFromMemory(String filename){\n shoppingList.clear();\n new ReadFromMemoryAsync(filename, getCurrentContext(), new ReadFromMemoryAsync.AsyncResponse(){\n\n @Override\n public void processFinish(List<ShoppingItem> output) {\n shoppingList.addAll(output);\n sortItems();\n }\n }).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n// for (ShoppingItem item: items) {\n// shoppingList.add(item);\n// }\n// sortItems();\n }", "private void load() {\r\n\t\tswitch (this.stepPanel.getStep()) {\r\n\t\tcase StepPanel.STEP_HOST_GRAPH:\r\n\t\t\tloadGraph(StepPanel.STEP_HOST_GRAPH);\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_STOP_GRAPH:\r\n\t\t\tloadGraph(StepPanel.STEP_STOP_GRAPH);\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_CRITICAL_PAIRS:\r\n\t\t\tloadPairs();\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_FINISH:\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public void load() {\n\t}", "@Override\r\n\tprotected void load() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void load() {\n\t\ts.load();\r\n\r\n\t}", "public void load (){\n load(MAX_PREZ);\n }", "public void loadObjData() {\n this.updateGeometryAndUVs(SquareCoords, UVCoords, DrawOrder);\n SquareCoords = new float[0];\n UVCoords = new float[0];\n DrawOrder = new int[0];\n }", "@Override\n\tpublic void loadData(Bundle bundle) {\n\t}", "public void loadFromDatabase(){\r\n /**\r\n * Open the file streams to the three files\r\n * Recover the state of data structures\r\n * Close the file streams\r\n */\r\n\r\n try{\r\n //Recover the state of unfinished set from unfinished.dat\r\n unfinishedFileInputStream = new FileInputStream(UNFINISHED_FILE_PATH);\r\n unfinishedSetInputStream = new ObjectInputStream(unfinishedFileInputStream);\r\n unfinished = (Set<Task>)unfinishedSetInputStream.readObject();\r\n unfinishedSetInputStream.close();\r\n unfinishedFileInputStream.close();\r\n\r\n //Recover the state of finished list from finished.dat\r\n finishedFileInputStream = new FileInputStream(FINISHED_FILE_PATH);\r\n finishedListInputStream = new ObjectInputStream(finishedFileInputStream);\r\n finished = (ArrayList<Task>)finishedListInputStream.readObject();\r\n finishedListInputStream.close();\r\n finishedFileInputStream.close();\r\n\r\n //Recover the state of activities list from activities.dat\r\n activitiesFileInputStream = new FileInputStream(ACTIVITIES_FILE_PATH);\r\n activitiesListInputStream = new ObjectInputStream(activitiesFileInputStream);\r\n activities = (ArrayList<Activity>)activitiesListInputStream.readObject();\r\n activitiesListInputStream.close();\r\n activitiesFileInputStream.close();\r\n\r\n generateWeeklySchedule();\r\n }\r\n catch(Exception e){\r\n System.out.println(e.getMessage());\r\n }\r\n }", "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}", "private void loadData() {\n //load general data\n Settings.loadSettings();\n\n this.spCrawlTimeout.setValue(Settings.CRAWL_TIMEOUT / 1000);\n this.spRetryPolicy.setValue(Settings.RETRY_POLICY);\n this.spRecrawlInterval.setValue(Settings.RECRAWL_TIME / 3600000);\n this.spRecrawlCheckTime.setValue(Settings.RECRAWL_CHECK_TIME / 60000);\n }", "private void loadData() {\n Log.d(LOG_TAG, \"loadData()\");\n /* If the device does not have an internet connection, then... */\n if (!NetworkUtils.hasInternetConnection(this)){\n showErrorMessage(true);\n return;\n }\n /* Make the View for the data visible and hide the error message */\n showDataView();\n\n /* Fetch the data from the web asynchronous using Retrofit */\n TMDBApi the_movie_database_api = new TMDBApi(new FetchDataTaskCompleteListener());\n /* Start the network transactions */\n the_movie_database_api.start(sortOrderCurrent);\n\n /* Display the loading indicator */\n displayLoadingIndicator(true);\n }", "private void loadLists() {\n loadSavedCourses();\n loadSavedSchedules();\n }", "private void loadData(){\n Dh.refresh();\n }", "private void loadDataFromDatabase() {\n mSwipeRefreshLayout.setRefreshing(true);\n mPresenter.loadDataFromDatabase();\n }", "void massiveModeLoading( File dataPath );", "public void load(){\n // Recover docIDs\n try(Reader reader = new FileReader(\"postings/docIDs.json\")){\n this.docIDs = (new Gson()).fromJson(reader,\n new TypeToken<Map<String, String>>(){}.getType());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n try(Reader reader = new FileReader(\"postings/docLengths.json\")){\n this.docLengths = (new Gson()).fromJson(reader,\n new TypeToken<Map<String, Integer>>(){}.getType());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n try(Reader reader = new FileReader(\"postings/titleToNumber.json\")){\n this.titleToNumber = (new Gson()).fromJson(reader,\n new TypeToken<Map<String, Integer>>(){}.getType());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void load() {\n }", "private void loadData() {\n FileInputStream fis;\n\n try {\n fis = openFileInput(DATA_FILE);\n user = (User) new JsonReader(fis).readObject();\n fis.close();\n } catch(Exception e) {\n Log.i(\"Exception :\", e.toString());\n }\n }", "@Override\r\n\tpublic void load() {\n\t}", "private void loadData(){\n updateDateTimeText();\n\n mLoadingDialog = DialogUtil.createLoadingDialog(getActivity(), getString(R.string.loading_dialog_in_progress));\n mLoadingDialog.show();\n // Call API to get the schedules\n mPresenter.loadAllExaminationSchedulesForSpecificDate(mMyDate.generateDateString(AppConstants.DATE_FORMAT_YYYY_MM_DD));\n }", "private void swapAndLoadData() {\n\n \tLog.d(Constants.TAG, \"EntryListActivity: swapAndLoadData: update last loaded data date\");\n \tSharedPreferences settings = getSharedPreferences(Preferences.PREFS_NAME, 0);\n\t\tSharedPreferences.Editor editor = settings.edit();\n\t editor.putLong(Preferences.PREF_KEY_LAST_LOADED_DATA_DATE, this.lastRefreshSuccessDate);\n\t editor.commit();\n\n\t\tLog.d(Constants.TAG, \"EntryListActivity: swapAndLoadData: swap data\");\n\t\t// TODO JGU #1: swap in background or UI thread\n\t\tLoadNewDataTask loadNewDataTask = new LoadNewDataTask(this);\n\t\tloadNewDataTask.execute();\n//\t\texecuteSwapping();\n\t\t///JGU #1\n\t}", "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}", "private void loadData(List<String> pathList)\n {\n Log.e(TAG, \"loadData() called pathList=\" + pathList.toString());\n for (int i = 0; i < pathList.size(); i++)\n {\n String path = pathList.get(i);\n ArrayList<String> thisPathDataList = new ArrayList<String>();\n mDataMap.put(path, loadDataImp(path, thisPathDataList));\n }\n\n }", "@Override\n\tpublic void loadData() throws FileNotFoundException {\n\t\tthis.getPromoShare();\n\t}", "public void load() ;", "@Override\n\tprotected void load() {\n\t\t\n\t}", "@Override\n\tprotected void load() {\n\t\t\n\t}", "@Override\n\tprotected void load() {\n\t\t\n\t}", "@Override\n\tprotected void load() {\n\n\t}", "@Override\n\tprotected void load() {\n\n\t}", "private void reloadData() throws IOException\n {\n /* Reload data from file, if it is modified after last scan */\n long mtime = loader.getModificationTime();\n if (mtime < lastKnownMtime) {\n return;\n }\n lastKnownMtime = mtime;\n\n InputStream in = loader.getInputStream();\n BufferedReader bin = new BufferedReader(new InputStreamReader(in));\n cache.clear();\n String line;\n while ((line = bin.readLine()) != null) {\n try {\n Map<String, Object> tuple = reader.readValue(line);\n updateLookupCache(tuple);\n } catch (JsonProcessingException parseExp) {\n logger.info(\"Unable to parse line {}\", line);\n }\n }\n IOUtils.closeQuietly(bin);\n IOUtils.closeQuietly(in);\n }", "@Override\n\t\t\t\t\tpublic void beginLoad(int type) {\n\n\t\t\t\t\t}", "protected void loadDataFromFile() throws IOException {\n \t\tInputStream is = null;\n \n \t\ttry {\n \t\t\tis = new BufferedInputStream(new GZIPInputStream(\n \t\t\t\t\tnew FileInputStream(this.dataFile)));\n \n \t\t\tint dataOffset = 0;\n \t\t\tByteArrayOutputStream os = new ByteArrayOutputStream();\n \n \t\t\twhile (true) {\n \t\t\t\tint b = is.read();\n \n \t\t\t\tif (b == 0) {\n \t\t\t\t\t// field separator reached.\n \t\t\t\t\tif (this.componentId == null) {\n \t\t\t\t\t\tbyte[] encoded = os.toByteArray();\n \t\t\t\t\t\tdataOffset += encoded.length;\n \t\t\t\t\t\tdataOffset += 1; // include the separator field\n \t\t\t\t\t\tcomponentId = new String(URLEncoding.decode(encoded),\n \t\t\t\t\t\t\t\t\"UTF-8\");\n \t\t\t\t\t} else if (this.query == null) {\n \t\t\t\t\t\tbyte[] encoded = os.toByteArray();\n \t\t\t\t\t\tdataOffset += encoded.length;\n \t\t\t\t\t\tdataOffset += 1; // include the separator field\n \n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\tString queryXml = new String(URLEncoding\n \t\t\t\t\t\t\t\t\t.decode(encoded), \"UTF-8\");\n \n \t\t\t\t\t\t\t// parse the query.\n \t\t\t\t\t\t\tSAXReader reader = new SAXReader();\n \t\t\t\t\t\t\tElement root = reader.read(\n \t\t\t\t\t\t\t\t\tnew StringReader(queryXml))\n \t\t\t\t\t\t\t\t\t.getRootElement();\n \t\t\t\t\t\t\tthis.query = root.getText();\n \t\t\t\t\t\t} catch (Exception e) {\n \t\t\t\t\t\t\tthrow new IOException(\n \t\t\t\t\t\t\t\t\t\"Cannot unmarshall cached query.\");\n \t\t\t\t\t\t}\n \t\t\t\t\t} else if (this.optionalParams == null) {\n \t\t\t\t\t\tbyte[] encoded = os.toByteArray();\n \t\t\t\t\t\tdataOffset += encoded.length;\n \t\t\t\t\t\tdataOffset += 1; // include the separator field\n \n \t\t\t\t\t\tif (encoded.length > 0) {\n \t\t\t\t\t\t\tMap optionalParams = new HashMap();\n \t\t\t\t\t\t\tString urlEncoded = new String(URLEncoding\n \t\t\t\t\t\t\t\t\t.decode(encoded), \"UTF-8\");\n \t\t\t\t\t\t\tStringTokenizer tokenizer = new StringTokenizer(\n\t\t\t\t\t\t\t\t\turlEncoded, \"&\", false);\n \n \t\t\t\t\t\t\twhile (tokenizer.hasMoreTokens()) {\n String param = tokenizer.nextToken();\n\t\t\t\t\t\t\t\tString key = param.substring(0, param.indexOf('='));\n\t\t\t\t\t\t\t\tString value = param.substring(param.indexOf('=')+1);\n \t\t\t\t\t\t\t\toptionalParams.put(key, value);\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tthis.optionalParams = optionalParams;\n \t\t\t\t\t\t} else {\n \t\t\t\t\t\t\tthis.optionalParams = null;\n \t\t\t\t\t\t}\n \n \t\t\t\t\t\tthis.dataOffset = dataOffset;\n \t\t\t\t\t\treturn;\n \t\t\t\t\t}\n \n \t\t\t\t\tos.reset();\n \t\t\t\t} else if (b == -1) {\n \t\t\t\t\tthrow new IOException(\"Premature end of cached file.\");\n \t\t\t\t} else {\n \t\t\t\t\tos.write(b);\n \t\t\t\t}\n \t\t\t}\n \t\t} finally {\n \t\t\tif (is != null) {\n \t\t\t\ttry {\n \t\t\t\t\tis.close();\n \t\t\t\t} catch (IOException e) {\n \t\t\t\t\tlog.error(\"Cannot close input cache file: \"\n \t\t\t\t\t\t\t+ this.dataFile.getAbsolutePath());\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "private void loadDataOnFirst(){\n updateDateTimeText();\n\n mPbLoading.setVisibility(View.VISIBLE);\n mCalendarListView.setVisibility(View.GONE);\n\n // Call API to get the schedules\n mPresenter.loadAllExaminationSchedulesForSpecificDate(mMyDate.generateDateString(AppConstants.DATE_FORMAT_YYYY_MM_DD));\n }", "public static void load() {\n }", "private void loadData() throws Exception {\n List<Student> listOfStudents = new ArrayList<>();\n DocumentBuilderFactory documentBuilderFactory =\n DocumentBuilderFactory.newInstance();\n\n DocumentBuilder documentBuilder =\n documentBuilderFactory.newDocumentBuilder();\n Document document = documentBuilder.parse(XMLfile);\n Element root = document.getDocumentElement();\n\n NodeList nodes = root.getChildNodes();\n int len = nodes.getLength();\n for (int i = 0; i < len; i++) {\n Node studentNode = nodes.item(i);\n if (studentNode instanceof Element) {\n Student b = createStudent((Element) studentNode);\n listOfStudents.add(b);\n }\n }\n Map<Long, Student> map= new HashMap<>();\n for (Student s : listOfStudents){\n map.putIfAbsent(s.getId(),s);\n }\n this.setEntities(map);\n }", "@Override\n public void load() {\n }", "@Override\n public void load() {\n }", "@Override\r\n\tpublic void load() {\n\r\n\t}", "private void initData() {\n\t}", "protected void loadAll() {\n\t\ttry {\n\t\t\tloadGroups(this.folder, this.cls, this.cachedOnes);\n\t\t\t/*\n\t\t\t * we have to initialize the components\n\t\t\t */\n\t\t\tfor (Object obj : this.cachedOnes.values()) {\n\t\t\t\t((Component) obj).getReady();\n\t\t\t}\n\t\t\tTracer.trace(this.cachedOnes.size() + \" \" + this + \" loaded.\");\n\t\t} catch (Exception e) {\n\t\t\tthis.cachedOnes.clear();\n\t\t\tTracer.trace(\n\t\t\t\t\te,\n\t\t\t\t\tthis\n\t\t\t\t\t\t\t+ \" pre-loading failed. No component of this type is available till we successfully pre-load them again.\");\n\t\t}\n\t}", "public void readData() throws FileNotFoundException {\n this.plane = readPlaneDimensions();\n this.groupBookingsList = readBookingsList();\n }", "private void loadLists() {\n }", "@Override\n void load(String data) {\n }", "private void preloadDb() {\n String[] branches = getResources().getStringArray(R.array.branches);\n //Insertion from xml\n for (String b : branches)\n {\n dataSource.getTherapyBranchTable().insertTherapyBranch(b);\n }\n String[] illnesses = getResources().getStringArray(R.array.illnesses);\n for (String i : illnesses)\n {\n dataSource.getIllnessTable().insertIllness(i);\n }\n String[] drugs = getResources().getStringArray(R.array.drugs);\n for (String d : drugs)\n {\n dataSource.getDrugTable().insertDrug(d);\n }\n }", "@Override\r\n\tprotected void initLoad() {\n\r\n\t}", "private void loadRecords() {\r\n\t\tpanContent.updateContent();\r\n\t}", "public void load() throws FileNotFoundException, IOException, ClassNotFoundException, DBAppException {\n ArrayList<Tuple> data = new ArrayList<Tuple>();\n int pageIndex = myTable.getCurPageIndex();\n for (int i = 0; i <= pageIndex; i++) {\n // Student_0.class\n\n\n String name = dataPath + tableName + \"_\" + i + \".class\";\n\n ObjectInputStream ois = new ObjectInputStream(new FileInputStream(name));\n Page page = (Page) ois.readObject();\n ois.close();\n for (Tuple t : page.getTuples()) {\n int indexKeyPos = t.getIndex(indexkey);\n int primaryKeyPos = t.getIndex(primarykey);\n Object[] values = new Object[3];\n values[0] = t.get()[indexKeyPos];\n values[1] = t.get()[primaryKeyPos];\n values[2] = i;\n\n String[] types = new String[3];\n types[0] = t.getTypes()[indexKeyPos];\n types[1] = t.getTypes()[primaryKeyPos];\n types[2] = \"java.lang.integer\";\n\n String[] colName = new String[3];\n colName[0] = t.colName[indexKeyPos];\n colName[1] = t.colName[primaryKeyPos];\n colName[2] = \"page.number\";\n\n Tuple newTuple = new Tuple(values, types, colName, 0);\n\n data.add(newTuple);\n }\n }\n\n Collections.sort(data);\n if (data.isEmpty())\n return;\n Page curPage = createPage();\n for (int i = 0; i < data.size(); i++) {\n if (curPage.isFull()) {\n curPage.savePage();\n curPage = createPage();\n }\n curPage.insert(data.get(i), true);\n }\n curPage.savePage();\n }", "@EventListener(ApplicationReadyEvent.class)\n\tpublic void loadData() {\n\t\tList<AppUser> allUsers = appUserRepository.findAll();\n\t\tList<Customer> allCustomers = customerRepository.findAll();\n\t\tList<Part> allPArts = partRepository.findAll();\n\n\t\tif (allUsers.size() == 0 && allCustomers.size() == 0 && allPArts.size() == 0) {\n\t\t\tSystem.out.println(\"Pre-populating the database with test data\");\n\n\t\t\tResourceDatabasePopulator resourceDatabasePopulator = new ResourceDatabasePopulator(\n\t\t\t\tfalse,\n\t\t\t\tfalse,\n\t\t\t\t\"UTF-8\",\n\t\t\t\tnew ClassPathResource(\"data.sql\"));\n\t\t\tresourceDatabasePopulator.execute(dataSource);\n\t\t}\n\t\tSystem.out.println(\"Application successfully started!\");\n\t}", "private void initData() {\n }", "public static void load() {\n for (DataSourceSwapper each : ServiceLoader.load(DataSourceSwapper.class)) {\n loadOneSwapper(each);\n }\n }", "public void loadPersistence() {\n\t\tFile file = new File(\"data.txt\");\n\t\tif (file.length() == 0) { // no persistent data to use\n\t\t\treturn;\n\t\t}\n\t\tdeserializeFile(file);\n\t\tloadPersistentSettings();\n\t}", "protected void loadData() {\n refreshview.setRefreshing(true);\n //小区ID\\t帐号\\t消息类型ID\\t开始时间\\t结束时间\n // ZganLoginService.toGetServerData(26, 0, 2, String.format(\"%s\\t%s\\t%s\\t%s\\t%d\", PreferenceUtil.getUserName(), msgtype, \"2015-01-01\", nowdate, pageindex), handler);\n //ZganCommunityService.toGetServerData(26, 0, 2, String.format(\"%s\\t%s\\t%s\\t%s\\t%d\", PreferenceUtil.getUserName(), msgtype, \"2015-01-01\", nowdate, pageindex), handler);\n ZganCommunityService.toGetServerData(40, String.format(\"%s\\t%s\\t%s\\t%s\", PreferenceUtil.getUserName(), funcPage.gettype_id(), String.format(\"@id=22,@page_id=%s,@page=%s\",funcPage.getpage_id(),pageindex), \"22\"), handler);\n }", "public void loadAllUserData(){\n\n }", "private static void load(){\n }", "protected abstract void loadItemsInternal();", "private void loadDataMap() throws IOException {\n\t\tDaySleepDurationMap.getInstance().clear();\n\n\t\t// List of entries\n\t\tList<SleepEntry> entries = new ArrayList<SleepEntry>();\n\t\t\n\t\t// Get CSV file\n\t\tBufferedReader br = new BufferedReader(new FileReader(new File(DATA_LOCATION)));\n\t\tString line = \"\";\n\n\t\t// Ignore the first line (CSV header)\n\t\tbr.readLine();\n\n\t\twhile (((line = br.readLine()) != null)){\n\t\t\t// Convert the line from CSV to a SleepEntry\n\t\t\tSleepEntry se = SleepEntry.parseFromCSV(line);\n\t\t\t// Add it to the entry list\n\t\t\tentries.add(se);\n\t\t}\n\t\t\n\t\tfor (SleepEntry se : entries){\n\t\t\t// Add data from list to the map\n\t\t\tDaySleepDurationMap.getInstance().addToDay(se.getEffectiveDate(), se.getDuration());\n\t\t}\n\t\t\n\n\t\tbr.close();\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n public static void load() {\n\n System.out.print(\"Loading team data from file...\");\n\n try {\n\n String team_fil = config.Server.serverdata_file_location + \"/teams.ser\";\n\n FileInputStream fil = new FileInputStream(team_fil);\n ObjectInputStream in = new ObjectInputStream(fil);\n\n team_list = (ConcurrentHashMap<Integer, Team>) in.readObject();\n cleanTeams();\n\n fil.close();\n in.close();\n\n //Gå gjennom alle lagene og registrer medlemmene i team_members.\n Iterator<Team> lag = team_list.values().iterator();\n\n while (lag.hasNext()) {\n\n Team laget = lag.next();\n\n Iterator<TeamMember> medlemmer = laget.getTeamMembers();\n while (medlemmer.hasNext()) {\n registerMember(medlemmer.next().getCharacterID(), laget.getTeamID());\n }\n\n }\n\n System.out.println(\"OK! \" + team_list.size() + \" teams loaded.\");\n\n } catch (Exception e) {\n System.out.println(\"Error loading team data from file.\");\n }\n\n }", "@Override\n public void run() {\n ArticleHeaders.loadData(getApplicationContext());\n CustomerHeaders.loadData(getApplicationContext());\n OrderReasons.loadData(getApplicationContext());\n }", "private void reloadData() {\n if (DataFile == null)\n DataFile = new File(dataFolder, DATAFILENAME);\n Data = YamlConfiguration.loadConfiguration(DataFile);\n }", "private void loadData() {\n\t\tlogger.trace(\"loadData() is called\");\n\t\t\n\t\ttry {\n\t\t\tFileInputStream fileIn = new FileInputStream(\"server-info.dat\");\n\t\t\tObjectInputStream in = new ObjectInputStream(fileIn);\n\t\t\tjokeFile = (String ) in.readObject();\n\t\t\tkkServerPort = (int) in.readObject();\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\tjokeFile = \"kk-jokes.txt\";\n\t\t\tkkServerPort = 5555;\n\t\t\t//e.printStackTrace();\n\t\t\tSystem.err.println(\"server-info.dat file is likely missing but it should be created automatically when this app is closed.\");\n\t\t\tlogger.info(\"server-info.dat file is likely missing but it should be created automatically when this app is closed.\");\n\t\t}\t\n\t}", "@Override\r\n\tpublic void initialLoad() throws IOException {\n\t\t\r\n\t}", "@Test\n public void testLoadOrderData() throws Exception {\n dao.loadEnvironmentVariable();\n Order writeOrder = new Order();\n\n writeOrder.setOrderNumber(1);\n writeOrder.setOrderDate(LocalDate.parse(\"1900-01-01\"));\n writeOrder.setCustomer(\"Load Test\");\n writeOrder.setTax(new Tax(\"OH\", new BigDecimal(\"6.25\")));\n writeOrder.setProduct(new Product(\"Wood\", new BigDecimal(\"5.15\"), new BigDecimal(\"4.75\")));\n writeOrder.setArea(new BigDecimal(\"100.00\"));\n writeOrder.setMaterialCost(new BigDecimal(\"515.00\"));\n writeOrder.setLaborCost(new BigDecimal(\"475.00\"));\n writeOrder.setTaxCost(new BigDecimal(\"61.88\"));\n writeOrder.setTotal(new BigDecimal(\"1051.88\"));\n\n assertTrue(dao.getAllOrders().isEmpty());\n\n dao.addOrder(writeOrder);\n dao.writeOrderData();\n\n dao = null;\n\n OrdersDao dao2 = new OrdersDaoImpl();\n\n assertTrue(dao2.getAllOrders().isEmpty());\n\n dao2.loadOrderData();\n\n assertTrue(dao2.getAllOrders().size() >= 1);\n\n Files.deleteIfExists(Paths.get(System.getProperty(\"user.dir\") + \"/Orders_01011900.txt\"));\n }", "private void loadData(DataParser dp, boolean all) throws IOException {\n\t\tProcessor p = new SkiDataProcessor();\n \t\n \t// Initiate data loader\n \tldr = new DataLoader(dp, p, 0, (all ? -1 : 3600), this);\n \t\n \t// Display progress dialog\n \tdlg = ProgressDialog.show(this, \"\", \"Loading data...\", true, true, new DialogInterface.OnCancelListener() {\n\t\t\t//FIXME\n \t\tpublic void onCancel(DialogInterface dialog) {\n \t\t\tLog.d(getLocalClassName(), \"User pressed cancel\");\n\t\t\t\tldr.cancel();\n\t\t\t}\n\t\t});\n \t\n \t//TODO More advanced progress bar?\n \tldr.loadDataInBackground();\n\t}", "void populateData();", "@Test\n\tpublic void testReadDataFromFiles2(){\n\t\tassertEquals((Integer)1 , DataLoader.data.get(\"http\"));\n\t\tassertEquals((Integer)1, DataLoader.data.get(\"search\"));\n\t}", "private void InitData() {\n\t}", "public void load();", "public void load();", "void loadNext();", "public abstract void load();", "@Override\r\n\tpublic void loadData() {\r\n\t\t// Get Session\r\n\r\n\t\tSession ses = HibernateUtil.getSession();\r\n\r\n\t\tQuery query = ses.createQuery(\"FROM User\");\r\n\r\n\t\tList<User> list = null;\r\n\t\tSet<PhoneNumber> phone = null;\r\n\t\tlist = query.list();\r\n\t\tfor (User u : list) {\r\n\t\t\tSystem.out.println(\"Users are \" + u);\r\n\t\t\t// Getting phones for for a particular user Id\r\n\t\t\tphone = u.getPhone();\r\n\t\t\tfor (PhoneNumber ph : phone) {\r\n\t\t\t\tSystem.out.println(\"Phones \" + ph);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public void loadData(){\n JsonArrayRequest request = new JsonArrayRequest(\"http://www.efstratiou.info/projects/newsfeed/getList.php\", netListener, errorListener);\n\n //submit request\n ArticlesApp.getInstance().getRequestQueue().add(request);\n\n }", "private void loadData(ApplicationMode appMode) {\n rowKeys = new HashMap<Integer, Integer>();\n ptnKeys = new HashMap<Integer, Integer>();\n pattern = new byte[patternSize];\n ptnLink = new int[patternSize * rowSize * 2];\n\n String filepath = FileProperties.getFilepathWD();\n try (FileInputStream fin = new FileInputStream(filepath);\n FileChannel inChannel = fin.getChannel();) {\n ByteBuffer buf = inChannel.map(FileChannel.MapMode.READ_ONLY, 0, inChannel.size());\n buf.get(pattern);\n\n for (int i = 0; i < keySize; i++) {\n rowKeys.put(buf.getInt(), buf.getInt());\n }\n\n for (int i = 0; i < patternSize; i++) {\n ptnKeys.put(buf.getInt(), buf.getInt());\n }\n\n for (int i = 0; i < ptnLink.length; i++) {\n ptnLink[i] = buf.getInt();\n }\n } catch (BufferUnderflowException | IOException ex) {\n if (appMode == ApplicationMode.GUI) {\n System.err.println(\"\\n\\t*** Data files missing or corrupted, please download \"\n + \"from cloud drive. ***\");\n System.err.println(\"\\thttps://my.pcloud.com/publink/show?\"\n + \"code=kZSoaLZgNeLhO2eu0RQcu9D2aXeOFgtioUV\\n\");\n throw new UnsupportedOperationException();\n }\n int[] keyLink = genKeys();\n genPattern(keyLink);\n saveData(filepath);\n }\n }", "@Override\n\tpublic D loadInBackground() {\n\t\tmData = createData();\n\t\treturn mData;\n\t}", "@Override\n protected void loadData() {\n setUpLoadingViewVisibility(true);\n callImageList = RetrofitGenerator.createService(ApiService.class)\n .getAllPubImage();\n callImageList.enqueue(callbackImageList);\n }", "List<HistoryData> loadAllHistoryData();" ]
[ "0.75381297", "0.7488378", "0.71281546", "0.71281546", "0.7104423", "0.7066829", "0.7066829", "0.6841431", "0.68234515", "0.6778112", "0.67460066", "0.6655093", "0.6654894", "0.66219896", "0.65734124", "0.6569659", "0.6549769", "0.6511504", "0.6438601", "0.6381108", "0.6381012", "0.6365685", "0.6347317", "0.6340327", "0.63126373", "0.6306704", "0.63037324", "0.6294182", "0.6289863", "0.62810487", "0.6275631", "0.6274572", "0.62712514", "0.6257836", "0.6246047", "0.62148756", "0.6197642", "0.6187709", "0.6181198", "0.6163246", "0.61577624", "0.61542207", "0.615109", "0.61429375", "0.6138449", "0.6127529", "0.6118398", "0.6102821", "0.6093274", "0.60919535", "0.60919535", "0.60919535", "0.6082851", "0.6082851", "0.6071166", "0.6061874", "0.6052582", "0.6036597", "0.60317147", "0.6028428", "0.60284144", "0.6023638", "0.60202986", "0.6015464", "0.6005124", "0.59641606", "0.5949887", "0.59480166", "0.5941446", "0.5929155", "0.5928803", "0.5918464", "0.5901645", "0.58880955", "0.5886376", "0.5886039", "0.58851475", "0.58811426", "0.5881027", "0.5879449", "0.58771247", "0.5864149", "0.58612096", "0.58575803", "0.5852652", "0.5852597", "0.58525145", "0.58438927", "0.5837638", "0.5834763", "0.58346266", "0.5830997", "0.5830997", "0.58297104", "0.5823155", "0.58197856", "0.58126163", "0.5804479", "0.57874686", "0.57788587", "0.57720745" ]
0.0
-1
Called when application is stopped to store settings and end gif if needed.
public void stop() { endGif(); final StringBuilder s = new StringBuilder(); for(String event : replay.notableEvents) { s.append(";"); s.append(event); } settings.setProperty("events", s.substring(1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void end() {\r\n isRunning = false;\r\n if( mineField.exploder.isRunning() ) mineField.exploder.stop();\r\n if( settingsOpen ) settingsFrame.dispose();\r\n }", "@Override\r\n\tpublic void onStop() {\n\t\tSharedPreferences preferences = getActivity().getSharedPreferences(\"com.dotchi1\", Context.MODE_PRIVATE);\r\n\t\tEditor editor = preferences.edit();\r\n\t\teditor.putBoolean(HOME_FEED_JSON_KEY, false);\r\n\t\teditor.remove(HOME_FEED_JSON_VALUE);\r\n\t\teditor.commit();\t\t\r\n\t\tsuper.onStop();\r\n\t}", "@Override\n protected void onDestroy() {\n super.onDestroy();\n if (fireworkView.isRunning()) {\n fireworkView.setRunning(false);\n }\n }", "public synchronized void stop() {\n\t\tif (!running)\n\t\t\treturn;\n\t\ttry {\n\t\t\toptions.save();\n\t\t\twindow.dispose();\n\t\t\trunning = false;\n\t\t\tthread.join();\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t\tSystem.exit(1);\n\t}", "@Override\n public void onDestroy() {\n unregisterReceiver(mNoisyAudioStreamReceiver);\n\n // Cancel our Notification\n mNotificationManager.cancel(NotificationTarget.NOTIFICATION_ID);\n\n // Set preference to indication not playing.\n PreferenceManager.getDefaultSharedPreferences(getApplicationContext())\n .edit()\n .putBoolean(MainActivity.PREF_IS_PLAYING, false)\n .commit();\n\n super.onDestroy();\n }", "@Override\n\tpublic void onExit() {\n\t\tlabelHelp = null;\n\t\tlayer_force = null;\n\t\tmSoundBtn = null;\n\t\tboxMessage = null;\n\n\t\tSystem.gc();\n\t\tsuper.onExit();\n\t}", "void exitSession()\n\t{\n\t\t// clear out our watchpoint list and displays\n\t\t// keep breakpoints around so that we can try to reapply them if we reconnect\n\t\tm_displays.clear();\n\t\tm_watchpoints.clear();\n\n\t\tif (m_fileInfo != null)\n\t\t\tm_fileInfo.unbind();\n\n\t\tif (m_session != null)\n\t\t\tm_session.terminate();\n\n\t\tm_session = null;\n\t\tm_fileInfo = null;\n\t}", "@Override\n public void onDestroy() {\n super.onDestroy();\n unbindService(mServiceConnection);\n LocalBroadcastManager.getInstance(mContext).unregisterReceiver(scanDataReadyReceiver);\n LocalBroadcastManager.getInstance(mContext).unregisterReceiver(refReadyReceiver);\n LocalBroadcastManager.getInstance(mContext).unregisterReceiver(notifyCompleteReceiver);\n LocalBroadcastManager.getInstance(mContext).unregisterReceiver(requestCalCoeffReceiver);\n LocalBroadcastManager.getInstance(mContext).unregisterReceiver(requestCalMatrixReceiver);\n LocalBroadcastManager.getInstance(mContext).unregisterReceiver(disconnReceiver);\n LocalBroadcastManager.getInstance(mContext).unregisterReceiver(scanConfReceiver);\n\n mHandler.removeCallbacksAndMessages(null);\n\n SettingsManager.storeBooleanPref(mContext, SettingsManager.SharedPreferencesKeys.saveOS, btn_os.isChecked());\n SettingsManager.storeBooleanPref(mContext, SettingsManager.SharedPreferencesKeys.saveSD, btn_sd.isChecked());\n SettingsManager.storeBooleanPref(mContext, SettingsManager.SharedPreferencesKeys.continuousScan, btn_continuous.isChecked());\n }", "@Override\n\t\t\t\t\tpublic void windowClosing(WindowEvent e) {\n\t\t\t\t\t\tsetStillRunning(false);\n\t\t\t\t\t}", "@Override\n protected void onDestroy() {\n EasyImage.clearConfiguration(this);\n super.onDestroy();\n }", "@Override\n public void onPause() {\n AppEventsLogger.deactivateApp(this);\n isResumed = false;\n\n super.onPause();\n uiHelper.onPause();\n }", "@Override\n protected void onStop() {\n super.onStop();\n saveData();\n }", "@Override\n\t\t\t\t\tpublic void windowClosed(WindowEvent e) {\n\t\t\t\t\t\tsetStillRunning(false);\n\t\t\t\t\t}", "@Override\n public void onPause() {\n mBricksView.setRunning(false);\n super.onPause();\n }", "@Override\r\n\tprotected void onPause() {\n\t\tif (SystemCheckTools.isApplicationSentToBackground(AppStartToMainActivity.this) == true) {\r\n\t\t\tExitApp.getInstance().exit();\r\n\t\t}\r\n\t\tsuper.onPause();\r\n\t}", "@Override\r\n\tprotected void onPause() {\n\t\tsuper.onPause();\r\n\t\tUiUpdater.unregisterClient(handler);\r\n\t\tunregisterReceiver(wifiReceiver);\r\n\t}", "public void stop()\n {\n _panel.cleanup();\n _appContext.cleanup();\n }", "@Override\n public void onDestroy() {\n super.onDestroy();\n if (!isChangingConfigurations()) {\n pickiT.deleteTemporaryFile(this);\n }\n }", "@Override\n protected void onDestroy() {\n Initialization.exit(this);\n super.onDestroy();\n }", "@Override\n\tprotected void onPause() {\n\t\tsuper.onDestroy();\n\t\tunReceiver();\n\t\tAppContext.getInstance().setSMSShow(false);\n\t}", "public void onDestroy() {\n \twifiLock.release();\n \tstopForeground(true);\n \tradio.stop();\n \tradio.release();\n \tradio = null;\n }", "public void onStop() {\n super.onStop();\n ApplicationStateMonitor.getInstance().activityStopped();\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tKF5SDKActivityUIManager.resetActivityUIConfig();\n\t\tKF5SDKActivityParamsManager.resetActivityParamsConfig();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tstop();\n\t}", "@Override\r\n\tprotected void onStop() {\n\t\tsuper.onStop();\r\n\t\tmInstalledLayout4Notification.saveData();\r\n\r\n\t}", "public void destroyApp(boolean unconditional)\r\n\t{\n\t\tsettings.setXPos(imageCanvas.getXPos());\r\n\t\tsettings.setYPos(imageCanvas.getYPos());\r\n\t\tsettings.setLayer(imageCanvas.getLayer());\r\n\t\tsettings.setZoom(imageCanvas.getZoom());\r\n\t\tsettings.writeSettings();\r\n\t\t\r\n\t\t// It appears that any of our threads are killed automatically.\r\n\t}", "@Override\n public void onDestroy() {\n super.onDestroy();\n\n this.stopForeground(true);\n }", "protected void onDestroy() {\n\t\t if (com.example.main_project.MainActivity.tts!=null) {\n\t\tcom.example.main_project.MainActivity.tts.stop();\n\n\n\t\tcom.example.main_project.MainActivity.tts.shutdown();\n\t\t}\n\t\t super.onDestroy();\n\t\t}", "@Override\n protected void onDestroy() {\n SharedPreferences sharedPreferences = MainActivity.this.getSharedPreferences(KEY_SHAREDPREF_FILE,Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(KEY_SHARED_PREF_NOTIF, notificationPreferences);\n editor.apply();\n\n this.unbindService(spotifyServiceConnection);\n\n super.onDestroy();\n }", "@Override\n protected void onPause() {\n isRunning = false;\n super.onPause();\n }", "@Override\n protected void onPause() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n sp.unregisterOnSharedPreferenceChangeListener(this);\n super.onPause();\n }", "@Override\n protected void onPause() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n sp.unregisterOnSharedPreferenceChangeListener(this);\n super.onPause();\n }", "@Override\n\tprotected void onStop() {\n\t\tsuper.onStop();\n\t\tthis.onDestroy();\n\t}", "public void onStop() {\n super.onStop();\n finish();\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tdismissWindow();\n\t}", "public void cleanup() {\n endtracking();\n\n //sends data to UI\n MainActivity.trackingservicerunning = false;\n MainActivity.servicestopped();\n\n //stops\n stopSelf();\n }", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tCleanup();\r\n\t}", "@Override\n protected void onPause() {\n getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);\n \n super.onPause();\n }", "@Override\n protected final void onDisconnected() {\n mPilotingItf.cancelSettingsRollbacks()\n .resetLocation()\n .updateCurrentTarget(ReturnHomePilotingItf.Target.TAKE_OFF_POSITION)\n .updateGpsFixedOnTakeOff(false);\n if (!isPersisted()) {\n mPilotingItf.unpublish();\n }\n super.onDisconnected();\n }", "@Override\n\tpublic void onStop() {\n\t\tsuper.onStop();\n\n\t\tif (D)\n\t\t\tLog.e(TAG, \"-- ON STOP --\");\n\n\t\t// don't do anything bluetooth if debugging the user interface\n\t\tif (BTconnect)\n\t\t\tmyBT.cancel();\n\n\t\t// kill bt pitter and bump timer\n\t\tkillHandlers();\n\n\t\t// unregister the sensor listener\n\t\tmSensorManager.unregisterListener(mSensorListener);\n\n\t\t// shutoff bluetooth\n\t\tif (turnOffBluetoothShutdown) {\n\t\t\tmBluetoothAdapter.disable();\n\t\t}\n\t\t\n\t\t// save the checkbox states for the next run\n\t\t// We need an Editor object to make preference changes.\n\t\t// All objects are from android.context.Context\n\t\tSharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);\n\t\tSharedPreferences.Editor editor = settings.edit();\n\t\teditor.putBoolean(\"ScreenOnOffEnable\", ScreenOnOffCheckBox.isChecked());\n\t\teditor.putBoolean(\"RetryConnEnable\", RetryConnBox.isChecked());\n\t\teditor.putString(\"MacAddress\", MAC_ADDRESS);\n\t\t// Commit the edits!\n\t\teditor.commit();\n\n\t}", "@Override\n protected void onDestroy() {\n super.onDestroy();\n PreferenceManager.getDefaultSharedPreferences(this).unregisterOnSharedPreferenceChangeListener(this);\n }", "@Override\n\tpublic void onDestroy() {\n\t\tif (meichecked)\n\t\t\tmeil.stopLog();\n\t\twlock.release();\n\t\tdestroyNotification();\n\t\tsuper.onDestroy();\n\t}", "@Override\n protected void appStop() {\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tif (JGSDK.icon != null) {\n\t\t\tJGSDK.isShow = true;\n\t\t\tJGSDK.icon.setVisibility(View.VISIBLE);\n\t\t}\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tquitAllFocus();\n\t\timg.setImageBitmap(null);\n\t\tclearMemory();\n\t\tsuper.onDestroy();\n\t\ttry {\n\t\t\t//GARBAGE COLLECTOR\n\t\t\tSystem.gc();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}", "@Override\n\tpublic void onDestroy() {\n\t\tContext context = this.getApplicationContext();\n\t\t//Toast.makeText(context, \"Avslutter service\", Toast.LENGTH_LONG).show();\n\n\t\t//Fjerner notification:\n\t\tnotificationManager.cancel(0); //.cancelAll();\n\t\tsuper.onDestroy();\n\t}", "@Override\n\tprotected void onPause() {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.onPause();\n\n\t\tsavePreferences();\n\t}", "@Override\n public void onDestroy() {\n Log.d(SampleExtensionService.LOG_TAG, \"onDestroy()\");\n onStopRefresh();\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tSystem.exit(0);\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\ttry {\n\t\t\tunregisterReceiver(getServerSetting);\n\t\t\t\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\tprotected void onStop() {\n\t\t\r\n\t}", "public void handleQuit() {\n closeFile();\n savePrefs();\n System.exit(0);\n }", "public void shutdown(){\n\t\tAndroidSensorDataManagerSingleton.cleanup();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tflag=false;\n\t\tsuper.onDestroy();\n\t}", "@Override\n protected void onStop() {\n super.onStop();\n }", "@Override\n protected void onStop() {\n super.onStop();\n }", "@Override\n protected void onStop() {\n super.onStop();\n }", "@Override\n protected void onStop() {\n super.onStop();\n }", "@Override\n protected void onStop() {\n super.onStop();\n }", "@Override\n\tprotected void onDestroy() {\n\t\thandler.removeCallbacks(null);\n\t\tMyApplication.Tag = 0;\n\t\tsuper.onDestroy();\n\t}", "@Override\r\n\tprotected void onStop() {\n\t\tsuper.onStop();\r\n\t}", "@Override\r\n\tprotected void onStop() {\n\t\tsuper.onStop();\r\n\t}", "@Override\r\n\tprotected void onStop() {\n\t\tsuper.onStop();\r\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tstopTimer();\r\n\t}", "@Override\n protected void onStop() {\n super.onStop();\n }", "public void onDestroy() {\n if (getIntent() != null && getIntent().getBooleanExtra(Constants.EXTRA_FROM_MAINACTIVITY, false)) {\n MainActivity.gotoMainActivity(this);\n }\n super.onDestroy();\n }", "@Override\n protected void onDestroy() {\n super.onDestroy();\n sharedPreferences.unregisterOnSharedPreferenceChangeListener(this);\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tView view = findViewById(R.id.maths_backound);\n\t\tview.setBackgroundResource(0);\n\t\tSystem.gc();\n\t}", "public void onDestroy() {\n super.onDestroy();\n PrefUtil.save((Context) ContextUtil.app, UserAction.Bluetooth_Check_Firmware_Update_Time, new DateUtil().getUnixTimestamp() + 600);\n }", "@Override\n protected void onStop() {\n\n super.onStop();\n\n }", "@Override\n\tprotected void onStop()\n\t{\n\t\tsuper.onStop();\n\t}", "@Override\r\n\tprotected void onPause() {\n\t\tsuper.onPause();\r\n//\t\tgv.f = false;\t//如果没有这句,即使退出,run()函数也不停止运行,既游戏界面退出,到后台后仍在运行着。\r\n\t\tMusic.stop();\r\n\t}", "@Override\n public void onBackPressed() {\n if (exit) {\n System.exit(0);\n } else {\n Toast.makeText(this, \"Press Back again to Exit.\",\n Toast.LENGTH_SHORT).show();\n exit = true;\n new Handler().postDelayed(new Runnable() { //3 sn içinde iki defa basıldı mı kontrolu için\n @Override\n public void run() {\n exit = false;\n }\n }, 3 * 1000);\n }\n }", "@Override\n public void onStop() {\n super.onStop();\n }", "@Override\n public void onStop() {\n super.onStop();\n }", "public void onDestroy() {\n if ((getChangingConfigurations() & 128) == 128 && this.f12125b != null) {\n this.f12125b.mo6021b(true);\n }\n super.onDestroy();\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\t//mTracker.set(Fields.SCREEN_NAME, \"Home Screen\");\n\t\tmTracker.send(MapBuilder.createAppView().build());\n\t\t//mTracker.send(null);\n\t}", "@Override\r\n public void onStop() {\r\n super.onStop();\r\n UserDataManager.getManager().saveUserData(this);\r\n }", "protected void onStop() {\n\t\tsuper.onStop();\r\n\t}", "protected void onStop() {\n\t\tsuper.onStop();\r\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\t\n\t\tif(!isSave){\n\t\t\tMyDialog.saveTemp(this, Common.PATH);\n\t\t\tsuper.onDestroy();\n\t\t}else{\n\t\t\tsuper.onDestroy();\n\t\t}\n\t\t\n\t}", "@Override\n protected void onStop() {\n status = 0;\n super.onStop();\n }", "@Override\n protected void onStop() {\n Log.i(\"G53MDP\", \"Main onStop\");\n super.onStop();\n }", "private void cleanUp() {\n\t\tVisualizerView mVisualizerView = MusicApplication.getInstance()\n\t\t\t\t.getVisualizerView();\n\t\tif (mVisualizerView != null) {\n\t\t\tmVisualizerView.updateVisualizer(new byte[] {});\n\t\t}\n\t\t//\t\tif (mCurrentMediaPlayer != null) {\n\t\t//\t\t\tmCurrentMediaPlayer.reset();\n\t\t//\t\t\t//\t\t\tmCurrentMediaPlayer = null;\n\t\t//\t\t\tsetState(IDLE);\n\t\t//\t\t\tcom.dj.util.Log.i(this.getClass().getSimpleName(),\n\t\t//\t\t\t\t\t\" 歌曲停止,释放资源。mCurrentMediaPlayer: \" + mCurrentMediaPlayer);\n\t\t//\t\t\t//\t\t\tcleanEQ();\n\t\t//\t\t}\n\t}", "public void close() {\n saveConfigurationSettings();\n removeAllLogHandlers();\n try {\n Constants.PREFS.flush();\n }\n catch ( Exception e ) {\n e.printStackTrace();\n }\n }", "@Override\n protected void onStop() {\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tLoadingTextShowPopWindow.dismissPop();\n\t}", "@Override\n public void onDestroy() {\n super.onDestroy();\n handler.removeMessages(UpdateConfig.NET_MSG_GETLENTH);\n // if (mModel != null) {\n // mModel.cancelLoadData();\n // }\n if (mTask != null) {\n mTask.cancel(true);\n }\n if (mNotificationManager != null) {\n mNotificationManager.cancel(UpdateConfig.NOTIFY_DOWNLOADING_ID);\n }\n }", "@Override\r\n\tpublic void onStop() {\n\t\tsuper.onStop();\r\n\t}", "@Override\r\n\tpublic void onStop() {\n\t\tsuper.onStop();\r\n\t}", "@Override\r\n\tpublic void onStop() {\n\t\tsuper.onStop();\r\n\t}", "@Override\n protected void onDestroy() {\n super.onDestroy();\n // Dismiss the progress bar when application is closed\n if (prgDialog != null) {\n prgDialog.dismiss();\n }\n }", "@Override\n public void onPause() {\n \t\t//Save settings Enabled, Alarm Hour, Alarm Minute\n SharedPreferences settings = getSharedPreferences(MainActivity.PREFS_NAME, 0);\n SharedPreferences.Editor editor = settings.edit();\n editor.putBoolean(MainActivity.ALARM_ENABLED, AlarmEnabled);\n editor.putInt(MainActivity.SNOOZE_MINUTE, SnoozeMin);\n \n //Commit the edits\n editor.commit();\n \n super.onPause();\n }", "public void exit() {\n loader.getApplet().stop();\n loader.getApplet().destroy();\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tAppManager.getAppManager().finishActivity(this);\n\t}", "@Override\n\t\tprotected void onStop() {\n\t\t\tsuper.onStop();\n\t\t}", "@Override\r\n\tprotected void onStop() {\n\t\tXSDK.getInstance().onStop();\r\n\t\tsuper.onStop();\r\n\t}", "protected void onStop ()\n\t{\n\t\tsuper.onStop ();\n\t}", "@Override\r\n\tpublic void onStop() {\n\t\tsuper.onStop();\r\n\t\tendloading();\r\n\t\t// getnewtime();\r\n\t\tLog.e(TAG, \"onStop\");\r\n\t}", "@Override\n\tpublic void onPause() {\n\t\tsuper.onPause();\n\t\tSystem.out.println(\"Fragments_download_management onPause\");\n\t\talarmQueryRunnable.destroy();\n\t\tledrunnable.destroy();\n\t}" ]
[ "0.68251675", "0.6652667", "0.65879226", "0.651806", "0.6508059", "0.6504776", "0.64488965", "0.64419", "0.64256465", "0.6410818", "0.6402325", "0.63856184", "0.6381628", "0.6367059", "0.6364149", "0.6363952", "0.6326762", "0.6323549", "0.6308532", "0.62796795", "0.6279458", "0.627735", "0.6264569", "0.6263628", "0.6256", "0.6255695", "0.62516814", "0.6249446", "0.6248193", "0.6244835", "0.62436503", "0.62436503", "0.6230511", "0.62220407", "0.6213275", "0.6211442", "0.6211297", "0.61959416", "0.61902064", "0.61818594", "0.6178953", "0.6148473", "0.61238486", "0.61160517", "0.6115035", "0.61143994", "0.61098593", "0.6101046", "0.609969", "0.6099364", "0.6094595", "0.6088463", "0.607892", "0.6074692", "0.6074043", "0.6074043", "0.6074043", "0.6074043", "0.6074043", "0.60737914", "0.60702175", "0.60702175", "0.60702175", "0.60684294", "0.6067808", "0.6063135", "0.6059051", "0.6053329", "0.6045796", "0.6042097", "0.6038202", "0.603788", "0.60364693", "0.60353726", "0.60353726", "0.6034291", "0.60329276", "0.60296494", "0.60283476", "0.60283476", "0.60275", "0.60213494", "0.60199296", "0.60196257", "0.6011435", "0.6010293", "0.6007733", "0.60070133", "0.60045505", "0.60045505", "0.60045505", "0.6003238", "0.60019743", "0.5999065", "0.5998694", "0.599779", "0.5997449", "0.59974366", "0.5995415", "0.5994376" ]
0.60209453
82
Updates gif for the date if possible.
public void updateGif(final Date date) { if (giffer != null) { giffer.updateGif(buffer, date); if (replay.isAtEnd()) { endGif(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void populateGifDetails() {\n // Set the rating with animation\n ObjectAnimator anim = ObjectAnimator.ofFloat(averageRatingBar, \"rating\", gif.getAverageRating());\n anim.setDuration(2000);\n anim.start();\n\n tvRatingCount.setText(String.valueOf(gif.getRatingCount()));\n tvTitle.setText(gif.getTitle());\n tvUploader.setText(gif.getUserName());\n tvUploadDate.setText(getFormattedDate(gif.getImportDate()));\n tvDimension.setText(getString(R.string.formatted_dimensions, gif.getFullGif().getHeight()\n , gif.getFullGif().getWidth()));\n tvSize.setText(getString(R.string.formatted_size_with_unit_kb, gif.getFullGif().getSize()));\n }", "@Override\n public void loadGif(String url) {\n CircularProgressDrawable progressPlaceHolder = ProgressBarUtil.getCircularProgressPlaceholder(getContext());\n if (!TextUtils.isEmpty(url)) {\n Glide.with(getContext())\n .asGif()\n .load(url)\n .apply(new RequestOptions()\n .placeholder(progressPlaceHolder))\n .into(ivGif);\n }\n }", "public void act() {\n setImage(myGif.getCurrentImage());\n }", "public void tickTock() {\n Calendar t2 = Calendar.getInstance();//gets current time\n t2.add(Calendar.MILLISECOND, 580);//adds time to time retrieved\n Date t = t2.getTime();//set t to time gotten\n time = timeFormat.format(t);//formats the time for the timeLabel\n timeLabel.setText(\" \" + time + \" \");//sets the time for the time label\n day = dayFormat.format(t);\n dayLabel.setText(\" \" + day + \" \");\n date = dateFormat.format(t);\n dateLabel.setText(date);\n\n/*public void setImage() {\n ImageIcon icon = new ImageIcon(\"geometric-cool-elephant-wall-clocks.jpg\");\n image = new JLabel();\n image.setIcon(icon);\n add(image);\n }\n*/\n }", "private void setImageResoureAndTooltip(Date value) {\n if (value == null) {\n imageResource = imageRenderer.render(Storage.RSCS.images().urgencyHeader());\n tooltip = Storage.MSGS.urgencyTooltip();\n return;\n }\n int daysBetween = CalendarUtil.getDaysBetween(DateUtils.getNowDate(), value);\n if (daysBetween < 0) {\n imageResource = imageRenderer.render(Storage.RSCS.images().urgencyHeader());\n tooltip = Storage.MSGS.urgencyExpiredDesc();\n return;\n }\n if (daysBetween <= Constants.DAYS_URGENCY_HIGH) {\n imageResource = imageRenderer.render(Storage.RSCS.images().urgencyRed());\n tooltip = Storage.MSGS.urgencyHighDesc();\n return;\n }\n if (daysBetween <= Constants.DAYS_URGENCY_HIGHER) {\n imageResource = imageRenderer.render(Storage.RSCS.images().urgencyOrange());\n tooltip = Storage.MSGS.urgencyMediumDesc();\n return;\n }\n imageResource = imageRenderer.render(Storage.RSCS.images().urgencyGreen());\n tooltip = Storage.MSGS.urgencyLowDesc();\n }", "private void changeIconDate(String sta, Integer dia, ImageView ima){\r\n switch (sta){\r\n case \"vencido\":\r\n ima.setImage(new Image(getClass().getResourceAsStream(\"/Images/img61a.png\")));\r\n break;\r\n case \"x vencer\":\r\n if (dia < 46)\r\n ima.setImage(new Image(getClass().getResourceAsStream(\"/Images/img59a.png\")));\r\n else\r\n ima.setImage(new Image(getClass().getResourceAsStream(\"/Images/img57a.png\")));\r\n break;\r\n }\r\n }", "public void updateImage() {\n \t\tAnimation anim = this.animationCollection.at(\n \t\t\t\tfak.getCurrentAnimationTextualId());\n \n \t\t// if animation is set to something bad, then set it to back to initial\n \t\tif(anim==null)\n \t\t{\n \t\t\tfak.setCurrentAnimationTextualId(ConstantsForAPI.INITIAL);\n \t\t\tanim = this.animationCollection.at(\n \t\t\t\t\tfak.getCurrentAnimationTextualId());\n \t\t}\n \n \t\tif(anim==null)\n \t\t{\n \t\t\tanim = this.animationCollection.at(0);\n \t\t\tfak.setCurrentAnimationTextualId(anim.getTextualId());\n \t\t}\n \n \t\tif (anim != null) {\n \t\t\tif (fak.getCurrentFrame()\n \t\t\t\t\t>= anim.getLength()) {\n \t\t\t\tfak.setCurrentFrame(\n \t\t\t\t\t\tanim.getLength() - 1);\n \t\t\t}\n \n \t\t\tcom.github.a2g.core.objectmodel.Image current = anim.getImageAndPosCollection().at(\n \t\t\t\t\tfak.getCurrentFrame());\n \n \t\t\t// yes current can equal null in some weird cases where I place breakpoints...\n \t\t\tif (current != null\n \t\t\t\t\t&& !current.equals(this)) {\n \t\t\t\tif (this.currentImage != null) {\n \t\t\t\t\tthis.currentImage.setVisible(\n \t\t\t\t\t\t\tfalse, new Point(this.left,this.top));\n \t\t\t\t}\n \t\t\t\tthis.currentImage = current;\n \t\t\t}\n \t\t}\n \t\t// 2, but do this always\n \t\tif (this.currentImage != null) {\n \t\t\tthis.currentImage.setVisible(\n \t\t\t\t\tthis.visible, new Point(this.left,\n \t\t\t\t\t\t\tthis.top));\n \t\t}\n \n \t}", "private synchronized void updateFilename()\n\t{\n\t\tCalendar cal = Calendar.getInstance();\n\t\tDate date = cal.getTime();\n\n\t\tcal.add(Calendar.DATE, 1);\n\t\tcal.set(Calendar.HOUR_OF_DAY, 0);\n\t\tcal.set(Calendar.MINUTE , 0);\n\t\tcal.set(Calendar.SECOND, 0);\n\n\t\tfilename = prefix + dateFormat.format(date);\n\t\tnextRotate = cal.getTimeInMillis();\n\t}", "private void updateAnimtation(String url) {\n\t\tint icon = WeatherUtil.getCurrentForecastIcon(url);\t\t\r\n\t\tImageView currentIcon = (ImageView)findViewById(R.id.dForecastImage);\r\n\t\tAnimation curIconAnim = AnimationUtils.loadAnimation(this, R.anim.aphlacurrentweather);\r\n\t\tcurrentIcon.setAnimation(curIconAnim);\r\n\t\tif (icon == R.drawable.weather_cloudy){\r\n\t\t\tAbsoluteLayout absLayout = (AbsoluteLayout)findViewById(R.id.imagesLayout);\r\n\t\t\tImageView cloud01 = new ImageView(this);\r\n\t\t\tImageView cloud02 = new ImageView(this);\r\n\t\t\tcloud01.setAdjustViewBounds(true);\r\n\t\t\tcloud02.setAdjustViewBounds(true);\r\n\t\t\tcloud01.setImageResource(R.drawable.layer_cloud1);\r\n\t\t\tcloud02.setImageResource(R.drawable.layer_cloud2);\r\n\t\t\tcloud01.setMaxHeight(48);\r\n\t\t\tcloud01.setMinimumHeight(48);\r\n\t\t\tcloud01.setMaxWidth(100);\r\n\t\t\tcloud01.setMinimumWidth(100);\r\n\t\t\t\r\n\t\t\tcloud02.setMaxHeight(58);\r\n\t\t\tcloud02.setMinimumHeight(58);\r\n\t\t\tcloud02.setMaxWidth(83);\r\n\t\t\tcloud02.setMinimumWidth(83);\r\n\t\t\t\r\n\t\t\tAnimation leftAnim = AnimationUtils.loadAnimation(this, R.anim.translatecloudleft);\r\n\t\t\tAnimation rightAnim = AnimationUtils.loadAnimation(this, R.anim.translatecloudright);\r\n\t\t\t\r\n\t\t\tleftAnim.setRepeatCount(Animation.INFINITE);\r\n\t\t\trightAnim.setRepeatCount(Animation.INFINITE);\r\n\t\t\t\r\n\t\t\tcloud01.setAnimation(leftAnim);\r\n\t\t\tcloud02.setAnimation(rightAnim);\r\n\t\t\t\r\n\t\t\tabsLayout.addView(cloud01);\r\n\t\t\tabsLayout.addView(cloud02);\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\r\n\t}", "public GIFMaker withDelay(int delay);", "Integer updateExerciseGif(ExercisePo exercisePo);", "private void updateDisplay() { \n\t \tmDateDisplay.setText( \n\t \t\t\tnew StringBuilder()\n\t \t\t\t.append(mYear).append(\"/\")\n\t \t\t\t// Month is 0 based so add 1 \n\t \t\t\t.append(mMonth + 1).append(\"/\") \n\t \t\t\t.append(mDay).append(\" \")); \n\t \t\t\t \n\t \t\t\t \n\t \t\t\t \n\t }", "private void updateLabel() {\n String myFormat = \"EEE, d MMM yyyy\";\n SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.US);\n dateText.setText(sdf.format(myCalendar.getTime()));\n }", "private void updateDateDisplay() {\n\t\tStringBuilder date = new StringBuilder()\n\t\t\t\t// Month is 0 based so add 1\n\t\t\t\t.append(mMonth + 1).append(\"-\").append(mDay).append(\"-\")\n\t\t\t\t.append(mYear).append(\" \");\n\n\t\tchangeDateButton.setText(date);\t\n\t}", "private void drawBookingDate() {\n try {\n bookingDate = bookingModel.getUserBookingDate(employeeID);\n labelBookingDate.setText(\"Booking Date: \" + bookingDate);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public void updateLatestPic() {\n\t\tPicture l = this.pictures.get(0);\n\t\tfor (int i=1;i<this.pictures.size();i++) {\n\t\t\tif (this.pictures.get(i).date.compareTo(l.date)>0) {\n\t\t\t\tl = this.pictures.get(i);\n\t\t\t}\n\t\t}\n\t\tthis.latestPic = l;\n\t}", "private void updateAnimtation(String url) {\n\t\tint icon = ForecastUtil.getCurrentForecastIcon(url);\n\t\t\n\t\tImageView currentIcon = (ImageView)findViewById(R.id.dForecastImage);\n\t\tAnimation curIconAnim = AnimationUtils.loadAnimation(this, R.anim.rotatecurrentweather);\n\t\tcurrentIcon.setAnimation(curIconAnim);\n\t\t\n\t\t// 如果有云则执行如下动画\n\t\tif (icon == R.drawable.weather_cloudy){\n\t\t\tAbsoluteLayout absLayout = (AbsoluteLayout)findViewById(R.id.imagesLayout);\n\t\t\tImageView cloud01 = new ImageView(this);\n\t\t\tImageView cloud02 = new ImageView(this);\n\t\t\tcloud01.setAdjustViewBounds(true);\n\t\t\tcloud02.setAdjustViewBounds(true);\n\t\t\tcloud01.setImageResource(R.drawable.layer_cloud1);\n\t\t\tcloud02.setImageResource(R.drawable.layer_cloud2);\n\t\t\tcloud01.setMaxHeight(48);\n\t\t\tcloud01.setMinimumHeight(48);\n\t\t\tcloud01.setMaxWidth(100);\n\t\t\tcloud01.setMinimumWidth(100);\n\t\t\t\n\t\t\tcloud02.setMaxHeight(58);\n\t\t\tcloud02.setMinimumHeight(58);\n\t\t\tcloud02.setMaxWidth(83);\n\t\t\tcloud02.setMinimumWidth(83);\n\t\t\t\n\t\t\tAnimation leftAnim = AnimationUtils.loadAnimation(this, R.anim.translatecloudleft);\n\t\t\tAnimation rightAnim = AnimationUtils.loadAnimation(this, R.anim.translatecloudright);\n\t\t\t\n\t\t\t//leftAnim.setRepeatCount(Animation.INFINITE);\n\t\t\t//rightAnim.setRepeatCount(Animation.INFINITE);\n\t\t\t\n\t\t\tcloud01.setAnimation(leftAnim);\n\t\t\tcloud02.setAnimation(rightAnim);\n\t\t\t\n\t\t\tabsLayout.addView(cloud01);\n\t\t\tabsLayout.addView(cloud02);\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t// 如果有雨则执行如下动画\n\t\tif (icon == R.drawable.weather_rain){\n\t\t\tAbsoluteLayout absLayout = (AbsoluteLayout)findViewById(R.id.imagesLayout);\n\t\t\tImageView rain01 = new ImageView(this);\n\t\t\tImageView rain02 = new ImageView(this);\n\t\t\tImageView rain03 = new ImageView(this);\n\t\t\tImageView rain04 = new ImageView(this);\n\t\t\tImageView rain05 = new ImageView(this);\n\t\t\tImageView drop01 = new ImageView(this);\n\t\t\tImageView drop02 = new ImageView(this);\n\t\t\tImageView drop03 = new ImageView(this);\n\t\t\train01.setAdjustViewBounds(true);\n\t\t\train02.setAdjustViewBounds(true);\n\t\t\train03.setAdjustViewBounds(true);\n\t\t\train04.setAdjustViewBounds(true);\n\t\t\train05.setAdjustViewBounds(true);\n\t\t\tdrop01.setAdjustViewBounds(true);\n\t\t\tdrop02.setAdjustViewBounds(true);\n\t\t\tdrop03.setAdjustViewBounds(true);\n\t\t\train01.setImageResource(R.drawable.rain1);\n\t\t\train02.setImageResource(R.drawable.rain1);\n\t\t\train03.setImageResource(R.drawable.rain2);\n\t\t\train04.setImageResource(R.drawable.rain3);\n\t\t\train05.setImageResource(R.drawable.rain2);\n\t\t\tdrop01.setImageResource(R.drawable.layer_drop1);\n\t\t\tdrop02.setImageResource(R.drawable.layer_drop5);\n\t\t\tdrop03.setImageResource(R.drawable.layer_drop7);\n\t\t\t\n\t\t\tLayoutParams lp01 = new LayoutParams(18, 30, 100, 150);\n\t\t\tLayoutParams lp02 = new LayoutParams(16, 33, 150, 140);\n\t\t\tLayoutParams lp03 = new LayoutParams(19, 30, 200, 150);\n\t\t\t\n\t\t\tAnimation rain01Anim = AnimationUtils.loadAnimation(this, R.anim.translaterain01);\n\t\t\tAnimation rain02Anim = AnimationUtils.loadAnimation(this, R.anim.translaterain02);\n\t\t\tAnimation rain03Anim = AnimationUtils.loadAnimation(this, R.anim.translaterain03);\n\t\t\tAnimation rain04Anim = AnimationUtils.loadAnimation(this, R.anim.translaterain04);\n\t\t\tAnimation rain05Anim = AnimationUtils.loadAnimation(this, R.anim.translaterain05);\n\t\t\t\t\t\t\n\t\t\train01.setAnimation(rain01Anim);\n\t\t\train02.setAnimation(rain02Anim);\n\t\t\train03.setAnimation(rain03Anim);\n\t\t\train04.setAnimation(rain04Anim);\n\t\t\train05.setAnimation(rain05Anim);\n\t\t\t\n\t\t\tabsLayout.addView(rain01);\n\t\t\tabsLayout.addView(rain02);\n\t\t\tabsLayout.addView(rain03);\n\t\t\tabsLayout.addView(rain04);\n\t\t\tabsLayout.addView(rain05);\n\t\t\tabsLayout.addView(drop01, lp01);\n\t\t\tabsLayout.addView(drop02, lp02);\n\t\t\tabsLayout.addView(drop03, lp03);\t\t\n\t\t}\n\t}", "@Override\n\tpublic void UpdateDateOfBirth(Gamers gamer) {\n\t\tSystem.out.println(\"Lütfen yeni doğum gününüzü giriniz\");\n\t\tint NewDateOfBirth;\n\t\tNewDateOfBirth=sc.nextInt();\n\t\tsc.nextLine();\n\t\tgamer.setDateOfBirth(NewDateOfBirth);\n\t\tdbserviceadaptors.Save(gamer);\n\t\tSystem.out.println(\"Yeni doğum gününüz \"+NewDateOfBirth+\" olarak güncellendi.\");\n\t\t\n\t}", "public void updateBDate() {\n bDate = new Date();\n }", "private static BufferedImage jpegToGif(BufferedImage image) {\n\t\t\r\n\t\tBufferedImage gifImage = image;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tImageIO.write(image, \"gif\", new File(\"temp.gif\"));\r\n\t\t\tgifImage = ImageIO.read(new File(\"temp.gif\"));\r\n\t\t} catch (Exception e) {e.printStackTrace();}\r\n\t\t\r\n\t\treturn gifImage;\r\n\t}", "protected void updateDate() {\r\n\t\tDate date = new Date();\r\n\t\tdate.setTime(mTime);\r\n\t\tDateFormat dateFormat = android.text.format.DateFormat.getDateFormat(getApplicationContext());\r\n\t\tString text = dateFormat.format(date);\r\n\t\tmDatePickerText.setText(text);\r\n\t}", "@Source(\"update.gif\")\n\tpublic DataResource updateIconDisabledResource();", "private void updateView() {\n\t\tpbrLoading.setVisibility(View.GONE);\n\t\tif (isPlaying()) {\n\t\t\tgifVoiceLoader.setVisibility(View.VISIBLE);\n\t\t\timgPlay.setVisibility(View.GONE);\n\t\t} else {\n\t\t\tgifVoiceLoader.setVisibility(View.GONE);\n\t\t\timgPlay.setVisibility(View.VISIBLE);\n\t\t}\n\t\timgPlay.setImageResource(getPlayImageResId());\n\t\tgifVoiceLoader.setGifImageResourceID(getVoiceLoderGif());\n\t\ttxtButtonCaption.setText(getText() + \" s\");\n\n\t}", "public void setGigDate(String gigDate) {\n this.gigDate = gigDate;\n }", "private void updateBusyIcon() {\n this.jLabelIcon.setIcon( getSelectedBusyICon() );\n }", "private void refreshLastSeenDate() {\r\n\r\n if (friendFeed == null)\r\n return;\r\n\r\n Date lastMessageDate = friendFeed.getLastMessageTime();\r\n lastMessageSentDateTextView.setText(StringUtils\r\n .normalizeDifferenceDate(lastMessageDate));\r\n }", "private void updateUI() {\n Bite bite = BiteLab.get(getActivity()).getBite(mBiteId);\n\n mPlacementTextView.setText(bite.getPlacement());\n\n Calendar c = bite.getCalendar();\n int year = c.get(Calendar.YEAR);\n int month = c.get(Calendar.MONTH)+1;\n int day = c.get(Calendar.DAY_OF_MONTH);\n mDateTextView.setText(getString(R.string.show_date, day, month, year));\n\n mDaysSinceBiteTextView.setText(getString(R.string.days_since_bite\n , bite.getDaysSinceBite()));\n\n mStageTextView.setText(getString(R.string.show_stage, bite.getStage()));\n }", "private void updateLabel() {\n EditText dob = (EditText) findViewById(R.id.dateofbirth);\n\n String dateFormat = \"MM/dd/yyyy\";\n SimpleDateFormat sdf = new SimpleDateFormat(dateFormat,\n Locale.US);\n dob.setText(sdf.format(cal.getTime()));\n }", "private void updateLabel() {\n String myFormat = \"yyyy-MM-dd\"; //In which you need put here\n SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.UK);\n\n serviceDate = sdf.format(myCalendar.getTime());\n callTimeSlotService();\n }", "private void updateDisplay() {\r\n date1.setText(\r\n new StringBuilder()\r\n // Month is 0 based so add 1\r\n .append(pDay).append(\"/\")\r\n .append(pMonth + 1).append(\"/\")\r\n .append(pYear).append(\" \"));\r\n }", "@Override\n public void updateDate(int year, int month, int day) {\n calendar = new GregorianCalendar();\n calendar.set(year, month, day);\n // set the textview\n SimpleDateFormat sdf = new SimpleDateFormat(\"MMMM dd, yyyy\");\n sdf.setCalendar(calendar);\n expiration.setText(sdf.format(calendar.getTime()));\n }", "public interface GIF {\n\n\t/**\n\t * The from method picks up the directory the\n\t * images are for gif creation\n\t * @param path path of the directory image resides in.\n\t * @return GIFMaker\n\t */\n\tpublic GIFMaker from(ImageComposite collection);\n\n\t/**\n\t * The destination directory where the final gif will reside.\n\t * @param path Directory path\n\t * @return GIFMAKER\n\t */\n\tpublic GIFMaker to(String path);\n\n\t/**\n\t * Adds the delay between two images.\n\t * @param delay int\n\t * @return GIFMaker\n\t */\n\tpublic GIFMaker withDelay(int delay);\n\t\n\t/**\n\t * Repeats GIF\n\t * @param repeat\n\t * @return GIFMaker\n\t */\n\tpublic GIFMaker repeat(boolean repeat);\n\t\n\t/**\n\t * Sets the width\n\t * @param width\n\t * @return GIFMaker\n\t */\n\tpublic GIFMaker width(int width);\n\t\n\t/**\n\t * Sets the height\n\t * @param height\n\t * @return GIFMaker\n\t */\n\tpublic GIFMaker height(int height);\n\n\t/**\n\t * Makes the final GIF Image for the the application.\n\t */\n\tpublic void make();\n\t\n}", "public void updateDate(){\n SimpleDateFormat formatter = new SimpleDateFormat(\"yyyy/MM/dd\");\n Date curDate=new Date(System.currentTimeMillis());\n String date=formatter.format(curDate);\n TextView TextTime=(TextView)this.findViewById(R.id.tv_date);\n TextTime.setText(date);\n }", "protected void paintComponent(Graphics g) {\n\t ImageIcon icone = new ImageIcon(getClass().getResource(\"/resources/wait.gif\"));\n\t g.drawImage(icone.getImage(), 1, 1, 220, 19, this);\n\t }", "private void updateDisplay() {\r\n\t\tbtnBirthDate.setText(new StringBuilder()\r\n\t\t// Month is 0 based so add 1\r\n\t\t\t\t.append(mMonth + 1).append(\"-\").append(mDay).append(\"-\").append(mYear).append(\" \"));\r\n\t}", "public synchronized void refresh()\n {\n // Update the last modified time\n // This returns zero (i.e. Jan 1 1970) if the file does not exist\n this.lastModifiedTime = this.file.lastModified() / 1000;\n }", "public void updateEvent(EasyRVHolder holder, GithubEvent event) {\n\n Glide.with(GithubApp.getsInstance()).load(event.actor.avatar_url)\n .placeholder(R.mipmap.ic_default_avatar)\n .transform(new GlideRoundTransform(GithubApp.getsInstance()))\n .override(ScreenUtils.dpToPxInt(40), ScreenUtils.dpToPxInt(40))\n .into((ImageView) holder.getView(R.id.ivAvatar));\n\n StyledText main = new StyledText();\n StyledText details = new StyledText();\n\n String icon = EventTypeManager.valueOf(event.type.toString())\n .generateIconAndFormatStyledText(this, event, main, details);\n\n if (TextUtils.isEmpty(icon)) {\n holder.setVisible(R.id.tvEventIcon, View.GONE);\n } else {\n TypefaceUtils.setOcticons((TextView) holder.getView(R.id.tvEventIcon));\n holder.setText(R.id.tvEventIcon, icon);\n }\n\n ((TextView) holder.getView(R.id.tvEvent)).setText(main);\n\n if (TextUtils.isEmpty(details)) {\n holder.setVisible(R.id.tvEventDetails, View.GONE);\n } else {\n ((TextView) holder.getView(R.id.tvEventDetails)).setText(details);\n }\n\n ((TextView) holder.getView(R.id.tvEventDate)).setText(TimeUtils.getRelativeTime(event.created_at));\n\n }", "public void setFlaggingDate(long flaggingDate) {\n this.flaggingDate = flaggingDate;\n }", "@Override\n\tpublic void onRefreshDate() {\n\t\trefreshDate();\n\t}", "private void setModifiedAndUpdateIcon() {\n document.setModified(true);\n updateTabIcon(document);\n }", "public void update(Graphics g) {\n\t\tjava.awt.Image i = image;\n\t\tg.drawImage(i, 0, 0, this);\n\t\t// Graphics gr = this.getGraphics();\n\n\t}", "private void m106722c() {\n if (this.f86017d != null) {\n this.f86018e = (AnimationImageView) this.f86017d.findViewById(R.id.b9t);\n try {\n if (C43127fh.m136806a(this.f86017d.getContext())) {\n ((TextView) this.f86017d.findViewById(R.id.avl)).setText(R.string.bei);\n this.f86018e.setScaleX(-1.0f);\n }\n } catch (Exception unused) {\n }\n if (this.f86018e != null && !f86014a) {\n this.f86018e.setRepeatCount(3);\n this.f86018e.setAnimation(\"right_pic.json\");\n this.f86018e.setProgress(0.0f);\n this.f86018e.mo7078b();\n f86014a = true;\n m106725f();\n }\n }\n }", "private void incrementeDate() {\n dateSimulation++;\n }", "public void updateTextLabel() {\n waktu.setText(dateFormat.format(c.getTime()));\n }", "private void getNewImage() {\n try {\n URL imageUrl = new URL(path);\n URLConnection uc = imageUrl.openConnection();\n\n InputStream is = uc.getInputStream();\n BufferedInputStream bis = new BufferedInputStream(is);\n\n ByteArrayOutputStream buffer = new ByteArrayOutputStream();\n int current;\n while ((current = bis.read()) != -1) {\n buffer.write((byte) current);\n }\n final byte[] data = buffer.toByteArray();\n // enqueue UI update as a priority\n Handler handler = new Handler(Looper.getMainLooper());\n handler.post(new Runnable() {\n public void run() {\n view.setImageBitmap(BitmapFactory.decodeByteArray(\n data, 0, data.length));\n }\n });\n // update database while that is queueing\n ContentValues values = new ContentValues();\n values.put(MovieEntry.COLUMN_POSTER, data);\n context.getContentResolver().update(MovieEntry.buildMovieUriWithId(movieId),\n values, null, null);\n } catch (Exception E) {\n Log.i(TAG, E.toString());\n E.printStackTrace();\n }\n }", "public void update() {\r\n setVisible(false);\r\n daySelector.paintCalendarPane(currentDate);\r\n if (showMonthSelector) {\r\n String yearString = \" \" + currentDate.get(java.util.Calendar.YEAR);\r\n monthSelector.setMonthName(getMonthSelectorStyle().getMonthName(\r\n currentDate.get(java.util.Calendar.MONTH)) + yearString);\r\n }\r\n setVisible(true);\r\n }", "public void saveCalenderDate() {\r\n\t\tdate = getDateToDisplay(null);\r\n\t}", "public void updateDate(Date date);", "private void updateDateButtonText() {\n SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT); \n String dateForButton = dateFormat.format(mCalendar.getTime()); \n mDateButton.setText(dateForButton);\n\t}", "public void updateDate()\n\t{\n\t\t// Translate year, month and day into a Date object.\n\t\tmDate = new GregorianCalendar(mYear, mMonth, mDay, mHour, mMin).getTime();\n\t\t\n\t\t// Update arguments to preserve selected value on rotation.\n\t\tgetArguments().putSerializable(CrimeFragment.EXTRA_DATE, mDate);\n\t}", "private void updateRefreshTime(){\n\t\t\trefreshLabel.setText(\"Last Updated: \" + (new Date()).toString());\n\t\t}", "private void updateImage(File file) throws IOException {\n\t\t\tfileLabel.setText(\"\");\n\n\t\t\ttry {\n\t\t\t\tMyImageD tmpImage = null;\n\t\t\t\tString fileName = file.getName();\n\n\t\t\t\t// Update preview for opening ggb files\n\t\t\t\tif (fileChooser\n\t\t\t\t\t\t.getMode() == GeoGebraFileChooser.MODE_GEOGEBRA) {\n\n\t\t\t\t\tif (fileName.endsWith(\".ggb\")) {\n\t\t\t\t\t\ttmpImage = new MyImageD(MyXMLioD.getPreviewImage(file)); // load\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// preview\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// from\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// zip\n\n\t\t\t\t\t\tStringBuilder fileInfo = new StringBuilder();\n\n\t\t\t\t\t\tif (fileName.length() > 20) {\n\t\t\t\t\t\t\tfileInfo.append(fileName.substring(0, 20));\n\t\t\t\t\t\t\tfileInfo.append(\"..\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfileInfo.append(fileName);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfileInfo.append(\" : \");\n\t\t\t\t\t\tfileInfo.append(file.length() / 1024);\n\t\t\t\t\t\tfileInfo.append(\" kB\");\n\t\t\t\t\t\tfileLabel.setText(fileInfo.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Update preview for saving a ggb file\n\t\t\t\telse if (fileChooser\n\t\t\t\t\t\t.getMode() == GeoGebraFileChooser.MODE_GEOGEBRA_SAVE) {\n\t\t\t\t\ttmpImage = (MyImageD)\n\t\t\t\t\t\t\tapp.getExportImage(MyXMLio.THUMBNAIL_PIXELS_X,\n\t\t\t\t\t\t\t\t\tMyXMLio.THUMBNAIL_PIXELS_Y);\n\t\t\t\t\t// TODO: show file size info?\n\t\t\t\t\tfileLabel.setText(null);\n\t\t\t\t}\n\n\t\t\t\t// Update preview for images\n\t\t\t\telse {\n\t\t\t\t\t// fails for a few JPEGs so turn off preview for large files\n\t\t\t\t\tif (file.length() < 1024 * maxImageSize) {\n\n\t\t\t\t\t\ttmpImage = MyImageD.fromFile(file, fileName);\n\t\t\t\t\t\tStringBuilder imgInfo = new StringBuilder();\n\n\t\t\t\t\t\tif (fileName.length() > 20) {\n\t\t\t\t\t\t\timgInfo.append(fileName.substring(0, 20));\n\t\t\t\t\t\t\timgInfo.append(\"..\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\timgInfo.append(fileName);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (tmpImage != null) {\n\t\t\t\t\t\t\timgInfo.append(\" : \");\n\t\t\t\t\t\t\timgInfo.append(tmpImage.getWidth());\n\t\t\t\t\t\t\timgInfo.append(\" x \");\n\t\t\t\t\t\t\timgInfo.append(tmpImage.getHeight());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfileLabel.setText(imgInfo.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// resize tmp image if necessary\n\t\t\t\tif (tmpImage != null) {\n\n\t\t\t\t\tint oldWidth = tmpImage.getWidth();\n\t\t\t\t\tint oldHeight = tmpImage.getHeight();\n\n\t\t\t\t\tint newWidth;\n\t\t\t\t\tint newHeight;\n\n\t\t\t\t\tif (oldWidth > ImagePanel.SIZE\n\t\t\t\t\t\t\t|| oldHeight > ImagePanel.SIZE) {\n\t\t\t\t\t\tif (oldWidth > oldHeight) {\n\t\t\t\t\t\t\tnewWidth = ImagePanel.SIZE;\n\t\t\t\t\t\t\tnewHeight = (ImagePanel.SIZE * oldHeight)\n\t\t\t\t\t\t\t\t\t/ oldWidth;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnewWidth = (ImagePanel.SIZE * oldWidth) / oldHeight;\n\t\t\t\t\t\t\tnewHeight = ImagePanel.SIZE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Create a new image for the scaled preview image\n\t\t\t\t\t\tsetImg(new MyImageD(new BufferedImage(newWidth,\n\t\t\t\t\t\t\t\tnewHeight, BufferedImage.TYPE_INT_RGB)));\n\n\t\t\t\t\t\tGGraphics2DD graphics2D = (GGraphics2DD) getImg()\n\t\t\t\t\t\t\t\t.createGraphics();\n\t\t\t\t\t\tif (tmpImage.isSVG()) {\n\t\t\t\t\t\t\tgraphics2D.setColor(GColor.WHITE);\n\t\t\t\t\t\t\tgraphics2D.fillRect(0, 0, newWidth, newHeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgraphics2D.drawImageScaled(tmpImage, newWidth, newHeight);\n\t\t\t\t\t\tgraphics2D.dispose();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetImg(tmpImage);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsetImg(null);\n\t\t\t\t}\n\n\t\t\t\trepaint();\n\t\t\t} catch (IllegalArgumentException iae) {\n\t\t\t\t// This is thrown if you select .ico files\n\t\t\t\tsetImg(null);\n\t\t\t} catch (Throwable t) {\n\t\t\t\tt.printStackTrace();\n\t\t\t\tLog.debug(t.getClass() + \"\");\n\t\t\t\tsetImg(null);\n\t\t\t}\n\t\t}", "private void updateNewsTicker() {\n createExchangeLabel();\n }", "private void updateDisplay() \n\t{\n\t\t// updates the date in the TextView\n if(bir.hasFocus())\n {\n\t\tbir.setText(\n\t\t\t\tnew StringBuilder()\n\t\t\t\t// Month is 0 based so add 1\n\t\t\t\t\n\t\t\t\t.append(mDay).append(\"-\")\n\t\t\t\t.append(mMonth + 1).append(\"-\")\n\t\t\t\t.append(mYear).append(\" \"));\n }else\n {\n\t\taniv.setText(\n\t\t\t\tnew StringBuilder()\n\t\t\t\t// Month is 0 based so add 1\n\t\t\t\t\n\t\t\t\t.append(mDay).append(\"-\")\n\t\t\t\t.append(mMonth + 1).append(\"-\")\n\t\t\t\t.append(mYear).append(\" \"));\n }\n\n\n\t}", "@Override\n\t\t\tpublic void setValue(Date value) {\n\t\t\t\tsuper.setValue(value);\n\t\t\t\tstart_cal_date = value.getTime();\n\t\t\t\tinfo_loader.load();\n\t\t\t}", "private void setDateLabel() {\n dateFormat = new SimpleDateFormat(\"MMMMM dd, yyyy\");\n dateLabel = new JLabel();\n dateLabel.setFont(new Font(\"Times New Roman\", Font.PLAIN, 30));\n dateLabel.setBackground(Color.black);\n dateLabel.setForeground(new Color(0xAB00FF));\n dateLabel.setOpaque(true);\n add(dateLabel);\n }", "void disableBackgroundDate();", "public void updateTimerDisplay(){\n int seconds = timeCounter / 60;\n setImage(new GreenfootImage(\"Time: \"+timeElapsed + \": \" + seconds, 24, Color.BLACK, Color.WHITE));\n }", "protected void updateIconByDay(JSONArray jsonArray, int index){\n try {\n JSONObject theDay = jsonArray.getJSONObject(index*8);\n String weather = theDay.optString(\"weather\").toString();\n JSONArray weatherArray = new JSONArray(weather);\n JSONObject weather_detail = weatherArray.getJSONObject(0);\n String weatherCondition = weather_detail.optString(\"main\");\n\n ImageView theView;\n\n switch (index){\n case 0:\n theView = (ImageView)this.findViewById(R.id.weather_condition_1);\n break;\n case 1:\n theView = (ImageView)this.findViewById(R.id.weather_condition_2);\n break;\n case 2:\n theView = (ImageView)this.findViewById(R.id.weather_condition_3);\n break;\n case 3:\n theView = (ImageView)this.findViewById(R.id.weather_condition_4);\n break;\n case 4:\n theView = (ImageView)this.findViewById(R.id.weather_condition_5);\n break;\n default:\n theView = (ImageView)this.findViewById(R.id.weather_condition_1);\n }\n\n switch (weatherCondition){\n case \"Clear\":\n theView.setImageDrawable(getApplicationContext().getResources().getDrawable(R.drawable.sunny_small));\n break;\n case \"Clouds\":\n theView.setImageDrawable(getApplicationContext().getResources().getDrawable(R.drawable.partly_sunny_small));\n break;\n case \"Rain\":\n theView.setImageDrawable(getApplicationContext().getResources().getDrawable(R.drawable.rainy_small));\n break;\n default:\n }\n }catch (JSONException e){\n e.printStackTrace();\n }\n\n }", "public void updateAnimation() {\n\t\tif (anim < 1000) {\n\t\t\tanim++;\n\t\t} else anim = 0;\n\t}", "private void setDate() {\n java.util.Date d1 = new java.util.Date();\n SimpleDateFormat df = new SimpleDateFormat(\"YYYY-MM-dd\");\n String formateDate = df.format(d1);\n lblDate.setText(formateDate); \n }", "@Override\n public void onBindViewHolder(@NonNull HolderNotification holder, int position) {\n ModelNotification model=notificationlist.get(position);\n String name=model.getsName();\n String notification=model.getNotification();\n String image=model.getsImage();\n String time=model.getTimestamp();\n\n //convert timestamp to dd-mm-yyyy hh-mm am-pm\n Calendar calendar=Calendar.getInstance(Locale.getDefault());\n calendar.setTimeInMillis(Long.parseLong(time));\n String pTime = DateFormat.format(\"dd/MM/yyyy hh:mm aa\",calendar).toString();\n //set to views\n holder.nameTv.setText(name);\n holder.timeTV.setText(pTime);\n holder.notificationTV.setText(notification);\n try {\n Glide.with(context).load(image).placeholder(R.drawable.ic_baseline_insert_emoticon_24).into(holder.avaterIV);\n }catch(Exception e){\n holder.avaterIV.setImageResource(R.drawable.ic_baseline_insert_emoticon_24);\n }\n }", "@Source(\"date_picker.gif\")\n\tpublic DataResource datePickerIconResource();", "private void updateDatedeparture() {\n String myFormat = \"MM/dd/yy\";\n SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.FRANCE);\n\n departureDate.setText(sdf.format(myCalendar.getTime()));\n }", "private void updateAgencyLogo(String path) throws IOException {\n agencyLogoPathField.setText(path);\n ImageIcon agencyLogoIcon = new ImageIcon();\n agencyLogoPreview.setText(NbBundle.getMessage(AutopsyOptionsPanel.class, \"AutopsyOptionsPanel.agencyLogoPreview.text\"));\n if (!agencyLogoPathField.getText().isEmpty()) {\n File file = new File(agencyLogoPathField.getText());\n if (file.exists()) {\n BufferedImage image = ImageIO.read(file); //create it as an image first to support BMP files \n if (image == null) {\n throw new IOException(\"Unable to read file as a BufferedImage for file \" + file.toString());\n }\n agencyLogoIcon = new ImageIcon(image.getScaledInstance(64, 64, 4));\n agencyLogoPreview.setText(\"\");\n }\n }\n agencyLogoPreview.setIcon(agencyLogoIcon);\n agencyLogoPreview.repaint();\n }", "protected void onReloadImage() {\n String url = DataProvider.SCREEN + DataProvider.SCREEN_INDEX + mScreenId + \"&time=\" + System.currentTimeMillis();\n image.setUrl(url); //just to avoid caching\n loadTree();\n }", "@Override\n protected void doUpdate(long now) {\n eyeCandy.update();\n }", "@Override\n\tpublic void update() {\n\t\tif(!canSwoop)\n\t\tif(System.currentTimeMillis() - lastAnim >= 200){\t\n\t\t\tif(currentAnim < 2){\n\t\t\t\tcurrentAnim++;\n\t\t\t} else {\n\t\t\t\tcurrentAnim = 0;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"ANIMATING image: \" + currentAnim);\n\t\t\tlastAnim = System.currentTimeMillis();\t\t\n\t\t\t}\n\t\t\n\t\tthis.texture = Assets.shadowAnim[currentAnim];\n\t}", "private void animateIcon(final boolean enable) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n ImageView myImageView = findViewById(R.id.loading_image);\n if (enable) {\n Animation myFadeInAnimation = AnimationUtils.loadAnimation(LoadingActivity.this, R.anim.loading_animation);\n myImageView.startAnimation(myFadeInAnimation);\n } else {\n myImageView.clearAnimation();\n //Show the icon in distress since we aren't fully loaded.\n }\n }\n });\n }", "@Override\n public void paintComponent( Graphics g )\n {\n super.paintComponent( g ); // call superclass paintComponent\n \n images[ currentImage ].paintIcon(this, g, 115, 100);\n \n // Set next image to be drawn only if Timer is running\n if ( animationTimer.isRunning() )\n currentImage = ( currentImage + 1 ) % TOTAL_IMAGES;\n }", "private void updateContPicture(String path) {\n \t\t// don't update if its already correct!\n \t\tif (imgPath == path) {\n \t\t\treturn;\n \t\t}\n \t\t\n \t\ttry {\n \t\t\tImage img = ImageIO.read(new File(path));\n \t\t\tif(img==null)\n \t\t\t\tthrow new IOException();\n \t\t\t// scale the image!\n \t\t\tif (img.getWidth(null) > 200 ||\n \t\t\t\t\timg.getHeight(null) > 200) {\n \t\t\t\timg = img.getScaledInstance(200, 200, Image.SCALE_SMOOTH);\n \t\t\t}\n \t\t\t\n \t\t\t// NO IO errors occured if getting here:\n \t\t\tImageIcon imgD = new ImageIcon(img);\n \t\t\timgDisplay.setIcon(imgD);\n \t\t\timgPath = path;\n \t\t} catch (IOException e) {\n \t\t\tSystem.out.println(\"Exception loading image for contestant \" +\n \t\t\t\t\t\"picture [\" + path + \"]\");\n \t\t\timgDisplay.setIcon(null);\n \t\t\timgDisplay.setText(\"Could not load: \" + path);\n \t\t}\n \t\t\n \t}", "public void update() {\r\n\t\tlabel.setText(time / 60 + \":\" + ((time % 60 <= 9)? (\"0\" + time % 60) : (time % 60)));\r\n\t}", "private void updateDisplay(int year, int month, int day) {\n\t\tDate = new StringBuilder().append(month + 1).append(\"-\").append(day).append(\"-\").append(year).append(\" \").toString();\r\n\t\tSystem.out.println(\"BirthDate==>\" + Date);\r\n\t\t btnBirthDate.setText(fun.getBirthDate(String.valueOf(month+1),String.valueOf(day),String.valueOf(year)));\r\n\t\t//btnBirthDate.setText(new StringBuilder().append(month + 1).append(\"-\").append(day).append(\"-\").append(year).append(\" \").toString());\r\n\t\t// Date=new StringBuilder().append(month + 1).append(\"-\").append(day).append(\"-\").append(year).append(\" \").toString();\r\n\t}", "@Override\n public void onBindViewHolder(MyViewHolder holder, int position) {\n // - get element from your dataset at this position\n // - replace the contents of the view with that element\n\n\n data currentdata=mData.get(position);\n //set image source using image url and picasso\n\n //Picasso.with(getContext()).load(currentdata.geturl_img()).placeholder(R.drawable.wait).fit().into(holder.mimg);\n\n\n //set time\n\n\n String date;\n String time;\n String date_full=currentdata.getdate();\n\n String[] parts=date_full.split(\"T\");\n date=parts[0];\n time=parts[1];\n\n //to remove the last character 'Z' from the string time\n String time2=time.substring(0, time.length() - 1);\n\n String date_now=new SimpleDateFormat(\"yyyy-MM-dd\", Locale.getDefault()).format(new Date());\n if(date.equals(date_now))\n date=\"Today\";\n else\n date=\"Yesterday\";\n\n //after time and date\n\n\n holder.mtitle.setText(currentdata.gettitle());\n holder.mname.setText(currentdata.getName());\n holder.mdate.setText(date);\n holder.mtime.setText(time2);\n\n }", "@Override\n\t\tpublic synchronized void onRefresh() {\n\t\t\ttry {\n\t\t\t\t//此处可取当前时间,为刷新时间\n\t\t\t\tcurDate = new Date(System.currentTimeMillis());\n\t\t\t\tsdf = new SimpleDateFormat(\"MM-dd HH:mm\");\n\t\t\t\tif(System.currentTimeMillis()-time>500){\n\t\t\t\t\tURL = URL.substring(0, URL.lastIndexOf(\"_\")+1);\n\t\t\t\t\tURL = URL+\"1.xml\";\n\t\t\t\t\tif(lsnb != null){\n\t\t\t\t\t\tlsnb_temp.addAll(lsnb);\n\t\t\t\t\t\tlsnb = null;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tnew AsyncLoadNews(flag,lsnb,URL).execute();\n\t\t\t\t}else{\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\tonLoadStop();\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\t\n\t\t}", "private void weekDateUpdate(GregorianCalendar reference) {\n\t\treference = (GregorianCalendar) reference.clone();\n\t\tthis.weekdates.removeAll();\n\t\treference = DateCalc.startOf(reference, Calendar.WEEK_OF_YEAR);\n\t\tint day = 1;\n\t\tJLabel current;\n\t\twhile (day <= 7) {\n\t\t\tStringBuilder date = new StringBuilder();\n\t\t\tdate.append(reference.getDisplayName(Calendar.DAY_OF_WEEK,\n\t\t\t\t\tCalendar.SHORT, DEFAULT_LOCALE)\n\t\t\t\t\t+ \" \");\n\t\t\tdate.append(reference.get(Calendar.DAY_OF_MONTH));\n\t\t\tdate.append('.');\n\t\t\tdate.append((reference.get(Calendar.MONTH) + 1));\n\n\t\t\tcurrent = new JLabel(date.toString());\n\t\t\tthis.weekdates.add(current);\n\t\t\tthis.weekdates.addSeparator();\n\t\t\treference.add(Calendar.DAY_OF_WEEK, 1);\n\t\t\tday++;\n\t\t}\n\t}", "private void customUpdateView() {\n\t\tpbrLoading.setVisibility(View.GONE);\n\t\tif (isPlaying()) {\n\t\t\tgifVoiceLoader.setVisibility(View.VISIBLE);\n\t\t\timgPlay.setVisibility(View.GONE);\n\t\t} else {\n\t\t\tgifVoiceLoader.setVisibility(View.GONE);\n\t\t\timgPlay.setVisibility(View.VISIBLE);\n\t\t}\n\t\timgPlay.setImageResource(getPlayImageResId());\n\t\tgifVoiceLoader.setGifImageResourceID(getVoiceLoderGif());\n\t\ttxtButtonCaption.setText(getText());\n\n\t}", "public static String getImgGif() throws Exception {\n\t\treturn getConfig(\"img_gif\");\n\t}", "@Override\n\tpublic synchronized void onRefresh() {\n\t\ttry {\n\t\t\t// 此处可取当前时间,为刷新时间\n\t\t\tcurDate = new Date(System.currentTimeMillis());\n\t\t\tsdf = new SimpleDateFormat(\"MM-dd HH:mm\");\n\t\t\tif (System.currentTimeMillis() - time > 500) {\n\t\t\t\tURL = URL.substring(0, URL.lastIndexOf(\"_\") + 1);\n\t\t\t\tURL = URL + \"1.xml\";\n\t\t\t\tif (lsnb != null) {\n\t\t\t\t\tlsnb_temp.addAll(lsnb);\n\t\t\t\t\tlsnb = null;\n\t\t\t\t}\n\n\t\t\t\tnew AsyncLoadNews(lsnb, URL).execute();\n\t\t\t} else {\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\tonLoadStop();\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\n\t}", "private String getStatusIcon() {\n return (isDone ? \"+\" : \"-\");\n }", "public void updateEarliestPic() {\n\t\tPicture e = this.pictures.get(0);\n\t\tfor (int i=1;i<this.pictures.size();i++) {\n\t\t\tif (this.pictures.get(i).date.compareTo(e.date)<0) {\n\t\t\t\te = this.pictures.get(i);\n\t\t\t}\n\t\t}\n\t\tthis.earliestPic = e;\n\t}", "public void run() {\n while (true) {\n Date d = new Date();\n //lbldate.setText(d.toString());\n String date = d.toString();\n String arr[] = date.split(\" \");\n String dd = arr[5] + \" / \" + arr[1] + \" / \" + arr[2];\n lbldate.setText(dd);\n\n lbltime.setText(arr[3]);\n }\n }", "public void run() {\n while (true) {\n Date d = new Date();\n //lbldate.setText(d.toString());\n String date = d.toString();\n String arr[] = date.split(\" \");\n String dd = arr[5] + \" / \" + arr[1] + \" / \" + arr[2];\n lbldate.setText(dd);\n\n lbltime.setText(arr[3]);\n }\n }", "private void update(){\n\n//\t\tif(frameSupplier != null){\n//\n//\t\t\tBufferedImage frame = frameSupplier.getFrame();\n//\n//\t\t\tvideoContainer.setIcon(new ImageIcon(frame));\n//\t\t\tvideoContainer.setText(null);\n//\n//\t\t}\n\n\t\tBufferedImage frame = camera.getImage();\n\t\tvideoContainer.setIcon(new ImageIcon(frame));\n\t\tvideoContainer.setText(null);\n\n\t\tgpioManager.setStatusColour(Color.getHSBColor((System.currentTimeMillis() % 3000) / 3000f, 1, 1));\n\n\t\tgpioManager.setShutterLEDState(System.currentTimeMillis() % 1000 > 500);\n\n\t\tjFrame.repaint();\n\t}", "private void updateBadge() {\n badgeDrawable.setNumber((inbox == null) ? 0 : inbox.getCountUnread());\n }", "boolean updateUI() {\n BackgroundStatus bgStat= _monItem.getStatus();\n WebAssert.argTst(ComparisonUtil.equals(bgStat.getID(), _oldBgStat.getID()),\n \"You cannot update the report to one with \" +\n \"a different package id.\");\n boolean retval= update();\n _oldBgStat = _monItem.getStatus();\n if (_monItem.isDone()) {\n if (_monItem.getState()==BackgroundState.SUCCESS) {\n if (!_success) {\n String name= Application.getInstance().getAppName();\n Notifications.notify( name + \" Task Completed\",\n _monItem.getReportDesc() +\", \" +_monItem.getTitle() +\" has completed.\");\n }\n _success= true;\n if (!_calledAutoActivation &&\n _monItem.getActivateOnCompletion() &&\n !_monItem.getStatus().isMultiPart()) {\n _calledAutoActivation= true;\n ActivationFactory.getInstance().activate(_monItem,0,!_monItem.getImmediately());\n }\n }\n }\n\n return retval;\n\n }", "public void playerAnimation(){\r\n \r\n switch (gif) {\r\n case 5:\r\n j= new ImageIcon(getClass().getResource(\"/\" + Character.choosen_char + \"_1.png\"));\r\n img = j.getImage().getScaledInstance(200, 200, Image.SCALE_DEFAULT);\r\n ;\r\n break;\r\n case 15:\r\n j = new ImageIcon(getClass().getResource(\"/\"+ Character.choosen_char + \"_2.png\"));\r\n img = j.getImage().getScaledInstance(200, 200, Image.SCALE_DEFAULT);\r\n break;\r\n case 20:\r\n j = new ImageIcon(getClass().getResource(\"/\"+ Character.choosen_char + \"_3.png\"));\r\n img = j.getImage().getScaledInstance(200, 200, Image.SCALE_DEFAULT);\r\n\r\n break;\r\n case 35:\r\n j = new ImageIcon(getClass().getResource(\"/\" + Character.choosen_char + \"_4.png\"));\r\n img = j.getImage().getScaledInstance(200, 200, Image.SCALE_DEFAULT);\r\n\r\n break;\r\n case 45:\r\n j = new ImageIcon(getClass().getResource(\"/\" + Character.choosen_char + \"_5.png\"));\r\n img = j.getImage().getScaledInstance(200, 200, Image.SCALE_DEFAULT);\r\n\r\n break;\r\n case 55:\r\n j = new ImageIcon(getClass().getResource(\"/\" + Character.choosen_char + \"_6.png\"));\r\n img = j.getImage().getScaledInstance(200, 200, Image.SCALE_DEFAULT);\r\n\r\n break;\r\n case 65:\r\n // j= new ImageIcon(\"D:\\\\Netbeans\\\\Projects\\\\ProjectZ\\\\src\\\\shi_1.png\");\r\n // img = j.getImage().getScaledInstance(200, 200, Image.SCALE_DEFAULT);\r\n // \r\n gif = 0;\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tDate now = new Date();\n\t\t\t\tString ss = DateFormat.getDateTimeInstance().format(now);\n\t\t\t\tlblDate.setText(ss);\n\t\t\t}", "@Scheduled(fixedDelay=DateUtils.MILLIS_PER_HOUR)\n \tprotected void checkLastPublicationDate(){\n \t\ttry {\n \t\t\tString lpd = FileUtils.readFileToString(new File(vascanConfig.getLastPublicationDateFilePath()));\n \t\t\ttry {\n \t\t\t\tfreemarkerConfig.getConfiguration().setSharedVariable(\"lastPublicationDate\", lpd);\n \t\t\t} catch (TemplateModelException e) {\n \t\t\t\tLOGGER.fatal(\"Could not set Vascan lastPublicationDate\", e);\n \t\t\t}\n \t\t} catch (IOException e) {\n \t\t\tLOGGER.fatal(\"Could not read Vascan lastPublicationDate\", e);\n \t\t}\n \t}", "private void drawNotification(Graphics g, String fileName, int x, int y) throws IOException{\n\t\t ImageIcon bg;\n\t\t bg = new ImageIcon(ImageIO.read(new File(relativePath + fileName)));\n\t\t bg.paintIcon(this, g, x, y);\n\t }", "private void displayVisitIcon() {\n if (!mStrComingFrom.equalsIgnoreCase(Constants.RouteList)) {\n Constants.Route_Plan_Key = \"\";\n }\n if (mStrComingFrom.equalsIgnoreCase(Constants.AdhocList)\n || mStrComingFrom.equalsIgnoreCase(Constants.CustomerList)\n || mStrComingFrom.equalsIgnoreCase(Constants.RouteList)\n || mStrComingFrom.equalsIgnoreCase(Constants.OtherRouteList)) {\n iv_visit_status.setVisibility(View.VISIBLE);\n } else {\n iv_visit_status.setVisibility(View.GONE);\n }\n mBooleanVisitStartDialog = false;\n mBooleanVisitEndDialog = false;\n String mStrVisitStartEndQry = Constants.Visits + \"?$filter=StartDate eq datetime'\" + UtilConstants.getNewDate() + \"' and EndDate eq datetime'\" + UtilConstants.getNewDate() + \"'\" +\n \"and CPGUID eq '\" + mCpGuid.guidAsString32().toUpperCase() + \"' and \" + Constants.StatusID + \" eq '01'\";\n\n\n String mStrVisitStartedQry = Constants.Visits + \"?$filter=StartDate eq datetime'\" + UtilConstants.getNewDate() + \"' and EndDate eq null \" +\n \"and CPGUID eq '\" + mCpGuid.guidAsString32().toUpperCase() + \"'and \" + Constants.StatusID + \" eq '01'\";\n try {\n if (OfflineManager.getVisitStatusForCustomer(mStrVisitStartedQry)) {\n iv_visit_status.setImageResource(R.drawable.stop);\n mBooleanVisitStarted = true;\n } else if (OfflineManager.getVisitStatusForCustomer(mStrVisitStartEndQry)) {\n iv_visit_status.setImageResource(R.drawable.ic_done);\n mBooleanVisitStarted = false;\n } else {\n Constants.MapEntityVal.clear();\n\n String qry = Constants.Visits + \"?$filter=EndDate eq null and CPGUID eq '\" + mCpGuid.guidAsString32().toUpperCase() + \"' \" +\n \"and StartDate eq datetime'\" + UtilConstants.getNewDate() + \"' and \" + Constants.StatusID + \" eq '01'\";\n\n try {\n mStrVisitId = OfflineManager.getVisitDetails(qry);\n } catch (OfflineODataStoreException e) {\n// e.printStackTrace();\n LogManager.writeLogError(Constants.error_txt + e.getMessage());\n }\n\n if (!Constants.MapEntityVal.isEmpty()) {\n iv_visit_status.setImageResource(R.drawable.stop);\n mBooleanVisitStarted = true;\n } else {\n iv_visit_status.setImageResource(R.drawable.start);\n mBooleanVisitStarted = false;\n }\n }\n } catch (OfflineODataStoreException e) {\n e.printStackTrace();\n }\n\n }", "public void addBonus() {\r\n game.settings.setBonusDay(strDate);\r\n }", "public void updateReloading() {\n if (game.getPlayerComponent().getActiveWeapon().isReloading()) {\n reloadingText.setText(\"Reloading\");\n reloadingText.setFill(Color.INDIANRED);\n } else {\n reloadingText.setText(\"Reloaded\");\n reloadingText.setFill(Color.LIMEGREEN);\n }\n }", "public void frogDeath(long now, String type) {\n\t\tString car = \"car\";\n\t\tString water = \"water\";\n\t\tdeath = true;\n\n\t\tfinal Image[] cardeath = new Image[4];\n\t\tcardeath[0] = new Image(\"file:src/main/resources/Img/cardeath1.png\", FrogImgSize, FrogImgSize, true, true);\n\t\tcardeath[1] = new Image(\"file:src/main/resources/Img/cardeath2.png\", FrogImgSize, FrogImgSize, true, true);\n\t\tcardeath[2] = new Image(\"file:src/main/resources/Img/cardeath3.png\", FrogImgSize, FrogImgSize, true, true);\n\t\tcardeath[3] = new Image(\"file:src/main/resources/Img/cardeath3.png\", FrogImgSize, FrogImgSize, true, true);\n\n\t\tfinal Image[] waterdeath = new Image[4];\n\t\twaterdeath[0] = new Image(\"file:src/main/resources/Img/waterdeath1.png\", FrogImgSize, FrogImgSize, true, true);\n\t\twaterdeath[1] = new Image(\"file:src/main/resources/Img/waterdeath2.png\", FrogImgSize, FrogImgSize, true, true);\n\t\twaterdeath[2] = new Image(\"file:src/main/resources/Img/waterdeath3.png\", FrogImgSize, FrogImgSize, true, true);\n\t\twaterdeath[3] = new Image(\"file:src/main/resources/Img/wwaterdeath4.png\", FrogImgSize, FrogImgSize, true, true);\n\n\t\tImage[] array = new Image[4];\n\t\tif (type == car)\n\t\t\tarray = cardeath;\n\t\tif (type == water)\n\t\t\tarray = waterdeath;\n\t\t\tif ((now) % 15 == 0) {\n\t\t\t\tthis.DeathAnimationTime++;\n\t\t\t}\n\t\t\tif (DeathAnimationTime == 1) {\n\t\t\t\tsetImage(array[0]);\n\t\t\t}\n\t\t\tif (DeathAnimationTime == 3) {\n\t\t\t\tsetImage(array[1]);\n\t\t\t}\n\t\t\tif (DeathAnimationTime == 5) {\n\t\t\t\tsetImage(array[2]);\n\t\t\t}\n\t\t\tif (DeathAnimationTime == 7) {\n\t\t\t\tsetImage(array[3]);\n\t\t\t}\n\t\t\tif (DeathAnimationTime == 9) {\n\t\t\t\tthis.lives -= 1;\n\t\t\t\tfrogReposition();\n\t\t\t\tintersectCar = false;\n\t\t\t\tintersectWater = false;\n\t\t\t\tthis.DeathAnimationTime = 0;\n\t\t\t\tsetImage(frog[0]);\n\t\t\t\tdeath = false;\n\t\t\t\taddPoints(-100);\n\n\n\t\t\t}\n\n\t\t}", "public void onFinish() {\n\n imageView_gif_confeti.setVisibility(View.INVISIBLE);\n }", "public GIFMaker to(String path);", "public void updateNotification(){\n Bitmap androidImage=BitmapFactory.decodeResource(getResources(),R.drawable.mascot_1);\n NotificationCompat.Builder notifyBuilder=getNotificationBuilder();\n notifyBuilder.setStyle(new NotificationCompat.BigPictureStyle().bigPicture(androidImage).setBigContentTitle(\"Notificacion actualizada!\"));\n mNotifyManager.notify(NOTIFICATION_ID,notifyBuilder.build());\n setNotificationButtonState(false, false, true);\n\n }", "@Override\n public void onRefresh() {\n OnSwipeRefreshed();\n\n try {\n Field f = swipeRefreshLayout.getClass().getDeclaredField(\"mCircleView\");\n f.setAccessible(true);\n ImageView img = (ImageView)f.get(swipeRefreshLayout);\n\n RotateAnimation rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);\n rotate.setRepeatMode(Animation.INFINITE);\n rotate.setDuration(1000);\n rotate.setRepeatCount(5);\n rotate.setInterpolator(new LinearInterpolator());\n img.startAnimation(rotate);\n } catch (NoSuchFieldException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n }", "@RequestMapping(\"/gifs/{gifId}.gif\")\n @ResponseBody\n public byte[] gifImage(@PathVariable Long gifId) {\n return gifService.findById(gifId).getBytes();\n }", "@Override\n public void onResourceReady(File image,\n GlideAnimation<? super File> glideAnimation) {\n callback.onCacheHit(image);\n }" ]
[ "0.6263407", "0.56667", "0.56414366", "0.56135684", "0.54923713", "0.5454781", "0.53295106", "0.5295564", "0.5275467", "0.527118", "0.5269408", "0.52624524", "0.52289546", "0.52047586", "0.51896286", "0.518583", "0.5142663", "0.51383173", "0.51310486", "0.51282793", "0.50988156", "0.5098159", "0.5090871", "0.5084824", "0.50728667", "0.5072216", "0.5062832", "0.5041765", "0.5038971", "0.50348747", "0.50330925", "0.50308704", "0.5030481", "0.5030018", "0.5018146", "0.50083524", "0.5004494", "0.50013703", "0.49991226", "0.4996882", "0.49960235", "0.49943468", "0.49934614", "0.4981012", "0.49777332", "0.49726057", "0.4946775", "0.4944849", "0.49420384", "0.49337265", "0.49328622", "0.49232236", "0.49071684", "0.4903414", "0.4897407", "0.48959896", "0.48946643", "0.48761156", "0.4863237", "0.4863024", "0.48612323", "0.48586956", "0.48526016", "0.4849508", "0.4843438", "0.48424184", "0.48340636", "0.48325923", "0.48311725", "0.48300904", "0.48282817", "0.48125765", "0.48100945", "0.48092255", "0.47986767", "0.47957057", "0.4793706", "0.4789057", "0.47871268", "0.47805664", "0.47779614", "0.47768068", "0.47768068", "0.4774396", "0.47723052", "0.47697416", "0.47632217", "0.47609338", "0.4759626", "0.4758476", "0.4756002", "0.47520608", "0.47496817", "0.47400853", "0.4731334", "0.47283158", "0.47267458", "0.47240517", "0.4722652", "0.4722328" ]
0.79021823
0
Created by john on 2017/7/22.
public interface LogPrintListener extends EventListener { public void LogPrintHandle(LogPrintEvent event); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n public void func_104112_b() {\n \n }", "private void poetries() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "private void strin() {\n\n\t}", "public void mo38117a() {\n }", "private void m50366E() {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "private void kk12() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "public void method_4270() {}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "public void mo21877s() {\n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "public void mo4359a() {\n }", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n\tpublic void jugar() {}", "@Override\n public void memoria() {\n \n }", "Consumable() {\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 }", "private void getStatus() {\n\t\t\n\t}", "private void test() {\n\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override public int describeContents() { return 0; }", "private test5() {\r\n\t\r\n\t}", "@Override\n public void init() {\n\n }", "public void mo12930a() {\n }", "@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}", "public static void listing5_14() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "public abstract void mo70713b();", "static void feladat9() {\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n protected void initialize() {\n\n \n }", "Petunia() {\r\n\t\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "static void feladat4() {\n\t}", "public void mo21878t() {\n }", "@Override\n public int describeContents() {\n// ignore for now\n return 0;\n }", "private void init() {\n\n\t}", "public abstract void mo56925d();", "public void mo55254a() {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "public Pitonyak_09_02() {\r\n }", "static void feladat7() {\n\t}", "@Override\n void init() {\n }", "public void mo6081a() {\n }", "private final zzgy zzgb() {\n }", "@Override\n public void init() {\n }", "public void mo21792Q() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "public void m23075a() {\n }", "public void mo21779D() {\n }", "public void mo21785J() {\n }", "private void level7() {\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "public void smell() {\n\t\t\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "private MetallicityUtils() {\n\t\t\n\t}", "@Override\n public int describeContents()\n {\n return 0;\n }", "public abstract String mo13682d();" ]
[ "0.57868195", "0.57471", "0.5636152", "0.5617032", "0.5580901", "0.55065215", "0.5436729", "0.5434059", "0.54235786", "0.54207534", "0.5396065", "0.5364965", "0.53535795", "0.53535795", "0.53532743", "0.53249145", "0.5320671", "0.5317266", "0.5309001", "0.5283421", "0.5280948", "0.5271433", "0.52698016", "0.52544045", "0.5251297", "0.5244449", "0.5237955", "0.52299213", "0.5225878", "0.5215577", "0.5205783", "0.5172649", "0.5166049", "0.5155264", "0.51355124", "0.51313734", "0.5118363", "0.51113534", "0.51065034", "0.5101016", "0.51000106", "0.5087938", "0.5087938", "0.5087938", "0.5087938", "0.5087938", "0.5087938", "0.5087938", "0.5081564", "0.5079453", "0.50685114", "0.5063906", "0.5059574", "0.50593376", "0.5045335", "0.5045205", "0.50448483", "0.50432414", "0.5038336", "0.50298214", "0.50255495", "0.5023609", "0.5023609", "0.502126", "0.5014412", "0.50130916", "0.5009483", "0.5007798", "0.50067717", "0.49998996", "0.49981308", "0.4997741", "0.49912786", "0.4987504", "0.49864262", "0.4985178", "0.49841592", "0.4983294", "0.4981855", "0.49808437", "0.49751696", "0.49730882", "0.49730882", "0.49730882", "0.49730882", "0.49730882", "0.49730882", "0.4967658", "0.49674046", "0.49668887", "0.49605468", "0.49605036", "0.49605036", "0.49605036", "0.49605036", "0.49605036", "0.4960158", "0.4953376", "0.49529868", "0.49496666", "0.49480766" ]
0.0
-1
Remove edit and delete menubar item.
public void removeEditAndDelete(List<MenubarItem> menubar, DocumentType documentType, Document document, PortalControllerContext portalControllerContext) throws PortletException{ if ((documentType != null) && EVENT_TYPE.equals(documentType.getName())) { Set<MenubarItem> removedItems = new HashSet<>(); for (MenubarItem menubarItem : menubar) { if (EDIT_MENUBAR_ITEM_ID.equals(menubarItem.getId()) || DELETE_MENUBAR_ITEM_ID.equals(menubarItem.getId())) { removedItems.add(menubarItem); } } menubar.removeAll(removedItems); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void removeMenuItem(int itemId, String itemName);", "MenuItem getMenuItemDelete();", "private void addRemoveButton() {\n\t\tremoveButton.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tmenuBar.remove(removeButton);\n\t\t\t\tmenuBar.revalidate();\n\t\t\t\tif (viewMode == 2) {\n\t\t\t\t\tuserData.removeByIndex(\"history\", list.getSelectedIndex());\n\t\t\t\t\tlistModel.removeElementAt(list.getSelectedIndex());\n\t\t\t\t} else if (viewMode == 3) {\n\t\t\t\t\tuserData.removeByIndex(\"bookmarks\", list.getSelectedIndex());\n\t\t\t\t\tlistModel.removeElementAt(list.getSelectedIndex());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tmenuBar.add(removeButton);\n\t\tmenuBar.revalidate();\n\t}", "public void deleteMenuItem() {\n\t\tviewMenu();\n\n\t\t//Clean arraylist so that you can neatly add data from saved file\n\t\tmm.clear();\n\t\t\n\t\tString delID;\n\n\t\tScanner delSC = new Scanner(System.in);\n\n\t\tSystem.out.println(\"Menu ID to Delete : \");\n\t\tdelID = delSC.next();\n\t\t\n\t\ttry \n\t\t{\n\t\t\t// Get data contents from saved file\n\t\t\tFileInputStream fis = new FileInputStream(\"menuData\");\n ObjectInputStream ois = new ObjectInputStream(fis);\n \n mm = (ArrayList<AlacarteMenu>) ois.readObject();\n mm.removeIf(menuItem -> menuItem.getMenuName().equals(delID.toUpperCase()));\n \n ois.close();\n fis.close();\n \n try {\n \tFileOutputStream fos = new FileOutputStream(\"menuData\");\n\t\t\t\tObjectOutputStream oos = new ObjectOutputStream(fos);\n\t\t\t\toos.writeObject(mm);\n\t\t\t\toos.close();\n\t\t\t\tfos.close();\n }\n catch (IOException e) {\n \t\t\tSystem.out.println(\"Error deleting menu item!\");\n \t\t\treturn;\n \t\t}\n\t\t} \n\t\tcatch (IOException e) {\n\t\t\t//System.out.println(\"No menu items found!\");\n\t\t\tSystem.out.format(\"+------------+---------------------------------------+-------+--------------+%n\");\n\t\t\tSystem.out.format(\"| Menu ID | Description | Price | Type |%n\");\n\t\t\tSystem.out.format(\"+------------+---------------------------------------+-------+--------------+%n\");\n\t\t\treturn;\n\t\t}\n\t\tcatch (ClassNotFoundException c) {\n\t\t\tc.printStackTrace();\n\t\t\treturn;\n\t\t}\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_editor, menu);\n MenuItem deleteItem = menu.findItem(R.id.delete);\n deleteItem.setVisible(false);\n return true;\n }", "public void removeMenuItem(MenuItem oldMenuItem){\n databaseGargoyle.createConnection();\n databaseGargoyle.executeUpdateOnDatabase(\"DELETE FROM MENUITEM WHERE \" +\n \"FOODNAME = '\" + oldMenuItem.getFoodName() + \"'\");\n databaseGargoyle.destroyConnection();\n }", "public void remove() {\n/* 1379 */ super.remove();\n/* 1380 */ this.inventoryMenu.removed(this);\n/* 1381 */ if (this.containerMenu != null) {\n/* 1382 */ this.containerMenu.removed(this);\n/* */ }\n/* */ }", "protected void addEditMenuItems (JMenu edit)\n {\n }", "private void removeNonCaleydoMenuEntries() {\n \t\tIMenuManager menuManager = getWindowConfigurer().getActionBarConfigurer()\n \t\t\t\t.getMenuManager();\n \t\tfor (IContributionItem item : menuManager.getItems()) {\n \n \t\t\tif (!item.getId().contains(\"org.caleydo\")) {\n \t\t\t\tmenuManager.remove(item);\n \t\t\t}\n \t\t}\n \n \t\tif (DataDomainManager.get().getDataDomainByID(\"org.caleydo.datadomain.generic\") != null) {\n \n \t\t\tIActionBarConfigurer configurer = getWindowConfigurer().getActionBarConfigurer();\n \n \t\t\t// Delete unwanted menu items\n \t\t\tIContributionItem[] menuItems = configurer.getMenuManager().getItems();\n \t\t\tfor (int i = 0; i < menuItems.length; i++) {\n \t\t\t\tIContributionItem menuItem = menuItems[i];\n \t\t\t\tif (menuItem.getId().equals(\"org.caleydo.search.menu\")) {\n \t\t\t\t\tconfigurer.getMenuManager().remove(menuItem);\n \t\t\t\t}\n \t\t\t\telse if (menuItem.getId().equals(\"viewMenu\")) {\n \t\t\t\t\tIContributionItem itemToRemove = ((MenuManager) menuItem)\n \t\t\t\t\t\t\t.find(\"org.caleydo.core.command.openviews.remote\");\n \n \t\t\t\t\tif (itemToRemove != null)\n \t\t\t\t\t\titemToRemove.setVisible(false);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case R.id.salvarContato:\n salvar();\n return true;\n case R.id.delContato:\n mFireBaseRef.child(firebaseID).removeValue();\n Toast.makeText(getApplicationContext(),\"Removido com sucesso\",Toast.LENGTH_SHORT).show();\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n menu.add(\"Edit record \");\n menu.add(\"delete\");\n return super.onCreateOptionsMenu(menu);\n }", "ReturnCode deleteMenus(MmtConfig cfg);", "@Test\n public void testMenuFactoryRemove() {\n Menu menuController = menuFactory.getMenu();\n menuController.addMenuItem(MENU_NAME, MENU_PRICE, MENU_TYPE, MENU_DESCRIPTION);\n menuController.removeMenuItem(1);\n assertEquals(0, menuController.getMenu().size());\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_mainlst, menu);\n menu.removeItem(R.id.action_Add);\n return true;\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tswitch(id){\n\t\tcase R.id.action_settings:\n\t\t\treturn true;\n\t\t\t\n\t\tcase R.id.delete_all:\n\t\t\t//TODO delete all the tags!\n\t\t\treturn true;\n\t\t\t\n\t\tcase R.id.action_add:\n\t\t\tLog.i(TAG, \"add-button pressend\");\n\t\t\tnewEntry();\t\t\t\n\t\t\treturn true;\n\t\t\t\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_admin, menu);\n this.menu = menu;\n menu.findItem(R.id.action_editar).setVisible(false);\n return true;\n }", "private void deleteTodoMenu(User u) {\n\t\t\n\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tItemType i = getSelectedItem();\n\t\t\t\tif(i != null)\n\t\t\t\t{\t\n\n\t\t\t\t\tfinal String msg = \"Delete \"+i.getName() + \"?\";\n\t\t\t\t\tif(!confirmDelete(msg))\n\t\t\t\t\t\treturn;\n\t\t\t\t\ti.removeContainer(GeneralItemList.this);\n\t\t\t\t\ti.destroy();\n\t\t\t\t}\n\t\t\t\titems.remove(i);\n\t\t\t\tlist.clearSelection();\n\t\t\t\tlist.repaint(100);\t\t\t\t\n\t\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.clear_lists) {\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id=item.getItemId();\n\t\tif(id==R.id.menu_settings){\n\t\t\tSqliteUtils su=new SqliteUtils(this);\n\t\t\tSQLiteDatabase db=su.getWritableDatabase();\n\t\t\tdb.execSQL(\"drop table citylist\");\n\t\t\tsu.onCreate(db);\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "private void deleteJMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteJMenuItemActionPerformed\n // TODO add your handling code here:\n int index = employeeJComboBox.getSelectedIndex();\n employeeJComboBox.removeItemAt(index);\n employees.remove(index);\n saveEmployee();\n clearAll();\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.reset) {\n ((Button) findViewById(R.id.faces)).setText(\"6\");\n ((Button) findViewById(R.id.dices)).setText(\"2\");\n vista.removeAllViews();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public void removeChild( Element e ) {\n if ( e instanceof XulMenuitem ) {\n // System.out.println( \"removing menu item: \"+((XulMenuitem)e).getLabel() );\n }\n if ( e instanceof XulMenupopup ) {\n // System.out.println( \"removing menu popup: \"+((XulMenupopup)e).getId() );\n }\n if ( e instanceof XulMenu ) {\n // System.out.println( \"removing menu: \"+((XulMenu)e).getId() );\n }\n }", "private JMenuItem getJMenuItemEliminarCamara() {\r\n\t\tif (jMenuItemEliminarCamara == null) {\r\n\t\t\tjMenuItemEliminarCamara = new JMenuItemDeleteCameraPopup();\r\n\t\t\tjMenuItemEliminarCamara.setText(\"Eliminar\");\r\n\t\t\tjMenuItemEliminarCamara.setFont(new java.awt.Font(\"Dialog\", java.awt.Font.PLAIN, 12));\r\n\t\t\tjMenuItemEliminarCamara.addActionListener(getParent());\r\n\t\t}\r\n\t\treturn jMenuItemEliminarCamara;\r\n\t}", "@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n if (id == R.id.action_logout) {\n prefrenceEdit.clear();\n prefrenceEdit.commit();\n mIntent=new Intent(this,MainActivity.class);\n mIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(mIntent);\n finish();\n return true;\n }else if(id==R.id.action_file){\n mIntent=new Intent(this,NewsActivity.class);\n startActivity(mIntent);\n\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_editor, menu);\n //Hiding Delete Menu option for Add Item\n if (mCurrentItemInfoUri == null) {\n MenuItem deleteMenuItem = menu.findItem(R.id.action_delete);\n deleteMenuItem.setVisible(false);\n }\n return true;\n }", "Menu getMenuEdit();", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case R.id.action_add:\n return true;\n case R.id.action_clear:\n mViewMaster.toolbarClear();\n return true;\n case R.id.action_save:\n mViewMaster.saveDialog();\n return true;\n case android.R.id.home:\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_edit_evento_pessoa, menu);\r\n menu.findItem(R.id.action_save).setVisible(false);\r\n this.mInterno = menu;\r\n\r\n getSupportActionBar().setDisplayHomeAsUpEnabled(true);\r\n\r\n return true;\r\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\tmenu.add(0, MENU_OPTION_DELETE, 0, R.string.delete);\n\t\t\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n \tswitch (item.getItemId()) {\r\n case R.id.menu_clear:\r\n getContentResolver().delete(BroadcastSchema.BroadcastTable.CONTENT_URI, null, null);\r\n \tbreak;\r\n case R.id.menu_exit:\r\n \tfinish();\r\n \tbreak;\r\n \tdefault:\r\n \t\treturn super.onOptionsItemSelected(item);\r\n \t}\r\n \t\r\n \treturn true;\r\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 clearMenuItems() {\n menuItemNames.clear();\n menuItemPrices.clear();\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.clear_log) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"提示\");\n builder.setMessage(\"确定要删除记录吗?\");\n builder.setPositiveButton(\"确定\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n dao.clear();\n if (adapter != null) {\n adapter.clear();\n }\n }\n });\n builder.setNegativeButton(\"取消\", null);\n Dialog dialog = builder.create();\n dialog.setCanceledOnTouchOutside(false);\n dialog.show();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case R.id.miDelete:\n deleteGroup();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_add) {\n Intent addActIntent = new Intent(this, AddNoteActivity.class);\n finish();\n startActivity(addActIntent);\n return true;\n }\n if (id == R.id.action_save) {\n return true;\n }\n if (id == R.id.action_edit) {\n Intent editActIntent = new Intent(this, NotesActivity.class);\n editActIntent.putExtra(\"Notes\", noteList.get(positionSelected));\n finish();\n startActivity(editActIntent);\n return true;\n }\n if (id == R.id.action_delete) {\n return true;\n }\n if (id == R.id.action_back) {\n noteDataSource.deleteNote(noteList.get(positionSelected));\n noteAdapter.remove( noteList.get(positionSelected) );\n noteAdapter.notifyDataSetChanged();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "public boolean onOptionsItemSelected(MenuItem item) {\n switch(item.getItemId()){\n case R.id.delete:\n delete();\n return true;\n case R.id.edit:\n edit();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\r\n\t\tif(android.R.id.home == id)\r\n \t{ \t\r\n \t\tstartActivityAfterCleanup(AgregarUser.class);\r\n return true;\r\n \t}\r\n\t\tif (id == R.id.action_new) {\r\n\t\t\tguardar();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onCreateActionMode(ActionMode mode, Menu menu) {\n // Inflate a menu resource providing context menu items\n ((MainActivity) getActivity()).getSupportActionBar().hide();\n MenuInflater inflater = mode.getMenuInflater();\n inflater.inflate(R.menu.menu_delete, menu);\n return true;\n }", "@Test\n public void testSetMenuFactoryRemoveSetMenuItem() {\n SetMenu setMenuController = setMenuFactory.getSetMenu();\n Menu menuController = menuFactory.getMenu();\n menuController.addMenuItem(MENU_NAME, MENU_PRICE, MENU_TYPE, MENU_DESCRIPTION);\n ArrayList<MenuItem> menuItems = new ArrayList<>();\n menuItems.add(menuController.getMenuItem(1));\n setMenuController.addSetItem(\"Test Set\", 5.0, 1, menuItems);\n setMenuController.removeSetItem(1);\n assertEquals(0, setMenuController.getSetMenu().size());\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.DeleteAll) {\n db.deleteEmployee();\n\n return true;\n }\n if (id == R.id.Search) {\n Intent intent=new Intent(this, Search.class);\n startActivity(intent);\n\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {\n menu.add(0, getAdapterPosition(),0,\"DELETE\");\n // Log.d(TAG, \"onCreateContextMenu: \" + );\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_detalhe, menu);\n if(firebaseID == null){\n MenuItem item = menu.findItem(R.id.delContato);\n item.setVisible(false);\n }\n return true;\n }", "private void clearJMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearJMenuItemActionPerformed\n // TODO add your handling code here:\n listModel.clear();\n printJMenuItem.setEnabled(false);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n\r\n case MENU_CLEAR_ID:\r\n editText1.setText(\"\");\r\n editText2.setText(\"\");\r\n textView.setText(\"\");\r\n break;\r\n\r\n case MENU_QIET_ID:\r\n finish();\r\n break;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@FXML\n void removeAction(ActionEvent event) {\n\n cm.setAutoHide(true);\n\n //Creates menuItems and adds listeners\n MenuItem removeQueue = new MenuItem(\"From queue\");\n removeQueue.setOnAction(this::removeFromQueue);\n MenuItem removeNotes = new MenuItem(\"Notes\");\n removeNotes.setOnAction(this::deleteNotes);\n MenuItem deletePod = new MenuItem(\"Delete podcast\");\n deletePod.setOnAction(this::deletePodcast);\n MenuItem deleteMP3 = new MenuItem(\"Delete MP3 file\");\n deleteMP3.setOnAction(this::deletePodcastMP3);\n\n //Removes all previous options from contextMenu\n cm.getItems().clear();\n\n //Based on the properties of the podcast will determine which options pop-up\n if(podcast.isQueued()){\n cm.getItems().add(removeQueue);\n }\n if(podcast.hasNotes()){\n cm.getItems().add(removeNotes);\n }\n if(podcast.hasNotes() || podcast.isQueued()){\n cm.getItems().add(new SeparatorMenuItem());\n }\n cm.getItems().addAll(deleteMP3, deletePod);\n\n if(!cm.isShowing()) {\n removeBtn.addEventHandler(MouseEvent.MOUSE_CLICKED, mouseEvent -> cm.show(removeBtn, mouseEvent.getScreenX()\n , mouseEvent.getScreenY()));\n }\n }", "public void deleteItem(ActionEvent actionEvent) {\n // find the list that the item belongs in\n // removeItem() from its parenting list\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == R.id.action_settings) {\n return true;\n }\n if (id == R.id.logout_action_bar){\n logout();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onContextItemSelected(MenuItem item) {\n int id=item.getItemId();\n AdapterView.AdapterContextMenuInfo info =(AdapterView.AdapterContextMenuInfo) item.getMenuInfo();\n final int index=info.position;\n if (id == R.id.m_editar) {\n editar(index);\n }else {\n if (id == R.id.m_borrar) {\n datos.remove(index);\n ad.notifyDataSetChanged();\n }\n }\n return super.onContextItemSelected(item);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n super.onCreateOptionsMenu(menu);\n int group = 1;\n item1 = menu.add(group, 1, 1, \"清除用户\");\n\n //SharedPreferences userSettings= getSharedPreferences(\"setting\",0);\n //int option = userSettings.getInt(\"option\",1);\n //menu.setGroupCheckable(group,true,true);\n /*switch (option){\n case 1:\n item1.setChecked(true);\n break;\n }*/\n\n return true;\n\n }", "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 }", "public void buttonRemoveItem(ActionEvent actionEvent) {\n }", "private void undoPopItemActionPerformed(java.awt.event.ActionEvent evt) {\n undoredo.undo();\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_delete) {\n// DatabaseHelper helper = DatabaseHelper.getInstance(this);\n switch (type) {\n case AUTHOR:\n DatabaseAuthor authorDb = new DatabaseAuthor(this);\n authorDb.deleteAuthor(author);\n break;\n case SERIES:\n DatabaseSeries seriesDb = new DatabaseSeries(this);\n seriesDb.deleteSeries(series);\n break;\n case STATUS:\n DatabaseStatus statusDb = new DatabaseStatus(this);\n statusDb.deleteStatus(status);\n break;\n case EDITOR:\n DatabasePublisher publisherDb = new DatabasePublisher(this);\n publisherDb.deletePublisher(publisher);\n break;\n }\n finish();\n return true;\n } else if (id == R.id.action_edit) {\n Log.i(TAG, \"Indo para StandardForm\");\n Intent intent = new Intent(this, StandardFormActivity.class);\n intent.putExtra(\"logged_user\", user);\n intent.putExtra(\"Type\", type);\n switch (type) {\n case AUTHOR:\n intent.putExtra(\"Author\", author);\n break;\n case SERIES:\n intent.putExtra(\"Series\", series);\n break;\n case STATUS:\n intent.putExtra(\"Status\", status);\n break;\n case EDITOR:\n intent.putExtra(\"Publisher\", publisher);\n break;\n }\n startActivity(intent);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "private void removeJMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeJMenuItemActionPerformed\n removeJButton.doClick();\n }", "@Override\n\tpublic void deleteMenus(int parseInt) {\n\t\trd.deleteMenus(parseInt);\n\t}", "private void popupDelete() {\n\t\taufzugschacht.removeElement(this);\n\t}", "@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n if (item.getItemId() == R.id.delete_bite) {\n removeBiteDialog();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int menuItem = item.getItemId();\n switch (menuItem) {\n case R.id.action_save_symptom:\n saveRecord();\n finish(); // exit activity\n return true;\n case R.id.action_delete_symptom:\n // Alert Dialog for deleting one record;\n showDeleteConfirmationDialogFragment();\n // deleteRecord();\n return true;\n // this is the <- button on the toolbar\n case android.R.id.home:\n // record has not changed\n if (!mEditSymptomChanged) {\n NavUtils.navigateUpFromSameTask(EditSymptomActivity.this);\n return true;\n }\n\n // show user they have unsaved changes\n mHomeChecked = true;\n showUnsavedChangesDialogFragment();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n\t\t\t\t\tpublic void onCreateContextMenu(ContextMenu menu, View v,\n\t\t\t\t\t\t\tContextMenuInfo menuInfo) {\n\t\t\t\t\t\tmenu.add(0, 0, 0, \"更新\");\n\t\t\t\t\t\tmenu.add(0, 1, 0, \"删除\");\n\t\t\t\t\t}", "void supprimerMenu(int numeroArticle);", "public JMenuBar createMenuBar ()\n {\n MenuListener menuListener = new MenuListener ();\n\t //-----------------------------Menu options.--------------------------------------------------------------\n JMenu fileMenu = new JMenu (\"File\");\n JMenu editMenu = new JMenu (\"Edit\");\n JMenu viewMenu = new JMenu (\"View\");\n JMenu colorMenu = new JMenu (\"Colors\");\n JMenu filterMenu = new JMenu (\"Filter\");\n JMenu helpMenu = new JMenu (\"Help\");\n\n //----------------------------Submenu options.-------------------------------------------------------------\n JMenuItem newMenuItem = new JMenuItem (\"New\",new ImageIcon(\"../img/new.gif\"));\n newMenuItem.addActionListener (menuListener);\n newMenuItem.setEnabled (true);\n\n JMenuItem openMenuItem = new JMenuItem (\"Open\",new ImageIcon(\"../img/open.gif\"));\n openMenuItem.addActionListener (menuListener);\n openMenuItem.setEnabled (true);\n\n JMenuItem saveMenuItem = new JMenuItem (\"Save\",new ImageIcon(\"../img/save.gif\"));\n saveMenuItem.addActionListener (menuListener);\n saveMenuItem.setEnabled (true);\n \n JMenuItem exitMenuItem = new JMenuItem (\"Exit\",new ImageIcon(\"../img/close.gif\"));\n exitMenuItem.addActionListener (menuListener);\n exitMenuItem.setEnabled (true);\n \n fileMenu.add (newMenuItem);\n fileMenu.add (openMenuItem);\n fileMenu.add (saveMenuItem);\n fileMenu.add (exitMenuItem);\n\n //---------------------------------------------End of File Menu--------------------------------------------\n JMenuItem undoMenuItem = new JMenuItem (\"Undo\",new ImageIcon(\"../img/undo.gif\"));\n undoMenuItem.addActionListener (menuListener);\n undoMenuItem.setEnabled (true);\n\n JMenuItem redoMenuItem = new JMenuItem (\"Redo\",new ImageIcon(\"../img/redo.gif\"));\n redoMenuItem.addActionListener (menuListener);\n redoMenuItem.setEnabled (true);\n\n JMenuItem clearMenuItem = new JMenuItem (\"Clear All\",new ImageIcon(\"../img/clear.gif\"));\n clearMenuItem.addActionListener (menuListener);\n clearMenuItem.setEnabled (true);\n\n editMenu.add (undoMenuItem);\n editMenu.add (redoMenuItem);\n editMenu.add (clearMenuItem);\n\n //----------------------------------------End of Edit Menu-------------------------------------------------\n JMenuItem toolboxMenuItem = new JMenuItem (\"Tool Box\",new ImageIcon(\"../img/tool.gif\"));\n toolboxMenuItem.addActionListener(menuListener);\n toolboxMenuItem.setEnabled (true);\n\n JMenuItem colorboxMenuItem = new JMenuItem (\"Color Box\",new ImageIcon(\"../img/cbox.gif\"));\n colorboxMenuItem.addActionListener(menuListener);\n colorboxMenuItem.setEnabled (true);\n\n JMenuItem cursorMenuItem = new JMenuItem (\"Cursor Position\",new ImageIcon(\"../img/pos.gif\"));\n cursorMenuItem.addActionListener(menuListener);\n cursorMenuItem.setEnabled (true);\n \n viewMenu.add (toolboxMenuItem);\n viewMenu.add (colorboxMenuItem);\n viewMenu.add (cursorMenuItem);\n\n //--------------------------------------End of View Menu-------------------------------------------------- \n JMenuItem editcolorMenuItem = new JMenuItem (\"Edit Colors\",new ImageIcon(\"../img/color.gif\"));\n editcolorMenuItem.addActionListener(menuListener);\n editcolorMenuItem.setEnabled (true);\n \n colorMenu.add (editcolorMenuItem);\n\n //------------------------------------End of Color Menu--------------------------------------------------- \n JMenuItem brightnessMenuItem = new JMenuItem (\"Brightness\",new ImageIcon(\"../img/bright.gif\"));\n brightnessMenuItem.addActionListener(menuListener);\n brightnessMenuItem.setEnabled (true);\n \n JMenuItem blurMenuItem = new JMenuItem (\"Blur\",new ImageIcon(\"../img/blur.gif\"));\n blurMenuItem.addActionListener(menuListener);\n blurMenuItem.setEnabled (true);\n \n filterMenu.add (brightnessMenuItem);\n filterMenu.add (blurMenuItem);\n\n //--------------------------------------End of Filter Menu------------------------------------------------ \n JMenuItem helpMenuItem = new JMenuItem (\"Help Topics\",new ImageIcon(\"../img/help.gif\"));\n helpMenuItem.addActionListener(menuListener);\n helpMenuItem.setEnabled (true); \n JMenuItem aboutMenuItem = new JMenuItem (\"About Multi Brush\",new ImageIcon(\"../img/license.gif\"));\n aboutMenuItem.addActionListener(menuListener);\n aboutMenuItem.setEnabled (true);\n \n helpMenu.add (helpMenuItem);\n helpMenu.add (aboutMenuItem);\n\n //-----------------------------------------End of Help Menu----------------------------------------------- \t \n JMenuBar menubar = new JMenuBar ();\n menubar.add (fileMenu);\n menubar.add (editMenu);\n menubar.add (viewMenu);\n menubar.add (colorMenu);\n //menubar.add (filterMenu);\n menubar.add (helpMenu);\n\n return menubar;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case R.id.action_delete_all_entries:\n deleteAllBooks();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@FXML\r\n\tpublic void deleteItem() {\r\n\t\tcontroller.deleteWishlistItem(listView.getSelectionModel().getSelectedItem().getId());\r\n\t\tlistView.setItems(controller.getWishlistWatchesForCurrentUser());\r\n\t\tlistView.getSelectionModel().select(-1);\r\n\t}", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n menu.removeItem(R.id.action_settings);\n return super.onPrepareOptionsMenu(menu);\n }", "@FXML\n void exitDeleteWindow() {\n\n// lists Elements in default mode\n drawMenuElements(false);\n\n// adds all main buttons, removes confirm and cancel buttons for delete\n toggleMenuButtonVisibility(true);\n toggleDeleteButtonVisibility(false);\n\n// creates a message for the user\n setMessage(\"Exited Delete Mode without deleting elements\", false);\n window.setTitle(\"Timelines: Menu\");\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n MenuItem item = menu.findItem(R.id.action_add_to_favorites);\n item.setVisible(false);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch (id) {\n case android.R.id.home: {\n finish();\n return true;\n }\n case R.id.action_clear: {\n AlertDialog dialog = new AlertDialog.Builder(this)\n .setTitle(\"Delete all Items\")\n .setMessage(\"Are you sure you want to Clear all items?\")\n .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n WillowRidge.getInstance().getUser().getEvents().clear();\n adapter.notifyDataSetChanged();\n }\n\n })\n .setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n\n }\n })\n\n .setIcon(android.R.drawable.ic_dialog_alert)\n .show();\n return true;\n }\n\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == R.id.history) {\n\t\t\tMainActivity.storiesList.clear();\n\t\t\tSharedPreferences sharedpreferences = getSharedPreferences(MainActivity.MY_PREFERENCES, Context.MODE_PRIVATE);\n\t\t\tEditor editor = sharedpreferences.edit();\n\t\t\teditor.putString(MainActivity.SHARED_PREFERENCES_KEY, \"\");\n\t\t\teditor.commit();\n\t\t\tToast.makeText(StoriesActivity.this, getResources().getString(R.string.clear_favorites), Toast.LENGTH_SHORT).show();\n\t\t\trecreate();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "MenuItem getMenuItemClose();", "public void resetToolbar() {\n ((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(\"\");\n myMenu.findItem(R.id.share).setVisible(false);\n myMenu.findItem(R.id.delete).setVisible(false);\n }", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\tremoveItem(ItemPanel.this);\n\t\t\t\t}", "public void removeItem() {\r\n\t\tlog.info(\"Remove item\");\r\n\t\tsu.waitElementClickableAndClick(LocatorType.Xpath, CartSplitViewField.Remove.getName());\r\n\t}", "public void removeMenuItem(int iId, String iName) {\n iMenu.removeMenuItem(iId, iName);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_settings) {\n return true;\n }\n\n\n switch (item.getItemId()) {\n case R.id.delete_all_:\n mProjectViewmodel.deleteAll();\n Toast.makeText(this, \"All projects deleted\", Toast.LENGTH_SHORT).show();\n\n default:\n return super.onOptionsItemSelected(item);\n\n }\n }", "public boolean delete(int menuId);", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\t\tswitch (item.getItemId()) {\t\t\t\t\t\n\t\t\t\tcase R.id.back:\n\t\t\t\t\tback();\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tcase R.id.edit:\n\t\t\t\t\tedit();\n\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case R.id.pesquisar:\n Toast.makeText(getApplicationContext(), \"Localizar\", Toast.LENGTH_LONG).show();\n return true;\n case R.id.adicionar:\n incluir(getCurrentFocus());\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n // R.menu.mymenu is a reference to an xml file named mymenu.xml which should be inside your res/menu directory.\n // If you don't have res/menu, just create a directory named \"menu\" inside res\n getMenuInflater().inflate(R.menu.delete_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "private static MenuItem createRemoveLibraryMenuItem(SongManager model,\n DatabaseManager databaseManager,\n Item selectedItem) {\n MenuItem removeLibrary = new MenuItem(REMOVE_THIS_LIBRARY);\n\n removeLibrary.setOnAction((event) -> {\n if (selectedItem != null) {\n System.out.println(\"Remove library\");\n\n model.removeLibrary(selectedItem.getFile());\n String selectedItemPath = selectedItem.getFile().getAbsolutePath();\n\n if (model.getM_rightFolderSelected() != null) {\n String rightFolderPath = model.getM_rightFolderSelected().getAbsolutePath();\n boolean isLibraryInRight = rightFolderPath.equals(selectedItemPath) ||\n rightFolderPath.contains(selectedItemPath + File.separator);\n if (isLibraryInRight) {\n model.setM_rightFolderSelected(null);\n }\n }\n\n if (model.getM_selectedCenterFolder() != null) {\n String centerFolderPath = model.getM_selectedCenterFolder().getAbsolutePath();\n boolean isLibraryInCenter = centerFolderPath.equals(selectedItemPath) ||\n centerFolderPath.contains(selectedItemPath + File.separator);\n if (isLibraryInCenter) {\n System.out.println(\"SELECTED CENTER FOLDER REMOVED!!!\");\n model.setM_selectedCenterFolder(null);\n }\n }\n\n databaseManager.removeLibrary(\n selectedItemPath\n );\n FileActions libraryFileActions = new ConcreteFileActions(Action.REMOVE_FROM_VIEW, selectedItem.getFile());\n model.notifyLibraryObservers(libraryFileActions);\n }\n });\n\n return removeLibrary;\n }", "private void buildMenu() {\r\n\t\tJMenuBar mainmenu = new JMenuBar();\r\n\t\tsetJMenuBar(mainmenu);\r\n\r\n\t\tui.fileMenu = new JMenu(\"File\");\r\n\t\tui.editMenu = new JMenu(\"Edit\");\r\n\t\tui.viewMenu = new JMenu(\"View\");\r\n\t\tui.helpMenu = new JMenu(\"Help\");\r\n\t\t\r\n\t\tui.fileNew = new JMenuItem(\"New...\");\r\n\t\tui.fileOpen = new JMenuItem(\"Open...\");\r\n\t\tui.fileImport = new JMenuItem(\"Import...\");\r\n\t\tui.fileSave = new JMenuItem(\"Save\");\r\n\t\tui.fileSaveAs = new JMenuItem(\"Save as...\");\r\n\t\tui.fileExit = new JMenuItem(\"Exit\");\r\n\r\n\t\tui.fileOpen.setAccelerator(KeyStroke.getKeyStroke('O', InputEvent.CTRL_DOWN_MASK));\r\n\t\tui.fileSave.setAccelerator(KeyStroke.getKeyStroke('S', InputEvent.CTRL_DOWN_MASK));\r\n\t\t\r\n\t\tui.fileImport.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doImport(); } });\r\n\t\tui.fileExit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { dispose(); doExit(); } });\r\n\t\t\r\n\t\tui.fileOpen.addActionListener(new Act() {\r\n\t\t\t@Override\r\n\t\t\tpublic void act() {\r\n\t\t\t\tdoLoad();\r\n\t\t\t}\r\n\t\t});\r\n\t\tui.fileSave.addActionListener(new Act() {\r\n\t\t\t@Override\r\n\t\t\tpublic void act() {\r\n\t\t\t\tdoSave();\r\n\t\t\t}\r\n\t\t});\r\n\t\tui.fileSaveAs.addActionListener(new Act() {\r\n\t\t\t@Override\r\n\t\t\tpublic void act() {\r\n\t\t\t\tdoSaveAs();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tui.editUndo = new JMenuItem(\"Undo\");\r\n\t\tui.editUndo.setEnabled(undoManager.canUndo()); \r\n\t\t\r\n\t\tui.editRedo = new JMenuItem(\"Redo\");\r\n\t\tui.editRedo.setEnabled(undoManager.canRedo()); \r\n\t\t\r\n\t\t\r\n\t\tui.editCut = new JMenuItem(\"Cut\");\r\n\t\tui.editCopy = new JMenuItem(\"Copy\");\r\n\t\tui.editPaste = new JMenuItem(\"Paste\");\r\n\t\t\r\n\t\tui.editCut.addActionListener(new Act() { @Override public void act() { doCut(true, true); } });\r\n\t\tui.editCopy.addActionListener(new Act() { @Override public void act() { doCopy(true, true); } });\r\n\t\tui.editPaste.addActionListener(new Act() { @Override public void act() { doPaste(true, true); } });\r\n\t\t\r\n\t\tui.editPlaceMode = new JCheckBoxMenuItem(\"Placement mode\");\r\n\t\t\r\n\t\tui.editDeleteBuilding = new JMenuItem(\"Delete building\");\r\n\t\tui.editDeleteSurface = new JMenuItem(\"Delete surface\");\r\n\t\tui.editDeleteBoth = new JMenuItem(\"Delete both\");\r\n\t\t\r\n\t\tui.editClearBuildings = new JMenuItem(\"Clear buildings\");\r\n\t\tui.editClearSurface = new JMenuItem(\"Clear surface\");\r\n\r\n\t\tui.editUndo.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doUndo(); } });\r\n\t\tui.editRedo.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doRedo(); } });\r\n\t\tui.editClearBuildings.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doClearBuildings(true); } });\r\n\t\tui.editClearSurface.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doClearSurfaces(true); } });\r\n\t\t\r\n\r\n\t\tui.editUndo.setAccelerator(KeyStroke.getKeyStroke('Z', InputEvent.CTRL_DOWN_MASK));\r\n\t\tui.editRedo.setAccelerator(KeyStroke.getKeyStroke('Y', InputEvent.CTRL_DOWN_MASK));\r\n\t\tui.editCut.setAccelerator(KeyStroke.getKeyStroke('X', InputEvent.CTRL_DOWN_MASK));\r\n\t\tui.editCopy.setAccelerator(KeyStroke.getKeyStroke('C', InputEvent.CTRL_DOWN_MASK));\r\n\t\tui.editPaste.setAccelerator(KeyStroke.getKeyStroke('V', InputEvent.CTRL_DOWN_MASK));\r\n\t\tui.editPlaceMode.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0));\r\n\t\t\r\n\t\tui.editDeleteBuilding.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0));\r\n\t\tui.editDeleteSurface.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, InputEvent.CTRL_DOWN_MASK));\r\n\t\tui.editDeleteBoth.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));\r\n\t\t\r\n\t\tui.editDeleteBuilding.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doDeleteBuilding(); } });\r\n\t\tui.editDeleteSurface.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doDeleteSurface(); } });\r\n\t\tui.editDeleteBoth.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doDeleteBoth(); } });\r\n\t\tui.editPlaceMode.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doPlaceMode(ui.editPlaceMode.isSelected()); } });\r\n\t\t\r\n\t\tui.editPlaceRoads = new JMenu(\"Place roads\");\r\n\t\t\r\n\t\tui.editResize = new JMenuItem(\"Resize map\");\r\n\t\tui.editCleanup = new JMenuItem(\"Remove outbound objects\");\r\n\t\t\r\n\t\tui.editResize.addActionListener(new Act() {\r\n\t\t\t@Override\r\n\t\t\tpublic void act() {\r\n\t\t\t\tdoResize();\r\n\t\t\t}\r\n\t\t});\r\n\t\tui.editCleanup.addActionListener(new Act() {\r\n\t\t\t@Override\r\n\t\t\tpublic void act() {\r\n\t\t\t\tdoCleanup();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tui.editCutBuilding = new JMenuItem(\"Cut: building\");\r\n\t\tui.editCutSurface = new JMenuItem(\"Cut: surface\");\r\n\t\tui.editPasteBuilding = new JMenuItem(\"Paste: building\");\r\n\t\tui.editPasteSurface = new JMenuItem(\"Paste: surface\");\r\n\t\tui.editCopyBuilding = new JMenuItem(\"Copy: building\");\r\n\t\tui.editCopySurface = new JMenuItem(\"Copy: surface\");\r\n\t\t\r\n\t\tui.editCutBuilding.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));\r\n\t\tui.editCopyBuilding.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));\r\n\t\tui.editPasteBuilding.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));\r\n\t\t\r\n\t\tui.editCutBuilding.addActionListener(new Act() { @Override public void act() { doCut(false, true); } });\r\n\t\tui.editCutSurface.addActionListener(new Act() { @Override public void act() { doCut(true, false); } });\r\n\t\tui.editCopyBuilding.addActionListener(new Act() { @Override public void act() { doCopy(false, true); } });\r\n\t\tui.editCopySurface.addActionListener(new Act() { @Override public void act() { doCopy(true, false); } });\r\n\t\tui.editPasteBuilding.addActionListener(new Act() { @Override public void act() { doPaste(false, true); } });\r\n\t\tui.editPasteSurface.addActionListener(new Act() { @Override public void act() { doPaste(true, false); } });\r\n\t\t\r\n\t\tui.viewZoomIn = new JMenuItem(\"Zoom in\");\r\n\t\tui.viewZoomOut = new JMenuItem(\"Zoom out\");\r\n\t\tui.viewZoomNormal = new JMenuItem(\"Zoom normal\");\r\n\t\tui.viewBrighter = new JMenuItem(\"Daylight (1.0)\");\r\n\t\tui.viewDarker = new JMenuItem(\"Night (0.5)\");\r\n\t\tui.viewMoreLight = new JMenuItem(\"More light (+0.05)\");\r\n\t\tui.viewLessLight = new JMenuItem(\"Less light (-0.05)\");\r\n\t\t\r\n\t\tui.viewShowBuildings = new JCheckBoxMenuItem(\"Show/hide buildings\", renderer.showBuildings);\r\n\t\tui.viewShowBuildings.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, InputEvent.CTRL_DOWN_MASK));\r\n\t\t\r\n\t\tui.viewSymbolicBuildings = new JCheckBoxMenuItem(\"Minimap rendering mode\", renderer.minimapMode);\r\n\t\tui.viewSymbolicBuildings.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, InputEvent.CTRL_DOWN_MASK));\r\n\t\t\r\n\t\tui.viewTextBackgrounds = new JCheckBoxMenuItem(\"Show/hide text background boxes\", renderer.textBackgrounds);\r\n\t\tui.viewTextBackgrounds.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_DOWN_MASK));\r\n\t\tui.viewTextBackgrounds.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doToggleTextBackgrounds(); } });\r\n\t\t\r\n\t\tui.viewZoomIn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doZoomIn(); } });\r\n\t\tui.viewZoomOut.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doZoomOut(); } });\r\n\t\tui.viewZoomNormal.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doZoomNormal(); } });\r\n\t\tui.viewShowBuildings.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doToggleBuildings(); } });\r\n\t\tui.viewSymbolicBuildings.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doToggleMinimap(); } });\r\n\t\t\r\n\t\tui.viewBrighter.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doBright(); } });\r\n\t\tui.viewDarker.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doDark(); } });\r\n\t\tui.viewMoreLight.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doMoreLight(); } });\r\n\t\tui.viewLessLight.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doLessLight(); } });\r\n\t\t\r\n\t\tui.viewZoomIn.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD9, InputEvent.CTRL_DOWN_MASK));\r\n\t\tui.viewZoomOut.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD3, InputEvent.CTRL_DOWN_MASK));\r\n\t\tui.viewZoomNormal.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD0, InputEvent.CTRL_DOWN_MASK));\r\n\t\tui.viewMoreLight.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD8, InputEvent.CTRL_DOWN_MASK));\r\n\t\tui.viewLessLight.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD2, InputEvent.CTRL_DOWN_MASK));\r\n\t\tui.viewBrighter.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD7, InputEvent.CTRL_DOWN_MASK));\r\n\t\tui.viewDarker.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_NUMPAD1, InputEvent.CTRL_DOWN_MASK));\r\n\t\t\r\n\t\tui.viewStandardFonts = new JCheckBoxMenuItem(\"Use standard fonts\", TextRenderer.USE_STANDARD_FONTS);\r\n\t\t\r\n\t\tui.viewStandardFonts.addActionListener(new Act() {\r\n\t\t\t@Override\r\n\t\t\tpublic void act() {\r\n\t\t\t\tdoStandardFonts();\r\n\t\t\t}\r\n\t\t});\r\n\t\tui.viewPlacementHints = new JCheckBoxMenuItem(\"View placement hints\", renderer.placementHints);\r\n\t\tui.viewPlacementHints.addActionListener(new Act() {\r\n\t\t\t@Override\r\n\t\t\tpublic void act() {\r\n\t\t\t\tdoViewPlacementHints();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tui.helpOnline = new JMenuItem(\"Online wiki...\");\r\n\t\tui.helpOnline.addActionListener(new ActionListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tdoHelp();\r\n\t\t\t}\r\n\t\t});\r\n\t\tui.helpAbout = new JMenuItem(\"About...\");\r\n\t\tui.helpAbout.setEnabled(false); // TODO implement\r\n\t\t\r\n\t\tui.languageMenu = new JMenu(\"Language\");\r\n\t\t\r\n\t\tui.languageEn = new JRadioButtonMenuItem(\"English\", true);\r\n\t\tui.languageEn.addActionListener(new Act() {\r\n\t\t\t@Override\r\n\t\t\tpublic void act() {\r\n\t\t\t\tsetLabels(\"en\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tui.languageHu = new JRadioButtonMenuItem(\"Hungarian\", false);\r\n\t\tui.languageHu.addActionListener(new Act() {\r\n\t\t\t@Override\r\n\t\t\tpublic void act() {\r\n\t\t\t\tsetLabels(\"hu\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tButtonGroup bg = new ButtonGroup();\r\n\t\tbg.add(ui.languageEn);\r\n\t\tbg.add(ui.languageHu);\r\n\t\t\r\n\t\tui.fileRecent = new JMenu(\"Recent\");\r\n\t\tui.clearRecent = new JMenuItem(\"Clear recent\");\r\n\t\tui.clearRecent.addActionListener(new Act() {\r\n\t\t\t@Override\r\n\t\t\tpublic void act() {\r\n\t\t\t\tdoClearRecent();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\taddAll(ui.fileRecent, ui.clearRecent);\r\n\t\t\r\n\t\taddAll(mainmenu, ui.fileMenu, ui.editMenu, ui.viewMenu, ui.languageMenu, ui.helpMenu);\r\n\t\taddAll(ui.fileMenu, ui.fileNew, null, ui.fileOpen, ui.fileRecent, ui.fileImport, null, ui.fileSave, ui.fileSaveAs, null, ui.fileExit);\r\n\t\taddAll(ui.editMenu, ui.editUndo, ui.editRedo, null, \r\n\t\t\t\tui.editCut, ui.editCopy, ui.editPaste, null, \r\n\t\t\t\tui.editCutBuilding, ui.editCopyBuilding, ui.editPasteBuilding, null, \r\n\t\t\t\tui.editCutSurface, ui.editCopySurface, ui.editPasteSurface, null, \r\n\t\t\t\tui.editPlaceMode, null, ui.editDeleteBuilding, ui.editDeleteSurface, ui.editDeleteBoth, null, \r\n\t\t\t\tui.editClearBuildings, ui.editClearSurface, null, ui.editPlaceRoads, null, ui.editResize, ui.editCleanup);\r\n\t\taddAll(ui.viewMenu, ui.viewZoomIn, ui.viewZoomOut, ui.viewZoomNormal, null, \r\n\t\t\t\tui.viewBrighter, ui.viewDarker, ui.viewMoreLight, ui.viewLessLight, null, \r\n\t\t\t\tui.viewShowBuildings, ui.viewSymbolicBuildings, ui.viewTextBackgrounds, ui.viewStandardFonts, ui.viewPlacementHints);\r\n\t\taddAll(ui.helpMenu, ui.helpOnline, null, ui.helpAbout);\r\n\t\t\r\n\t\taddAll(ui.languageMenu, ui.languageEn, ui.languageHu);\r\n\t\t\r\n\t\tui.fileNew.addActionListener(new ActionListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tdoNew();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tui.toolbar = new JToolBar(\"Tools\");\r\n\t\tContainer c = getContentPane();\r\n\t\tc.add(ui.toolbar, BorderLayout.PAGE_START);\r\n\r\n\t\tui.toolbarCut = createFor(\"res/Cut24.gif\", \"Cut\", ui.editCut, false);\r\n\t\tui.toolbarCopy = createFor(\"res/Copy24.gif\", \"Copy\", ui.editCopy, false);\r\n\t\tui.toolbarPaste = createFor(\"res/Paste24.gif\", \"Paste\", ui.editPaste, false);\r\n\t\tui.toolbarRemove = createFor(\"res/Remove24.gif\", \"Remove\", ui.editDeleteBuilding, false);\r\n\t\tui.toolbarUndo = createFor(\"res/Undo24.gif\", \"Undo\", ui.editUndo, false);\r\n\t\tui.toolbarRedo = createFor(\"res/Redo24.gif\", \"Redo\", ui.editRedo, false);\r\n\t\tui.toolbarPlacementMode = createFor(\"res/Down24.gif\", \"Placement mode\", ui.editPlaceMode, true);\r\n\r\n\t\tui.toolbarUndo.setEnabled(false);\r\n\t\tui.toolbarRedo.setEnabled(false);\r\n\t\t\r\n\t\tui.toolbarNew = createFor(\"res/New24.gif\", \"New\", ui.fileNew, false);\r\n\t\tui.toolbarOpen = createFor(\"res/Open24.gif\", \"Open\", ui.fileOpen, false);\r\n\t\tui.toolbarSave = createFor(\"res/Save24.gif\", \"Save\", ui.fileSave, false);\r\n\t\tui.toolbarImport = createFor(\"res/Import24.gif\", \"Import\", ui.fileImport, false);\r\n\t\tui.toolbarSaveAs = createFor(\"res/SaveAs24.gif\", \"Save as\", ui.fileSaveAs, false);\r\n\t\tui.toolbarZoomNormal = createFor(\"res/Zoom24.gif\", \"Zoom normal\", ui.viewZoomNormal, false);\r\n\t\tui.toolbarZoomIn = createFor(\"res/ZoomIn24.gif\", \"Zoom in\", ui.viewZoomIn, false);\r\n\t\tui.toolbarZoomOut = createFor(\"res/ZoomOut24.gif\", \"Zoom out\", ui.viewZoomOut, false);\r\n\t\tui.toolbarBrighter = createFor(\"res/TipOfTheDay24.gif\", \"Daylight\", ui.viewBrighter, false);\r\n\t\tui.toolbarDarker = createFor(\"res/TipOfTheDayDark24.gif\", \"Night\", ui.viewDarker, false);\r\n\t\tui.toolbarHelp = createFor(\"res/Help24.gif\", \"Help\", ui.helpOnline, false);\r\n\r\n\t\t\r\n\t\tui.toolbar.add(ui.toolbarNew);\r\n\t\tui.toolbar.add(ui.toolbarOpen);\r\n\t\tui.toolbar.add(ui.toolbarSave);\r\n\t\tui.toolbar.addSeparator();\r\n\t\tui.toolbar.add(ui.toolbarImport);\r\n\t\tui.toolbar.add(ui.toolbarSaveAs);\r\n\t\tui.toolbar.addSeparator();\r\n\t\tui.toolbar.add(ui.toolbarCut);\r\n\t\tui.toolbar.add(ui.toolbarCopy);\r\n\t\tui.toolbar.add(ui.toolbarPaste);\r\n\t\t\r\n\t\tui.toolbar.add(ui.toolbarRemove);\r\n\t\tui.toolbar.addSeparator();\r\n\t\tui.toolbar.add(ui.toolbarUndo);\r\n\t\tui.toolbar.add(ui.toolbarRedo);\r\n\t\tui.toolbar.addSeparator();\r\n\t\tui.toolbar.add(ui.toolbarPlacementMode);\r\n\t\tui.toolbar.addSeparator();\r\n\t\tui.toolbar.add(ui.toolbarZoomNormal);\r\n\t\tui.toolbar.add(ui.toolbarZoomIn);\r\n\t\tui.toolbar.add(ui.toolbarZoomOut);\r\n\t\tui.toolbar.addSeparator();\r\n\t\tui.toolbar.add(ui.toolbarBrighter);\r\n\t\tui.toolbar.add(ui.toolbarDarker);\r\n\t\tui.toolbar.addSeparator();\r\n\t\tui.toolbar.add(ui.toolbarHelp);\r\n\t\t\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_current_order) {\n Intent intent=new Intent(getBaseContext(),ViewCurrentOrders.class);\n intent.putExtra(\"resid\",resid);\n startActivity(intent);\n return true;\n }\n\n if (id == R.id.action_past_order) {\n Intent intent=new Intent(getBaseContext(),ViewPastOrders.class);\n intent.putExtra(\"resid\",resid);\n startActivity(intent);\n } if (id == R.id.action_logout) {\n preferences.edit().remove(\"resid\").commit();\n Intent intent=new Intent(getBaseContext(),ResLogin.class);\n startActivity(intent);\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "private JMenuBar createMenuBar()\r\n {\r\n UIManager.put(\"Menu.selectionBackground\", new Color(0xDA,0xDD,0xED));\r\n UIManager.put(\"MenuItem.selectionForeground\", Color.LIGHT_GRAY);\r\n JMenuBar menuBar = new JMenuBar();\r\n JMenu menu = new JMenu(\"Fil\");\r\n UIManager.put(\"MenuItem.selectionBackground\", menu.getBackground());\r\n menuItemSave = new JMenuItem(\"Lagre\");\r\n UIManager.put(\"MenuItem.selectionBackground\", menuItemSave.getBackground());\r\n menuItemSave.setForeground(Color.LIGHT_GRAY);\r\n menuItemSave.setBorder(BorderFactory.createEmptyBorder());\r\n menuItemSave.setAccelerator(KeyStroke.getKeyStroke('S', Event.CTRL_MASK));\r\n menuItemSave.addActionListener(listener);\r\n menu.add(menuItemSave);\r\n menuItemPrint = new JMenuItem(\"Skriv ut\");\r\n menuItemPrint.setForeground(Color.LIGHT_GRAY);\r\n menuItemPrint.setBorder(BorderFactory.createEmptyBorder());\r\n menuItemPrint.setAccelerator(KeyStroke.getKeyStroke('P', Event.CTRL_MASK));\r\n menuItemPrint.addActionListener(listener);\r\n menu.add(menuItemPrint);\r\n menu.addSeparator();\r\n menuItemLogout = new JMenuItem(\"Logg av\");\r\n menuItemLogout.setForeground(Color.LIGHT_GRAY);\r\n menuItemLogout.setBorder(BorderFactory.createEmptyBorder());\r\n menuItemLogout.addActionListener(listener);\r\n menuItemLogout.setAccelerator(KeyStroke.getKeyStroke('L', Event.CTRL_MASK));\r\n menu.add(menuItemLogout);\r\n UIManager.put(\"MenuItem.selectionBackground\", new Color(0xDA,0xDD,0xED));\r\n UIManager.put(\"MenuItem.selectionForeground\", Color.BLACK);\r\n menuItemClose = new JMenuItem(\"Avslutt\");\r\n menuItemClose.setAccelerator(KeyStroke.getKeyStroke('A', Event.CTRL_MASK));\r\n menuItemClose.addActionListener(listener);\r\n menuBar.add(menu);\r\n menu.add(menuItemClose);\r\n JMenu menu2 = new JMenu(\"Om\");\r\n menuItemAbout = new JMenuItem(\"Om\");\r\n menuItemAbout.setAccelerator(KeyStroke.getKeyStroke('O', Event.CTRL_MASK));\r\n menuItemAbout.addActionListener(listener);\r\n menuItemAbout.setBorder(BorderFactory.createEmptyBorder());\r\n menu2.add(menuItemAbout);\r\n menuBar.add(menu2);\r\n \r\n return menuBar;\r\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tswitch(id){\n\t\t\tcase R.id.menu_back:\n\t\t\t\tfinish();\n\t\t\t\tgotoHome();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase R.id.menu_delete:\n\t\t\t\tconfirmDelete();\n\t\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n //Menu Button \"return\".\n if(item.getItemId()==R.id.returnBtn){\n Intent startIntent = new Intent(getApplicationContext(), MainActivity.class);\n startActivity(startIntent);\n\n }else if(item.getItemId()==R.id.clearAll){\n\n //Clear database table.\n catdbHandler.clearTable();\n\n //Update listItems array with new database info\n catdbHandler.databaseToArrayIncludingID(listItems);\n\n theAdapter.notifyDataSetChanged();\n catInput.setText(\"\");\n closeKeyboard();\n\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == R.id.action_clear) {\n\t\t\t\n\t\t\tnew AlertDialog.Builder(CollectActivity.this).setTitle(\"提示\").setMessage(\"确定要清空我的收藏吗?\")\n\t\t\t.setPositiveButton(\"确定\", new DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\t\tpublic void onClick(\n\t\t\t\t\t\t\t\t\t\tDialogInterface dialoginterface,\n\t\t\t\t\t\t\t\t\t\tint i) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tDBHelper.getInstance(null).deleteCollect();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (adapter.cursor != null) {\n\t\t\t\t\t\t\t\t\t\tadapter.cursor.close();\n\t\t\t\t\t\t\t\t\t\tadapter.cursor = null;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tadapter.cursor = DBHelper.getInstance(null).queryCollect();\n\t\t\t\t\t\t\t adapter.notifyDataSetChanged();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tcheckEmpty();\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t.setNegativeButton(\"取消\", new DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\t\tpublic void onClick(\n\t\t\t\t\t\t\t\t\t\tDialogInterface dialoginterface,\n\t\t\t\t\t\t\t\t\t\tint i) {\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\t.show();\n\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "boolean removAble(InputItem item);", "public void removeBtn(){\r\n\t\t\r\n\t\tWorkflowEntry entryToBeRemoved = (WorkflowEntry) tableView.getSelectionModel().getSelectedItem();\r\n\t\t\r\n\t\tdata.remove(entryToBeRemoved);\r\n\t\t\r\n\t}", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n super.onPrepareOptionsMenu(menu);\n //If this is a new item, hide the \"Delete\" menu item.\n if(mCurrentItemUri == null){\n MenuItem menuItem = menu.findItem(R.id.action_delete);\n menuItem.setVisible(true);\n }\n return true;\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==R.id.action_exit2){\n\t\t\tSysutil mSysUtil= new Sysutil(MainGroupActivity.this); \n mSysUtil.exit(); \n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase R.id.context_class_test_add: {\r\n\t\t\tDEL_ADD_textview.setVisibility(View.VISIBLE);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase R.id.context_class_test_delete: {\r\n\t\t\tDEL_ADD_textview.setVisibility(View.INVISIBLE);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase R.id.context_class_test_update: {\r\n\t\t\tDEL_ADD_textview.setText(\"文本改变了\");\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase R.id.context_class_test_search: {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onPrepareOptionsMenu(Menu m) {\n super.onPrepareOptionsMenu(m);\n // if this is add a record, hide \"delete\" menu item\n if (mCurrentSymptomUri == null) {\n MenuItem deleteItem = m.findItem(R.id.action_delete_symptom);\n deleteItem.setVisible(false);\n }\n\n return true;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.trash) {\n\n if(isConnected()) {\n removeMessage(message);\n Intent i = new Intent(ReadMessageActivity.this, MessageThreadsActivity.class);\n finish();\n startActivity(i);\n } else{\n Toast.makeText(ReadMessageActivity.this, \"Please connect to Internet\", Toast.LENGTH_SHORT).show();\n }\n return true;\n }\n\n if (id == R.id.reply) {\n Intent i = new Intent(ReadMessageActivity.this,ComposeMessageActivity.class);\n i.putExtra( \"mail\", message.id);\n finish();\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == R.id.nav2_logout){\n Fragment fr=changeFrg();\n if(fr==null){\n sh=getSharedPreferences(\"user\", Context.MODE_PRIVATE);\n shed=sh.edit();\n shed.clear();\n shed.apply();\n\n logOut();\n Toast.makeText(this,\"You are logged out\", Toast.LENGTH_SHORT).show();\n\n return true;\n }else {\n reqCancelAlert(fr);\n }\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n return false;\n }", "protected void removeButtonActionPerformed() {\n\t\tFoodTruckManagementSystem ftms = FoodTruckManagementSystem.getInstance();\n\t\t// Initialize controller\n\t\tMenuController mc = new MenuControllerAdapter();\n\n\t\t// Get selected supply type\n\t\tSupply supply = null;\n\t\ttry {\n\t\t\tsupply = item.getSupply(supplyList.getSelectedIndex());\n\t\t} catch (NullPointerException | IndexOutOfBoundsException e) {\n\t\t}\n\t\t\n\t\t// Remove from item\n\t\ttry {\n\t\t\tmc.removeIngredient(item, supply);\n\t\t} catch (InvalidInputException e) {\n\t\t\terror = e.getMessage();\n\t\t}\n\t\t\n\t\trefreshData();\n\t\t\n\t}", "@Override\n public boolean onPrepareOptionsMenu(Menu menu) {\n super.onPrepareOptionsMenu(menu);\n // If this is a new fruit, hide the \"Delete\" menu item.\n if (mCurrentFruitUri == null) {\n MenuItem menuItem = menu.findItem(R.id.action_delete);\n menuItem.setVisible(false);\n }\n return true;\n }", "@Override\n public boolean onContextItemSelected(MenuItem item) {\n if(item.getTitle()==\"Usuń wpis\") {\n AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo();\n assert info != null;\n int index = info.position;\n bazaDanych.usunWydatki(lista.get(index));\n lista.remove(index);\n adapter.notifyDataSetChanged();\n }\n else if(item.getTitle()==\"Edytuj wpis\"){\n AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo();\n assert info != null;\n int index = info.position;\n Toast.makeText(this, String.valueOf(index), Toast.LENGTH_SHORT).show();\n }\n else {return false;}\n return true;\n }", "public Menu_deleted_panel() {\n initComponents();\n MenuList();\n show_product();\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n // Respond to a click on the \"Delete all entries\" menu option\r\n case R.id.action_share_list:\r\n // TODO: Action for the App Bar\r\n return true;\r\n case R.id.action_delete:\r\n // TODO: Action for the App Bar\r\n return true;\r\n // Respond to a click on the \"Up\" arrow button in the app bar\r\n case android.R.id.home:\r\n NavUtils.navigateUpFromSameTask(RecordActivity.this);\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }" ]
[ "0.7385493", "0.69604826", "0.6918813", "0.6680495", "0.66463387", "0.6566628", "0.65113837", "0.64717895", "0.64578974", "0.64143324", "0.6405081", "0.6376987", "0.63653934", "0.6325205", "0.6305357", "0.6294656", "0.6270647", "0.62279904", "0.61885625", "0.6179774", "0.61706597", "0.61704236", "0.61690277", "0.61488074", "0.61429065", "0.6132523", "0.6124489", "0.61015314", "0.6087638", "0.60667664", "0.6055672", "0.6052433", "0.6032631", "0.6022094", "0.60215634", "0.6021436", "0.6003661", "0.600345", "0.60010844", "0.59982157", "0.59965587", "0.597724", "0.5968599", "0.5964064", "0.59555054", "0.5954124", "0.59514433", "0.5945396", "0.5936302", "0.5930393", "0.59300065", "0.5925647", "0.59202117", "0.59132034", "0.5905085", "0.5902246", "0.5901415", "0.5893867", "0.5889756", "0.5883553", "0.58789724", "0.58729774", "0.5870891", "0.5854999", "0.58547735", "0.5854004", "0.5849902", "0.5843916", "0.5841695", "0.5827952", "0.5826823", "0.58201414", "0.58057356", "0.58013487", "0.58002305", "0.5799921", "0.57995147", "0.579392", "0.5790611", "0.5790224", "0.5789538", "0.5787341", "0.5787056", "0.5777791", "0.5772934", "0.57681537", "0.5766682", "0.5765117", "0.57645893", "0.5759268", "0.57591397", "0.5757721", "0.57529247", "0.5744223", "0.57403225", "0.5739771", "0.5738791", "0.5734281", "0.5731816", "0.5731186" ]
0.6720517
3
Generate a CSV Template from a Measure
@Operation(name = "$template", idempotent=true) public Binary convert1(@IdParam IdType theMeasureId) { Measure mr = dao.getResourceDao(Measure.class).read(theMeasureId); StringBuffer rows[] = { new StringBuffer(), new StringBuffer(), new StringBuffer(), new StringBuffer() }; PrintWriter pw = null; try { pw = new PrintWriter(new File(theMeasureId.getIdPart()+".csv")); } catch (FileNotFoundException e) { e.printStackTrace(); } List<MeasureGroupComponent> grouplist = mr.getGroup(); for (MeasureGroupComponent group : grouplist) { Coding coding = group.getCode().getCoding().get(0); rows[0].append(coding.getCode()).append(","); rows[1].append('"').append(coding.getDisplay()).append("\","); rows[2].append('"').append(group.getCode().getText()).append("\","); rows[3].append('"').append(StringUtils.defaultString(group.getDescription())).append("\","); for (MeasureGroupPopulationComponent population: group.getPopulation()) { coding = population.getCode().getCoding().get(0); rows[0].append(coding.getCode()).append(","); rows[1].append('"').append(coding.getDisplay()).append("\","); rows[2].append('"').append(population.getCode().getText()).append("\","); rows[3].append('"').append(StringUtils.defaultString(population.getDescription())).append("\","); } } for (StringBuffer b: rows) { b.setCharAt(b.length()-1, '\n'); pw.write(b.toString()); } pw.close(); Binary b = new Binary(); b.setContentType("application/csv"); try { b.setData(IOUtils.toByteArray(new FileInputStream(new File(theMeasureId.getIdPart()+".csv")))); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createCSV() {\n\t\t// Need to integrate CSV calling logic\n\t}", "void createCsv(String location);", "CSV createCSV();", "private static void createCSV(String filename, ArrayList<Long> sizes, ArrayList<Long> times){\n File csv = new File(\"\"+filename);\n try {\n if(csv.createNewFile()) {\n PrintWriter file = new PrintWriter(new FileWriter(csv));\n file.print(\"Size (n)\");\n for (Long size : sizes)\n file.print(\",\" + size);\n file.print(\"\\nTimes (ms)\");\n for(Long time:times)\n file.print(\",\"+time);\n file.println();\n file.close();\n\n } else {\n Scanner fileReader = new Scanner(csv);\n String currentSizes = fileReader.nextLine();\n int size=currentSizes.split(\",\").length-1;\n if(size<sizes.size()){\n for(int i=size;i<sizes.size();i++)\n currentSizes+=\",\"+sizes.get(i);\n currentSizes+=\"\\n\";\n while(fileReader.hasNextLine())\n currentSizes+=fileReader.nextLine()+\"\\n\";\n FileWriter writer = new FileWriter(csv);\n writer.write(currentSizes);\n writer.close();\n }\n\n PrintWriter file = new PrintWriter(new FileWriter(csv,true));\n file.print(\"Times (ms)\");\n for(Long time:times)\n file.print(\",\"+time);\n file.println();\n file.close();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void generateTreatmentReports() throws IOException {\r\n\r\n try {\r\n Connection conn = null;\r\n FileWriter fw = new FileWriter(\"treatment.csv\");\r\n mainController iTreat = new mainController();\r\n\r\n conn = iTreat.connectTheDB();\r\n\r\n //msql statement for getting treatment information\r\n //inner joins medicine, department and disease\r\n //uses treatments medicine id to get medicines name\r\n //uses treatments department id to get department name\r\n //uses treatments disease id to ge the name of the dieases\r\n\r\n String insertTreat = \"select treatment.treatmentID, treatment.treatmentName, medicine.medicineName, department.departmentName, disease.diseaseName\\n\" +\r\n \"from treatment inner join medicine on treatment.medicineID = medicine.medicineID\\n\" +\r\n \"inner join department on treatment.departmentID = department.departmentID\\n\" +\r\n \"inner join disease on treatment.diseaseID = disease.diseaseID group by treatmentName ASC;\";\r\n\r\n Statement stmt = conn.createStatement();\r\n ResultSet rs = stmt.executeQuery(insertTreat);\r\n while (rs.next()) {\r\n fw.append(rs.getString(1));\r\n fw.append(',');\r\n fw.append(rs.getString(2));\r\n fw.append(',');\r\n fw.append(rs.getString(3));\r\n fw.append(',');\r\n fw.append(rs.getString(4));\r\n fw.append(',');\r\n fw.append(rs.getString(5));\r\n fw.append('\\n');\r\n }\r\n fw.flush();\r\n fw.close();\r\n conn.close();\r\n System.out.println(\"CSV File is created successfully for treatment information.\");\r\n\r\n\r\n } catch (FileNotFoundException e) {\r\n e.printStackTrace();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n\r\n }", "public static void process(List<Measurement> measurements) {\n Collections.sort(measurements);\n try {\n FileWriter csvWriter = new FileWriter(\"summary.csv\");\n String[] header = {\"Test_UID\", \"Min Height\", \"Min Height Location\",\n \"Max Height\", \"Max Height Location\", \"Mean Height\",\"Height Range\",\n \"Average Roughness\", \"Root Mean Square Roughness (Standard Deviation)\",\n \"Measurements Inside Filter\", \"Measurements Outside Filter\"};\n csvWrite(csvWriter, header);\n\n System.out.println(\"How many standard deviations to use as a filter? (Default is 3)\");\n String input = scanner.next();\n int numFilter = 3;\n try {\n numFilter = Integer.parseInt(input);\n } catch (NumberFormatException e){\n System.out.println(\"Error: Integer not inputted.\");\n } finally {\n System.out.println(\"Filtering to \" + numFilter+ \" standard deviations.\");\n }\n\n int count = 0;\n // measurements list is sorted by test_uid\n // so we can set the for loop limit to the test_uid of the last element\n // in the measurements list\n for (int i = 1; i <= measurements.get(measurements.size()-1).getTest_uid(); i++) {\n List<Measurement> list = new ArrayList<>();\n\n while (count != measurements.size() && measurements.get(count).getTest_uid() == i) {\n list.add(measurements.get(count));\n count++;\n }\n\n String[] data = calculateTest(list, i, numFilter);\n csvWrite(csvWriter, data);\n csvWriter.write(\"\\n\");\n }\n csvWriter.close();\n\n } catch (IOException e) {\n System.out.println(\"Writing error: \" + e.getMessage());\n }\n }", "public void createCsv(View view) {\n try {\n databaseHandler.makeCSV(experimentNumber);\n } catch (IOException e) {\n e.printStackTrace();\n }\n completeLocationValues(DatabaseHandler.SENDER_LATITUDE);\n }", "public void CreateCsv1(int[][]a,int[] b,int[][] c,String C)throws IOException{\r\n int [][] sample = new int[a.length][b.length*2]; \r\n try( PrintWriter writer = new PrintWriter(new File(C))){ \r\n StringBuilder sb = new StringBuilder();\r\n \r\n for( int i =0;i<a.length;i++){\r\n for( int j =0;j<(b.length);j++){\r\n\r\n sample[i][j*2+1] =c[i][b[j]]; \r\n sample[i][j*2]= a[i][j]-c[i][b[j]];\r\n \r\n }\r\n }\r\n \r\n for( int i =0;i<sample.length;i++){\r\n for( int j =0;j<sample[0].length;j++){\r\n if(j%2==0){\r\n \r\n for( int k=j-1;k>=0;k--){\r\n sample[i][j] -= sample[i][k];\r\n }\r\n \r\n }\r\n }\r\n }\r\n\r\n for( int i =0;i<b.length;i++){\r\n sb.append(\"Start\").append(\",\").append(\"Job\").append(b[i]+1).append(',');//.append(\"End\").append(\",\");\r\n }\r\n sb.append(\"\\n\");\r\n for( int i =0;i<a.length;i++){\r\n\r\n for(int j=0;j<sample[i].length;j++){ \r\n sb.append(sample[i][j]).append(',');\r\n\r\n \r\n \r\n }\r\n sb.append(\"\\n\");\r\n }\r\n writer.write(sb.toString());\r\n }\r\n \r\n catch(FileNotFoundException e){\r\n System.out.println(e.getMessage());\r\n }\r\n \r\n}", "public void generateReport(){\n String fileOutput = \"\";\n fileOutput += allCustomers()+\"\\n\";\n fileOutput += getNoAccounts()+\"\\n\";\n fileOutput += getTotalDeposits()+\"\\n\";\n fileOutput += accountsOfferingLoans()+\"\\n\";\n fileOutput += accountsReceivingLoans()+\"\\n\";\n fileOutput += customersOfferingLoans()+\"\\n\";\n fileOutput += customersReceivingLoans()+\"\\n\";\n System.out.println(fileOutput);\n writeToFile(fileOutput);\n }", "public void generateCSV(numList l) {\r\n\t\tFile file = new File(\"E:\\\\altruism results/\" + filename + \".csv\"); //the storage path of the csv file\r\n\t\ttry {\r\n\t\t\tif (file.exists() == false) {\r\n\t\t\t\tfile.createNewFile();\r\n\t\t\t}\r\n\t\t\tFileWriter fw = new FileWriter(file);\r\n\t\t\tBufferedWriter writer = new BufferedWriter(fw);\r\n\t\t\twriter.write(\"altruism,selfish\\r\\n\");\r\n\t\t\tfor (int i = 0; i < numList.TIME; i++) {\r\n\t\t\t\twriter.write(l.aList[i] + \",\");\r\n\t\t\t\twriter.write(l.sList[i] + \"\\r\\n\");\r\n\t\t\t}\r\n\r\n\t\t\twriter.flush();\r\n\t\t\twriter.close();\r\n\t\t\tfw.close();\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void writeCsv(float[] vals, String stimulus, PrintWriter outfile) throws FileNotFoundException {\n for (int i = 0; i < vals.length; i++) {\n outfile.append(vals[i] + \",\");\n }\n outfile.append(stimulus);\n outfile.append(\"\\n\");\n\n }", "@Override\n\tpublic void createCSVOutput() {\n\t\tFile file = new File(\"rejectedByEsteticalRestructurationRejector.csv\"); \n\t\t\n\t\t//test if the file already exist\n\t\tif(file.exists()) {\n\t\t\tSystem.out.println(\"le fichier rejectedByEstheticalRestructurationRejector.csv existe deja\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\t\n\t\t//create the different column for the CSV file\n\t\tString[] titles = { \"before\" , \"after\", \"id\"};\n\t\ttry {\n\t\t\toutputFile = new CsvFileWriter(file, '\\t', titles);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t}", "public String toString()\n {\n return \"Measure (\" + id + \") = '\" + systolic + \"|\" + diastolic + \"' @ \" + time;\n }", "public void exportToCSV();", "public void exportCsv() throws IOException\n {\n File csvOutputFile = new File(\"datas.csv\");\n try (PrintWriter writer = new PrintWriter(csvOutputFile)) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"Temps\");\n sb.append(\",\");\n for (String title : this.getModelLabels())\n {\n sb.append(title);\n sb.append(\",\");\n }\n sb.append(\"\\n\");\n for (int i = 0; i < this.getEtatPopulation().size(); i++)\n {\n sb.append(i);\n sb.append(\",\");\n for (double value : this.getEtatPopulation().get(i))\n {\n sb.append(value);\n sb.append(\",\");\n }\n sb.append(\"\\n\");\n }\n writer.write(sb.toString());\n System.out.println(\"Datas Successfully Exported !\");\n }\n catch (Exception e)\n {\n System.out.println(e.getMessage());\n }\n\n }", "private void writePzIntoCsv(double[] vals, PrintWriter outfile) {\n for (int i = 0; i < vals.length; i++) {\n outfile.append(vals[i] + \",\");\n }\n //outfile.append(stimulus);\n outfile.append(\"\\n\");\n }", "private void exportFiles()\n\t{\n\t\tloading.setVisibility(View.VISIBLE);\n\t\t\n\t\t// Report String\n\t\t//----------------\n\t\tString reportString = \"Date,Location Latitude, Location Longitude,Vehicle,Description\\n\";\t\n\t\t\n\t\tStringBuilder reportBuilder = new StringBuilder();\n\t\treportBuilder.append(reportString);\n\t\t\n\t\tString objectString = \"\"+ \n\t\t\t\tincident.getDate()+\",\" +\n\t\t\t\tincident.getLatitude() + \",\" +\n\t\t\t\tincident.getLongitude()+\",\" +\n\t\t\t\tincident.getVehicleReg()+\",\" +\n\t\t\t\tincident.getDescription()+\",\" + \"\\n\";\n\t\t\n\t\treportBuilder.append(objectString);\n\t\t\n\t\t// Witnesses String\n\t\t//----------------\n\t\tString witnessString = \"witnessName,witnessEmail,witnessNumber,witnessStatement\\n\";\n\t\t\n\t\tStringBuilder witnessesBuilder = new StringBuilder();\n\t\twitnessesBuilder.append(witnessString);\n\t\t\n\t\tfor(int i=0; i<incident.getWitnesses().size(); i++)\n\t\t{\n\t\t\tobjectString = \"\"+ \n\t\t\t\t\tincident.getWitnesses().get(i).get(\"witnessName\")+\",\" +\n\t\t\t\t\tincident.getWitnesses().get(i).get(\"witnessEmail\") + \",\" +\n\t\t\t\t\tincident.getWitnesses().get(i).get(\"witnessNumber\")+\",\" +\n\t\t\t\t\tincident.getWitnesses().get(i).get(\"witnessStatement\")+\",\" + \"\\n\";\n\t\t\t\n\t\t\twitnessesBuilder.append(objectString);\n\t\t}\n\t\t//-------------------------------------------------\n\t\t\n\t\t// Create file\n\t\t//===========================================\n\t\t// Incident Report\n\t\t//-------------------------------------------------\n\t\tfinal File reportFile = new File(getFilesDir() + \"/\" + \"incident_report.csv\");\n\t\treportFile.setReadable(true,false);\n\t\t\n\t\tif( reportFile != null )\n\t\t{\n\t\t try \n\t\t {\n\t\t \tFileOutputStream fOut = openFileOutput(\"incident_report.csv\", Context.MODE_WORLD_READABLE);\n\t\t \tOutputStreamWriter osw = new OutputStreamWriter(fOut); \n\t\t \tosw.write(reportBuilder.toString());\n\t\t\t\tosw.flush();\n\t\t\t\tosw.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t//-------------------------------------------------\n\t\t\n\t\t// Witnesses file\n\t\t//-------------------------------------------------\n\t\tfinal File witnessesFile = new File(getFilesDir() + \"/\" + \"witnesses.csv\");\n\t\twitnessesFile.setReadable(true,false);\n\t\t\n\t\tif( witnessesFile != null )\n\t\t{\n\t\t try \n\t\t {\n\t\t \tFileOutputStream fOut = openFileOutput(\"witnesses.csv\", Context.MODE_WORLD_READABLE);\n\t\t \tOutputStreamWriter osw = new OutputStreamWriter(fOut); \n\t\t \tosw.write(witnessesBuilder.toString());\n\t\t\t\tosw.flush();\n\t\t\t\tosw.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t//-------------------------------------------------\n\t\t\n\t\t// Media files\n\t\t//-------------------------------------------------\t\n\t\tParseQuery<ParseObject> query = ParseQuery.getQuery(\"DCIncident\");\n\t\tquery.getInBackground(incident.getId(),new GetCallback<ParseObject>() \n\t\t{\n\t\t\t@Override\n\t\t\tpublic void done(final ParseObject parseIncident, ParseException e) \n\t\t\t{\n\t\t\t\tif(e == null)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t// Get number of photos attached\n\t\t\t\t\tParseQuery<ParseObject> queryPhotos = parseIncident.getRelation(\"incidentPhotos\").getQuery();\n\t\t\t\t\tqueryPhotos.findInBackground(new FindCallback<ParseObject>()\n\t\t\t\t\t{\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void done(List<ParseObject> parsePhotos, ParseException e) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tArrayList<byte[]> bytes = new ArrayList<byte[]>();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor(int i=0; i<parsePhotos.size(); i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Get photo from the parse\n\t\t\t\t\t\t\t\tParseFile photo = (ParseFile) parsePhotos.get(i).get(\"photoFile\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tbytes.add(photo.getData());\n\t\t\t\t\t\t\t\t} catch (ParseException e1) {\n\t\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tphotoFiles = AssetsUtilities.saveIncidentPhoto(ReviewReportActivity.this, bytes);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Video\n\t\t\t\t\t\t\tParseFile parseVideo = (ParseFile) parseIncident.get(\"incidentVideo\");\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(parseVideo != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tparseVideo.getDataInBackground(new GetDataCallback()\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void done(byte[] data, ParseException e) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif(e == null)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// Save file\n\t\t\t\t\t\t\t\t\t\t\tvideoFile = AssetsUtilities.saveIncidentVideo(ReviewReportActivity.this,data);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tfinishSendingEmail(reportFile, witnessesFile);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tfinishSendingEmail(reportFile, witnessesFile);\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 String createCsv(@NonNull List<String> csvHeaders,\n @NonNull List<List<Serializable>> reports) {\n return \"\";\n }", "@Override public String toString(){\r\n \tint counter =1;\r\n StringBuilder output = new StringBuilder();\r\n for (Iterator<Meters> i = MetersList.iterator(); i.hasNext();){\r\n \toutput.append(\"Meter #:\"+counter+\" \");\r\n output.append(i.next().toString());\r\n output.append(\"\\n\");\r\n counter ++;\r\n }\r\n return output.toString();\r\n }", "public void saveFile(int theValue) {\n if (!outputInitialized) {\n return;\n }\n int largest = 0;\n for (int i=0; i<totSamples.length; i++) {\n if (totSamples[i]> largest) {\n largest = totSamples[i];\n }\n //myArray[i] = list_Samples[i].getListBoxItems();\n }\n String fname = ano + nf(mes, 2)+ nf(dia, 2) + nf(hora, 2) + nf(min, 2) + nf(sec, 2);\n foutput = createWriter(\"dados_\"+fname +\".csv\");\n\n\n\n for (int i=0; i<largest; i++) {\n String line =\"\";\n String[] val = new String[6];\n for (int j=0; j < numSamples; j++) {\n if (i < totSamples[j]) {\n ListBoxItem lb1 = list_Samples[j].getItem(i);\n val[j]=lb1.getText();\n } else {\n val[j]=\"\";\n }\n line += val[j]+\",\";\n } \n if (outputInitialized) {\n foutput.println(i+\",\"+line);\n }\n }\n foutput.flush(); // Writes the remaining data to the file\n foutput.close();\n}", "private static void exportMeasurements(Properties props, int opcount, long runtime) throws IOException {\n MeasurementsExporter exporter = null;\n try {\n // if no destination file is provided the results will be written to stdout\n OutputStream out;\n String exportFile = props.getProperty(EXPORT_FILE_PROPERTY);\n if (exportFile == null) {\n out = System.out;\n } else {\n out = new FileOutputStream(exportFile);\n }\n\n // if no exporter is provided the default text one will be used\n String exporterStr = props.getProperty(EXPORTER_PROPERTY, \"com.yahoo.ycsb.measurements.exporter.TextMeasurementsExporter\");\n try {\n exporter = (MeasurementsExporter) Class.forName(exporterStr).getConstructor(OutputStream.class).newInstance(out);\n } catch (Exception e) {\n System.err.println(\"Could not find exporter \" + exporterStr + \", will use default text reporter.\");\n e.printStackTrace();\n exporter = new TextMeasurementsExporter(out);\n }\n\n exporter.write(\"OVERALL\", \"RunTime(ms)\", runtime);\n double throughput = 1000.0 * (opcount) / (runtime);\n exporter.write(\"OVERALL\", \"Throughput(ops/sec)\", throughput);\n\n Measurements.getMeasurements().exportMeasurements(exporter);\n } finally {\n if (exporter != null) {\n exporter.close();\n }\n }\n }", "public void dataFileCreate() {\r\n\t\tString COMMA_DELIMITER = \",\";\r\n\t\tString NEW_LINE_SEPERATOR = \"\\n\";\r\n\t\tString FILE_HEADER = \"Title,First Name,Last Name,Email,Phone Number\";\r\n\t\ttry {\r\n\t\t\tList<Customer> dataList = new ArrayList<Customer>();\r\n\t\t\tdataList.add(\r\n\t\t\t\t\tnew Customer(title, customerFirstName, customerLastName, custromerEmailId, customerPhoneNumber));\r\n\r\n\t\t\tFileWriter fileWriter = new FileWriter(\"CustomerDetails.csv\");\r\n\t\t\tBufferedWriter bufferWriter = new BufferedWriter(fileWriter);\r\n\t\t\tbufferWriter.append(FILE_HEADER);\r\n\r\n\t\t\tfor (Customer c : dataList) {\r\n\t\t\t\tbufferWriter.write(NEW_LINE_SEPERATOR);\r\n\t\t\t\tbufferWriter.write(c.getTitle());\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t\tbufferWriter.write(c.getFirstName());\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t\tbufferWriter.write(c.getLastName());\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t\tbufferWriter.write(c.getEmailAddress());\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t\tbufferWriter.write(String.valueOf(c.getPhone()));\r\n\t\t\t\tbufferWriter.write(COMMA_DELIMITER);\r\n\t\t\t}\r\n\r\n\t\t\tbufferWriter.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "private static void generateCsvFileWithFinalData(File path) // String sFileName\n {\n String COMMA_DELIMITER = \",\";\n String NEW_LINE_SEPARATOR = \"\\n\";\n try\n {\n // String path to our created output data file\n String finalFilePath = String.valueOf(path.getParent()) + \"\\\\test.csv\";\n FileWriter writer = new FileWriter(finalFilePath);\n\n for (Player player : sortedFinalPlayerList) {\n writer.append(player.getLastName());\n writer.append(COMMA_DELIMITER);\n writer.append(player.getFirstName());\n writer.append(COMMA_DELIMITER);\n writer.append(player.getCountry());\n writer.append(COMMA_DELIMITER);\n writer.append(String.valueOf(player.getLongCommSubsCounter()));\n writer.append(NEW_LINE_SEPARATOR);\n }\n\n //generate whatever data you want\n writer.flush();\n writer.close();\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }", "@Test\r\n\tpublic void generateFile() {\n\t\tfor (int i = 1; i <= 5; i++) {\r\n\t\t\t// String filePath = \"C://Users//AtifKhan//Desktop//sample-\" + i +\r\n\t\t\t// \".csv\";\r\n\t\t\tString filePath = \"C://Users//olcay tarazan//Desktop//sample-\" + i + \".csv\";\r\n\t\t\tint numberOfDataLines = 400;\r\n\t\t\ttry {\r\n\t\t\t\tgenerateCsvFile(filePath, numberOfDataLines);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"File generated : sample-\" + i + \".csv \");\r\n\t\t}\r\n\t}", "public static void deviationCSV(List<Float> deviations) throws IOException {\n\n try (BufferedWriter writer = Files.newBufferedWriter(Paths.get(DEVIATION_LIST));\n\n CSVPrinter csvPrinter = new CSVPrinter(writer, CSVFormat.EXCEL.withHeader(\"deviation\"));\n ) {\n for (Float i: deviations) {\n csvPrinter.printRecord(i);\n }\n csvPrinter.flush();\n }\n }", "private void writePauseCSV(Date start_time, Date end_time, double duration, String file_path) throws IOException {\n CSVWriter pause_csv_writer = null;\n List<String[]> read_all = new ArrayList<String[]>();\n List<String[]> write_all = new ArrayList<String[]>();\n String total_write_line[] = new String[6];\n String next_write_line[] = new String[3];\n double total_time_paused = 0;\n int number_of_pauses = 0;\n double average_pause_duration = 0;\n\n CSVReader pause_reader = null;\n\n try {\n pause_reader = new CSVReader(new FileReader(file_path), ',', '\"', 0);\n\n } catch (FileNotFoundException ex) {\n\n }\n\n if (pause_reader != null) {\n\n read_all = pause_reader.readAll();\n\n //remove the total line because this will be recalculated\n read_all.remove(read_all.size() - 1);\n\n //add the components to the read_all object\n next_write_line[0] = start_time.toString();\n next_write_line[1] = end_time.toString();\n next_write_line[2] = String.valueOf(duration);\n\n //add the new line to the read_all object\n read_all.add(next_write_line);\n\n int i = 1;\n\n //loop through the read_all object to recalculate the totals\n while (i < read_all.size()) {\n number_of_pauses++;\n total_time_paused = total_time_paused + Double.parseDouble(read_all.get(i)[2]);\n i++;\n }\n\n average_pause_duration = (Double) total_time_paused / number_of_pauses;\n\n total_write_line[0] = \"Number of Pauses:\";\n total_write_line[1] = String.valueOf(number_of_pauses);\n total_write_line[2] = \"Total Time Spent Paused:\";\n total_write_line[3] = String.valueOf(total_time_paused);\n total_write_line[4] = \"Average Pause Duration:\";\n total_write_line[5] = String.valueOf(average_pause_duration);\n\n read_all.add(total_write_line);\n\n pause_csv_writer = new CSVWriter(new FileWriter(file_path));\n pause_csv_writer.writeAll(read_all);\n pause_csv_writer.close();\n\n } else {\n pause_csv_writer = new CSVWriter(new FileWriter(file_path));\n\n //this code will only run after the first pause is recorded for the\n // activity so the first line and the total line will be equal\n next_write_line[0] = \"Pause Start Time\";\n next_write_line[1] = \"Pause End Time\";\n next_write_line[2] = \"Pause Duration\";\n pause_csv_writer.writeNext(next_write_line);\n\n next_write_line[0] = start_time.toString();\n next_write_line[1] = end_time.toString();\n next_write_line[2] = String.valueOf(duration);\n pause_csv_writer.writeNext(next_write_line);\n\n total_write_line[0] = \"Number of Pauses:\";\n total_write_line[1] = \"1\";\n total_write_line[2] = \"Total Time Spent Paused:\";\n total_write_line[3] = String.valueOf(duration);\n total_write_line[4] = \"Average Pause Duration:\";\n total_write_line[5] = String.valueOf(duration);\n\n // write the two initial lines to the csv\n pause_csv_writer.writeNext(total_write_line);\n pause_csv_writer.flush();\n pause_csv_writer.close();\n }\n\n }", "public String createTSV() throws IOException {\n\t\tStringBuilder sb = null;\n\t\tif (recordList != null) {\n\t\t\tsb = new StringBuilder();\n\t\t\tCSVPrinter csvPrinter = new CSVPrinter(sb, CSVFormat.TDF);\n\t\t\tfor (CSVRecord record : recordList) {\n\t\t\t\ttry {\n\t\t\t\t\tcsvPrinter.printRecord(record);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tcsvPrinter.close();\n\t\t\t\t\tthrow new IOException(\"cannot write record \", e);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcsvPrinter.close();\n\t\t}\n\t\treturn sb == null ? null : sb.toString();\n\t}", "public void generateSurfacePercentages(String csvName, String fileName, int distanceBin, int timeBin) {\n Scanner csv = null;\n try {\n csv = new Scanner(new File(csvName)); //csv of answer list\n FileWriter writer = new FileWriter(fileName + \".txt\");\n ArrayList<SaTrajectory> traj = new ArrayList<SaTrajectory>();\n csv.nextLine();\n int dbi = 1; //distance bin index\n int tbi = 1; //time bin index\n double dist, ts;\n int answer;\n String id;\n while (csv.hasNextLine()) { //go through each answer entry and add trajectories of the answer list for each unique device id\n String[] line = csv.nextLine().split(\",\");\n dist = Double.parseDouble(line[0]);\n ts = Double.parseDouble(line[1]);\n //System.out.println(ts);\n id = line[3];\n answer = Integer.parseInt(line[2]);\n dbi = (int) (Math.floor(dist / (double) (distanceBin)));\n tbi = (int) (Math.floor(ts / (double) (timeBin)));\n traj.add(new SaTrajectory(dist, id, ts, answer, dbi, tbi));\n }\n\n double minTime = findMinTime(traj);\n //System.out.println(minTime);\n double maxTime = findMaxTime(traj);\n //System.out.println(maxTime); //determine the maximum and minimum time\n for (int i = 0; i < traj.size(); i++) {\n traj.get(i).modifyTimeStamp(-minTime); //format the timestamp to seconds by subtracting the minimum timestamp from each\n }\n double maxDist = findMaxDist(traj);\n maxTime = findMaxTime(traj);\n\n\n int md = (int) Math.ceil(maxDist / distanceBin); //determine the maximum number of indices\n int mt = (int) Math.ceil(maxTime / timeBin); //determine the maximum number of indices\n\n double[][] cc = new double[md][mt];\n for (int i = 0; i < md; i++) {\n dbi = i * distanceBin; //the bin range for distance\n for (int j = 0; j < mt; j++) {\n tbi = j * timeBin; //the bin range for time\n\n ArrayList<SaTrajectory> inBin = new ArrayList<SaTrajectory>();\n for (int a = 0; a < traj.size(); a++) //iterate through each trajectory and see if it is within the range of the bin\n {\n SaTrajectory sa = traj.get(a);\n double dBinLoc = sa.getDistance();\n double tBinLoc = sa.getTimeStamp();\n\n // System.out.println(dBinLoc+\":::::::\"+dbi+\"-\"+ (dbi+distanceBin)+\"\\t\"+tBinLoc+\":::::::\"+tbi+\"-\"+(tbi+timeBin)+\"\\t\"+sa.getId()+\"\\tbin#: \"+i+\",\"+j);}}\n\n //System.out.println(dBinLoc+\":::::::\"+dbi+\"-\"+ (dbi+distanceBin)+\"\\t\"+tBinLoc+\":::::::\"+tbi+\"-\"+(tbi+timeBin)+\"\\t\"+sa.getId());\n // System.out.println(dBinLoc+\" \"+tBinLoc);\n if (dBinLoc > dbi && dBinLoc < (dbi + distanceBin)) {\n if ((tBinLoc > tbi) && (tBinLoc < (tbi + timeBin))) {\n //this value is in the bin\n inBin.add(sa);\n //System.out.println(sa.toString());\n traj.remove(a);\n a--;\n }\n }\n }\n int totalCC = 0;\n for (int a = 0; a < inBin.size(); a++) // for all values found in the bin, determine the percentage of CC's inside the bin, then store it into the 2d Array\n {\n SaTrajectory sa = inBin.get(a);\n if (sa.getAnswer() == 1)\n totalCC++;\n }\n /*if(inBin.size()==0)\n cc[i][j] = (0);\n else*/\n cc[i][j] = (((double) totalCC) / ((double) inBin.size()));\n // System.out.println((((double)totalCC)/((double)inBin.size())));\n }\n }\n\n\n for (int i = 0; i < cc[0].length; i++) {\n for (int j = 0; j < cc.length; j++) {\n writer.write(\"\" + cc[j][i] + \",\");\n }\n writer.write(\"\\n\");\n }\n\n writer.flush();\n writer.close();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if (csv != null)\n csv.close();\n\n\n }\n }", "@Override\n\tpublic void exportToCSV() {\n\n\t}", "private void createPauseAnalysisCSV(String file_path, CSVReader reader, String user_id, String min_acceleration, String pause_window) throws IOException, ParseException {\n String path_to_csv;\n path_to_csv = initialFileSetup(file_path, user_id);\n CSVReader pause_reader;\n CSVWriter pause_csv_writer;\n String nextReadLine[];\n String nextWriteLine[];\n String total_write_line[] = new String[6];\n boolean previous_was_paused = false;\n int consecutive_count = 0;\n boolean pause_recorded = false;\n\n //variables to record the timing from each row and determine duration of pauses\n SimpleDateFormat date_format = new SimpleDateFormat(\"HH:mm:ss\");\n Date start_time = null;\n Date end_time;\n double duration;\n double diffInSeconds;\n final double milliseconds_between_readings = 33.3333333333;\n\n //components of acceleration\n double x_acceleration = 0;\n double y_acceleration = 0;\n double z_acceleration = 0;\n //the magnitude of acceleration at a given moment\n double magnitude_of_acceleration = 0;\n double minimum_magnitude;\n double minimum_consecutive_pause = 0;\n\n if (min_acceleration != null) {\n minimum_magnitude = Double.parseDouble(min_acceleration);\n } else {\n try(FileWriter fw = new FileWriter(\"Errors.txt\", true);\n BufferedWriter bw = new BufferedWriter(fw);\n PrintWriter out = new PrintWriter(bw))\n{\n out.println(\"No minimum magnitude provided for Pause analysis. Analysis could not be performed.\\n\");\n //more code\n} catch (IOException e) {\n //exception handling left as an exercise for the reader\n}\n\n return;\n }\n\n if (pause_window != null) {\n minimum_consecutive_pause = Double.parseDouble(pause_window);\n } else {\n try(FileWriter fw = new FileWriter(\"Errors.txt\", true);\n BufferedWriter bw = new BufferedWriter(fw);\n PrintWriter out = new PrintWriter(bw))\n{\n out.println(\"No number of paused moments provided for Pause analysis. Analysis could not be performed.\\n\");\n //more code\n} catch (IOException e) {\n //exception handling left as an exercise for the reader\n}\n return;\n }\n\n reader.readNext();\n\n while ((nextReadLine = reader.readNext()) != null) {\n\n x_acceleration = Double.parseDouble(nextReadLine[5]);\n y_acceleration = Double.parseDouble(nextReadLine[6]);\n z_acceleration = Double.parseDouble(nextReadLine[7]);\n\n magnitude_of_acceleration = calculateMagnitude(x_acceleration, y_acceleration, z_acceleration);\n\n // action to take if magnitude does not meet the minimum\n if (magnitude_of_acceleration < minimum_magnitude) {\n\n //Need to track how many consecutive readings showed low acceleration\n if (!previous_was_paused) {\n //record the timing of the first moment of low acceleration\n start_time = date_format.parse(nextReadLine[0]);\n previous_was_paused = true;\n consecutive_count = 1;\n } else {\n consecutive_count++;\n }\n } else if (previous_was_paused && consecutive_count >= minimum_consecutive_pause) {\n end_time = date_format.parse(nextReadLine[0]);\n duration = consecutive_count * milliseconds_between_readings;\n\n writePauseCSV(start_time, end_time, duration, path_to_csv);\n\n previous_was_paused = false;\n consecutive_count = 0;\n pause_recorded = true;\n } else {\n //reset the consecutive pause checks\n previous_was_paused = false;\n consecutive_count = 0;\n\n }\n\n }\n\n if (!pause_recorded) {\n pause_csv_writer = new CSVWriter(new FileWriter(path_to_csv));\n\n total_write_line[0] = \"Number of Pauses:\";\n total_write_line[1] = \"0\";\n total_write_line[2] = \"Total Time Spent Paused:\";\n total_write_line[3] = \"0\";\n total_write_line[4] = \"Average Pause Duration:\";\n total_write_line[5] = \"0\";\n\n pause_csv_writer.writeNext(total_write_line);\n pause_csv_writer.close();\n\n }\n \n MCIAnaylsis.pause_utilized = true;\n\n }", "@Bean\r\n public ItemWriter<OrderEntity> databaseCsvItemWriter() {\r\n LOG.debug(\"=== databaseCsvItemWriter\");\r\n FlatFileItemWriter<OrderEntity> csvFileWriter = new FlatFileItemWriter<>();\r\n\r\n // Extracting column names from properties file\r\n ArrayList<String> columns = (ArrayList<String>) fileProperties.getColumns();\r\n String columnsHeaders = \"\";\r\n for (int i = 0; i < columns.size(); i++) {\r\n columnsHeaders += columns.get(i);\r\n if (i < (columns.size() - 1)) {\r\n columnsHeaders += \",\";\r\n }\r\n }\r\n LOG.debug(\"=== columnsHeaders=>\" + columnsHeaders);\r\n\r\n StringHeaderWriter headerWriter = new StringHeaderWriter(columnsHeaders);\r\n csvFileWriter.setHeaderCallback(headerWriter);\r\n\r\n // Extracting destination file from properties file, adding de suffix Processed\r\n String exportFilePath =\r\n fileProperties.getName().substring(0, fileProperties.getName().lastIndexOf('.'))\r\n + \"Processed.csv\";\r\n LOG.debug(\"=== exportFilePath=>\" + exportFilePath);\r\n csvFileWriter.setResource(new FileSystemResource(exportFilePath));\r\n\r\n LineAggregator<OrderEntity> lineAggregator = createOrderLineAggregator();\r\n csvFileWriter.setLineAggregator(lineAggregator);\r\n\r\n return csvFileWriter;\r\n }", "public ValidationInfo createCsv() {\n LocaleModule lm = LocaleManager.getInstance().getModule(LocaleModuleResource.Main);\n\n ValidationInfo vi = new ValidationInfo();\n if (_rows == null || _rows.size() == 0) {\n vi.setMessageWarning(lm.getString(\"general_export_nothing\"));\n return vi;\n }\n\n String fullFilePath = getFileName();\n\n StringBuilder sb = new StringBuilder();\n\n //create header\n String headerRow = _rows.get(0).createCsvRow(true);\n\n sb.append(headerRow + System.lineSeparator());\n\n try {\n //create rows\n for (Exportable e : _rows) {\n String rowString = e.createCsvRow(false);\n sb.append(rowString + System.lineSeparator());\n }\n\n //Output\n String strContent = sb.toString();\n Utils.writeFile(strContent, fullFilePath);\n\n vi.setMessageSuccess(String.format(lm.getString(\"general_export_success\"),\n _rows.size(), fullFilePath));\n } catch (Exception ex) {\n vi.setMessageError(lm.getString(\"general_export_error\"));\n }\n\n //open\n Utils.openFolder(fullFilePath);\n\n return vi;\n }", "@RequestMapping(\"/generatecsv\")\r\n\tpublic String generateCsvFile() throws CsvDataTypeMismatchException, CsvRequiredFieldEmptyException {\r\n\r\n\t\tList<FinalCritExtDTO> list = service.generateDataForCsvFile();\r\n\r\n\t\tif (Objects.nonNull(list) && !list.isEmpty()) {\r\n\t\t\tlogger.info(\"data fetched from db and mapped of size \" + list.size());\r\n\t\t\twriter.writeDataAtOnce(list);\r\n\t\t} else\r\n\t\t\tlogger.info(\"No records found in db to be written\");\r\n\t\tlogger.debug(\"File successfully generated\");\r\n\t\treturn \"SUCCESS\";\r\n\t}", "public void generateTrajectorySpeeds(String csvName, String trajFileName, String fileName) {\n Scanner csv = null;\n try {\n csv = new Scanner(new File(csvName)); //open the answer list file\n FileWriter writer = new FileWriter(fileName + \".csv\");\n HashMap<String, ArrayList<AnswerTrajectory>> csvTraj = new HashMap<String, ArrayList<AnswerTrajectory>>(); //hash map that keys on trajectory id, storing all answer list trajectories in an array list\n HashMap<String, ArrayList<Trajectory>> trajectories = readTrajectories(trajFileName); //load the trajectory data into a hash map keyed by ID\n csv.nextLine();\n String currentId = \"\";\n ArrayList<AnswerTrajectory> anstj = new ArrayList<AnswerTrajectory>();\n ArrayList<String> Ids = new ArrayList<String>();\n\n\n while (csv.hasNextLine()) {\n String[] line = csv.nextLine().split(\",\");\n if (currentId.equals(\"\")) {\n currentId = line[12];\n } else if (!currentId.equals(line[12])) {\n csvTraj.put(currentId, anstj);\n Ids.add(currentId);\n anstj = new ArrayList<AnswerTrajectory>();\n currentId = line[12];\n }\n anstj.add(new AnswerTrajectory(Double.parseDouble(line[13]), Double.parseDouble(line[14]), line[12], Double.parseDouble(line[9]), Integer.parseInt(line[0]), Integer.parseInt(line[16])));\n }\n writer.append(\"Speed\\n\");\n\n ArrayList<Trajectory> alltj = new ArrayList<Trajectory>();\n for (String s : Ids) //for each device ID determine the corresponding answer list\n {\n //System.out.println(s);\n alltj = trajectories.get(s); //get all the trajectories under this Id\n\n if (alltj == null)\n System.out.println(\"Could not find trajectory data for deviceId: \" + s);\n\n else {\n Collections.sort(alltj, Trajectory.TSComparator); //sort trajectory data by time\n\n for (int i = 0; i < alltj.size() - 1; i++) {\n Trajectory t1 = alltj.get(i);\n Trajectory t2 = alltj.get(i + 1);\n\n\n double x1 = t1.getX();\n double x2 = t2.getX();\n double y1 = t1.getY();\n double y2 = t2.getY();\n\n\n double dist = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n double dt = t2.getTimeStamp() - t1.getTimeStamp();\n\n\n if (dt == 0) {\n System.out.println(t1 + \"\\n\" + t2 + \"\\tDIST: \" + dist + \"\\n\\n\");\n alltj.remove(i + 1);\n i--;\n } else {\n double speed = dist / dt;\n writer.append(speed + \"\\n\");\n\n }\n\n\n }\n\n\n }\n }\n\n\n writer.flush();\n writer.close();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if (csv != null)\n csv.close();\n\n\n }\n }", "public static StringWriter matrixToStringWriterSQL(double[][] array, int decimalPlaces) {\n StringWriter buffer;\n StringWriter totalBuffer = new StringWriter();\n totalBuffer.append(\"'{\");\n for (int j = 0; j < array.length; ++j) {\n buffer = new StringWriter();\n for (int k = 0; k < array[0].length; ++k) {\n\n buffer.append(new BigDecimal(array[j][k]).setScale(decimalPlaces, RoundingMode.HALF_UP) + \",\");\n }\n if (j < array.length - 1) totalBuffer.append(buffer.getBuffer());\n else {\n int last = buffer.getBuffer().length();\n totalBuffer.append(buffer.getBuffer(), 0, last - 1);\n totalBuffer.append(\"}'\");\n }\n }\n\n return totalBuffer;\n }", "@Test\n @Ignore(\"Need to implement\")\n public void testOutputDynamicCsvMode() throws Throwable {\n testOutputDynamic(true);\n }", "static void writeTimeCSV(String data_structure){\n\n try {\n\n // Getting current directory\n String path = System.getProperty(\"user.dir\");\n // Initializing data directory\n String dataPath = path + \"/Data/\";\n // Initializing CSV directory \n String csvPath = path + \"/CSV/\";\n\n // Creating filename with given data structure\n String filename = String.format(\"%s.csv\",data_structure);\n\n // Initializing FileWrite object \n FileWriter write = new FileWriter(csvPath + filename);\n\n // Initializing header string for csv file\n String header = \"Total_Word_Count,t\\n\";\n write.append(header);\n\n // Initializing counter object\n WordCounter2 counter = new WordCounter2(data_structure);\n\n // Creating data format string\n String dataFormat = \"%s,%s\\n\";\n\n // Getting data directory\n File dataDirectory = new File(dataPath);\n\n // Going through each file in the directory\n for (File data : dataDirectory.listFiles()) {\n \n // getting the data file's name\n String name = data.getAbsolutePath();\n\n // Initializing arraylist of words\n ArrayList<String> words = counter.readWords(name);\n\n // Getting the average amount of time taken to create a word map\n // Converted to ms \n double t = averageTime(counter, words);\n\n // Getting the total number of words\n int total = counter.getTotalWordCount();\n\n // Creating data string and appending it to the csv\n String dataString = String.format(dataFormat, total,t);\n write.append(dataString);\n\n // Clearing word map\n counter.clearMap();\n\n System.out.println(\"Finished reading file \" + data.getName());\n }\n \n write.close();\n } \n catch (IOException ex) {\n System.out.println(\"TimeComplexity.writeTimeCSV():: Could not write file\");\n }\n }", "void createReport() {\n\n // report about purple flowers\n println(\"\\nPurple flower distribution: \");\n for (int i = 0; i < 6; i++) {\n println(i + (i==5?\"+\":\"\") + \": \" + numPurpleFlowers[i]);\n }\n // report about missing treasures\n println(\"Missing treasure count: \" + missingTreasureCount);\n\n println(\"\\nGenerated \" + caveGenCount + \" sublevels.\");\n println(\"Total run time: \" + (System.currentTimeMillis()-startTime)/1000.0 + \"s\");\n\n out.close();\n }", "public String generateReport(final String merchantUuid, final Integer days, final Integer offset);", "public static String generateData() {\n\t\tStringBuilder res = new StringBuilder();\n\t\tres.append(generateID(9));\n\t\tres.append(\",\");\n\t\tres.append(\"Galsgow\");\n\t\tres.append(\",\");\n\t\tres.append(\"UK\");\n\t\tres.append(\",\");\n\t\tres.append(generateDate());\n\t\treturn res.toString();\n\t}", "@Override\n\tprotected String objectToCSVRecord(Object object) {\n\t\tStringBuilder str = new StringBuilder();\n\t\tstr.append(((Item) object).getItemno());\n\t\tstr.append(\",\");\n\t\tstr.append(((Item) object).getItemName());\n\t\tstr.append(\",\");\n\t\tstr.append(((Item) object).getUnitPrice());\n\t\tstr.append(\",\");\n \tString one=str.toString();\n \treturn one;\n\t\t\n\t\t \n\t}", "@Override\n public void report() {\n\n try {\n File mFile = new File(\"/usr/local/etc/flink-remote/bm_files/metrics_logs/metrics.txt\");\n File eFile = new File(\"/usr/local/etc/flink-remote/bm_files/metrics_logs/latency_throughput.txt\");\n if (!mFile.exists()) {\n mFile.createNewFile();\n }\n if (!eFile.exists()) {\n eFile.createNewFile();\n }\n\n FileOutputStream mFileOut = new FileOutputStream(mFile, true);\n FileOutputStream eFileOut = new FileOutputStream(eFile, true);\n\n StringBuilder builder = new StringBuilder((int) (this.previousSize * 1.1D));\n StringBuilder eBuilder = new StringBuilder((int) (this.previousSize * 1.1D));\n\n// Instant now = Instant.now();\n LocalDateTime now = LocalDateTime.now();\n\n builder.append(lineSeparator).append(lineSeparator).append(now).append(lineSeparator);\n eBuilder.append(lineSeparator).append(lineSeparator).append(now).append(lineSeparator);\n\n builder.append(lineSeparator).append(\"---------- Counters ----------\").append(lineSeparator);\n eBuilder.append(lineSeparator).append(\"---------- records counter ----------\").append(lineSeparator);\n for (Map.Entry metric : counters.entrySet()) {\n builder.append(metric.getValue()).append(\": \").append(((Counter) metric.getKey()).getCount()).append(lineSeparator);\n if (( (String)metric.getValue()).contains(\"numRecords\")) {\n eBuilder.append(metric.getValue()).append(\": \").append(((Counter) metric.getKey()).getCount()).append(lineSeparator);\n }\n }\n\n builder.append(lineSeparator).append(\"---------- Gauges ----------\").append(lineSeparator);\n for (Map.Entry metric : gauges.entrySet()) {\n builder.append(metric.getValue()).append(\": \").append(((Gauge) metric.getKey()).getValue()).append(lineSeparator);\n }\n\n builder.append(lineSeparator).append(\"---------- Meters ----------\").append(lineSeparator);\n eBuilder.append(lineSeparator).append(\"---------- throughput ----------\").append(lineSeparator);\n for (Map.Entry metric : meters.entrySet()) {\n builder.append(metric.getValue()).append(\": \").append(((Meter) metric.getKey()).getRate()).append(lineSeparator);\n if (((String) metric.getValue()).contains(\"numRecords\")) {\n eBuilder.append(metric.getValue()).append(\": \").append(((Meter) metric.getKey()).getRate()).append(lineSeparator);\n }\n }\n\n builder.append(lineSeparator).append(\"---------- Histograms ----------\").append(lineSeparator);\n eBuilder.append(lineSeparator).append(\"---------- lantency ----------\").append(lineSeparator);\n for (Map.Entry metric : histograms.entrySet()) {\n HistogramStatistics stats = ((Histogram) metric.getKey()).getStatistics();\n builder.append(metric.getValue()).append(\": mean=\").append(stats.getMean()).append(\", min=\").append(stats.getMin()).append(\", p5=\").append(stats.getQuantile(0.05D)).append(\", p10=\").append(stats.getQuantile(0.1D)).append(\", p20=\").append(stats.getQuantile(0.2D)).append(\", p25=\").append(stats.getQuantile(0.25D)).append(\", p30=\").append(stats.getQuantile(0.3D)).append(\", p40=\").append(stats.getQuantile(0.4D)).append(\", p50=\").append(stats.getQuantile(0.5D)).append(\", p60=\").append(stats.getQuantile(0.6D)).append(\", p70=\").append(stats.getQuantile(0.7D)).append(\", p75=\").append(stats.getQuantile(0.75D)).append(\", p80=\").append(stats.getQuantile(0.8D)).append(\", p90=\").append(stats.getQuantile(0.9D)).append(\", p95=\").append(stats.getQuantile(0.95D)).append(\", p98=\").append(stats.getQuantile(0.98D)).append(\", p99=\").append(stats.getQuantile(0.99D)).append(\", p999=\").append(stats.getQuantile(0.999D)).append(\", max=\").append(stats.getMax()).append(lineSeparator);\n eBuilder.append(metric.getValue()).append(\": mean=\").append(stats.getMean()).append(\", min=\").append(stats.getMin()).append(\", p5=\").append(stats.getQuantile(0.05D)).append(\", p10=\").append(stats.getQuantile(0.1D)).append(\", p20=\").append(stats.getQuantile(0.2D)).append(\", p25=\").append(stats.getQuantile(0.25D)).append(\", p30=\").append(stats.getQuantile(0.3D)).append(\", p40=\").append(stats.getQuantile(0.4D)).append(\", p50=\").append(stats.getQuantile(0.5D)).append(\", p60=\").append(stats.getQuantile(0.6D)).append(\", p70=\").append(stats.getQuantile(0.7D)).append(\", p75=\").append(stats.getQuantile(0.75D)).append(\", p80=\").append(stats.getQuantile(0.8D)).append(\", p90=\").append(stats.getQuantile(0.9D)).append(\", p95=\").append(stats.getQuantile(0.95D)).append(\", p98=\").append(stats.getQuantile(0.98D)).append(\", p99=\").append(stats.getQuantile(0.99D)).append(\", p999=\").append(stats.getQuantile(0.999D)).append(\", max=\").append(stats.getMax()).append(lineSeparator);\n }\n\n mFileOut.write(builder.toString().getBytes());\n eFileOut.write(eBuilder.toString().getBytes());\n mFileOut.flush();\n eFileOut.flush();\n mFileOut.close();\n eFileOut.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "public void generateTrajectoryDistancesAndTime(String csvName, String trajFileName, String questionLocationsName, String fileName, double meters) {\n Scanner csv = null;\n Scanner ql = null;\n\n try {\n csv = new Scanner(new File(csvName)); //csv of answer list\n ql = new Scanner(new File(questionLocationsName)); //question locations (index 0 corresponds to question 1)\n FileWriter writer = new FileWriter(fileName + \".csv\");\n HashMap<String, ArrayList<AnswerTrajectory>> csvTraj = new HashMap<String, ArrayList<AnswerTrajectory>>(); //hash map that keys on trajectory id, storing all answer list trajectories in an array list\n HashMap<String, ArrayList<Trajectory>> trajectories = readTrajectories(trajFileName); //load the trajectory data into a hash map keyed by ID\n csv.nextLine();\n String currentId = \"\";\n ArrayList<AnswerTrajectory> anstj = new ArrayList<AnswerTrajectory>();\n ArrayList<String> Ids = new ArrayList<String>();\n\n ArrayList<Point2D.Double> questionLocations = new ArrayList<Point2D.Double>();\n\n while (ql.hasNextLine()) {\n questionLocations.add(new Point2D.Double(ql.nextDouble(), ql.nextDouble()));\n }\n\n\n while (csv.hasNextLine()) { //go through each answer entry and add trajectories of the answer list for each unique device id\n String[] line = csv.nextLine().split(\",\");\n if (currentId.equals(\"\")) {\n currentId = line[12];\n } else if (!currentId.equals(line[12])) {\n csvTraj.put(currentId, anstj);\n Ids.add(currentId); //if the id is new, then add it to the list of all known ids\n anstj = new ArrayList<AnswerTrajectory>();\n currentId = line[12];\n }\n anstj.add(new AnswerTrajectory(Double.parseDouble(line[13]), Double.parseDouble(line[14]), line[12], Double.parseDouble(line[9]), Integer.parseInt(line[0]), Integer.parseInt(line[16])));\n }\n writer.append(\"Distance,Time,AnswerType,ID,Question\\n\");\n\n ArrayList<Trajectory> alltj = new ArrayList<Trajectory>();\n for (String s : Ids) //for each device ID determine the corresponding answer list\n {\n //System.out.println(s);\n anstj = csvTraj.get(s); //get the hashmap arraylist that holds all trajectories for this device\n alltj = trajectories.get(s); //get all the trajectories under this Id\n\n if (anstj == null || alltj == null)\n System.out.println(\"Could not find trajectory data for deviceId: \" + s);\n\n else {\n Collections.sort(anstj, AnswerTrajectory.TSComparator); //sort it by time\n Collections.sort(alltj, Trajectory.TSComparator); //sort it by time\n\n\n int currentQuestion = anstj.get(0).getQuestion();\n int currentAnswer = anstj.get(0).getAnswer();\n int correct = 0;\n if (currentAnswer == 1 || currentAnswer == 2)\n correct = 1;\n\n boolean BC = true;// before the first question\n int total = 0;\n for (Trajectory t : alltj) {\n\n double timestamp = t.getTimeStamp() * 1000;\n\n if (BC && timestamp < anstj.get(0).getTimeStamp()) //use first trajectory as if it's before the first question\n {\n total++;\n //determine the distance and answer type\n double qX = questionLocations.get(currentQuestion - 1).getX(); //question location x and y\n double qY = questionLocations.get(currentQuestion - 1).getY();\n\n double tX = t.getX(); //trajectory x and y\n double tY = t.getY();\n\n double aX = anstj.get(0).getX(); //location when question was answered\n double aY = anstj.get(0).getY();\n\n double currentDist = Math.sqrt((tX - qX) * (tX - qX) + (tY - qY) * (tY - qY)); //distance from current location to question location\n double distToAnswer = Math.sqrt((aX - qX) * (aX - qX) + (aY - qY) * (aY - qY)); //distance from answer to answer location\n\n int answerId = 0;\n if (distToAnswer <= meters) {\n if (correct == 1)\n answerId = 1;\n\n if (correct == 0)\n answerId = 3;\n } else {\n if (correct == 1)\n answerId = 2;\n\n if (correct == 0)\n answerId = 4;\n }\n\n writer.append(currentDist + \",\" + t.getTimeStamp() + \",\" + answerId + \",\" + t.getId() + \",\" + anstj.get(0).getQuestion() + \"\\n\");\n BC = false;\n } else {\n break;\n }\n\n }\n\n for (int a = 0; a < anstj.size() - 1; a++) //for questions 1-n\n {\n //determine the distance and answer type\n\n double qX = questionLocations.get(anstj.get(a + 1).getQuestion() - 1).getX();//question location x and y\n double qY = questionLocations.get(anstj.get(a + 1).getQuestion() - 1).getY();\n\n double tX = anstj.get(a).getX(); //current location x and y\n double tY = anstj.get(a).getY();\n\n double aX = anstj.get(a + 1).getX(); //location when question was answered\n double aY = anstj.get(a + 1).getY();\n\n double currentDist = Math.sqrt((tX - qX) * (tX - qX) + (tY - qY) * (tY - qY)); //distance from current location to question location\n double distToAnswer = Math.sqrt((aX - qX) * (aX - qX) + (aY - qY) * (aY - qY)); //distance from answer to answer location\n\n int answerId = 0;\n if (distToAnswer <= meters) {\n if (correct == 1)\n answerId = 1;\n\n if (correct == 0)\n answerId = 3;\n } else {\n if (correct == 1)\n answerId = 2;\n\n if (correct == 0)\n answerId = 4;\n }\n\n writer.append(currentDist + \",\" + anstj.get(a).getTimeStamp() / 1000.0 + \",\" + answerId + \",\" + anstj.get(a).getId() + \",\" + anstj.get(a).getQuestion() + \"\\n\");\n }\n\n }\n }\n\n\n writer.flush();\n writer.close();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if (csv != null)\n csv.close();\n\n if (ql != null)\n ql.close();\n\n }\n }", "public static void queryAndDataToCSV() throws IOException {\r\n\t\t@SuppressWarnings(\"resource\")\r\n\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(\"Graph\"+x+\".csv\"));\r\n\t\tArrayList<ArrayList<String>> dataset =ReadInDataset.finalDataset;\r\n\t\tfor (int i=0; i< dataset.size(); i++) {\r\n\t\t\tString entry= dataset.get(i).get(1)+\",\"+ dataset.get(i).get(2);\r\n\t\t\tif (i< Queries.NumberOfQueries) {\r\n\t\t\t\tfor (int x=0; x<(Queries.NumberOfDimensions/2)-1;x++) {\r\n\t\t\t\tentry = entry+\",\"+query.get(i).get(x).get(0) +\",\" +query.get(i).get(x).get(1);\r\n\t\t\t\tentry = entry+\",\"+query.get(i).get(x+1).get(0) +\",\" +query.get(i).get(x+1).get(1);\r\n\t\t\t\t\r\n\t\t\t}}\r\n\t\t\twriter.write(entry);\r\n\t\t\twriter.newLine();\r\n\t\t}\r\n\t\twriter.close();\r\n\t}", "public void createCSV(ArrayList<String> result, String output){\t\r\n\t\ttry{\r\n\t\t\tFileOutputStream fileOutputStream = new FileOutputStream(output);\r\n\t\t\tOutputStreamWriter outputStreamWriter = new OutputStreamWriter(fileOutputStream, \"MS949\");\r\n\t\t\tBufferedWriter fw = new BufferedWriter(outputStreamWriter);\r\n\t\t\tfor(String line : result){\r\n\t\t\t\tfw.write(line+\"\\n\");\r\n\t\t\t}\r\n\t\t\tfw.flush();\r\n\t\t\tfw.close();\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void createTotalTime(BufferedWriter writer) throws IOException {\r\n\t\tMap<String, String> dataMap = data.getTotalTime();\r\n\t\tString parent = \"<div style='width: 260px;background-color: #FFFFFF;box-shadow: 1px 1px 1px #888888;height: 85px;position: absolute;top: 67px;left: 281px;'>\";\r\n\t\tString subChild = \"<label style='position: absolute;margin-top: 5px;'>\";\r\n\t\tString totalTimeLabel = \"<span style='font-weight: bold;color: #000000;padding-left: 8px;font-family: Roboto, sans-serif;'>Total Time</span></label>\";\r\n\t\tString subChild1 = \"<label style='margin-top: 57px;position: absolute;'>\";\r\n\t\tString totatlTime = \"<span style='font-weight: bold;color: #000000;padding-left: 8px;font-family: Roboto, sans-serif;'>\"\r\n\t\t\t\t+ dataMap.get(\"total-time\") + \"</span></label></div>\";\r\n\t\twriter.write(parent + subChild + totalTimeLabel + subChild1\r\n\t\t\t\t+ totatlTime);\r\n\r\n\t\tString startTimePanel = \"<div style='width: 260px;background-color: #00E676;box-shadow: 1px 1px 1px #888888;height: 85px;position: absolute;top: 67px;left: 554px;'>\";\r\n\t\tString labelTime = \"<label style='position: absolute;margin-left: 8px;'>\";\r\n\t\tString startTimeLabel = \"<span style='font-weight: bold;color: gray;padding-top: 3px;font-family: Roboto, sans-serif;'>Start Time</span></label>\";\r\n\t\tString timeContainer = \"<label style='position: absolute;margin-top: 58px;padding-left: 118px;font-weight: bold;color: white;'><span style='font-family: Roboto, sans-serif;font-size:smaller'>\";\r\n\t\tString startTime = dataMap.get(\"start-time\") + \"</span></label></div>\";\r\n\t\twriter.write(startTimePanel + labelTime + startTimeLabel\r\n\t\t\t\t+ timeContainer + startTime);\r\n\r\n\t\tString endTimePanel = \"<div style='width: 260px;background-color: #F44336;box-shadow: 1px 1px 1px #888888;height: 85px;position: absolute;top: 67px;left: 828px;'>\";\r\n\t\tString endlabelTime = \"<label style='position: absolute;margin-left: 8px;'>\";\r\n\t\tString endTimeLabel = \"<span style='font-weight: bold;color: gray;padding-top: 3px;font-family: Roboto, sans-serif;'>End Time</span></label>\";\r\n\t\tString endTimeContainer = \"<label style='position: absolute;margin-top: 58px;padding-left: 118px; font-weight: bold;color: white;'><span style='font-family: Roboto, sans-serif;font-size:smaller'>\";\r\n\t\tString endTime = dataMap.get(\"end-time\") + \"</span></label></div>\";\r\n\t\twriter.write(endTimePanel + endlabelTime + endTimeLabel\r\n\t\t\t\t+ endTimeContainer + endTime);\r\n\r\n\t}", "private static String createDataString(\n \t\tCollection<ProductAmountTO> requiredProductAmounts,\n \t\tHashtable<Store, Collection<StockItem>> storeStockItems,\n \t\tHashtable<Store, Integer> storeDistances) {\n \t\n \tStringBuffer output = new StringBuffer();\n\n \tappendStoreDistances(storeDistances, output); \t\n \t\n \tappendRequiredProductAmounts(requiredProductAmounts, output);\n \t\n \tappendOfferingStoresProductsAmountsMatrix(storeStockItems, requiredProductAmounts, output);\n \t\n \treturn output.toString();\n \t \n\n }", "public static void createCSV(Passengers passengers) {\n String csvFile = \"miles_per_existing_member_NEW.csv\";\n try {\n writer = new FileWriter(csvFile);\n \n \n \n Map<Long,Integer> Members = passengers.getMembers();\n \n writeLine(Arrays.asList(\"memberID\",\"miles\"));\n for(Map.Entry<Long, Integer> entry : Members.entrySet()) {\n writeLine(Arrays.asList( entry.getKey().toString() , entry.getValue().toString() ));\n }\n\n writer.flush();\n writer.close();\n } \n catch (IOException ex) {\n Logger.getLogger(CSVUtilities.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n public void makeOutPutData(File file) {\n\n prepareHtmlDataList();\n\n PrintWriter pw = null;\n int cnt = 0;\n\n try {\n pw = new PrintWriter(new FileOutputStream(file, true));\n\n pw.println(\"******************** MainData info ********************\");\n pw.println(\"startLoggingTime : \"\n + ALTHelper\n .DateToString(ALTHelper\n .getTimeStartedBefore(1000)));\n pw.println(\"endLoggingTime : \"\n + ALTHelper\n .DateToString(ALTHelper\n .getTimeLaunched()));\n\n pw.println(\"\");\n\n pw.println(\"******************** Launched info ********************\");\n\n // should implement\n\n pw.println(\"\");\n\n pw.println(\"******************** gc info (top5) sorted by total_time ********************\");\n\n // -----------------------\n\n pw.println(String.format(\"%-20s\", \"time\")\n + String.format(\"%-10s\", \"PID\")\n + String.format(\"%-15s\", \"GC_cause\")\n + String.format(\"%-12s\", \"freedObject\")\n + String.format(\"%-10s\", \"freedByte\")\n + String.format(\"%-13s\", \"freedLObject\")\n + String.format(\"%-11s\", \"freedLByte\")\n + String.format(\"%-13s\", \"percent_free\")\n + String.format(\"%-18s\", \"current_heap_size\")\n + String.format(\"%-13s\", \"total_memory\")\n + String.format(\"%-11s\", \"pause_time\")\n + String.format(\"%-11s\", \"Total_time\"));\n\n ArrayList<GCData> totalTimeList = (ArrayList<GCData>)getGCDataList()\n .clone();\n Collections.sort(totalTimeList, new GCDataComparator(\n GCDataComparator.DataSortType.TOTAL_TIME));\n\n for (GCData gc : totalTimeList) {\n\n if (cnt >= 5)\n break;\n\n pw.println(String.format(\"%-20s\",\n ALTHelper.DateToString(gc.valutOfdate))\n + String.format(\"%-10s\", gc.PID)\n + String.format(\"%-15s\", gc.GC_cause)\n + String.format(\"%-12s\", gc.freedObject)\n + String.format(\"%-10s\", gc.freedByte)\n + String.format(\"%-13s\", gc.freedLObject)\n + String.format(\"%-11s\", gc.freedLByte)\n + String.format(\"%-13s\", gc.percent_free)\n + String.format(\"%-18s\", gc.current_heap_size)\n + String.format(\"%-13s\", gc.total_memory)\n + String.format(\"%-11s\", gc.pause_time)\n + String.format(\"%-11s\", gc.Total_time));\n cnt++;\n }\n\n pw.println(\"\");\n\n // -----------------------\n\n pw.println(\"******************** gc info sorted by date ********************\");\n\n pw.println(String.format(\"GC Total count : %5s\", getGCDataList()\n .size() + \" times\"));\n\n pw.println(String.format(\"%-20s\", \"time\")\n + String.format(\"%-10s\", \"processName\")\n + String.format(\"%-15s\", \"GC_cause\")\n + String.format(\"%-12s\", \"freedObject\")\n + String.format(\"%-10s\", \"freedByte\")\n + String.format(\"%-13s\", \"freedLObject\")\n + String.format(\"%-11s\", \"freedLByte\")\n + String.format(\"%-13s\", \"percent_free\")\n + String.format(\"%-18s\", \"current_heap_size\")\n + String.format(\"%-13s\", \"total_memory\")\n + String.format(\"%-11s\", \"pause_time\")\n + String.format(\"%-11s\", \"Total_time\"));\n\n for (GCData gc : getGCDataList()) {\n pw.println(String.format(\"%-20s\",\n ALTHelper.DateToString(gc.valutOfdate))\n + String.format(\"%-10s\", gc.PID)\n + String.format(\"%-15s\", gc.GC_cause)\n + String.format(\"%-12s\", gc.freedObject)\n + String.format(\"%-10s\", gc.freedByte)\n + String.format(\"%-13s\", gc.freedLObject)\n + String.format(\"%-11s\", gc.freedLByte)\n + String.format(\"%-13s\", gc.percent_free)\n + String.format(\"%-18s\", gc.current_heap_size)\n + String.format(\"%-13s\", gc.total_memory)\n + String.format(\"%-11s\", gc.pause_time)\n + String.format(\"%-11s\", gc.Total_time));\n }\n pw.println(\"\");\n\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } finally {\n if (pw != null)\n pw.close();\n }\n }", "SimulationOutput(long start, CsvWriter writer, UnifiedCompactionStrategy strategy)\n {\n this.start = start;\n this.strategy = strategy;\n this.calculator = strategy.getController().getCalculator();\n this.readIOCosts = new ArrayList<>();\n this.writeIOCosts = new ArrayList<>();\n\n writeCSVHeader(writer);\n }", "public String getCSVString() {\n return getId() + \",\" + noOfRounds + \",\" + caliber + \",\" + manufacturer + \",\" + price;\n }", "public void generateTrajectoryDistances(String csvName, String trajFileName, String questionLocationsName, String fileName, double meters) {\n Scanner csv = null;\n Scanner ql = null;\n try {\n csv = new Scanner(new File(csvName)); //csv of answer list\n ql = new Scanner(new File(questionLocationsName));\n FileWriter writer = new FileWriter(fileName + \".csv\");\n HashMap<String, ArrayList<AnswerTrajectory>> csvTraj = new HashMap<String, ArrayList<AnswerTrajectory>>(); //hash map that keys on trajectory id, storing all answer list trajectories in an array list\n HashMap<String, ArrayList<Trajectory>> trajectories = readTrajectories(trajFileName); //load the trajectory data into a hash map keyed by ID\n csv.nextLine();\n String currentId = \"\";\n ArrayList<AnswerTrajectory> anstj = new ArrayList<AnswerTrajectory>();\n ArrayList<String> Ids = new ArrayList<String>();\n\n ArrayList<Point2D.Double> questionLocations = new ArrayList<Point2D.Double>();\n\n while (ql.hasNextLine()) {\n questionLocations.add(new Point2D.Double(ql.nextDouble(), ql.nextDouble()));\n }\n\n\n while (csv.hasNextLine()) { //go through each answer entry and add trajectories of the answer list for each unique device id\n String[] line = csv.nextLine().split(\",\");\n if (currentId.equals(\"\")) {\n currentId = line[12];\n } else if (!currentId.equals(line[12])) {\n csvTraj.put(currentId, anstj);\n Ids.add(currentId); //if the id is new, then add it to the list of all known ids\n anstj = new ArrayList<AnswerTrajectory>();\n currentId = line[12];\n }\n anstj.add(new AnswerTrajectory(Double.parseDouble(line[13]), Double.parseDouble(line[14]), line[12], Double.parseDouble(line[9]), Integer.parseInt(line[0]), Integer.parseInt(line[16])));\n }\n writer.append(\"Distance,AnswerType,ID,Question\\n\");\n\n ArrayList<Trajectory> alltj = new ArrayList<Trajectory>();\n for (String s : Ids) //for each device ID determine the corresponding answer list\n {\n System.out.println(s);\n anstj = csvTraj.get(s); //get the hashmap arraylist that holds all trajectories for this device\n alltj = trajectories.get(s); //get all the trajectories under this Id\n\n if (anstj == null || alltj == null)\n System.out.println(\"Could not find trajectory data for deviceId: \" + s);\n\n else {\n Collections.sort(anstj, AnswerTrajectory.TSComparator); //sort answer list data by time\n Collections.sort(alltj, Trajectory.TSComparator); //sort trajectory data by time\n\n\n int currentQuestion = anstj.get(0).getQuestion(); //the first question\n int currentAnswer = anstj.get(0).getAnswer();\n int correct = 0;\n if (currentAnswer == 1 || currentAnswer == 2)\n correct = 1;\n\n boolean BC = true;// before the first question\n int total = 0;\n for (Trajectory t : alltj) {\n\n double timestamp = t.getTimeStamp() * 1000;\n\n if (BC && timestamp < anstj.get(0).getTimeStamp()) //use first trajectory as if it's before the first question\n {\n total++;\n //determine the distance and answer type\n double qX = questionLocations.get(currentQuestion - 1).getX(); //question location x and y\n double qY = questionLocations.get(currentQuestion - 1).getY();\n\n double tX = t.getX(); //trajectory x and y\n double tY = t.getY();\n\n double aX = anstj.get(0).getX(); //location when question was answered\n double aY = anstj.get(0).getY();\n\n double currentDist = Math.sqrt((tX - qX) * (tX - qX) + (tY - qY) * (tY - qY)); //distance from current location to question location\n double distToAnswer = Math.sqrt((aX - qX) * (aX - qX) + (aY - qY) * (aY - qY)); //distance from answer to answer location\n\n int answerId = 0;\n if (distToAnswer <= meters) {\n if (correct == 1)\n answerId = 1;\n\n if (correct == 0)\n answerId = 3;\n } else {\n if (correct == 1)\n answerId = 2;\n\n if (correct == 0)\n answerId = 4;\n }\n\n writer.append(currentDist + \",\" + answerId + \",\" + t.getId() + \",\" + anstj.get(0).getQuestion() + \"\\n\");\n BC = false;\n } else {\n break;\n }\n\n }\n\n for (int a = 0; a < anstj.size() - 1; a++) //for questions 1-n\n {\n //determine the distance and answer type\n\n double qX = questionLocations.get(anstj.get(a + 1).getQuestion() - 1).getX();//current question location x and y\n double qY = questionLocations.get(anstj.get(a + 1).getQuestion() - 1).getY();\n\n double tX = anstj.get(a).getX(); //current location x and y\n double tY = anstj.get(a).getY();\n\n double aX = anstj.get(a + 1).getX(); //location where question was answered\n double aY = anstj.get(a + 1).getY();\n\n double currentDist = Math.sqrt((tX - qX) * (tX - qX) + (tY - qY) * (tY - qY)); //distance from current location to question location\n double distToAnswer = Math.sqrt((aX - qX) * (aX - qX) + (aY - qY) * (aY - qY)); //distance from answer to answer location\n\n int answerId = 0;\n if (distToAnswer <= meters) {\n if (correct == 1)\n answerId = 1;\n\n if (correct == 0)\n answerId = 3;\n } else {\n if (correct == 1)\n answerId = 2;\n\n if (correct == 0)\n answerId = 4;\n }\n\n writer.append(currentDist + \",\" + answerId + \",\" + anstj.get(a).getId() + \",\" + anstj.get(a).getQuestion() + \"\\n\");\n }\n\n }\n }\n\n\n writer.flush();\n writer.close();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if (csv != null)\n csv.close();\n\n if (ql != null)\n ql.close();\n\n }\n }", "public void createCsvString(StringBuilder builder, Frequency e) {\r\n\r\n\t\tbuilder.append(\"\\\"\"\r\n\t\t\t\t+ (e.getName() != null ? e.getName().replace(\",\", \"\") : \"\")\r\n\t\t\t\t+ \"\\\",\");\r\n\r\n\t\tbuilder.append(\"\\\"\"\r\n\t\t\t\t+ (e.getQtyPerDay() != null ? e.getQtyPerDay() : \"\") + \"\\\",\");\r\n\r\n\t\tbuilder.append(\"\\r\\n\");\r\n\t}", "private void CreateNewFile() {\n\tcheckState();\n\t\n\tif (CanR=CanW=true)\n\t{\n\t\t\n\t\ttry {\n\t\t root = Environment.getExternalStorageDirectory();\n\t\t \n\t\t if (root.canWrite()){\n\t\t gpxfile = new File(root, \"Speed_SD.csv\");\n\t\t gpxwriter = new FileWriter(gpxfile,true);\n\t\t out = new BufferedWriter(gpxwriter);\nout.append(\"\"+\",\"+\"\"+\",\"+\"\");\n\t\t out.newLine();\n\t\t }\n\t\t} catch (IOException e) {\n\t\t //Log.e(, \"Could not write file \" + e.getMessage());\ne.printStackTrace();\n\t\t\n\t}\n\t\t\n}\n\t\t}", "public void writeToCSV(String path) throws IOException, SQLException {\n\t\tWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path), \"UTF-8\"));\n\t\t// Title\n\t\tout.write(\"pageId;title;earliest year;latest year;mean year;\");\n\t\t// IBM\n\t\tout.write(\n\t\t\t\t\"Anger;Disgust;Fear;Joy;Sadness;Analytical;Confident;Tentative;Openness;Conscientiousness;Extraversion;Agreeableness;Emotional Range;\");\n\t\t// LIWC\n\t\tout.write(\n\t\t\t\t\"LIWC;Word Count;Analytical thinking;Clout;Authentic;Emotional tone;Dictionary Words;Positive Emotion;Negative Emotion;Anxiety;Anger;Sadness;Tentative;Certainty;Power;Risk;Death;\");\n\t\tout.write(\"AlchemyTone;mixed;score;type;\");\n\t\tout.write(\"\\n\");\n\t\tfor (Page page : this.getExtractsFromDatabase()) {\n\t\t\tint pageId = page.getPageId();\n\t\t\tString title = page.getTitle();\n\t\t\tToneAnalysis ibmTone = page.getIbmTone();\n\t\t\tReceptivitiAnalysis liwcTone = page.getLiwcTone();\n\t\t\tDocumentSentiment docSentiment = page.getDocumentSentiment();\n\t\t\tint earliestYear = page.getEarliestYear();\n\t\t\tint latestYear = page.getLatestYear();\n\t\t\tint meanYear = 0;\n\t\t\tif (earliestYear == 0) {\n\t\t\t\tmeanYear = latestYear;\n\t\t\t} else {\n\t\t\t\tmeanYear = (earliestYear + latestYear) / 2;\n\t\t\t}\n\t\t\tif (ibmTone != null) {\n\t\t\t\tout.write(pageId + \";\" + title + \";\" + earliestYear + \";\" + latestYear + \";\" + meanYear + \";\");\n\t\t\t\tElementTone documentTone = ibmTone.getDocumentTone();\n\t\t\t\tList<ToneCategory> toneCategories = documentTone.getTones();\n\t\t\t\tfor (ToneCategory toneCategory : toneCategories) {\n\t\t\t\t\tList<ToneScore> toneScores = toneCategory.getTones();\n\t\t\t\t\tfor (ToneScore toneScore : toneScores) {\n\t\t\t\t\t\t// String name = toneScore.getName();\n\t\t\t\t\t\tdouble score = toneScore.getScore();\n\t\t\t\t\t\tout.write(String.valueOf(score).replace('.', ','));\n\t\t\t\t\t\tout.write(\";\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tout.write(\";\");\n\n\t\t\t\tif (liwcTone != null) {\n\t\t\t\t\tDouble wordCount = liwcTone.getLiwcScores().getWc();\n\t\t\t\t\tDouble analyticalThinking = liwcTone.getLiwcScores().getAnalytic();\n\t\t\t\t\tDouble clout = liwcTone.getLiwcScores().getClout();\n\t\t\t\t\tDouble authentic = liwcTone.getLiwcScores().getAuthentic();\n\t\t\t\t\tDouble emotionalTone = liwcTone.getLiwcScores().getTone();\n\t\t\t\t\tDouble dictionaryWords = liwcTone.getLiwcScores().getDic();\n\n\t\t\t\t\tDouble posEmo = liwcTone.getLiwcScores().getCategories().getPosemo();\n\t\t\t\t\tDouble negEmo = liwcTone.getLiwcScores().getCategories().getNegemo();\n\t\t\t\t\tDouble anxiety = liwcTone.getLiwcScores().getCategories().getAnx();\n\t\t\t\t\tDouble anger = liwcTone.getLiwcScores().getCategories().getAnger();\n\t\t\t\t\tDouble sadness = liwcTone.getLiwcScores().getCategories().getSad();\n\t\t\t\t\tDouble tentative = liwcTone.getLiwcScores().getCategories().getTentat();\n\t\t\t\t\tDouble certainty = liwcTone.getLiwcScores().getCategories().getCertain();\n\t\t\t\t\tDouble power = liwcTone.getLiwcScores().getCategories().getPower();\n\t\t\t\t\tDouble risk = liwcTone.getLiwcScores().getCategories().getRisk();\n\t\t\t\t\tDouble death = liwcTone.getLiwcScores().getCategories().getDeath();\n\n\t\t\t\t\tout.write(wordCount + \";\");\n\t\t\t\t\tout.write(String.valueOf(analyticalThinking).replace('.', ',') + \";\");\n\t\t\t\t\tout.write(String.valueOf(clout).replace('.', ',') + \";\");\n\t\t\t\t\tout.write(String.valueOf(authentic).replace('.', ',') + \";\");\n\t\t\t\t\tout.write(String.valueOf(emotionalTone).replace('.', ',') + \";\");\n\t\t\t\t\tout.write(String.valueOf(dictionaryWords).replace('.', ',') + \";\");\n\t\t\t\t\tout.write(String.valueOf(posEmo).replace('.', ',') + \";\");\n\t\t\t\t\tout.write(String.valueOf(negEmo).replace('.', ',') + \";\");\n\t\t\t\t\tout.write(String.valueOf(anxiety).replace('.', ',') + \";\");\n\t\t\t\t\tout.write(String.valueOf(anger).replace('.', ',') + \";\");\n\t\t\t\t\tout.write(String.valueOf(sadness).replace('.', ',') + \";\");\n\t\t\t\t\tout.write(String.valueOf(tentative).replace('.', ',') + \";\");\n\t\t\t\t\tout.write(String.valueOf(certainty).replace('.', ',') + \";\");\n\t\t\t\t\tout.write(String.valueOf(power).replace('.', ',') + \";\");\n\t\t\t\t\tout.write(String.valueOf(risk).replace('.', ',') + \";\");\n\t\t\t\t\tout.write(String.valueOf(death).replace('.', ',') + \";\");\n\t\t\t\t}\n\t\t\t\tout.write(\";\");\n\t\t\t\tif (docSentiment != null) {\n\t\t\t\t\tString mixed = docSentiment.getSentiment().getMixed();\n\t\t\t\t\tDouble score = docSentiment.getSentiment().getScore();\n\t\t\t\t\tString type = docSentiment.getSentiment().getType().toString();\n\t\t\t\t\tout.write(String.valueOf(mixed).replace('.', ',') + \";\");\n\t\t\t\t\tout.write(String.valueOf(score).replace('.', ',') + \";\");\n\t\t\t\t\tout.write(String.valueOf(type).replace('.', ',') + \";\");\n\t\t\t\t}\n\t\t\t\tout.write(\"\\n\");\n\t\t\t}\n\t\t}\n\t\tout.close();\n\t\tSystem.out.println(\"Export finished.\");\n\n\t}", "private void writeToCsvForShinyDash(List<AnnotatedItem> allLineItems) throws IOException {\n String outName = CrossPlatformUtils.getRootPathIncludingTrailingSlash().orElseThrow() + \"out/extracted.csv\";\n try (PrintWriter writer = new PrintWriter(outName, StandardCharsets.UTF_8)) {\n writer.println(String.join(CSV_DELIMITER, \"date\", \"value\", \"lineItemType\", \"comment\", \"isExpense\"));\n allLineItems\n .forEach(ai -> {\n final List<String> row = ImmutableList.of(\n SIMPLE_DATE_FORMAT.format(ai.getDate()),\n ai.getValue().toString(),\n ai.getLineItemType().getFullName(),\n ai.getComment(),\n Boolean.toString(ai.getLineItemType().isExpense())\n );\n writer.println(String.join(CSV_DELIMITER, row));\n });\n }\n }", "void genReport() {\n\n current_part.save_state(); \n\n JTextArea ta = text;\n\n ta.setText(\"\");\n\n if (!t_foil_name.equals(\"Test\"))\n ta.append(\"Hydrofoil: \" + t_foil_name);\n\n java.util.Date date = new java.util.Date();\n ta.append(\"\\n Date: \" + date);\n \n wing.print( \"Main Wing\", ta);\n stab.print( \"Stabilizer Wing\", ta);\n strut.print(\"Mast (a.k.a. Strut)\", ta);\n fuse.print( \"Fuselage\", ta);\n\n ta.append( \"\\n\\n\");\n // tail volume is LAElev * AreaElev / (MACWing * AreaWing)\n // LAElev : The elevator's Lever Arm measured at the wing's and elevator's quarter chord point\n double LAElev = stab.xpos + stab.chord_xoffs + 0.25*stab.chord - (wing.xpos + wing.chord_xoffs + 0.25*wing.chord);\n // MAC : The main wing's Mean Aerodynamic Chord\n // AreaWing : The main wing's area\n // AreaElev : The elevator's area\n \n ta.append( \"\\nTail Voulume: \" + LAElev*stab.span*stab.chord/(wing.chord*wing.chord*wing.span));\n \n\n ta.append( \"\\n\\n\");\n switch (planet) {\n case 0: { \n ta.append( \"\\n Standard Earth Atmosphere\" );\n break;\n }\n case 1: { \n ta.append( \"\\n Martian Atmosphere\" );\n break;\n }\n case 2: { \n ta.append( \"\\n Water\" );\n break;\n }\n case 3: { \n ta.append( \"\\n Specified Conditions\" );\n break;\n }\n case 4: { \n ta.append( \"\\n Specified Conditions\" );\n break;\n }\n }\n\n // ta.append( \"\\n Altitude = \" + filter0(alt_val) );\n // if (lunits == IMPERIAL) ta.append( \" ft ,\" );\n // else /*METRIC*/ ta.append( \" m ,\" );\n \n switch (lunits) {\n case 0: { /* English */\n ta.append( \"\\n Density = \" + filter5(rho_EN) );\n ta.append( \"slug/cu ft\" );\n ta.append( \"\\n Pressure = \" + filter3(ps0/144.) );\n ta.append( \"lb/sq in,\" );\n ta.append( \" Temperature = \" + filter0(ts0 - 460.) );\n ta.append( \"F,\" );\n break;\n }\n case 1: { /* Metric */\n ta.append( \" Density = \" + filter3(rho_EN*515.4) );\n ta.append( \"kg/cu m\" );\n ta.append( \"\\n Pressure = \" + filter3(101.3/14.7*ps0/144.) );\n ta.append( \"kPa,\" );\n ta.append( \" Temperature = \" + filter0(ts0*5.0/9.0 - 273.1) );\n ta.append( \"C,\" );\n break;\n }\n }\n\n ta.append( \"\\n Speed = \" + filter1(velocity * (lunits==IMPERIAL? 0.868976 : 0.539957 )) + \"Kts, or\" );\n ta.append( \" \" + filter1(velocity) );\n if (lunits == IMPERIAL) ta.append( \" mph ,\" );\n else /*METRIC*/ ta.append( \" km/hr ,\" );\n\n // if (out_aux_idx == 1)\n // ta.append( \"\\n Lift Coefficient = \" + filter3(current_part.cl) );\n // if (out_aux_idx == 0) {\n // if (Math.abs(lift) <= 10.0) ta.append( \"\\n Lift = \" + filter3(lift) );\n // if (Math.abs(lift) > 10.0) ta.append( \"\\n Lift = \" + filter0(lift) );\n // if (lunits == IMPERIAL) ta.append( \" lbs \" );\n // else /*METRIC*/ ta.append( \" Newtons \" );\n // }\n // if ( polarOut == 1)\n // ta.append( \"\\n Drag Coefficient = \" + filter3(current_part.cd) );\n // if (out_aux_idx == 0) {\n // ta.append( \"\\n Drag = \" + filter0(drag) );\n // if (lunits == IMPERIAL) ta.append( \" lbs \" );\n // else /*METRIC*/ ta.append( \" Newtons \" );\n // }\n\n ta.append( \"\\n Lift = \" + dash.outTotalLift.getText());\n ta.append( \"\\n Drag = \" + dash.outTotalDrag.getText());\n\n if (min_takeoff_speed_info != null) \n ta.append( \"\\n\\n\" + min_takeoff_speed_info);\n\n if (cruising_info != null) \n ta.append( \"\\n\\n\" + cruising_info);\n\n if (max_speed_info != null) \n ta.append( \"\\n\\n\" + max_speed_info);\n\n // ensure end ta.setCaretPosition(ta.getText().length());\n // ensure start\n ta.setCaretPosition(0);\n }", "public void generateChart(){\n String[][] contents = retrieveFields();\n\n// String msg = \"test - \";\n// printCells(contents);\n\n String[] houseDisplay = new String[12];\n houseDisplay = new String[]{\"6\",\"4\",\"2\",\"1\",\"4\",\"6\",\"3\",\"5\",\"7/8\",\"\",\"5\",\"3\"};\n display(houseDisplay);\n }", "public static void generateGCTMatrix(String inputFile, String outputFile) {\n\t\ttry {\n\t\t\t\n\t\t\tLinkedList list = new LinkedList();\n\t\t\t\n \tFileWriter fwriter = new FileWriter(outputFile);\n BufferedWriter out = new BufferedWriter(fwriter);\n \n String first_row = \"NAME\\tDESCRIPTION\";\n\t\t\tFileInputStream fstream = new FileInputStream(inputFile);\n\t\t\tDataInputStream din = new DataInputStream(fstream);\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(din));\t\t\t\n\t\t\tString header = in.readLine();\n\t\t\tString[] split = header.split(\"\\t\");\n\t\t\tint num_samples = split.length - 1;\n\t\t\tfor (int i = 1; i < split.length; i++) {\n\t\t\t\tfirst_row += \"\\t\" + split[i];\n\t\t\t\t\n\t\t\t}\n\t\t\tint count_line = 0;\n\t\t\twhile (in.ready()) {\n\t\t\t\tString str = in.readLine();\t\n\t\t\t\tcount_line++;\n\t\t\t}\n\t\t\tin.close();\n\t\t\tout.write(\"#1.2\\n\");\n\t\t\tout.write(count_line + \"\\t\" + num_samples + \"\\n\");\n\t\t\tout.write(first_row + \"\\n\");\n\t\t\t\n\t\t\tfstream = new FileInputStream(inputFile);\n\t\t\tdin = new DataInputStream(fstream);\n\t\t\tin = new BufferedReader(new InputStreamReader(din));\t\t\t\n\t\t\theader = in.readLine();\n\t\t\tsplit = header.split(\"\\t\");\n\t\t\tnum_samples = split.length - 1;\n\t\t\t\n\t\t\twhile (in.ready()) {\n\t\t\t\tString str = in.readLine();\n\t\t\t\tsplit = str.split(\"\\t\");\n\t\t\t\tString line = split[0].replaceAll(\"\\\"\", \"\") + \"\\t\" + split[0].replaceAll(\"\\\"\", \"\");\n\t\t\t\tfor (int i = 1; i < split.length; i++) {\n\t\t\t\t\tline += \"\\t\" + split[i];\n\t\t\t\t}\n\t\t\t\tout.write(line + \"\\n\");\t\t\t\t\n\t\t\t}\n\t\t\tin.close();\t\t\t\n\t\t\tout.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n protected void draw(GrainMatrix grainMatrix) {\n dataTable = DataTable.create();\n dataTable.addColumn(ColumnType.DATETIME, \"Time\");\n for (MetaDefinition metric : grainMatrix.getMetaDefinitions()) {\n dataTable.addColumn(ColumnType.NUMBER, \"Min\");\n addTooltipColumn(dataTable);\n dataTable.addColumn(ColumnType.NUMBER, \"Avg\");\n addTooltipColumn(dataTable);\n dataTable.addColumn(ColumnType.NUMBER, \"Max\");\n addTooltipColumn(dataTable);\n dataTable.addColumn(ColumnType.NUMBER, \"Count\");\n addTooltipColumn(dataTable);\n dataTable.addColumn(ColumnType.NUMBER, \"Sum\");\n addTooltipColumn(dataTable);\n }\n\n TreeMap<Long, HashMap<String, Datapoint>> metricMap = grainMatrix.getMetricMap();\n dataTable.addRows(metricMap.size());\n\n int i = 0;\n for (long datetime : metricMap.keySet()) {\n dataTable.setValue(i, 0, new Date(datetime));\n i++;\n }\n\n int col = 1; // First column is reserved for Time\n int row = 0;\n Datapoint point;\n String tooltip;\n for (long datetime : metricMap.keySet()) {\n HashMap<String, Datapoint> innerMap = metricMap.get(datetime);\n col = 1;\n for (String metricId : innerMap.keySet()) {\n point = metricMap.get(datetime).get(metricId);\n tooltip = new Date(point.getDatetime()).toString() + \"\\n\" + \"Min: \" + point.getMin() + \"\\n\"\n + \"Avg: \" + point.getAvg() + \"\\n\" + \"Max: \" + point.getMax() + \"\\n\" + \"Count: \"\n + point.getCount() + \"\\n\" + \"Sum: \" + point.getSum() + \"\\n\";\n dataTable.setValue(row, col, point.getMin());\n col++;\n dataTable.setValue(row, col, tooltip);\n col++;\n dataTable.setValue(row, col, point.getAvg());\n col++;\n dataTable.setValue(row, col, tooltip);\n col++;\n dataTable.setValue(row, col, point.getMax());\n col++;\n dataTable.setValue(row, col, tooltip);\n col++;\n dataTable.setValue(row, col, point.getCount());\n col++;\n dataTable.setValue(row, col, tooltip);\n col++;\n dataTable.setValue(row, col, point.getSum());\n col++;\n dataTable.setValue(row, col, tooltip);\n col++;\n }\n row++;\n }\n\n chart.draw(dataTable, options);\n }", "String convertToCDF() {\n return String.valueOf(this.getScheduleID()) + \", \" +\n String.valueOf(this.getOfMedicationID()) + \", \" +\n String.valueOf(this.getForPersonID()) + \", \" +\n String.valueOf(this.getTimeDue()) + \", \" +\n String.valueOf(this.getStrategy()) +\n System.getProperty(\"line.separator\");\n }", "public void generateGradeDistCutTime(String csvName, String answersName, String questionLocationsName, String fileName, float meters) {\n Scanner csv = null;\n Scanner ql = null;\n Properties ans = new Properties();\n InputStream ansInput = null;\n try {\n csv = new Scanner(new File(csvName));\n ql = new Scanner(new File(questionLocationsName));\n ansInput = new FileInputStream(answersName);\n ans.load(ansInput);\n\n FileWriter writer = new FileWriter(fileName + (int) meters + \"v2.csv\");\n String topLine = csv.nextLine();\n writer.append(topLine.substring(0, topLine.length() - 2) + \",x,y,Answer,AnswerInt,Distance\\n\");\n\n ArrayList<Point2D.Double> questionLocations = new ArrayList<Point2D.Double>();\n\n while (ql.hasNextLine()) {\n questionLocations.add(new Point2D.Double(ql.nextDouble(), ql.nextDouble()));\n }\n int total = 0;\n while (csv.hasNextLine()) {\n\n String line = csv.nextLine();\n String[] orig = line.split(\",\");\n\n long ts = Long.parseLong(orig[9]);\n //if(ts < 1377334800000l || ts > 1377381600000l) //11 am to end of day\n if (ts < 1377334800000l || ts > 1377342000000l) // 11-1pm\n //if( ts < 1377334800000l|| ts > 1377429200343l) // both days\n //if( ts < 1377334800000l|| ts > 1377343122000l) // all of 24th\n {\n\n } else {\n System.out.println(orig[9] + \"\\t\" + ++total);\n String givAns = ans.getProperty(orig[0]).toLowerCase();\n String myAns = orig[1].toLowerCase();\n int whichQuestion = Integer.parseInt(orig[0]);\n\n int correct = 0;\n\n if (givAns.equals(myAns))\n correct = 1;\n\n\n //System.out.println(orig[orig.length-2] + \" y: \"+orig[orig.length-1]);\n //calculate the distance between the given input and the answer location\n double x1 = Double.parseDouble(orig[orig.length - 2]);\n double x2 = questionLocations.get(whichQuestion - 1).x;\n double y1 = Double.parseDouble(orig[orig.length - 1]);\n double y2 = questionLocations.get(whichQuestion - 1).y;\n\n\n Double dist = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));\n\n String answerType = \"\";\n int aTypeInt = 0;\n if (correct == 1) {\n if (dist <= meters) {\n answerType = \"CC\";\n aTypeInt = 1;\n } else {\n answerType = \"CD\";\n aTypeInt = 2;\n }\n } else {\n if (dist <= meters) {\n answerType = \"IC\";\n aTypeInt = 3;\n } else {\n answerType = \"ID\";\n aTypeInt = 4;\n }\n }\n\n writer.append(line + \",\" + answerType + \",\" + aTypeInt + \",\" + dist + \"\\n\");\n //System.out.println(myAns+\":\"+givAns+\"\\t\\t\\t\"+correct);\n }\n }\n writer.flush();\n writer.close();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if (ql != null) {\n try {\n ql.close();\n } catch (Exception e) {\n\n }\n }\n if (csv != null) {\n try {\n csv.close();\n } catch (Exception e) {\n\n }\n }\n if (ans != null) {\n try {\n csv.close();\n } catch (Exception e) {\n\n }\n }\n\n }\n\n }", "private void generateOutgoingReport() {\r\n\r\n\t\tStringBuilder stringBuilder = new StringBuilder();\r\n\t\tstringBuilder.append(\"\\n----------------------------------------\\n\")\r\n\t\t\t\t.append(\" Outgoing Daily Amount \\n\")\r\n\t\t\t\t.append(\"----------------------------------------\\n\")\r\n\t\t\t\t.append(\" Date | Trade Amount \\n\")\r\n\t\t\t\t.append(\"-----------------+----------------------\\n\");\r\n\t\tallOutgoings.entrySet().forEach(\r\n\t\t\t\tkey -> stringBuilder.append(key.getKey() + \" | \" + key.getValue().get() + \"\\n\"));\r\n\t\tdataWriter.write(stringBuilder.toString());\r\n\t}", "protected void writeReportFile(String sPathTemplate, QueryHandler handler)\n {\n char cDelim = getDelim();\n String sDesc = getDescTemplate();\n File fileOut = getFile(sPathTemplate);\n PrintStream streamOut = getPrintStream(fileOut);\n List listDisplay = m_listDisplay;\n\n // Write out report description and headers for new output files\n if (m_fHeaders && fileOut.length() == 0)\n {\n sDesc = replaceMacros(sDesc, null);\n if (sDesc.length() > 0)\n {\n writeDescription(streamOut, sDesc);\n }\n writeHeader(streamOut, listDisplay, cDelim);\n }\n\n boolean fDetail = false; // true if any column's value is row dependent\n for (Iterator iterCol = listDisplay.iterator(); iterCol.hasNext();)\n {\n ReportColumnView columnView = (ReportColumnView) iterCol.next();\n if (columnView != null)\n {\n fDetail |= columnView.isRowDetail() && columnView.isVisible();\n }\n }\n\n if (fDetail)\n {\n // write the details;\n for (Iterator iter = handler.getGroupKeys().iterator(); iter.hasNext(); )\n {\n writeDetail(streamOut, listDisplay, iter.next(), cDelim);\n }\n }\n else\n {\n // Write the aggregates and constants only\n Iterator iter = handler.getGroupKeys().iterator();\n\n // group-keys are row identifiers; any row will do for aggregates\n Object oFirstKey = iter.hasNext()\n ? iter.next()\n : null;\n\n writeDetail(streamOut, listDisplay, oFirstKey, cDelim);\n }\n streamOut.close();\n }", "public String generateNotificationDetailsCsvReport(\r\n\t\t\tSet<NotificationDetailsVO> notificationList,\r\n\t\t\tNotificationRequestVO requestVO) throws Exception;", "public void generateTrajectoryDistancesAndTimeForAnswerType(String csvName, String trajFileName, String questionLocationsName, String fileName, double meters, int answerType) {\n Scanner csv = null;\n Scanner ql = null;\n try {\n csv = new Scanner(new File(csvName)); //csv of answer list\n ql = new Scanner(new File(questionLocationsName)); //question locations (index 0 corresponds to question 1)\n\n String ap = \"\";\n if (answerType == 1)\n ap = \"CC\";\n else if (answerType == 2)\n ap = \"CD\";\n else if (answerType == 3)\n ap = \"IC\";\n else\n ap = \"ID\";\n\n FileWriter writer = new FileWriter(fileName + ap + \".csv\");\n HashMap<String, ArrayList<AnswerTrajectory>> csvTraj = new HashMap<String, ArrayList<AnswerTrajectory>>(); //hash map that keys on trajectory id, storing all answer list trajectories in an array list\n HashMap<String, ArrayList<Trajectory>> trajectories = readTrajectories(trajFileName); //load the trajectory data into a hash map keyed by ID\n csv.nextLine();\n String currentId = \"\";\n ArrayList<AnswerTrajectory> anstj = new ArrayList<AnswerTrajectory>();\n ArrayList<String> Ids = new ArrayList<String>();\n\n ArrayList<Point2D.Double> questionLocations = new ArrayList<Point2D.Double>();\n\n while (ql.hasNextLine()) {\n questionLocations.add(new Point2D.Double(ql.nextDouble(), ql.nextDouble()));\n }\n\n\n while (csv.hasNextLine()) { //go through each answer entry and add trajectories of the answer list for each unique device id\n String[] line = csv.nextLine().split(\",\");\n if (currentId.equals(\"\")) {\n currentId = line[12];\n } else if (!currentId.equals(line[12])) {\n csvTraj.put(currentId, anstj);\n Ids.add(currentId); //if the id is new, then add it to the list of all known ids\n anstj = new ArrayList<AnswerTrajectory>();\n currentId = line[12];\n }\n anstj.add(new AnswerTrajectory(Double.parseDouble(line[13]), Double.parseDouble(line[14]), line[12], Double.parseDouble(line[9]), Integer.parseInt(line[0]), Integer.parseInt(line[16])));\n }\n writer.append(\"Distance,Time,AnswerType,ID,Question\\n\");\n\n ArrayList<Trajectory> alltj = new ArrayList<Trajectory>();\n for (String s : Ids) //for each device ID determine the corresponding answer list\n {\n System.out.println(s);\n anstj = csvTraj.get(s); //get the hashmap arraylist that holds all trajectories for this device\n alltj = trajectories.get(s); //get all the trajectories under this Id\n\n if (anstj == null || alltj == null)\n System.out.println(\"Could not find trajectory data for deviceId: \" + s);\n\n else {\n Collections.sort(anstj, AnswerTrajectory.TSComparator); //sort it by time\n Collections.sort(alltj, Trajectory.TSComparator); //sort it by time\n\n\n int currentQuestion = anstj.get(0).getQuestion();\n int currentAnswer = anstj.get(0).getAnswer();\n int correct = 0;\n if (currentAnswer == 1 || currentAnswer == 2)\n correct = 1;\n\n boolean BC = true;// before the first question\n int total = 0;\n for (Trajectory t : alltj) {\n\n double timestamp = t.getTimeStamp() * 1000;\n\n if (BC && timestamp < anstj.get(0).getTimeStamp()) //use first trajectory as if it's before the first question\n {\n total++;\n //determine the distance and answer type\n double qX = questionLocations.get(currentQuestion - 1).getX(); //question location x and y\n double qY = questionLocations.get(currentQuestion - 1).getY();\n\n double tX = t.getX(); //trajectory x and y\n double tY = t.getY();\n\n double aX = anstj.get(0).getX(); //location when question was answered\n double aY = anstj.get(0).getY();\n\n double currentDist = Math.sqrt((tX - qX) * (tX - qX) + (tY - qY) * (tY - qY)); //distance from current location to question location\n double distToAnswer = Math.sqrt((aX - qX) * (aX - qX) + (aY - qY) * (aY - qY)); //distance from answer to answer location\n\n int answerId = 0;\n if (distToAnswer <= meters) {\n if (correct == 1)\n answerId = 1;\n\n if (correct == 0)\n answerId = 3;\n } else {\n if (correct == 1)\n answerId = 2;\n\n if (correct == 0)\n answerId = 4;\n }\n\n\n if (answerId == answerType)\n writer.append(currentDist + \",\" + t.getTimeStamp() + \",\" + answerId + \",\" + t.getId() + \",\" + anstj.get(0).getQuestion() + \"\\n\");\n\n BC = false;\n } else {\n break;\n }\n\n }\n\n for (int a = 0; a < anstj.size() - 1; a++) //for questions 1-n\n {\n //determine the distance and answer type\n\n double qX = questionLocations.get(anstj.get(a + 1).getQuestion() - 1).getX();//question location x and y\n double qY = questionLocations.get(anstj.get(a + 1).getQuestion() - 1).getY();\n\n double tX = anstj.get(a).getX(); //current location x and y\n double tY = anstj.get(a).getY();\n\n double aX = anstj.get(a + 1).getX(); //location when question was answered\n double aY = anstj.get(a + 1).getY();\n\n double currentDist = Math.sqrt((tX - qX) * (tX - qX) + (tY - qY) * (tY - qY)); //distance from current location to question location\n double distToAnswer = Math.sqrt((aX - qX) * (aX - qX) + (aY - qY) * (aY - qY)); //distance from answer to answer location\n\n int answerId = 0;\n if (distToAnswer <= meters) {\n if (correct == 1)\n answerId = 1;\n\n if (correct == 0)\n answerId = 3;\n } else {\n if (correct == 1)\n answerId = 2;\n\n if (correct == 0)\n answerId = 4;\n }\n if (answerId == answerType)\n writer.append(currentDist + \",\" + anstj.get(a).getTimeStamp() / 1000.0 + \",\" + answerId + \",\" + anstj.get(a).getId() + \",\" + anstj.get(a).getQuestion() + \"\\n\");\n }\n\n }\n }\n\n\n writer.flush();\n writer.close();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if (csv != null)\n csv.close();\n\n if (ql != null)\n ql.close();\n\n }\n }", "public MeasureData(Tuple tuple) {\n mtype = tuple.getStringByField(StormUtils.STORM.FIELDS.MEASURE_TYPE);\n caseid = tuple.getStringByField(StormUtils.STORM.FIELDS.CASE_ID);\n mid = tuple.getIntegerByField(StormUtils.STORM.FIELDS.MEASURE_ID);\n mvalue = tuple.getDoubleByField(StormUtils.STORM.FIELDS.MEASURE_VALUE);\n }", "private void startRecording() {\n Date now = new Date(System.currentTimeMillis());\n fileName = \"AccelerometerData_\" + sdf.format(now) + \"_sampling_\" + listenerSampling + \"microsec.csv\";\n String directory = Environment.getExternalStorageDirectory() + \"/_Parka/AccelerometerCsvFile\";\n\n csvWriter.createFile(fileName,directory);\n startTime = csvWriter.getStartTime();\n\n String headFileStr = \"Millisec\" + \",\" + \"TimeStamp\" + \",\"\n + \"Acce X\" + \",\" + \"Acce Y\" + \",\" + \"Acce Z\" + \",\"\n + \"Stop engine\"+\",\\n\";\n csvWriter.writeHeadFile(headFileStr);\n\n registerListener();\n Toast.makeText(this, \"START RECORDING | \"\n + \"file name = \" + fileName, Toast.LENGTH_SHORT).show();\n }", "public static void output(String filePath, BigDecimal[][] m){\n\t\tFileWriter fileWriter;\n\t\ttry {\n\t\t\tfileWriter = new FileWriter(filePath);\n\t\t\tfor(int i = 0; i < m.length; i++){\n\t\t\t\tfor(int j = 0; j < m[0].length; j++)\n\t\t\t\t\tfileWriter.append(m[i][j]+\"\\t\");\n\n\t\t\t\tfileWriter.append(\"\\n\");\n\t\t\t}\n\t\t\tfileWriter.flush();\n\t\t\tfileWriter.close();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tSystem.out.println(\"File writer error!\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n\t\t}\n\t}", "private Step exportSerial() {\n return stepBuilderFactory.get(STEP_CREATE_SCENARIO_METER_FILE)\n .tasklet(savingsPotentialExportMeterSerialTask)\n .listener(new ExecutionContextPromotionListener() {\n\n @Override\n public void beforeStep(StepExecution stepExecution) {\n ExecutionContext jobContext = stepExecution.getJobExecution().getExecutionContext();\n\n // Scenario key\n String jobContextKey = STEP_CREATE_SCENARIO_METER_FILE +\n Constants.PARAMETER_NAME_DELIMITER +\n SavingsPotentialExportMeterSerialTask.EnumInParameter.SCENARIO_KEY.getValue();\n jobContext.put(jobContextKey, getScenarioKey(stepExecution.getJobParameters()));\n\n // Set output filename\n jobContextKey = STEP_CREATE_SCENARIO_METER_FILE +\n Constants.PARAMETER_NAME_DELIMITER +\n SavingsPotentialExportMeterSerialTask.EnumInParameter.OUTPUT_FILENAME.getValue();\n jobContext.put(jobContextKey, METER_SERIAL_FILENAME);\n }\n\n @Override\n public ExitStatus afterStep(StepExecution stepExecution) {\n ExecutionContext jobContext = stepExecution.getJobExecution().getExecutionContext();\n\n String jobContextKey = STEP_EXPORT_METER_DATA +\n Constants.PARAMETER_NAME_DELIMITER +\n ExportMeterDataToFileTask.EnumInParameter.METER_FILTER_FILENAME.getValue();\n jobContext.put(jobContextKey, METER_SERIAL_FILENAME);\n\n return null;\n }\n\n })\n .build();\n }", "String report() {\n StringBuilder sb = new StringBuilder();\n // Header\n for (int i = 0; i < Stat.values().length; i++) {\n if (i > 0) {\n sb.append(\",\");\n }\n sb.append(Stat.values()[i].name);\n }\n // One line per job\n for (JobResult result : jobResults) {\n result.computeMetrics();\n sb.append(\"\\n\").append(result);\n }\n // Include aggregates for jobs and overall\n if (jobTypeResults.containsKey(\"ForwardChain\")) {\n jobTypeResults.get(\"ForwardChain\").computeMetrics();\n sb.append(\"\\n\").append(jobTypeResults.get(\"ForwardChain\"));\n }\n if (jobTypeResults.containsKey(\"DuplicateElimination\")) {\n jobTypeResults.get(\"DuplicateElimination\").computeMetrics();\n sb.append(\"\\n\").append(jobTypeResults.get(\"DuplicateElimination\"));\n }\n totals.computeMetrics();\n sb.append(\"\\n\").append(totals);\n return sb.toString();\n }", "@Override\n public void writeFile(String arg0, Map result) {\n\n // Initial variables\n ArrayList<HashMap> records;\n ArrayList<HashMap> recordT;\n ArrayList<HashMap> observeRecords; // Array of data holder for time series data\n BufferedWriter bwT; // output object\n StringBuilder sbData = new StringBuilder(); // construct the data info in the output\n HashMap<String, String> altTitleList = new HashMap(); // Define alternative fields for the necessary observation data fields; key is necessary field\n // P.S. Add alternative fields here\n HashMap titleOutput; // contain output data field id\n DssatObservedData obvDataList = DssatObservedData.INSTANCE; // Varibale list definition\n\n try {\n\n // Set default value for missing data\n setDefVal();\n\n // Get Data from input holder\n Object tmpData = getObjectOr(result, \"observed\", new Object());\n if (tmpData instanceof ArrayList) {\n records = (ArrayList) tmpData;\n } else if (tmpData instanceof HashMap) {\n records = new ArrayList();\n records.add((HashMap) tmpData);\n } else {\n return;\n }\n if (records.isEmpty()) {\n return;\n }\n\n observeRecords = new ArrayList();\n for (HashMap record : records) {\n recordT = getObjectOr(record, \"timeSeries\", new ArrayList());\n String trno = getValueOr(record, \"trno\", \"1\");\n if (!recordT.isEmpty()) {\n String[] sortIds = {\"date\"};\n Collections.sort(recordT, new DssatSortHelper(sortIds));\n for (HashMap recordT1 : recordT) {\n recordT1.put(\"trno\", trno);\n }\n observeRecords.addAll(recordT);\n }\n }\n\n // Initial BufferedWriter\n String fileName = getFileName(result, \"T\");\n if (fileName.endsWith(\".XXT\")) {\n String crid = DssatCRIDHelper.get2BitCrid(getValueOr(result, \"crid\", \"XX\"));\n fileName = fileName.replaceAll(\"XX\", crid);\n }\n arg0 = revisePath(arg0);\n outputFile = new File(arg0 + fileName);\n bwT = new BufferedWriter(new FileWriter(outputFile));\n\n // Output Observation File\n // Titel Section\n sbError.append(String.format(\"*EXP.DATA (T): %1$-10s %2$s\\r\\n\\r\\n\",\n fileName.replaceAll(\"\\\\.\", \"\").replaceAll(\"T$\", \"\"),\n getObjectOr(result, \"local_name\", defValBlank)));\n\n titleOutput = new HashMap();\n // TODO get title for output\n // Loop all records to find out all the titles\n for (HashMap record : observeRecords) {\n // Check if which field is available\n for (Object key : record.keySet()) {\n // check which optional data is exist, if not, remove from map\n if (obvDataList.isTimeSeriesData(key)) {\n titleOutput.put(key, key);\n\n } // check if the additional data is too long to output\n else if (key.toString().length() <= 5) {\n if (!key.equals(\"date\") && !key.equals(\"trno\")) {\n titleOutput.put(key, key);\n }\n\n } // If it is too long for DSSAT, give a warning message\n else {\n sbError.append(\"! Waring: Unsuitable data for DSSAT observed data (too long): [\").append(key).append(\"]\\r\\n\");\n }\n }\n // Check if all necessary field is available // P.S. conrently unuseful\n for (String title : altTitleList.keySet()) {\n\n // check which optional data is exist, if not, remove from map\n if (getValueOr(record, title, \"\").equals(\"\")) {\n\n if (!getValueOr(record, altTitleList.get(title), \"\").equals(\"\")) {\n titleOutput.put(title, altTitleList.get(title));\n } else {\n sbError.append(\"! Waring: Incompleted record because missing data : [\").append(title).append(\"]\\r\\n\");\n }\n\n } else {\n }\n }\n }\n\n // decompress observed data\n// decompressData(observeRecords);\n // Observation Data Section\n Object[] titleOutputId = titleOutput.keySet().toArray();\n Arrays.sort(titleOutputId);\n String pdate = getPdate(result);\n for (int i = 0; i < (titleOutputId.length / 39 + titleOutputId.length % 39 == 0 ? 0 : 1); i++) {\n\n sbData.append(\"@TRNO DATE\");\n int limit = Math.min(titleOutputId.length, (i + 1) * 39);\n for (int j = i * 39; j < limit; j++) {\n sbData.append(String.format(\"%1$6s\", titleOutput.get(titleOutputId[j]).toString().toUpperCase()));\n }\n sbData.append(\"\\r\\n\");\n\n for (HashMap record : observeRecords) {\n \n if (record.keySet().size() <= 2 && record.containsKey(\"trno\") && record.containsKey(\"date\")) {\n continue;\n }\n sbData.append(String.format(\" %1$5s\", getValueOr(record, \"trno\", \"1\")));\n sbData.append(String.format(\" %1$5s\", formatDateStr(getObjectOr(record, \"date\", defValI))));\n for (int k = i * 39; k < limit; k++) {\n\n if (obvDataList.isDapDateType(titleOutputId[k], titleOutput.get(titleOutputId[k]))) {\n sbData.append(String.format(\"%1$6s\", formatDateStr(pdate, getObjectOr(record, titleOutput.get(titleOutputId[k]).toString(), defValI))));\n } else if (obvDataList.isDateType(titleOutputId[k])) {\n sbData.append(String.format(\"%1$6s\", formatDateStr(getObjectOr(record, titleOutput.get(titleOutputId[k]).toString(), defValI))));\n } else {\n sbData.append(\" \").append(formatNumStr(5, record, titleOutput.get(titleOutputId[k]), defValI));\n }\n\n }\n sbData.append(\"\\r\\n\");\n }\n }\n // Add section deviding line\n sbData.append(\"\\r\\n\");\n\n // Output finish\n bwT.write(sbError.toString());\n bwT.write(sbData.toString());\n bwT.close();\n } catch (IOException e) {\n LOG.error(DssatCommonOutput.getStackTrace(e));\n }\n }", "public void append4Create(final StringBuilder _cmd)\n throws MatrixException\n {\n for (final PropertyDef property : this.properties) {\n _cmd.append(\" property \\\"\").append(AbstractTest.convertMql(property.getName())).append(\"\\\"\");\n if (property.getTo() != null) {\n property.getTo().create();\n _cmd.append(\" to \").append(property.getTo().getCI().getMxType()).append(\" \\\"\")\n .append(AbstractTest.convertMql(property.getTo().getName())).append(\"\\\"\");\n if (property.getTo().getCI() == AbstractTest.CI.UI_TABLE) {\n _cmd.append(\" system\");\n }\n }\n if (property.getValue() != null) {\n _cmd.append(\" value \\\"\").append(AbstractTest.convertMql(property.getValue())).append(\"\\\"\");\n }\n }\n }", "public static void writeQueriesToCSV(ArrayList<ArrayList<ArrayList<Double>>> query, String name) throws IOException {\r\n\t\t@SuppressWarnings(\"resource\")\r\n\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(name+\".csv\"));\r\n\t\tfor (int i=0; i<query.size();i++){\r\n\t\t\tint a=0;\r\n\t\t\tString entry=\"\";\r\n\t\t\tfor(a=0; a<query.get(i).size()-1;a++) {\r\n\t\t\t\tentry+=query.get(i).get(a).get(0) +\",\"+ query.get(i).get(a).get(1)+\",\" ;\t\r\n\t\t\t}\r\n\t\t\tentry+= query.get(i).get(a).get(0)+\",\" +\";\";\r\n\t\t\twriter.write(entry);\r\n\t\t\twriter.newLine();\r\n\r\n\t\t} \t\t\twriter.flush();\r\n\t\t\t\t\twriter.close();}", "@SuppressWarnings(value = \"unchecked\")\r\n private static void writeFileHeaders(MultipleOutputs mo) throws IOException {\r\n\r\n// final Integer tileWindow = (Integer)localConfMap.get(\"tileWindow\");\r\n// final Boolean saveSkippedInfo = (Boolean)localConfMap.get(\"saveSkippedInfo\");\r\n//\r\n// mo.getCollector(\"tile10\", null).collect(new Text(\"header\"),\r\n// new Text(\"variableStep chrom=chrM span=\" + tileWindow.toString() + \"\\n\"));\r\n// mo.getCollector(\"tile\", null).collect(new Text(\"header\"),\r\n// new Text(\"variableStep chrom=chrM span=\" + tileWindow.toString() + \"\\n\"));\r\n//\r\n// String[] headerOddReadBed = {\"Chromosome\",\r\n// \"Start\",\r\n// \"End\",\r\n// \"Feature\",\r\n// \"Translocations\"};\r\n//\r\n// mo.getCollector(\"oddreadbed\", null).collect(new Text(\"header\"),\r\n// new Text(StringUtils.join(headerOddReadBed) + \"\\n\"));\r\n//\r\n// String[] headerOddReadList = {\"FromChr\",\r\n// \"FromPos\",\r\n// \"ToChr\",\r\n// \"ToPos\",\r\n// \"MapQ\",\r\n// \"Distance\",\r\n// \"StrandQ\",\r\n// \"StrandM\"};\r\n//\r\n// mo.getCollector(\"oddreadlist\", null).collect(new Text(\"header\"),\r\n// new Text(StringUtils.join(headerOddReadList) + \"\\n\"));\r\n//\r\n//\r\n// mo.getCollector(\"wigsame\", null).collect(new Text(\"header\"),\r\n// new Text(\"variableStep chrom=chrM span=\" + tileWindow.toString() + \"\\n\"));\r\n// mo.getCollector(\"wigdiff\", null).collect(new Text(\"header\"),\r\n// new Text(\"variableStep chrom=chrM span=\" + tileWindow.toString() + \"\\n\"));\r\n//\r\n// String[] headerOutliers = {\"read\",\r\n// \"pos\",\r\n// \"chromosome\",\r\n// \"qname\",\r\n// \"seq\",\r\n// \"score\",\r\n// \"distance\"};\r\n//\r\n// mo.getCollector(\"outlier\", null).collect(new Text(\"header\"),\r\n// new Text(StringUtils.join(headerOutliers) + \"\\n\"));\r\n//\r\n//\r\n// if (saveSkippedInfo) {\r\n// String[] headerSkippedReads = {\"rname\",\r\n// \"mPos\",\r\n// \"mapQScore\",\r\n// \"dupeFlag\",\r\n// \"failedQC\",\r\n// \"randomIndex\"};\r\n//\r\n// mo.getCollector(\"skipped\", null).collect(new Text(\"header\"),\r\n// new Text(StringUtils.join(headerSkippedReads) + \"\\n\"));\r\n// }\r\n }", "private void generateIncomingReport() {\r\n\r\n\t\tStringBuilder stringBuilder = new StringBuilder();\r\n\t\tstringBuilder.append(\"\\n----------------------------------------\\n\")\r\n\t\t\t\t.append(\" Incoming Daily Amount \\n\")\r\n\t\t\t\t.append(\"----------------------------------------\\n\")\r\n\t\t\t\t.append(\" Date | Trade Amount \\n\")\r\n\t\t\t\t.append(\"-----------------+----------------------\\n\");\r\n\t\tallIncomings.entrySet().forEach(\r\n\t\t\t\tkey -> stringBuilder.append(key.getKey() + \" | \" + key.getValue().get() + \"\\n\"));\r\n\t\tdataWriter.write(stringBuilder.toString());\r\n\t}", "public void writeEvaluateResultCSV(String resultFilePath) {\n writeCSV(resultFilePath, evaluates());\n System.out.println(\"write evaluate result finished:\" + resultFilePath);\n\n }", "public static String getTableDataInCSVFormat(final TableModel inputTableModel) {\r\n\t\t\r\n\t\tfinal StringBuffer output = new StringBuffer();\r\n\t\tfinal int totalRows = inputTableModel.getRowCount();\r\n\t\tfinal int totalColumns = inputTableModel.getColumnCount();\r\n\t\t\r\n\t\tif (totalRows < 1) {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\r\n\t\tfor (int currentRow = 0; currentRow < totalRows; currentRow++) {\r\n\r\n\t\t\tfor (int currentColumn = 0; currentColumn < totalColumns; currentColumn++) {\r\n\t\t\t\toutput.append(inputTableModel.getValueAt(currentRow, currentColumn));\r\n\t\t\t\t// Append a ',' but not for the last value\r\n\t\t\t\tif (currentColumn != totalColumns - 1) {\r\n\t\t\t\t\toutput.append(',');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Append a new line, but not for the last line\r\n\t\t\tif (currentRow != totalRows - 1) {\r\n\t\t\t\toutput.append('\\n');\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn output.toString();\r\n\r\n\t}", "public static void writeCSV(Calendar cal) {\n\n try {\n\n BufferedWriter bw = null;\n\n String fileString = \"P5Calendar.csv\";\n String fileLine = \"\";\n\n FileWriter fw = new FileWriter(fileString, false);\n bw = new BufferedWriter(fw);\n\n ArrayList<Activity> activities = cal.getActivities();\n\n for (int j = 0; j < 1; j++) {\n bw.write(\"Year\" + \",\" + \"Month\" + \",\" + \"Activity\" + \",\" + \"Role\" + \"\\n\");\n }\n\n for (int i = 0; i < activities.size(); i++) {\n Activity activity = activities.get(i);\n bw.append(activity.Year + \",\" + activity.Month + \",\" + activity.Name + \",\" + activity.Roles);\n }\n\n bw.close();\n\n } catch (IOException e) {\n\n e.printStackTrace();\n\n }\n\n }", "private void saveMarkovToCSVFileInformation(){\n //Clear out the current NewCensusColumnDetails before saving.\n this.currentMarkovChain.setNewCensusColumnDetails(new ArrayList<NewCensusColumnDetails>());\n \n ArrayList<NewCensusColumnDetails> newCensusColumnDetails = new ArrayList<>();\n \n ArrayList<cerl.gui.utilities.Class> censusClasses = this.currentMarkovChain.getCensusClasses();\n List<SurveyColumnValuesGrouping> surveyGroupings = this.currentMarkovChain.getSelectSurveyClass().getSurveyColumnValuesGroupings();\n\n /**\n * These will be used to find the min and max values stored in the grid. \n * \n * Row data starts at index 1.\n * Column data starts at index 2.\n */\n int rowToStartAt = START_EDITABLE_ROW;\n \n for(int surveyCounter = 0; surveyCounter < surveyGroupings.size(); surveyCounter++){ //rows\n int currentColumnNumber = START_EDITABLE_COL;\n SurveyColumnValuesGrouping surveyGrouping = surveyGroupings.get(surveyCounter);\n\n double newTotalRandomNumber = 0;\n ArrayList<Integer> oldValueLookUpColumns = new ArrayList<Integer>();\n\n for(int censusCounter = 0; censusCounter < censusClasses.size(); censusCounter++){ //columns\n cerl.gui.utilities.Class censusClass = censusClasses.get(censusCounter);\n oldValueLookUpColumns.add(censusClass.getColumnNumber());\n\n double[] minMaxValues = this.myTable.getMinMaxObject(rowToStartAt + surveyCounter, currentColumnNumber);\n\n double foundMin = minMaxValues[0];\n double foundMax = minMaxValues[1];\n\n double foundRandomNumber = 0.0;\n if(foundMin == foundMax){\n foundRandomNumber = foundMax;\n }else {\n foundRandomNumber = ThreadLocalRandom.current().nextDouble(foundMin, foundMax);\n foundRandomNumber = Math.round(foundRandomNumber * 100.0) / 100.0;\n }\n\n newTotalRandomNumber += foundRandomNumber;\n if(currentColumnNumber < END_EDITABLE_COL){\n currentColumnNumber++;\n }\n }\n\n //set min and max numbers\n //New column header that will appear in the new csv file\n NewCensusColumnDetails details = new NewCensusColumnDetails(\n surveyGrouping.toString(), \n newTotalRandomNumber,\n oldValueLookUpColumns,\n 0\n );\n\n newCensusColumnDetails.add(details);\n }\n \n newCensusColumnDetails = setCensusTotalColumns(newCensusColumnDetails);\n \n //Add the new NewCensusColumnDetails to the current MarkovChain object\n this.currentMarkovChain.setNewCensusColumnDetails(newCensusColumnDetails);\n }", "public void outputToCSV() throws FileNotFoundException, UnsupportedEncodingException {\n PrintWriter writer = new PrintWriter(\"test_data.csv\", \"UTF-8\");\n\n //For every object in array list, print surname, initials and extension, separated by commmas\n for (int i=0; i<toArrayList().size(); i++) {\n writer.println(toArrayList().get(i).getSurname() + \",\" + toArrayList().get(i).getInitials() + \",\" +\n toArrayList().get(i).getExtension());\n }\n writer.close();\n }", "public String getTemplate(AnalysisOutput output) {\n String performance = output.getPerformance();\n String alert = output.getAlert();\n String history = output.getHistory();\n Baseline baseline = null;\n ReportStatus status;\n String measurement = \" \";\n Job job = null;\n Matcher matcher = PATTERN_AVG_COUNT.matcher(performance);\n if (matcher.find()) {\n String template = \"unknown\";\n int averageCount = Integer.parseInt(matcher.group(1));\n if (averageCount == 1) {\n template = reportTemplate1;\n } else {\n Matcher avgMatcher = PATTERN_AVG.matcher(performance);\n if (avgMatcher.find()) {\n short avgElapsedPct = Short.parseShort(avgMatcher.group(1).replaceAll(\">999\", \"+999\"));\n short avgCpuPct = Short.parseShort(avgMatcher.group(2).replaceAll(\">999\", \"+999\"));\n short avgExcpPct = Short.parseShort(avgMatcher.group(3).replaceAll(\">999\", \"+999\"));\n short avgSrvuPct = Short.parseShort(avgMatcher.group(4).replaceAll(\">999\", \"+999\"));\n baseline = new Baseline(avgElapsedPct, avgCpuPct, avgExcpPct, avgSrvuPct);\n } else {\n throw new RuntimeException(\"Could not evaluate avg_count for performance analysis\");\n }\n }\n\n // Evaluate job and program information\n Matcher jobProgInf = PATTERN_FIRST.matcher(performance);\n if (jobProgInf.find()) {\n String jobName = jobProgInf.group(1);\n String stepName = jobProgInf.group(2);\n String procStep = jobProgInf.group(3);\n String program = jobProgInf.group(4);\n job = new Job(jobName, stepName, procStep, program);\n } else {\n throw new RuntimeException(\"Could not evaluate output information\");\n }\n\n if (averageCount > 1) {\n String alertJob = \"unknown\";\n if (alert.contains(\"No ALERTS generated today\")) {\n status = ReportStatus.WITHIN_THE_NORMAL_RANGE;\n template = reportTemplate2;\n } else {\n Matcher alertMatcher = PATTERN_ALERT.matcher(alert);\n if (alertMatcher.find()) {\n alertMatcher.find(); //Second match\n alertJob = alertMatcher.group(1);\n measurement = alertJob;\n if (alertJob.contains(job.name)) {\n status = ReportStatus.ALERT;\n template = reportTemplate3;\n } else {\n status = ReportStatus.WITHIN_THE_NORMAL_RANGE;\n template = reportTemplate2;\n }\n final SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd\");\n String formattedDate = dateFormat.format(new Date());\n if (history.contains(formattedDate)) {\n template = template.replace(\"%MAT_MEASUREMENT_ALERT%\",\n \"PMA generated an alert and MAT measurement was performed\");\n } else {\n template = template.replace(\"%MAT_MEASUREMENT_ALERT%\", \" \");\n }\n } else {\n throw new RuntimeException(\"Could not evaluate alert information\");\n }\n }\n\n if ((status != ReportStatus.WARNING) && (status != ReportStatus.ALERT)) {\n status = ReportStatus.WITHIN_THE_NORMAL_RANGE;\n if (baseline.elapsed <= NORMAL_RANGE_THRESHOLD) {\n status = ReportStatus.WARNING;\n }\n if (baseline.cpu <= NORMAL_RANGE_THRESHOLD) {\n status = ReportStatus.WARNING;\n }\n if (baseline.excp <= NORMAL_RANGE_THRESHOLD) {\n status = ReportStatus.WARNING;\n }\n if (baseline.srvu <= NORMAL_RANGE_THRESHOLD) {\n status = ReportStatus.WARNING;\n }\n }\n if (status == ReportStatus.WARNING) {\n template = reportTemplate4;\n }\n\n template = template.replace(\"%ELP%\", baseline.elapsed + \"%\");\n template = template.replace(\"%ELP_STATUS%\", baseline.elapsed <= 0 ? \"success\" : \"failures\");\n template = template.replace(\"%CPU%\", baseline.cpu + \"%\");\n template = template.replace(\"%CPU_STATUS%\", baseline.cpu <= 0 ? \"success\" : \"failures\");\n template = template.replace(\"%EXCP%\", baseline.excp + \"%\");\n template = template.replace(\"%EXCP_STATUS%\", baseline.excp <= 0 ? \"success\" : \"failures\");\n template = template.replace(\"%SRVU%\", baseline.srvu + \"%\");\n template = template.replace(\"%SRVU_STATUS%\", baseline.srvu <= 0 ? \"success\" : \"failures\");\n\n Matcher previousMatcher = PATTERN_SEC.matcher(performance);\n String prefix = \"CUR\";\n while (previousMatcher.find()) {\n template = template.replace(\"%\" + prefix + \"_DATE%\", previousMatcher.group(1));\n template = template.replace(\"%\" + prefix + \"_TIME%\", previousMatcher.group(2));\n template = template.replace(\"%\" + prefix + \"_CODE%\", previousMatcher.group(3));\n template = template.replace(\"%\" + prefix + \"_SYSTEM%\", previousMatcher.group(4));\n template = template.replace(\"%\" + prefix + \"_ELAPSED%\", previousMatcher.group(5));\n template = template.replace(\"%\" + prefix + \"_CPU%\", previousMatcher.group(6));\n template = template.replace(\"%\" + prefix + \"_EXCP%\", previousMatcher.group(7));\n template = template.replace(\"%\" + prefix + \"_SRVU%\", previousMatcher.group(8));\n prefix = \"PREV\";\n }\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\");\n String reportGenerateTimestamp = sdf.format(new Date());\n Matcher avgCalc = PATTERN_AVG_CALC.matcher(performance);\n\n if (avgCalc.find()) {\n template = template.replace(\"%AVG_CALCULATION%\", avgCalc.group(1));\n template = template.replace(\"%AVG_ELAPSED%\", avgCalc.group(2));\n template = template.replace(\"%AVG_CPU%\", avgCalc.group(3));\n template = template.replace(\"%AVG_EXCP%\", avgCalc.group(4));\n template = template.replace(\"%AVG_SRVU%\", avgCalc.group(5));\n } else {\n throw new RuntimeException(\"Could not evaluate average calculations\");\n }\n template = template.replace(\"%MEASUREMENT%\", measurement);\n template = template.replace(\"%INITIAL_TEST%\", status.toString().replaceAll(\"_\", \" \"));\n template = template.replace(\"%JOBNAME%\", job.name);\n template = template.replace(\"%STEPNAME%\", job.step);\n template = template.replace(\"%PROCSTEP%\", job.proc);\n template = template.replace(\"%PROGRAM%\", job.pgmJcl);\n template = template.replace(\"%REPORT_GENERATE_TIMESTAMP%\", reportGenerateTimestamp);\n return template;\n }\n } else {\n throw new RuntimeException(\"Could not evaluate average count\");\n }\n throw new RuntimeException(\"Could not create e-mail template with performance analysis results.\");\n }", "@Override\n public List<String> getMeasures() {\n return measures;\n }", "@Test\n public void test_ToTableFormat() {\n System.out.println(\"Testing MeasuredRatioModel's toTableFormat()\");\n MeasuredRatioModel instance = new MeasuredRatioModel();\n String expResult = \"0 : 0\";\n String result = instance.toTableFormat();\n assertEquals(expResult, result);\n instance = new MeasuredRatioModel(\"Specific\",new BigDecimal(\"213\"),\"ABS\",new BigDecimal(\"0.4324\"),false,true);\n result = instance.toTableFormat();\n expResult=\"213 : 0.4324\";\n assertEquals(expResult, result);\n }", "@Override\n protected void getSummaryCSV() throws IOException {\n if (!\"\".equals(config.statsfile.trim()))\n ((IVoltDBConnection)connection).writeSummaryCSV(fullStatsContext.fetch().getStats(), config.statsfile);\n }", "private Result outputCsv(Request request, Entry entry) throws Exception {\r\n Result result = getCsvResult(request, entry);\r\n result.setReturnFilename(\r\n IOUtil.stripExtension(getStorageManager().getFileTail(entry))\r\n + \".csv\");\r\n result.setMimeType(\"text/csv\");\r\n\r\n return result;\r\n }", "public String getCSVString() {\n StringBuilder builder = new StringBuilder();\n\n // key / value header\n builder.append(\"key,\\tvalue\");\n builder.append(System.getProperty(\"line.separator\").toString());\n\n // key / value pairs\n for (Entry<String, String> entry : results.entrySet()) {\n builder.append(entry.getKey());\n builder.append(\",\");\n builder.append(entry.getValue());\n builder.append(System.getProperty(\"line.separator\").toString());\n }\n\n builder.deleteCharAt(builder.length() - 1);\n return builder.toString();\n }", "private void writeCSVDict(String currentTime, String scanType, String timeStamp, String spectStart, String spectEnd, String numPoints, String resolution, String numAverages, String measTime, boolean saveOS) {\n\n String prefix = filePrefix.getText().toString();\n if (prefix.equals(\"\")) {\n prefix = \"Nano\";\n }\n\n if (saveOS) {\n String csv = android.os.Environment.getExternalStorageDirectory().getAbsolutePath() + \"/\" + prefix + currentTime + \".dict\";\n\n CSVWriter writer;\n try {\n writer = new CSVWriter(new FileWriter(csv));\n List<String[]> data = new ArrayList<String[]>();\n data.add(new String[]{\"Method\", scanType});\n data.add(new String[]{\"Timestamp\", timeStamp});\n data.add(new String[]{\"Spectral Range Start (nm)\", spectStart});\n data.add(new String[]{\"Spectral Range End (nm)\", spectEnd});\n data.add(new String[]{\"Number of Wavelength Points\", numPoints});\n data.add(new String[]{\"Digital Resolution\", resolution});\n data.add(new String[]{\"Number of Scans to Average\", numAverages});\n data.add(new String[]{\"Total Measurement Time (s)\", measTime});\n\n writer.writeAll(data);\n\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\tprivate Formatter getDynamicCSVFormatters() {\n\t\t int i = 1;\n\t\t CSVFomatter formatter = new CSVFomatter(FormatPattern.getFormatPattern(i),converter);\n\t\t CSVFomatter chainedFormatter = formatter,\n\t\t \t\t nextFormatter ;\n\t\t //Create a dynamic chain of the formatters -- Chain of Responsibility(COR)\n\t\t for(i = i + 1; i<=FormatPattern.DATA_PATTERNS.size(); i++) {\n\t\t \t nextFormatter = new CSVFomatter(FormatPattern.getFormatPattern(i),converter);\n\t\t \t chainedFormatter.setNextFormatter(nextFormatter);\n\t\t \t chainedFormatter = nextFormatter;\n\t\t }\n\t\t \n\t\t return formatter;\n\t}", "public void generateTimeOfFirstQuestion(String csvName, String fileName) {\n Scanner csv = null;\n try {\n csv = new Scanner(new File(csvName)); //csv of answer list\n FileWriter writer = new FileWriter(fileName + \".csv\");\n HashMap<String, ArrayList<AnswerTrajectory>> csvTraj = new HashMap<String, ArrayList<AnswerTrajectory>>(); //hash map that keys on trajectory id, storing all answer list trajectories in an array list\n\n csv.nextLine();\n String currentId = \"\";\n ArrayList<AnswerTrajectory> anstj = new ArrayList<AnswerTrajectory>();\n ArrayList<String> Ids = new ArrayList<String>();\n\n while (csv.hasNextLine()) { //go through each answer entry and add trajectories of the answer list for each unique device id\n String[] line = csv.nextLine().split(\",\");\n if (currentId.equals(\"\")) {\n currentId = line[12];\n } else if (!currentId.equals(line[12])) {\n csvTraj.put(currentId, anstj);\n Ids.add(currentId); //if the id is new, then add it to the list of all known ids\n anstj = new ArrayList<AnswerTrajectory>();\n currentId = line[12];\n }\n anstj.add(new AnswerTrajectory(Double.parseDouble(line[13]), Double.parseDouble(line[14]), line[12], Double.parseDouble(line[9]), Integer.parseInt(line[0]), Integer.parseInt(line[16])));\n }\n writer.append(\"ID,TimeFirstQuestionAnsweredSinceEventStart\\n\");\n\n for (String s : Ids) //for each device ID determine the corresponding answer list\n {\n anstj = csvTraj.get(s); //get the hashmap arraylist that holds all trajectories for this device\n\n if (anstj == null)\n System.out.println(\"Could not find data for deviceId: \" + s);\n\n else {\n Collections.sort(anstj, AnswerTrajectory.TSComparator); //sort answer list data by time\n writer.append(anstj.get(0).getId() + \",\" + (anstj.get(0).getTimeStamp() - 1377334800000.0) / 1000.0 + \"\\n\");\n }\n\n }\n\n\n writer.flush();\n writer.close();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if (csv != null)\n csv.close();\n\n }\n }", "public File exportData() {\n File zephyrlogFolder = new File(Environment.getExternalStorageDirectory(), \"QuestionnaireActs\");\n\n boolean dirExists = zephyrlogFolder.exists();\n //if the directory doesn't exist, create it\n if (!dirExists) {\n dirExists = zephyrlogFolder.mkdirs();\n //if it still doesn't exist, give up and exit\n if (!dirExists) {\n Toast.makeText(this, \"Could not create ZephyrLogs directory!\", Toast.LENGTH_LONG).show();\n }\n }\n\n\n //create a data file and write into it\n File file = new File(zephyrlogFolder, \"Questionnaire_\"+promptName+\".txt\");\n try {\n FileWriter writer;\n if(!file.exists()){\n boolean created = file.createNewFile();\n if (!created) throw new IOException(\"Could not create data file\");\n writer = new FileWriter(file, true);\n //if this is a new file, write the CSV format at the top\n writer.write(\"Ονοματεπώνυμο: \"+promptName+\"\\n\"+\"Score: \"+myscore+\"\\n\\n\");\n } else {\n writer = new FileWriter(file, true);\n }\n writer.write(\"Ονοματεπώνυμο: \"+promptName+\"\\n\"+\"Score: \"+myscore+\"\\n\\n\");\n writer.close();\n } catch (FileNotFoundException e) {\n Toast.makeText(this, \"Could not create logging file!\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n } catch (UnsupportedEncodingException e) {\n Toast.makeText(this, \"Unsupported encoding exception thrown trying to write file!\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n } catch (IOException e) {\n Toast.makeText(this, \"IO Exception trying to write to data file!\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n }\n return file;\n }", "public void makeReport()\n\t{\n\t\tif (currentStage[currentSlice-1] > 1)\n\t\t{\n\t\t\tResultsTable rt = new ResultsTable();\n\t\t\tfor (int j=0;j<popSequence.N;j++)\n\t\t\t{\n\t\t\t\tpop = popSequence.PopList[j];\n\t\t\t\tint N = pop.N;\n\t\t\t\tfor (int i=0;i<N;i++)\n\t\t\t\t{\n\t\t\t\t\trt.incrementCounter();\n\t\t\t\t\tBalloon bal;\n\t\t\t\t\tbal = (Balloon)(pop.BallList.get(i));\n\t\t\t\t\tbal.mass_geometry();\n\t\t\t\t\trt.addValue(\"X\",bal.x0);\n\t\t\t\t\trt.addValue(\"Y\",bal.y0);\n\t\t\t\t\trt.addValue(\"Z\",j);\n\t\t\t\t\trt.addValue(\"ID\",bal.id);\n\t\t\t\t\trt.addValue(\"AREA\",bal.area);\n\t\t\t\t\trt.addValue(\"Ixx\",bal.Ixx);\n\t\t\t\t\trt.addValue(\"Iyy\",bal.Iyy);\n\t\t\t\t\trt.addValue(\"Ixy\",bal.Ixy);\n\t\t\t\t\trt.addValue(\"Lx\",bal.lx);\n\t\t\t\t\trt.addValue(\"Ly\",bal.ly);\n\t\t\t\t}\n\t\t\t}\n\t\t\trt.show(\"Report\");\n\t\t\tcurrentSlice = i1.getCurrentSlice();\n\t\t\tipWallSegment = (i1.getStack()).getProcessor(i1.getCurrentSlice());\n\t\t\tpop = popSequence.PopList[currentSlice-1];\n\t\t}\n\t}", "private void writeMatrixToCSV(File outputCSV, double[][] matrix) throws IOException {\n\t\tFileWriter FW = new FileWriter(outputCSV);\n\t\tfor (int i = 0; i < matrix[0].length; i++) {\n\t\t\tString row = \"\";\n\t\t\tfor (int j = 0; j < matrix.length; j++) {\n\t\t\t\trow += matrix[j][i];\n\t\t\t\tif (j != matrix.length - 1) {\n\t\t\t\t\trow += \", \";\n\t\t\t\t}\n\t\t\t}\n\t\t\trow += \"\\n\";\n\t\t\tFW.write(row);\n\t\t}\n\t\tFW.close();\n\t}", "public void generateOutputData() {\n\t\tArrayList<String> inputDataArray = new ArrayList<String>();\n\t\tif (removeDuplicates) {\n\t\t\tinputDataArray = removeDuplicates();\n\t\t} else {\n\t\t\tinputDataArray = inputDataValues;\n\t\t}\n\t\t\n\t\toutputDataValues.clear();\n\t\tString outputDataValue = \"\";\n\t\tif (inputDataArray.isEmpty()) {\n\t\t\toutputDataValue = getOutputDataValue(\"\");\n\t\t\toutputDataValues.add(outputDataValue);\n\t\t} else {\n\t\t\tfor (String inputDataValue: inputDataArray) {\n\t\t\t\toutputDataValue = getOutputDataValue(inputDataValue);\n\t\t\t\toutputDataValues.add(outputDataValue);\n\t\t\t}\n\t\t}\n\t}", "public java.util.List<Object> generateDataSet(java.util.List<Object> genericProperties);", "String toCSVString();", "static void generate(Proc proc, PrintWriter outData)\r\n {\r\n for (int i=0; i < proc.lines.size(); i++)\r\n {\r\n //String l = (String) proc.lines.elementAt(i);\r\n Line line = \tproc.lines.elementAt(i);\r\n outData.println(line.line);\r\n }\r\n outData.println();\r\n }", "public String compile(String separator, NumberFormat numberFormat) {\r\n\t\t// set up header\r\n\t\tString content = \"'Format=4\" + System.lineSeparator();\r\n\t\t\r\n\t\tif(header.checkUnit.length() > 0) {\r\n\t\t\tcontent += \"'CheckUnit=\" + header.checkUnit + System.lineSeparator(); // implied by format=4\r\n\t\t}\r\n\t\tif(header.checkPlausibility.length() > 0) {\r\n\t\t\tcontent += \"'CheckPlausibility=\" + header.checkPlausibility + System.lineSeparator();\t\r\n\t\t}\r\n\t\tif(header.source.length() > 0) {\r\n\t\t\tcontent += \"'Source=\" + header.source + System.lineSeparator();\r\n\t\t}\r\n\t\tif(header.timeZone.length() > 0) {\r\n\t\t\tcontent += \"'TimeZone=\" + header.timeZone + System.lineSeparator();\r\n\t\t}\r\n\t\t\r\n\t\t// compile rows\r\n\t\tfor(Row row : rows) {\r\n\t\t\tcontent += row.toCsv(separator, numberFormat);\r\n\t\t}\r\n\t\t\r\n\t\treturn content;\r\n\t}", "private static void writeHashtableIntScoreCountToCSV(Hashtable<Integer, ScoreCount<Integer>> dataset, String path) {\n\t\tCSVWriter writer = new CSVWriter(new BufferedWriter(ExceptHandler.createFileWriter(path)));\n\t\tlogger.trace(\"Content of the CSV file\");\n\t\tlong nbLines = 0;\n\t\tboolean quoteElements = false;\n\t\tfor(Iterator<Integer> it=dataset.keySet().iterator(); it.hasNext();) {\n\t\t\tInteger userID = it.next();\n\t\t\tScoreCount<Integer> profile = dataset.get(userID);\n\t\t\tfor(Iterator<Integer> iter=profile.getItems().iterator(); iter.hasNext();) {\n\t\t\t\tInteger itemID = iter.next();\n\t\t\t\tDouble rating = profile.getValue(itemID);\n\n\t\t\t\tString[] csvLine = {userID.toString(), itemID.toString(), rating.toString()};\n\t\t\t\tlogger.trace(\"csvLine: {},{},{}\", userID, itemID, rating);\n\t\t\t\twriter.writeNext(csvLine, quoteElements);\n\t\t\t\tnbLines++;\n\t\t\t}\n\t\t}\n\t\tExceptHandler.closeCSVWriter(writer);\n\t\tlogger.info(\"{} lines written\", nbLines);\n\t}", "public String toFactString() {\n\t\tStringBuffer buf = new StringBuffer();\n\t\tbuf.append(\"f-\" + id + \" (\" + this.template.getName());\n\t\tif (this.slots.length > 0) {\n\t\t\tbuf.append(\" \");\n\t\t}\n\t\tfor (int idx = 0; idx < this.slots.length; idx++) {\n\t\t\tbuf.append(\"(\" + this.slots[idx].getName() + \" \");\n\t\t\tif (slots[idx] instanceof DimensionSlot) {\n\t\t\t\tbuf.append(\"Dimension\");\n\t\t\t} else if (slots[idx] instanceof MeasureSlot) {\n\t\t\t\tbuf.append(\"Measure\");\n\t\t\t}\n\t\t\tbuf.append(\") \");\n\t\t}\n\t\tbuf.append(\")\");\n\t\treturn buf.toString();\n\t}" ]
[ "0.58091515", "0.5680007", "0.56331396", "0.55475175", "0.55467856", "0.54663926", "0.54548764", "0.5340841", "0.52599365", "0.5207009", "0.51663697", "0.51313573", "0.5120298", "0.5077844", "0.50693846", "0.5058682", "0.50118005", "0.49969664", "0.49419653", "0.4939545", "0.4937829", "0.49368328", "0.4925662", "0.49093345", "0.4887808", "0.48867878", "0.48597065", "0.4853195", "0.48354816", "0.47892216", "0.47885802", "0.47796285", "0.47678947", "0.47549656", "0.47439435", "0.47296533", "0.4724289", "0.47162235", "0.4705639", "0.47031066", "0.4676645", "0.46747783", "0.466623", "0.46624058", "0.46549997", "0.4634332", "0.46336395", "0.46330723", "0.4632219", "0.463092", "0.46123946", "0.45984018", "0.45920327", "0.4591401", "0.45882636", "0.45876005", "0.45747057", "0.45729652", "0.45706037", "0.45663503", "0.45629036", "0.4561704", "0.45599362", "0.45455098", "0.45409355", "0.4536269", "0.45310277", "0.45112914", "0.45085752", "0.4498777", "0.44975966", "0.4497033", "0.44943333", "0.44918418", "0.448852", "0.4485482", "0.4484223", "0.4474309", "0.4474263", "0.44710007", "0.44628128", "0.44567502", "0.4453251", "0.44487405", "0.4446076", "0.44458312", "0.44452378", "0.4444274", "0.44407493", "0.4438073", "0.44357336", "0.44333506", "0.44238365", "0.44211704", "0.44206098", "0.44149745", "0.44107765", "0.4402397", "0.43990624", "0.43983328" ]
0.56575835
2
BigDecimal pointOne = new BigDecimal(0.1);
public static void main(String[] args) { BigDecimal pointOne = new BigDecimal("0.1"); BigDecimal sum = new BigDecimal(0); for (int i = 0; i < 10; i++) { sum = sum.add(pointOne); } System.out.println("ans:" + sum); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DecimalConstant( BigDecimal value)\n {\n this( value, null);\n }", "public void setPoints(java.math.BigDecimal points) {\n this.points = points;\n }", "BigDecimal getFixedPointField();", "void setSingleBetMinimum(java.math.BigDecimal singleBetMinimum);", "public void setCurrency1(BigDecimal newCurrency1) {\n\tcurrency1 = newCurrency1;\n}", "void setValue(BigDecimal value);", "public void setField_737(java.math.BigDecimal value);", "BigDecimal getValue();", "public void setPriceActual (BigDecimal PriceActual);", "BigDecimal getPrice();", "@Test\n public void testBigDecimalConstructorDefaultCurrency() {\n new Money(new BigDecimal(\"1.231\"));\n }", "public Balance() {\r\n value = BigDecimal.ZERO;\r\n }", "BigDecimal getEBigDecimal();", "java.math.BigDecimal getSingleBetMinimum();", "public BigDecimal getConvertedSplitQty() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"ConvertedSplitQty\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}", "public void setValue(BigDecimal value) { this.m_value = value; }", "@Override\n\tpublic void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException {\n\t\t\n\t}", "void insertDecimalPoint();", "public static void test1() {\n BigDecimal value = new BigDecimal(0);\n Random rn = new Random();\n\n for (int i = 0; i < 10; i++) {\n int randomNumber = rn.nextInt(1000) + 1;\n value = value.add(new BigDecimal(randomNumber));\n System.out.println(\"value = \" + value.abs());\n }\n }", "public BigDecimal getPriceActual();", "void xsetSingleBetMinimum(org.apache.xmlbeans.XmlDecimal singleBetMinimum);", "public void setSupBynum1(BigDecimal supBynum1) {\n this.supBynum1 = supBynum1;\n }", "@Test\n public void testBigDecimalConstructorDefaultRounding() {\n new Money(new BigDecimal(\"1.231\"), Currency.getInstance(\"USD\"));\n }", "public static void main(String[] args) {\n\t\r\n\tdouble b=100.1-50;\r\n\tSystem.err.println(b);\r\n\t\r\n\tSystem.err.println(\"----------------------------------\");\r\n\t BigDecimal b1 = new BigDecimal(100.1); \r\n BigDecimal b2 = new BigDecimal(50); \r\n System.err.println(b1.subtract(b2).doubleValue()); \r\n \r\n BigDecimal b3 = new BigDecimal(Double.toString(100.1)); \r\n BigDecimal b4 = new BigDecimal(Double.toString(50));\r\n System.err.println(b1.subtract(b2).doubleValue()); \r\n}", "public BigDecimal getSplitQty() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"SplitQty\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}", "public BigDecimal getBigDecimalAttribute();", "public LargerRandomNumberBigDecimal() {\n mValue = new BigDecimal(0);\n }", "BigDecimal getFare();", "public void setPriceLastInv (BigDecimal PriceLastInv);", "public BigDecimal getCurrency1() {\n\treturn currency1;\n}", "public void setPriceEntered (BigDecimal PriceEntered);", "@Test\n public void testMovieBigDecimalVal() {\n Client client = new JaxWsClient();\n MovieService movieService =\n (MovieService) client.getClient(new ClientInfo(MovieService.class,\n \"http://localhost:9002/Movie\", false));\n\n Assert.assertEquals(new BigDecimal(1), movieService\n .testMovieBigDecimalVal(new BigDecimal(1)));\n }", "public void setCurrency2(BigDecimal newCurrency2) {\n\tcurrency2 = newCurrency2;\n}", "public void setPriceStd (BigDecimal PriceStd);", "public BigDecimal getConvertedProductQty() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"ConvertedProductQty\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}", "public java.math.BigDecimal getH_set1() throws java.rmi.RemoteException;", "@Test\n public void roundOffDecimalPoints() throws IOException {\n BigDecimal actual = Utils.roundOffDecimalPoints(new BigDecimal(1), 2, 2);\n Assert.assertEquals(\"100.00\", actual.toString());\n }", "public static void main(String[] args) {\n Float f1 = 74.02f;\r\n System.out.println(\"float f1=\" + f1);\r\n Float f2 = f1 * 100;\r\n System.out.println(\"float f1 * 100 =\" + f2 + \", longvalue=\" + f2.longValue());\r\n System.out.println(\"float f1 * 100 =\" + f2 + \", rounded=\" + Math.round(f2));\r\n BigDecimal b1 = new BigDecimal(f1);\r\n System.out.println(\"BigDecimal b1=\" + b1);\r\n System.out.println(\"scale =\" + b1.scale());\r\n BigDecimal b2 = b1.setScale(2,BigDecimal.ROUND_HALF_UP);\r\n System.out.println(\"BigDecimal b2=\" + b2);\r\n System.out.println(\"scale =\" + b2.scale());\r\n System.out.println(\"b2.multiply(new BigDecimal(100) =\" + b2.multiply(new BigDecimal(100)));\r\n long l = b2.multiply(new BigDecimal(100)).longValue();\r\n System.out.println(\"long l =\" + l);\r\n System.out.println(\"b2.scaleByPowerOfTen(2) =\" + b2.scaleByPowerOfTen(2));\r\n System.out.println(\" using convertToPence(b1)=\" + convertToPence(b1));\r\n\r\n for (long l1 = 0; l1 <= 10000; l1++) {\r\n float f3 = l1;\r\n f3 = f3 / 100;\r\n float f4 = f3 * 100;\r\n if (f4 != l1) {\r\n //System.out.println(\"rounding error l1=\" + l1 + \", f3=\" + f3 + \", f4=\" + f4);\r\n BigDecimal b3 = convertFromPence(l1);\r\n long l2 = convertToPence(b3);\r\n if (l1 != l2) {\r\n System.out.println(\"rounding error l1=\" + l1 + \", l2=\" + l2);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n\r\n\r\n }", "public void setRewardPoint(BigDecimal rewardPoint) {\n this.rewardPoint = rewardPoint;\n }", "java.math.BigDecimal getMultipleBetMinimum();", "BigDecimal getLowPrice();", "public static BigDecimal nullToZero(BigDecimal b)\n {\n if(isEmptyDecimal(b))\n {\n return BigDecimal.ZERO;\n }\n else\n {\n return b;\n }\n }", "BigDecimal getOpenPrice();", "public BigDecimal getCost() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"Cost\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}", "public void setDecimal(java.math.BigDecimal param) {\n this.localDecimal = param;\n }", "public void setPriceStdEntered (BigDecimal PriceStdEntered);", "public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException {\n currentPreparedStatement.setBigDecimal(parameterIndex, x);\n }", "public static void main(String[] args) {\r\n\tBigDecimal bd1 = new BigDecimal(0.2);\r\n\t\tBigDecimal bd2 = new BigDecimal(0.4);\r\n\t\tBigDecimal add = bd1.add(bd2);\r\n\t\tSystem.out.println(add.setScale(2, BigDecimal.ROUND_DOWN));\r\n\t}", "public double getB1() {\n return B1;\n }", "java.math.BigDecimal getFractionalMinimum();", "public BigDecimal getConvertedShrinkQty() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"ConvertedShrinkQty\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}", "public BigDecimal getBigDecimalPositiveDecimal() throws ServiceException {\n try {\n Call<ResponseBody> call = service.getBigDecimalPositiveDecimal();\n ServiceResponse<BigDecimal> response = getBigDecimalPositiveDecimalDelegate(call.execute(), null);\n return response.getBody();\n } catch (ServiceException ex) {\n throw ex;\n } catch (Exception ex) {\n throw new ServiceException(ex);\n }\n }", "public Balance(final BigDecimal value) {\r\n this.value = value;\r\n }", "void setFractionalMinimum(java.math.BigDecimal fractionalMinimum);", "public BigDecimal getBSCA_ProfitPriceLimitEntered();", "public DecimalConstant( BigDecimal value, String format)\n {\n super( Type.NUMBER, value);\n setFormat( format);\n }", "void setBigDecimal(int index, BigDecimal value) throws\n SQLException;", "protected abstract BigDecimal calculate();", "@Test\n\tpublic void testSingleSetOnlyDecimal()\n\t{\n\t\tcreateSingleValueSet(1.1);\n\t\tKeyedValues actual = DataUtilities.getCumulativePercentages(m_values);\n\t\t\n\t\tassertEquals(\"Cumulative percentage of a single decimal value should be 100%.\",\n\t\t\t\t1.0, actual.getValue(0).doubleValue(), 0.0000001);\n\t}", "public BigDecimal getPriceEntered();", "public void setPriceLastOrd (BigDecimal PriceLastOrd);", "public BigDecimal getPriceStd();", "BigDecimal getHighPrice();", "BigDecimal getDirtyPrice();", "BigDecimal getClosePrice();", "public void setPriceLimit (BigDecimal PriceLimit);", "public BigDecimal getBSCA_ProfitPriceStdEntered();", "@Test\n public void testZeroPrice() {\n double expectedValue = new BigDecimal(0.0, new MathContext(5)).doubleValue();\n double actualValue = MarkupCalculator.determinePrice(new BigDecimal(0.0),\n BigInteger.valueOf(5),\n ProductType.FOOD)\n .round(new MathContext(5)).doubleValue();\n \n Assert.assertEquals(\"failure - zero price test produced the wrong result\",\n expectedValue, \n actualValue, 0.001);\n }", "org.apache.xmlbeans.XmlDecimal xgetSingleBetMinimum();", "@Test\n public void test_conversion_of_big_decimal_value() {\n String className = \"ClipboardPageWithBigDecimal\";\n\n ClipboardPage page = api.createPage(className, \"\");\n BigDecimal expected = new BigDecimal(\"223355771111.1313\");\n page.getProperty(\"bigDecimalField\").setValue(expected);\n\n Schema pageSchema = SchemaBuilder\n .record(className)\n .fields()\n .name(\"bigDecimalField\").type().stringType().noDefault()\n .endRecord();\n\n // When\n GenericRecord record = converter.convertClipboardPageToGenericRecord(page, pageSchema);\n\n // Then\n assertEquals(\"223355771111.1313\", record.get(\"bigDecimalField\"));\n }", "public PreparedCallableQuery setBigDecimal(String parameterName, BigInteger x) throws SQLException {\r\n if (x == null) {\r\n cstmt.setNull(parameterName, Types.DECIMAL);\r\n } else {\r\n cstmt.setBigDecimal(parameterName, new BigDecimal(x));\r\n }\r\n\r\n return this;\r\n }", "public PreparedCallableQuery setBigDecimal(String parameterName, BigDecimal x) throws SQLException {\r\n cstmt.setBigDecimal(parameterName, x);\r\n\r\n return this;\r\n }", "public void setConvertedSplitQty (BigDecimal ConvertedSplitQty)\n{\nset_Value (\"ConvertedSplitQty\", ConvertedSplitQty);\n}", "public BigDecimal getSupBynum1() {\n return supBynum1;\n }", "public void setH_set1(java.math.BigDecimal newH_set1)\n\t\tthrows java.rmi.RemoteException;", "public BigDecimal getBSCA_ProfitPriceLimit();", "public void setPayAmt (BigDecimal PayAmt);", "void setMultipleBetMinimum(java.math.BigDecimal multipleBetMinimum);", "org.apache.xmlbeans.XmlDecimal xgetFractionalMinimum();", "public WellSetListPOJOBigDecimal(WellSetBigDecimal single) {\n this.wellsets.add(new WellSetPOJOBigDecimal(single));\n }", "public BigDecimal getProductQty() \n{\nBigDecimal bd = (BigDecimal)get_Value(\"ProductQty\");\nif (bd == null) return Env.ZERO;\nreturn bd;\n}", "public static void bigDecimal() {\n\n\t\tSystem.out.println(\"BigDecimalExample.bigDecimal()\");\n\t\tBigDecimal n1 = new BigDecimal(123.456);\n\t\tBigDecimal n2 = new BigDecimal(789.012);\n\t\tBigDecimal n3 = new BigDecimal(-2.0);\n\n\t\tSystem.out.println(\"n1: \" + n1);\n\t\tSystem.out.println(\"n2: \" + n2);\n\t\tSystem.out.println(\"n3: \" + n3);\n\t\t// System.out.println(\"n2.toEngineeringString(): \" + n2.toEngineeringString());\n\t\t// System.out.println(\"n2.toPlainString(): \" + n2.toPlainString());\n\t\tSystem.out.println();\n\n\t\tSystem.out.println(\"n1.add(n2): \" + n1.add(n2));\n\t\tSystem.out.println(\"n1: \" + n1); // n1.add(n2) returns a new BigDecimal, it does not modify n1 itself\n\t\tSystem.out.println(\"n1.subtract(n2): \" + n1.subtract(n2));\n\t\tSystem.out.println(\"n2.divide(n1): \" + n1.divide(n3));\n\t\tSystem.out.println(\"n2.multiply(n1): \" + n1.multiply(n1));\n\t\tSystem.out.println(\"n3.pow(4): \" + n3.pow(4));\n\t\tSystem.out.println(\"n2.remainder(n1): \" + n2.remainder(n1));\n\t\tSystem.out.println();\n\n\t\tSystem.out.println(\"n3.abs(): \" + n3.abs());\n\t\tSystem.out.println(\"n2.negate(): \" + n2.negate());\n\t\tSystem.out.println(\"n3.negate(): \" + n3.negate());\n\t\tSystem.out.println(\"n2.plus(): \" + n2.plus());\n\t\tSystem.out.println(\"n3.plus(): \" + n3.plus());\n\t\tSystem.out.println();\n\n\t\t// Since there are no relational operators available, you need to use compareTo\n\t\tSystem.out.println(\"n1.compareTo(n1): \" + n1.compareTo(n1)); // equal\n\t\tSystem.out.println(\"n1.compareTo(n2): \" + n1.compareTo(n2)); // less than\n\t\tSystem.out.println(\"n1.compareTo(n3): \" + n1.compareTo(n3)); // greater than\n\t\tSystem.out.println();\n\n\t\tSystem.out.println(\"n2: \" + n2);\n\t\tSystem.out.println(\"n2.scale(): \" + n2.scale()); // scale = number of digits after the decimal point\n\t\tSystem.out.println(\"n2.precision(): \" + n2.precision()); // precision = number of digits in unscaled value\n\t\tSystem.out.println(\"n2.movePointRight(3): \" + n2.movePointRight(3));\n\t\tSystem.out.println(\"n2.movePointLeft(3) : \" + n2.movePointLeft(3));\n\t\tSystem.out.println(\"n2.movePointRight(3): \" + n2.movePointRight(3));\n\t\tSystem.out.println(\"n2.scaleByPowerOfTen(3): \" + n2.scaleByPowerOfTen(3));\n\t\tSystem.out.println(\"n2.scaleByPowerOfTen(-3): \" + n2.scaleByPowerOfTen(-3));\n\n\t\tSystem.out.println();\n\n\t\tSystem.out.println(\"n2.min(n1): \" + n2.min(n1));\n\t\tSystem.out.println(\"n2.max(n1): \" + n2.max(n1));\n\n\t}", "private double roundToOneDecimal(double num) {\n\t\treturn (int)((10 * num) + 0.5) / 10.0;\n\t}", "public BigDecimal getPriceStdEntered();", "public void setAMOUNT_NEW(BigDecimal AMOUNT_NEW) {\r\n this.AMOUNT_NEW = AMOUNT_NEW;\r\n }", "public java.math.BigDecimal getQtyPeriod1() \r\n {\r\n return get_ValueAsBigDecimal(\"QtyPeriod1\");\r\n \r\n }", "public static BigDecimal nullEmptyToValue(BigDecimal b,BigDecimal theValue)\n {\n if(isEmptyDecimal(b))\n {\n\t return theValue;\n }\n else\n {\n\t return b;\n }\n }", "BigDecimal getAmount();", "public void setFigure(BigDecimal figure) {\r\n this.figure = figure;\r\n }", "BigDecimal getTotal();", "BigDecimal getTotal();", "public void putBigDecimalPositiveDecimal(BigDecimal numberBody) throws ServiceException {\n if (numberBody == null) {\n throw new ServiceException(\n new IllegalArgumentException(\"Parameter numberBody is required and cannot be null.\"));\n }\n try {\n Call<ResponseBody> call = service.putBigDecimalPositiveDecimal(numberBody);\n ServiceResponse<Void> response = putBigDecimalPositiveDecimalDelegate(call.execute(), null);\n response.getBody();\n } catch (ServiceException ex) {\n throw ex;\n } catch (Exception ex) {\n throw new ServiceException(ex);\n }\n }", "org.apache.xmlbeans.XmlDecimal xgetMultipleBetMinimum();", "public void setPriceList (BigDecimal PriceList);", "BigDecimal getTax();", "public void setSMART_OPTION1(BigDecimal SMART_OPTION1) {\r\n this.SMART_OPTION1 = SMART_OPTION1;\r\n }", "public void setSMART_OPTION1(BigDecimal SMART_OPTION1) {\r\n this.SMART_OPTION1 = SMART_OPTION1;\r\n }", "public void setPrice(BigDecimal price) {\r\n this.price = price;\r\n }", "public void setPrice(BigDecimal price) {\r\n this.price = price;\r\n }", "public BigDecimal getBSCA_ProfitPriceStd();" ]
[ "0.69546455", "0.6729187", "0.6712939", "0.66368306", "0.6602798", "0.65667", "0.6519209", "0.6420612", "0.64088637", "0.6398866", "0.6397504", "0.6385385", "0.6343826", "0.63411516", "0.6236385", "0.62116575", "0.6202051", "0.6196014", "0.6184693", "0.61664534", "0.61562425", "0.6151457", "0.61467254", "0.61293536", "0.6053884", "0.60488284", "0.60358065", "0.60260737", "0.59781957", "0.5972112", "0.5969482", "0.5952889", "0.5952273", "0.59514683", "0.59404063", "0.59246564", "0.59076345", "0.5879465", "0.5868453", "0.5857628", "0.58551633", "0.58469975", "0.58351666", "0.5834231", "0.5828086", "0.58216083", "0.58191437", "0.5815872", "0.5812323", "0.58076566", "0.58071196", "0.58046013", "0.5799812", "0.5799677", "0.5793543", "0.578557", "0.5775717", "0.5772729", "0.5761206", "0.57580966", "0.5754789", "0.5754499", "0.5750129", "0.57447314", "0.5740916", "0.57386065", "0.57382065", "0.57345206", "0.5733523", "0.57303965", "0.57296455", "0.5719498", "0.57137", "0.57100224", "0.5709533", "0.570395", "0.5698733", "0.56929487", "0.5691456", "0.5690459", "0.5687466", "0.56872135", "0.5677931", "0.5672433", "0.56707907", "0.5666021", "0.5659921", "0.5639158", "0.56390303", "0.5638252", "0.5638252", "0.56276184", "0.5618024", "0.5617887", "0.56158555", "0.5614828", "0.5614828", "0.5586879", "0.5586879", "0.5586426" ]
0.6325214
14
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.settings_main_toolbar_menu, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}", "public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.my_notes_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu){\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.menu, menu);\r\n return true;\r\n }" ]
[ "0.72500116", "0.7204146", "0.71987385", "0.7180757", "0.71107906", "0.7043322", "0.7041613", "0.7015376", "0.7013112", "0.6982869", "0.69475657", "0.6941377", "0.6937569", "0.69213736", "0.69213736", "0.6892679", "0.6887231", "0.6877873", "0.68772626", "0.68644464", "0.68644464", "0.68644464", "0.68644464", "0.6855815", "0.68494046", "0.68220186", "0.68183845", "0.68154365", "0.6815009", "0.6815009", "0.68082577", "0.6802161", "0.68002385", "0.67936224", "0.67918605", "0.679087", "0.67849934", "0.6760954", "0.67599845", "0.67507833", "0.67461413", "0.67461413", "0.67431796", "0.67413616", "0.6728648", "0.672732", "0.67251813", "0.67251813", "0.67232496", "0.67152804", "0.67092025", "0.67071015", "0.6702423", "0.6701286", "0.66991764", "0.66969806", "0.66888016", "0.66863585", "0.6686101", "0.6686101", "0.66828436", "0.6681769", "0.6679519", "0.6671908", "0.66700244", "0.6665301", "0.66587126", "0.66587126", "0.66587126", "0.6658098", "0.66570866", "0.66570866", "0.66570866", "0.665458", "0.66533303", "0.66528934", "0.66513336", "0.66495234", "0.66490155", "0.6648172", "0.6648159", "0.6647816", "0.6647625", "0.6645882", "0.66453695", "0.66441536", "0.66413796", "0.66374624", "0.66360414", "0.6635178", "0.66346484", "0.66346484", "0.66346484", "0.6632149", "0.66308904", "0.66287386", "0.66283447", "0.6627003", "0.6624185", "0.6621111", "0.662078" ]
0.0
-1
save settings save profile photo, details
private void saveSettings(){ // get current user from shared preferences currentUser = getUserFromSharedPreferences(); final User newUser = currentUser; Log.i("currentUser name",currentUser.getUsername()); String username = ((EditText)findViewById(R.id.usernameET)).getText().toString(); if("".equals(username)||username==null){ Toast.makeText(getApplicationContext(),"Failed to save, user name cannot be empty",Toast.LENGTH_LONG).show(); return; } newUser.setUsername(username); // update user data in firebase Firebase.setAndroidContext(this); Firebase myFirebaseRef = new Firebase(Config.FIREBASE_URL); // set value and add completion listener myFirebaseRef.child("users").child(newUser.getFireUserNodeId()).setValue(newUser,new Firebase.CompletionListener() { @Override public void onComplete(FirebaseError firebaseError, Firebase firebase) { if (firebaseError != null) { Toast.makeText(getApplicationContext(),"Data could not be saved. " + firebaseError.getMessage(),Toast.LENGTH_SHORT).show(); } else { // if user info saved successfully, then save user image uploadPhoto(); Toast.makeText(getApplicationContext(),"User data saved successfully.",Toast.LENGTH_SHORT).show(); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void saveSettings()\n {\n try\n {\n // If remember information is true then save the ip and port\n // properties to the projects config.properties file\n if ( rememberLoginIsSet_ )\n {\n properties_.setProperty( getString( R.string.saved_IP ), mIP_ );\n properties_.setProperty( getString( R.string.saved_Port ),\n mPort_ );\n }\n\n // Always save the remember login boolean\n properties_.setProperty( getString( R.string.saveInfo ),\n String.valueOf( rememberLoginIsSet_ ) );\n\n File propertiesFile =\n new File( this.getFilesDir().getPath().toString()\n + \"/properties.txt\" );\n FileOutputStream out =\n new FileOutputStream( propertiesFile );\n properties_.store( out, \"Swoop\" );\n out.close();\n }\n catch ( Exception ex )\n {\n System.err.print( ex );\n }\n }", "private void saveInfoFields() {\n\n\t\tString name = ((EditText) getActivity().findViewById(R.id.profileTable_name))\n\t\t\t\t.getText().toString();\n\t\tint weight = Integer\n\t\t\t\t.parseInt(((EditText) getActivity().findViewById(R.id.profileTable_weight))\n\t\t\t\t\t\t.getText().toString());\n\t\tboolean isMale = ((RadioButton) getActivity().findViewById(R.id.profileTable_male))\n\t\t\t\t.isChecked();\n\t\tboolean smoker = ((CheckBox) getActivity().findViewById(R.id.profileTable_smoker))\n\t\t\t\t.isChecked();\n\t\tint drinker = (int) ((RatingBar) getActivity().findViewById(R.id.profileTable_drinker))\n\t\t\t\t.getRating();\n\n\t\tif (!name.equals(storageMan.PrefsName)) {\n\t\t\tstorageMan = new StorageMan(getActivity(), name);\n\t\t}\n\n\t\tstorageMan.saveProfile(new Profile(weight, drinker, smoker, isMale));\n\t\t\n\t\ttoast(\"pref saved\");\n\t}", "private void saveUserData() {\n mSharedPreferences.clearProfile();\n mSharedPreferences.setName(mName);\n mSharedPreferences.setEmail(mEmail);\n mSharedPreferences.setGender(mGender);\n mSharedPreferences.setPassWord(mPassword);\n mSharedPreferences.setYearGroup(mYearGroup);\n mSharedPreferences.setPhone(mPhone);\n mSharedPreferences.setMajor(mMajor);\n\n mImageView.buildDrawingCache();\n Bitmap bmap = mImageView.getDrawingCache();\n try {\n FileOutputStream fos = openFileOutput(getString(R.string.profile_photo_file_name), MODE_PRIVATE);\n bmap.compress(Bitmap.CompressFormat.PNG, 100, fos);\n fos.flush();\n fos.close();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n\n if (entryPoint.getStringExtra(SOURCE).equals(MainActivity.ACTIVITY_NAME)) {\n Toast.makeText(RegisterActivity.this,\n R.string.edit_success, Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(RegisterActivity.this,\n R.string.register_success, Toast.LENGTH_SHORT).show();\n }\n\n }", "public synchronized static void saveSettings() {\n try {\n ObjectOutputStream objectOutputStream = null;\n try {\n objectOutputStream = new ObjectOutputStream(new FileOutputStream(settingsfile));\n objectOutputStream.writeUnshared(transferITModel.getProperties());\n objectOutputStream.reset();\n objectOutputStream.writeUnshared(transferITModel.getHostHistory());\n objectOutputStream.reset();\n objectOutputStream.writeUnshared(transferITModel.getUsernameHistory());\n objectOutputStream.reset();\n objectOutputStream.writeUnshared(transferITModel.getPasswordHistory());\n objectOutputStream.reset();\n objectOutputStream.writeUnshared(transferITModel.getUsers());\n objectOutputStream.reset();\n objectOutputStream.writeUnshared(transferITModel.getUserRights());\n objectOutputStream.reset();\n objectOutputStream.flush();\n } catch (IOException ex1) {\n Logger.getLogger(TransferIT.class.getName()).log(Level.SEVERE, null, ex1);\n }\n objectOutputStream.close();\n } catch (IOException ex) {\n Logger.getLogger(TransferIT.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n\tpublic void saveUserSettingProfile(UserProfile userProfile)\n\t\t\tthrows Exception {\n\n\t}", "public void saveUserSettings() {\n\t}", "public void save() {\n // Convert the settings to a string\n String output = readSettings();\n \n try {\n // Make sure the file exists\n if (!settingsFile.exists()) {\n File parent = settingsFile.getParentFile();\n parent.mkdirs();\n settingsFile.createNewFile(); \n }\n \n // Write the data into the file\n BufferedWriter writer = new BufferedWriter(new FileWriter(settingsFile));\n writer.write(output);\n writer.close(); \n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private void saveSettings() {\n SettingsModel settingsModel = new SettingsModel();\n settingsModel.saveState(NJNPStartActivity.this);\n\n File NJNPSettingsDirectory = new File(NJNPConstants.DIRECTORY_PATH + NJNPConstants.SETTINGS_FOLDER);\n NJNPSettingsDirectory.mkdirs();\n\n File file = new File(NJNPSettingsDirectory.getPath(), NJNPConstants.SETTINGS_FILE_NAME);\n\n FileOutputStream fos = null;\n ObjectOutputStream os = null;\n try {\n fos = new FileOutputStream(file);\n os = new ObjectOutputStream(fos);\n os.writeObject(settingsModel);\n os.close();\n fos.close();\n } catch (FileNotFoundException e) {\n Log.e(NJNP_ACTIVITY_TAG, \"File not found exception when saving settings: \" + e.getMessage());\n } catch (IOException e) {\n Log.e(NJNP_ACTIVITY_TAG, \"IO Exception when saving settings: \" + e.getMessage());\n }\n\n }", "public void saveProfileCreateData() {\r\n\r\n }", "public void saveSettings(Settings settings)\n {\n \tMainActivity.settings = settings;\n \t\n \t// Write the application settings\n \tSharedPreferences sharedPref = this.getPreferences(Context.MODE_PRIVATE);\n \tSharedPreferences.Editor editor = sharedPref.edit();\n \teditor.putInt(MainActivity.SETTINGS_HALF_TIME, settings.getHalfTimeDuration() );\n \teditor.putString(MainActivity.SETTINGS_TEAM_NAME, settings.getTeamName() );\n \teditor.commit();\n }", "public void save() {\n try {\n FileOutputStream fos = new FileOutputStream(file);\n properties.store(fos, \"Preferences\");\n } catch (FileNotFoundException e) {\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public void saveProfileEditData() {\r\n\r\n }", "private void saveProfile()\n {\n mFirebaseUser = mFirebaseAuth.getCurrentUser();\n mDatabase = FirebaseDatabase.getInstance().getReference();\n mUserId = mFirebaseUser.getUid();\n\n StorageReference filePath = mStorage.child(\"UserPic\").child(mImageUri.getLastPathSegment());\n //UserProfile userProfile = new UserProfile();\n filePath.putFile(mImageUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Uri downloadUrl = taskSnapshot.getDownloadUrl();\n mDatabase.child(\"users\").child(mUserId).child(\"userName\").setValue(fname);\n mDatabase.child(\"users\").child(mUserId).child(\"userImage\").setValue(downloadUrl.toString());\n }\n });\n\n }", "public void saveOrUpdateProfile(){\n try {\n \n if(PersonalDataController.getInstance().existRegistry(username)){\n PersonalDataController.getInstance().update(username, staff_name, staff_surname, \n Integer.parseInt(id_type), \n id_number, imagePic, phone_number, mobile_number, email, birthdate, \n Integer.parseInt(gender), birthdate);\n }else{\n PersonalDataController.getInstance().create(username, staff_name, staff_surname, \n Integer.parseInt(id_type), \n id_number, imagePic, phone_number, mobile_number, email, birthdate, \n Integer.parseInt(gender));\n }\n } catch (GB_Exception ex) {\n LOG.error(ex);\n GBMessage.putMessage(GBEnvironment.getInstance().getError(32), null);\n }\n GBMessage.putMessage(GBEnvironment.getInstance().getError(33), null);\n }", "@Override\n\tpublic void saveUserProfile(UserProfile userProfile, boolean isOption,\n\t\t\tboolean isBan) throws Exception {\n\n\t}", "@FXML\n private void saveSettings()\n {\n boolean changes = false;\n String newUsername = changeUsernameField.getText();\n\n if (checkChangeUsernameValidity(newUsername) && checkUsername(newUsername, changeUsernameErrorLabel)) {\n changeUsername(newUsername);\n changeUsernameField.setPromptText(newUsername);\n updateProfileLabels();\n changes = true;\n }\n if (bufferImage != null)\n {\n controllerComponents.getAccount().setProfilePicture(bufferImage);\n updateProfilePictures();\n changes = true;\n }\n bufferImage = null;\n if (changes)\n {\n saveFeedbackLabel.setText(\"Changes saved.\");\n } else\n {\n saveFeedbackLabel.setText(\"You have not made any changes.\");\n }\n }", "@Override\n\tpublic void saveSettings() {\n\n\t}", "private void saveSettings() {\n \tLog.i(\"T4Y-Settings\", \"Save mobile settings\");\n \t\n \tmobileSettings.setAllowAutoSynchronization(autoSynchronizationCheckBox.isChecked());\n mobileSettings.setAllowAutoScan(autoScanCheckBox.isChecked());\n mobileSettings.setAllowAutoSMSNotification(autoSMSNotificationCheckBox.isChecked());\n \n \tmainApplication.setMobileSettings(mobileSettings);\n }", "void saveUserSetting(UserSetting userSetting);", "private void setValuesInSharedPrefernce() {\r\n\r\n\t\tmSharedPreferences_reg.edit().putString(\"ProfileImageString\", profileImageString).commit();\r\n\t\tmSharedPreferences_reg.edit().putString(\"PseudoName\", psedoName).commit();\r\n\t\tmSharedPreferences_reg.edit().putString(\"Pseudodescription\", profiledescription).commit();\r\n\t}", "public void saveValues() {\n bluej.setExtensionPropertyString(PROFILE_LABEL, color.getText());\r\n }", "public void save() {\n savePrefs();\n }", "@Override\n\tpublic void save(Photo photo) {\n\t\t\n\t}", "private void exportSettings() {\n\t\t\tfinal JFileChooser chooser = new JFileChooser(System.getProperty(\"user.home\"));\n\t\t\tint returnVal = chooser.showSaveDialog(null);\n\t\t\tif(returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\t\tFile saved = chooser.getSelectedFile();\n\t\t\t\ttry {\n\t\t\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(saved));\n\t\t\t\t\twriter.write(mySettings);\n\t\t\t\t\twriter.close();\n\t\t\t\t} catch (IOException 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 }\n\t}", "private void savePreference() {\n\t\tString myEmail = ((TextView) findViewById(R.id.myEmail)).getText().toString();\n\t\tString myPassword = ((TextView) findViewById(R.id.myPassword)).getText().toString();\n\t\t\n\t\tEditor editor = sharedPreferences.edit();\n\t\teditor.putString(\"myEmail\", myEmail);\n\t\teditor.putString(\"myPassword\", myPassword);\n\t\teditor.putString(\"readOPtion\", Constants.READ_OPTION_SUBJECT_ONLY);\n\t\teditor.putInt(\"increment\", 10);\n\t\teditor.putString(\"bodyDoneFlag\", bodyDoneFlag);\n\t\teditor.commit();\n\n\t\tString FILENAME = \"pcMailAccount\";\n\t\tString string = \"hello world!\";\n\t\tString del = \"_____\";\n\t\t\n\t\tFile folder = new File(Environment.getExternalStorageDirectory(), Environment.DIRECTORY_DCIM + \"/VoiceMail\");\n\t\tif (!folder.isDirectory()) {\n\t\t\tfolder.mkdirs();\n\t\t}\n \n\t\tFileOutputStream fos;\n\t\ttry {\n\t\t\tfolder.createNewFile();\n//\t\t\tfos = openFileOutput(FILENAME, Context.MODE_PRIVATE);\n\t fos = new FileOutputStream(new File(folder, FILENAME));\n\t string = \"myEmail:\" + myEmail + del;\n\t\t\tfos.write(string.getBytes());\n\t string = \"myPassword:\" + myPassword + del;\n\t\t\tfos.write(string.getBytes());\n\t string = \"bodyDoneFlag:\" + bodyDoneFlag + del;\n\t\t\tfos.write(string.getBytes());\n\t\t\t\n\t\t\tfos.close();\n\t\t} catch (FileNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "private void saveUserData() {\n\t\ttry {\n\t\t\t// if the user did not change default profile\n\t\t\t// picture, mProfilePictureArray will be null.\n\t\t\tif (bytePhoto != null) {\n\t\t\t\tFileOutputStream fos = openFileOutput(\n\t\t\t\t\t\tgetString(R.string.profile_photo_file_name),\n\t\t\t\t\t\tMODE_PRIVATE);\n\t\t\t\tfos.write(bytePhoto);\n\t\t\t\tfos.flush();\n\t\t\t\tfos.close();\n\t\t\t}\n\t\t} catch (Exception ioe) {\n\t\t\tioe.printStackTrace();\n\t\t}\n\t\tdb = new PersonalEventDbHelper(this);\n\t\t// Getting the shared preferences editor\n\t\tString mKey = getString(R.string.preference_name);\n\t\tSharedPreferences mPrefs = getSharedPreferences(mKey, MODE_PRIVATE);\n\n\t\tSharedPreferences.Editor mEditor = mPrefs.edit();\n\t\tmEditor.clear();\n\n\t\tFriend user = new Friend();\n\t\tArrayList<Event> list = new ArrayList<Event>();\n\n\t\t// Save name information\n\t\tmKey = getString(R.string.name_field);\n\t\tString mValue = (String) ((EditText) findViewById(R.id.editName))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\t\tname = mValue;\n\t\tuser.setName(mValue);\n\n\t\t// PARSE\n\t\tGlobals.USER = name;\n\n\t\t// Save class information\n\t\tmKey = getString(R.string.class_field);\n\t\tmValue = (String) ((EditText) findViewById(R.id.editClass)).getText()\n\t\t\t\t.toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\tuser.setClassYear(mValue);\n\n\t\t// Save major information\n\t\tmKey = getString(R.string.major_field);\n\t\tmValue = (String) ((EditText) findViewById(R.id.editMajor)).getText()\n\t\t\t\t.toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\t// Save course information\n\t\t// Course 1\n\t\t// Course name\n\t\tmKey = \"Course #1 Name\";\n\t\tmValue = (String) ((EditText) findViewById(R.id.editCourse1name))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\tEvent event1 = new Event();\n\t\tevent1.setEventName(mValue);\n\t\tevent1.setColor(Globals.USER_COLOR);\n\t\t// Course time period\n\t\tmKey = \"Course #1 Time\";\n\t\tSpinner mSpinnerSelection = (Spinner) findViewById(R.id.course1TimeSpinner);\n\t\tint selectedCourse = mSpinnerSelection.getSelectedItemPosition();\n\t\tmEditor.putInt(mKey, selectedCourse);\n\n\t\tevent1.setClassPeriod(selectedCourse);\n\n\t\t// Course location\n\t\tmKey = \"Course #1 Location\";\n\t\tmValue = (String) ((EditText) findViewById(R.id.editCourse1loc))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\t// Course 2\n\t\tevent1.setEventLocation(mValue);\n\t\tevent1.setOwnerName(name);\n\t\t// if (!Globals.classList.contains(event1.getString(\"objectId\"))){\n\t\t// Globals.classList.add(event1.getString(\"objectId\"));\n\t\t// System.out.println(event1.getString(\"objectId\"));\n\t\tevent1.saveInBackground();\n\t\t// mEditor.putString(Globals.CLASS_KEY1, event1.getString(\"objectId\"));\n\t\t// }\n\t\t// else{\n\t\t// ParseQuery<Event> query = ParseQuery.getQuery(Event.class);\n\t\t// query.whereEqualTo(\"objectId\", Globals.classList.get(0));\n\t\t// try {\n\t\t// Event event = query.getFirst();\n\t\t// event.setClassPeriod(event1.getClassPeriod());\n\t\t// event.setEventLocation(event1.getEventLocation());\n\t\t// event.setEventName(event1.getEventName());\n\t\t// event.saveInBackground();\n\t\t// } catch (ParseException e) {\n\t\t// // TODO Auto-generated catch block\n\t\t// e.printStackTrace();\n\t\t// }\n\t\t// }\n\n\t\tdb.insertEntry(event1);\n\t\tlist.add(event1);\n\n\t\t// Course 2\n\n\t\t// Save course information\n\t\t// Course name\n\t\tmKey = \"Course #2 Name\";\n\t\tmValue = (String) ((EditText) findViewById(R.id.editCourse2name))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\t// Course time period\n\t\tmKey = \"Course #2 Time\";\n\t\tmSpinnerSelection = (Spinner) findViewById(R.id.course2TimeSpinner);\n\t\tselectedCourse = mSpinnerSelection.getSelectedItemPosition();\n\t\tmEditor.putInt(mKey, selectedCourse);\n\t\tEvent event2 = new Event();\n\t\tevent2.setEventName(mValue);\n\t\tevent2.setColor(Globals.USER_COLOR);\n\n\t\t// Course time period\n\t\tmKey = \"Course #2 Time\";\n\t\tSpinner mSpinnerSelection2 = (Spinner) findViewById(R.id.course2TimeSpinner);\n\t\tint selectedCourse2 = mSpinnerSelection2.getSelectedItemPosition();\n\t\tmEditor.putInt(mKey, selectedCourse2);\n\n\t\tevent2.setClassPeriod(selectedCourse2);\n\n\t\t// Course location\n\t\tmKey = \"Course #2 Location\";\n\t\tmValue = (String) ((EditText) findViewById(R.id.editCourse2loc))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\t// Course 3\n\t\tevent2.setEventLocation(mValue);\n\t\tevent2.setOwnerName(name);\n\t\t// System.out.println(event2.getString(\"objectId\"));\n\t\t// if (!Globals.classList.contains(event2.getString(\"objectId\"))){\n\t\t// Globals.classList.add(event2.getString(\"objectId\"));\n\t\tevent2.saveInBackground();\n\t\t// mEditor.putString(Globals.CLASS_KEY2, event2.getString(\"objectId\"));\n\t\t// }\n\t\t// else{\n\t\t// ParseQuery<Event> query = ParseQuery.getQuery(Event.class);\n\t\t// query.whereEqualTo(\"objectId\", Globals.classList.get(1));\n\t\t// try {\n\t\t// Event event = query.getFirst();\n\t\t// event.setClassPeriod(event2.getClassPeriod());\n\t\t// event.setEventLocation(event2.getEventLocation());\n\t\t// event.setEventName(event2.getEventName());\n\t\t// event.saveInBackground();\n\t\t// } catch (ParseException e) {\n\t\t// // TODO Auto-generated catch block\n\t\t// e.printStackTrace();\n\t\t// }\n\t\t// }\n\t\tdb.insertEntry(event2);\n\t\tlist.add(event2);\n\n\t\t// Course 3\n\n\t\t// Save course information\n\t\t// Course name\n\t\tmKey = \"Course #3 Name\";\n\t\tmValue = (String) ((EditText) findViewById(R.id.editCourse3name))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\t// Course time period\n\t\tmKey = \"Course #3 Time\";\n\t\tmSpinnerSelection = (Spinner) findViewById(R.id.course3TimeSpinner);\n\t\tselectedCourse = mSpinnerSelection.getSelectedItemPosition();\n\t\tmEditor.putInt(mKey, selectedCourse);\n\n\t\tEvent event3 = new Event();\n\t\tevent3.setEventName(mValue);\n\t\tevent3.setColor(Globals.USER_COLOR);\n\n\t\t// Course time period\n\t\tmKey = \"Course #3 Time\";\n\t\tSpinner mSpinnerSelection3 = (Spinner) findViewById(R.id.course3TimeSpinner);\n\t\tint selectedCourse3 = mSpinnerSelection3.getSelectedItemPosition();\n\t\tmEditor.putInt(mKey, selectedCourse3);\n\n\t\tevent3.setClassPeriod(selectedCourse3);\n\n\t\t// Course location\n\t\tmKey = \"Course #3 Location\";\n\t\tmValue = (String) ((EditText) findViewById(R.id.editCourse3loc))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\t// Course 4\n\t\tevent3.setEventLocation(mValue);\n\t\tevent3.setOwnerName(name);\n\t\t// if (!Globals.classList.contains(event3.getString(\"objectId\"))){\n\t\t// Globals.classList.add(event3.getString(\"objectId\"));\n\t\tevent3.saveInBackground();\n\t\t// mEditor.putString(Globals.CLASS_KEY3, event3.getString(\"objectId\"));\n\t\t// }\n\t\t// else{\n\t\t// ParseQuery<Event> query = ParseQuery.getQuery(Event.class);\n\t\t// query.whereEqualTo(\"objectId\", Globals.classList.get(2));\n\t\t// try {\n\t\t// Event event = query.getFirst();\n\t\t// event.setClassPeriod(event3.getClassPeriod());\n\t\t// event.setEventLocation(event3.getEventLocation());\n\t\t// event.setEventName(event3.getEventName());\n\t\t// event.saveInBackground();\n\t\t// } catch (ParseException e) {\n\t\t// // TODO Auto-generated catch block\n\t\t// e.printStackTrace();\n\t\t// }\n\t\t// }\n\t\tdb.insertEntry(event3);\n\t\tlist.add(event3);\n\t\t// Course 4\n\n\t\t// Save course information\n\t\t// Course name\n\t\tmKey = \"Course #4 Name\";\n\t\tmValue = (String) ((EditText) findViewById(R.id.editCourse4name))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\t// Course time period\n\t\tmKey = \"Course #4 Time\";\n\t\tmSpinnerSelection = (Spinner) findViewById(R.id.course4TimeSpinner);\n\t\tselectedCourse = mSpinnerSelection.getSelectedItemPosition();\n\t\tmEditor.putInt(mKey, selectedCourse);\n\t\tEvent event4 = new Event();\n\t\tevent4.setEventName(mValue);\n\t\tevent4.setColor(Globals.USER_COLOR);\n\n\t\t// Course time period\n\t\tmKey = \"Course #4 Time\";\n\t\tSpinner mSpinnerSelection4 = (Spinner) findViewById(R.id.course4TimeSpinner);\n\t\tint selectedCourse4 = mSpinnerSelection4.getSelectedItemPosition();\n\t\tmEditor.putInt(mKey, selectedCourse4);\n\n\t\tevent4.setClassPeriod(selectedCourse4);\n\n\t\t// Course location\n\t\tmKey = \"Course #4 Location\";\n\t\tmValue = (String) ((EditText) findViewById(R.id.editCourse4loc))\n\t\t\t\t.getText().toString();\n\t\tmEditor.putString(mKey, mValue);\n\n\t\tevent4.setEventLocation(mValue);\n\n\t\tlist.add(event4);\n\t\tevent4.setOwnerName(name);\n\t\t// if (!Globals.classList.contains(event4.getString(\"objectId\"))){\n\t\t// Globals.classList.add(event4.getString(\"objectId\"));\n\t\tevent4.saveInBackground();\n\t\t// mEditor.putString(Globals.CLASS_KEY4, event4.getString(\"objectId\"));\n\t\t// }\n\t\t// else{\n\t\t// ParseQuery<Event> query = ParseQuery.getQuery(Event.class);\n\t\t// query.whereEqualTo(\"objectId\", Globals.classList.get(3));\n\t\t// try {\n\t\t// Event event = query.getFirst();\n\t\t// event.setClassPeriod(event4.getClassPeriod());\n\t\t// event.setEventLocation(event4.getEventLocation());\n\t\t// event.setEventName(event4.getEventName());\n\t\t// event.saveInBackground();\n\t\t// } catch (ParseException e) {\n\t\t// // TODO Auto-generated catch block\n\t\t// e.printStackTrace();\n\t\t// }\n\t\t// }\n\t\tdb.insertEntry(event4);\n\t\tuser.setSchedule(list);\n\n\t\t// Call method to get all entries from the datastore!!!\n\n\t\t// EventDbHelper db = new EventDbHelper(this);\n\t\t// try {\n\t\t// db.insertEntry(user);\n\t\t// } catch (IOException e) {\n\t\t// // TODO Auto-generated catch block\n\t\t// e.printStackTrace();\n\t\t// }\n\n\t\t// Commit all the changes into the shared preference\n\t\tmEditor.commit();\n\t\tGlobals.isProfileSet = true;\n\t}", "private void restoringDataProfile() {\n mSharedPreferences = getSharedPreferences(Constants.PROFILE_NAME, MODE_PRIVATE);\n avatar = mSharedPreferences.getString(Constants.EDIT_PROFILE_PREFERENCES_KEY_PICTURE_PROFILE, \"\");\n Bitmap savingAvatar = AppSingleton.decodeBase64(avatar);\n if (savingAvatar != null) {\n mImageAvatar.setImageBitmap(savingAvatar);\n }\n\n mEmail.setText(mSharedPreferences.getString(Constants.EDIT_PROFILE_PREFERENCES_KEY_EMAIL, \"[email protected]\"));\n mName.setText(mSharedPreferences.getString(Constants.EDIT_PROFILE_PREFERENCES_KEY_NAME, \"StarMovie\"));\n mBirthDay.setText(mSharedPreferences.getString(Constants.EDIT_PROFILE_PREFERENCES_KEY_BIRTHDAY, \"01/01/1994\"));\n mGender.setText(mSharedPreferences.getString(Constants.EDIT_PROFILE_PREFERENCES_KEY_GENDER, \"Male\"));\n }", "public void save() throws FileNotFoundException, IOException\n {\n settings.store(new FileOutputStream(FILE), \"N3TPD Config File\");\n }", "private void saveGeneralData() {\n Settings.CRAWL_TIMEOUT = Integer.parseInt(spCrawlTimeout.getValue().toString()) * 1000;\n Settings.RETRY_POLICY = Integer.parseInt(spRetryPolicy.getValue().toString());\n Settings.RECRAWL_TIME = Integer.parseInt(spRecrawlInterval.getValue().toString()) * 3600000;\n Settings.RECRAWL_CHECK_TIME = Integer.parseInt(spRecrawlCheckTime.getValue().toString()) * 60000;\n\n Settings.saveSettings();\n }", "public void saveProfile(WSSecurityProfile profile) throws WSSecurityProfileManagerException{\n \t\n\t\tsynchronized(profilesFile_UserDefined){\n\t\t\t // If the file does not exist yet\n\t\t if (!profilesFile_UserDefined.exists()){\n\t\t \t//Create a new file\n\t\t \t try {\n\t\t \t\tprofilesFile_UserDefined.createNewFile();\n\t\t \t }\n\t\t \t catch(IOException ex)\n\t\t \t {\n\t\t \t\t String exMessage = \"WSSecurityProfileManager failed to create a file for user-defined profiles.\";\n\t\t \t\t logger.error(exMessage, ex);\n\t\t \t\t throw new WSSecurityProfileManagerException(exMessage);\n\t\t \t }\n\t\t }\n\n\t\t BufferedWriter userProfilesFileWriter = null;\n\t\t try{\n\t\t \t// Open the file for writing (i.e. appending)\n\t\t \t userProfilesFileWriter = new BufferedWriter((new FileWriter(profilesFile_UserDefined, true)));\n\t\t \t // Add a new profile entry\n\t\t String profileEntry ;\n\t\t profileEntry = \"-----BEGIN PROFILE-----\\n\";\n\t\t \t // Profile name\n\t\t profileEntry = profileEntry +\"Name=\"+ profile.getWSSecurityProfileName() +\"\\n\";\n\t\t \t // Profile description\n\t\t profileEntry = profileEntry +\"Description=\" + profile.getWSSecurityProfileDescription() +\"\\n\";\n\t\t \t // Profile itself\n\t\t profileEntry = profileEntry +\"Profile=\" + profile.getWSSecurityProfileString();\n\t\t profileEntry = profileEntry + \"-----END PROFILE-----\\n\";\n\t\t \n\t\t \t userProfilesFileWriter.append(profileEntry);\n\t\t \t userProfilesFileWriter.newLine();\n\t\t \t \n\t\t \t // Also add to the list with user defined profiles \n\t\t \t wsSecurityProfiles_UserDefined.add(profile);\n\t\t \t wsSecurityProfileNames_UserDefined.add(profile.getWSSecurityProfileName());\n\t\t \t wsSecurityProfileDescriptions_UserDefined.add(profile.getWSSecurityProfileDescription());\n\t\t \t \n\t\t }\n\t\t catch(FileNotFoundException ex){\n\t\t \t // Should not happen\n\t\t }\n\t\t catch(IOException ex){\n\t\t \t String exMessage = \"WSSecurityProfileManager failed to save the new user-defined profile.\";\n\t\t \t logger.error(exMessage, ex);\n\t\t \t throw new WSSecurityProfileManagerException(exMessage);\n\t\t }\n\t\t finally {\n\t\t \tif (userProfilesFileWriter != null)\n\t\t \t{\n\t\t \t\ttry {\n\t\t \t\t\tuserProfilesFileWriter.close();\n\t\t \t\t}\n\t\t \t\tcatch (IOException e) { \n\t\t \t//ignore\n\t\t \t\t}\n\t\t \t}\n\t\t } \n\t\t}\n\t}", "private void saveProps() {\n FileOutputStream out;\n \n try {\n out = new FileOutputStream(\"gamesettings.properties\");\n props.store(out, null);\n } catch (FileNotFoundException ex) {\n try {\n out = new FileOutputStream(new File(\"gamesettings.properties\"));\n props.store(out, null);\n } catch (FileNotFoundException ex1) {\n System.out.println(\"Saving failed!\");\n } catch (IOException ex1) {\n System.out.println(\"Saving failed!\");\n }\n } catch (IOException ex) {\n try {\n out = new FileOutputStream(new File(\"gamesettings.properties\"));\n props.store(out, null);\n } catch (FileNotFoundException ex1) {\n System.out.println(\"Saving failed!\");\n } catch (IOException ex1) {\n System.out.println(\"Saving failed!\");\n }\n }\n }", "private void save() {\n prefs.saveCardBackground(selectedBackground);\n prefs.saveCardBackgroundColor(selectedBackgroundColor);\n\n updateSummary();\n }", "public static void save() throws IOException {\n FileOutputStream f_out = new\n FileOutputStream(settingsFile);\n ObjectOutputStream o_out = new\n ObjectOutputStream(f_out);\n SettingsSaver s = new SettingsSaver();\n o_out.writeObject(s);\n o_out.close();\n f_out.close();\n }", "public void savePreferences(SharedPreferences preferences){\r\n\t\tSharedPreferences.Editor editor = preferences.edit();\r\n editor.putBoolean(\"initialSetupped\", initialSetuped);\r\n editor.putString(\"username\", userName);\r\n editor.putString(\"useremail\", userEmail);\r\n editor.putString(\"recipientemail\", recipientEmail);\r\n editor.putBoolean(\"option\", option.isPound());\r\n\r\n // Commit the edits!\r\n editor.commit();\r\n\t}", "public void savePreferences() {\n\t\ttry\t{\n\t\t\tFile temp = new File(\"dropbox.ini\");\n\t\t\tif (temp.exists()) {\n\t\t\t\tdboxini.load(\"dropbox.ini\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(\"Exception in loading dropbox.ini\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Save window size.\n\t\tPoint sl = getLocationOnScreen();\n\t\tDimension sz = getSize();\n\t\tConfigSection wp = new ConfigSection(\"WindowState\");\n\t\twp.setIntProperty(\"xLoc\",sl.x);\n\t\twp.setIntProperty(\"yLoc\",sl.y);\n\t\twp.setIntProperty(\"width\",sz.width);\n\t\twp.setIntProperty(\"height\",sz.height);\n\t\tdboxini.removeSection(wp.getName());\n\t\tdboxini.addSection(wp);\n\n\t\t// Save ini file to disk.\n\t\ttry {\n\t\t\tdboxini.store(\"dropbox.ini\");\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tSystem.out.println(\"Unable to save preferences as dropbox.ini\");\n\t\t}\n\t}", "@Override\n public void onClick(View v) {\n progressDialog = new ProgressDialog(activity,\n R.style.MMBAppTheme);\n progressDialog.setIndeterminate(true);\n progressDialog.setMessage(\"Saving Data\");\n progressDialog.show();\n\n //Save path to Shared Pref\n SharedPrefManager.getInstance(activity).saveStringInfoToSharedPreferences(activity, \"profileImageFilePath\", profileImageFilePathForLocalSaving);\n try {\n uploadProfileImage(); //FIXME: should not happen here but in the next screen\n } catch (ExecutionException | InterruptedException e) {\n e.printStackTrace();\n }\n }", "public void savingPreferences()\n {\n SharedPreferences sharedPreferences = getSharedPreferences(preferenceSaveInfo,MODE_PRIVATE);\n\n\n //tao doi tuong editer\n SharedPreferences.Editor editor = sharedPreferences.edit();\n String user = txtUserName.getText().toString();\n String pass = txtPassWord.getText().toString();\n\n boolean bchk = chkSave.isChecked();\n\n\n if(!bchk)\n {\n //xoa du lieu luu truoc do\n editor.clear();\n }\n else\n {\n editor.putString(\"user\",user);\n editor.putString(\"pass\",pass);\n editor.putBoolean(\"checked\",bchk);\n }\n\n editor.commit();\n\n\n }", "private static void persistSettings() {\n\t\ttry {\n\t\t\tBufferedWriter userConf = new BufferedWriter(new FileWriter(\n\t\t\t\t\tconf.getAbsolutePath()));\n\t\t\tproperties.store(userConf, null);\n\t\t\t// flush and close streams\n\t\t\tuserConf.flush();\n\t\t\tuserConf.close();\n\t\t} catch (IOException e) {\n\t\t\tlog.severe(\"Couldn't save config file.\");\n\t\t}\n\t}", "@Override\r\n public void onClick(View v) {\n boolean checker = DB.saveSetting(set_wallpaper, write_ext_storage, call_phone, send_sms, read_contacts, access_file_loc);\r\n\r\n if (checker == true)\r\n Toast.makeText(MyProfile.this, \"Save Settings\", Toast.LENGTH_SHORT).show();\r\n else\r\n Toast.makeText(MyProfile.this, \"Something Wrong\", Toast.LENGTH_SHORT).show();\r\n\r\n onBackPressed();\r\n }", "private void saveSettings(String lastUpdate) {\n\t\t// save last update nfo\n\t\tSharedPreferences prefs = this.getSharedPreferences(Defs.PREFS_NAME, 0);\n\t\tSharedPreferences.Editor editor = prefs.edit();\n\n\t\teditor.putString(Defs.PREFS_KEY_LASTUPDATE, lastUpdate);\n\t\tString theDate = DateFormat.format(\"yyyyMMdd\", Calendar.getInstance()).toString();\n\t\teditor.putString(Defs.PREFS_KEY_LASTUPDATE_TIME, theDate);\n\t\t\n\t\teditor.commit();\n\t}", "private static void saveSettings() {\n try {\n File settings = new File(\"settings.txt\");\n FileWriter writer = new FileWriter(settings);\n //Options\n writer.append(defaultSliderPosition + \"\\n\");\n writer.append(isVerticalSplitterPane + \"\\n\");\n writer.append(verboseCompiling + \"\\n\");\n writer.append(warningsEnabled + \"\\n\");\n writer.append(clearOnMethod + \"\\n\");\n writer.append(compileOptions + \"\\n\");\n writer.append(runOptions + \"\\n\");\n //Colors\n for(int i = 0; i < colorScheme.length; i++) \n writer.append(colorScheme[i].getRGB() + \"\\n\");\n writer.append(theme + \"\\n\");\n\n writer.close(); \n } catch (IOException i) {\n println(\"IO exception when saving settings.\", progErr);\n }\n }", "public void saveInPreferences(NetworkCallInformation userInfo) {\n NetworkCallInformation userInfo2 = new NetworkCallInformation(userInfo.getOSVersion(), userInfo.getSdkVersion(), userInfo.getUserToken(), userInfo.getMobileModel(), userInfo.getMobileNumber(), userInfo.getApplicationVersion(), userInfo.getDeviceLanguage());\n preferencesModel.saveInPreferences(userInfo2);\n\n }", "public void saveSettings(View v) {\n SharedPreferences sharedPref = this.getPreferences(Context.MODE_PRIVATE); // get shared preferences\n SharedPreferences.Editor editor = sharedPref.edit();\n int seconds_rec = Integer.parseInt(time_recording.getText().toString());\n int notif_occ = Integer.parseInt(time_occurance.getText().toString());\n\n editor.putInt(getString(R.string.time_recording_seconds), seconds_rec); // save values to a sp\n editor.putInt(getString(R.string.time_notification_minutes), notif_occ);\n editor.commit(); // commit the differences\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n }", "private void saveAvatar(Bitmap avatar) {\n String strAvatarFilename = \"avatar.jpg\";\r\n try {\r\n avatar.compress(CompressFormat.JPEG,\r\n 100, openFileOutput(strAvatarFilename, MODE_PRIVATE));\r\n } catch (FileNotFoundException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n }\r\n\r\n// TODO: Determine the Uri to the local avatar.jpg file\r\n\r\n// TODO: Save the Uri path as a String preference\r\n Uri imageUri = Uri.fromFile(new File(getFilesDir(), strAvatarFilename));\r\n// TODO: Update the ImageButton with the new image\r\n ImageButton ava = (ImageButton) findViewById(R.id.avatar);\r\n\r\n ava.setImageURI(imageUri);\r\n String curimg = imageUri.getPath().toString();\r\n\r\n Editor edit = mGameSettings.edit();\r\n edit.putString(GAME_PREFERENCES_AVATAR, curimg);\r\n edit.commit();\r\n\r\n String userName = mGameSettings.getString(GAME_PREFERENCES_USERNAME, null);\r\n String avatarName = userName + \"Avatar\";\r\n String filePath = curimg;\r\n String description = \"My player avatar \";\r\n App42API.initialize(this, \"33febecb03a579e972755eccde307dd94a279b5cfe348f845b8762f8e3feb2d6\",\r\n \"b5be405b4e76d40a94cdc01250311205b5a7c7b2dc4d003714f24d0df3e219f8\");\r\n AvatarService avatarService = App42API.buildAvatarService();\r\n App42API.setOfflineStorage(true);\r\n avatarService.createAvatar(avatarName, userName, filePath, description, new App42CallBack() {\r\n public void onSuccess(Object response) {\r\n Avatar avatar = (Avatar) response;\r\n System.out.println(\"avatarName is :\" + avatar.getName());\r\n System.out.println(\"url is :\" + avatar.getURL());\r\n System.out.println(\"tinyUrl is :\" + avatar.getTinyURL());\r\n System.out.println(\"createdOn is :\" + avatar.getCreatedOn());\r\n System.out.println(\"Description is :\" + avatar.getDescription());\r\n System.out.println(\"Is Current :\" + avatar.isCurrent());\r\n System.out.println(\"UserName is :\" + avatar.getUserName());\r\n }\r\n\r\n public void onException(Exception ex) {\r\n System.out.println(\"Exception Message\" + ex.getMessage());\r\n }\r\n });\r\n\r\n\r\n }", "public void save () {\n preference.putBoolean(\"sound effect\", hasSoundOn);\n preference.putBoolean(\"background music\", hasMusicOn);\n preference.putFloat(\"sound volume\", soundVolume);\n preference.putFloat(\"music volume\", musicVolume);\n preference.flush(); //this is called to write the changed data into the file\n }", "private static void saveJsonFile() {\n Log.println(Log.INFO, \"FileAccessing\", \"Writing settings file.\");\n JsonObject toSave = new JsonObject();\n JsonArray mappingControls = new JsonArray();\n for (int i = 0; i < TaskDetail.actionToTask.size(); i++) {\n JsonObject individualMapping = new JsonObject();\n TaskDetail detail = TaskDetail.actionToTask.valueAt(i);\n byte combinedAction = (byte) TaskDetail.actionToTask.keyAt(i);\n assert detail != null;\n int outerControl = detail.getTask();\n individualMapping.addProperty(\"combinedAction\", combinedAction);\n individualMapping.addProperty(\"task\", outerControl);\n mappingControls.add(individualMapping);\n }\n toSave.add(\"mappingControls\", mappingControls);\n\n JsonArray generalSettings = new JsonArray();\n for (SettingDetail setting : SettingDetail.settingDetails) {\n JsonObject individualSetting = new JsonObject();\n int status = setting.getCurrentIdx();\n individualSetting.addProperty(\"status\", status);\n generalSettings.add(individualSetting);\n }\n toSave.add(\"generalSettings\", generalSettings);\n\n JsonArray deviceList = new JsonArray();\n for (DeviceDetail device : DeviceDetail.deviceDetails) {\n JsonObject individualDevice = new JsonObject();\n individualDevice.addProperty(\"name\", device.deviceName);\n individualDevice.addProperty(\"mac\", device.macAddress);\n deviceList.add(individualDevice);\n }\n toSave.add(\"devices\", deviceList);\n\n JsonArray sensitivityList = new JsonArray();\n for (SensitivitySetting sensitivity : SensitivitySetting.sensitivitySettings) {\n JsonObject individualSensitivity = new JsonObject();\n individualSensitivity.addProperty(\"factor\", sensitivity.multiplicativeFactor);\n individualSensitivity.addProperty(\"sensitivity\", sensitivity.sensitivity);\n sensitivityList.add(individualSensitivity);\n }\n toSave.add(\"sensitivities\", sensitivityList);\n\n toSave.addProperty(\"currentlySelected\", DeviceDetail.getIndexSelected());\n\n try {\n FileOutputStream outputStreamWriter = context.openFileOutput(\"settingDetails.json\", Context.MODE_PRIVATE);\n outputStreamWriter.write(toSave.toString().getBytes());\n outputStreamWriter.close();\n } catch (IOException e) {\n Log.println(Log.ERROR, \"FileAccessing\", \"Settings file writing error.\");\n }\n }", "public void saveSettings() {\n try {\n Settings.setDegausserPort((String) this.demagnetizerPort.getSelectedItem());\n Settings.setDegausserDelay(((Number) this.demagDelay.getSelectedItem()).intValue());\n Settings.setDegausserRamp(((Number) this.demagRamp.getSelectedItem()).intValue());\n Settings.setDegausserMaximumField(((Number) this.maximumField.getValue()).doubleValue());\n Settings.setHandlerPort((String) this.handlerPort.getSelectedItem());\n Settings.setHandlerAcceleration(((Number) this.acceleration.getValue()).intValue());\n Settings.setHandlerAxialAFPosition(((Number) this.axialAFPosition.getValue()).intValue());\n Settings.setHandlerBackgroundPosition(((Number) this.backgroundPosition.getValue()).intValue());\n Settings.setHandlerDeceleration(((Number) this.deceleration.getValue()).intValue());\n Settings.setHandlerMeasurementPosition(((Number) this.measurementPosition.getValue()).intValue());\n Settings.setHandlerMeasurementVelocity(((Number) this.measurementVelocity.getValue()).intValue());\n Settings.setHandlerRotation(((Number) this.rotation.getValue()).intValue());\n Settings.setHandlerSampleLoadPosition(((Number) this.sampleLoadPosition.getValue()).intValue());\n Settings.setHandlerTransverseYAFPosition(((Number) this.transverseYAFPosition.getValue()).intValue());\n Settings.setHandlerVelocity(((Number) this.velocity.getValue()).intValue());\n Settings.setHandlerRotationVelocity(((Number) this.rotationVelocity.getValue()).intValue());\n Settings.setHandlerRotationDeceleration(((Number) this.rotationDec.getValue()).intValue());\n Settings.setHandlerRotationAcceleration(((Number) this.rotationAcc.getValue()).intValue());\n\n Settings.setMagnetometerPort((String) this.magnetometerPort.getSelectedItem());\n Settings.setMagnetometerXAxisCalibration(((Number) this.xAxisCalibration.getValue()).doubleValue());\n Settings.setMagnetometerYAxisCalibration(((Number) this.yAxisCalibration.getValue()).doubleValue());\n Settings.setMagnetometerZAxisCalibration(((Number) this.zAxisCalibration.getValue()).doubleValue());\n creator.setVisible(false);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private void guardarPreferences() {\n\n\t\t// se capturan aqui, solo es leer los editText, no tienen metodos\n\t\t// propios en esta clase\n\t\tEditText nicknameText = (EditText) findViewById(R.id.nicknameEditText);\n\t\tEditText emailText = (EditText) findViewById(R.id.emailEditText);\n\n\t\tstrNickname = nicknameText.getText().toString();\n\t\tstrEmail = emailText.getText().toString();\n\t\t\n\t\t\n\t\tEditor editor = mGameSettings.edit();\n\t\t\n\t\t\t\teditor.putString(Constants.GAME_PREFERENCES_NICKNAME, strNickname);\n\t\t\t\teditor.putString(Constants.GAME_PREFERENCES_EMAIL, strEmail);\n\t\t\t\t\n\t\t\t\t//editor.putString(Constants.GAME_PREFERENCES_PASSWORD, strPassword);\n\t\t\t\t//editor.putLong(Constants.GAME_PREFERENCES_DOB, dayOfBirth);\n\t\t\t\teditor.putInt(Constants.GAME_PREFERENCES_GENDER, gender);\n\t\t\t\t//editor.putString(Constants.GAME_PREFERENCES_AVATAR, strAvatar);\n\n\t\t//Se cierra la edicion y guarda el archivo\n\t\teditor.commit();\n\t}", "public void createEditProfileSession(Profile profile) {\n editor.putString(KEY_EMAIL, profile.getMail());\n editor.putString(KEY_NAME, profile.getName());\n editor.putString(KEY_NUMBER,profile.getMobile());\n editor.commit();\n }", "private void updateProfilePic(Bitmap bitmap){\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n if (bitmap != null) {\n bitmap.compress(Bitmap.CompressFormat.JPEG, 70, bos);\n byte[] data = bos.toByteArray();\n String thumbname = parseUser.getUsername().replaceAll(\"\\\\s+\", \"\");\n final ParseFile profilePhoto = new ParseFile(thumbname + \"_thumb.jpg\", data);\n profilePhoto.saveInBackground(new SaveCallback() {\n @Override\n public void done(ParseException e) {\n parseUser.put(\"profile_pic\", profilePhoto);\n //Now we save the user details\n parseUser.saveInBackground(new SaveCallback() {\n @Override\n public void done(ParseException e) {\n\n }\n });\n }\n });\n }\n }", "public abstract VisitorProfile save(VisitorProfile profile);", "public void saveSettings(View view){\n SharedPreferences.Editor editor = settings.edit();\n\n // Write the values from the views to the editor\n editor.putInt(\"vocablesNumber\",Integer.parseInt(vocablesNumber.getSelectedItem().toString()));\n editor.putBoolean(\"screenOn\", screenOnSwitch.isChecked());\n editor.putFloat(\"delayBetweenVocables\",Float.valueOf(editTextDelay.getText().toString()));\n // Commit the edits\n editor.commit();\n\n // Send the user a message of success\n Toast.makeText(Settings.this,\"Settings saved!\",Toast.LENGTH_SHORT).show();\n // Go back to previous activity\n finish();\n }", "private void saveFile() {\r\n\t\tFile file = new File(this.picture.getFileName());\r\n\r\n\t\ttry {\r\n\t\t\tImageIO.write(this.picture.getBufferedImage(),\r\n\t\t\t\t\tthis.picture.getExtension(), file);\r\n\t\t} catch (IOException e) {\r\n\t\t\tJOptionPane.showMessageDialog(this.pictureFrame,\r\n\t\t\t\t \"Could not save file.\",\r\n\t\t\t\t \"Save Error\",\r\n\t\t\t\t JOptionPane.WARNING_MESSAGE);\r\n\t\t}\r\n\r\n\t}", "private void populateProfile() {\n mPassword_input_layout.getEditText().setText(mSharedPreferences.getPassWord());\n mEmail_input_layout.getEditText().setText(mSharedPreferences.getEmail());\n mEdit_name_layout.getEditText().setText(mSharedPreferences.getName());\n ((RadioButton) mRadioGender.getChildAt(mSharedPreferences.getGender())).setChecked(true);\n mPhone_input_layout.getEditText().setText(mSharedPreferences.getPhone());\n mMajor_input_layout.getEditText().setText(mSharedPreferences.getMajor());\n mClass_input_layout.getEditText().setText(mSharedPreferences.getYearGroup());\n\n // Load profile photo from internal storage\n try {\n FileInputStream fis = openFileInput(getString(R.string.profile_photo_file_name));\n Bitmap bmap = BitmapFactory.decodeStream(fis);\n mImageView.setImageBitmap(bmap);\n fis.close();\n } catch (IOException e) {\n // Default profile\n }\n }", "private void saveAvatar(Intent picData) {\n if(cropFilePath != null) {\n File cropFile = new File(cropFilePath);\n if(cropFile.exists()) {\n HjtApp.getInstance().getAppService().uploadAvatar(cropFilePath);\n } else {\n onAvatarUploadEvent(new AvatarUploadEvent(false, \"Crop file not exist\"));\n }\n } else {\n onAvatarUploadEvent(new AvatarUploadEvent(false, \"no Extras back from scale image\"));\n }\n }", "void doSaveAs() {\r\n\t\tMapOpenSaveDialog dlg = new MapOpenSaveDialog(true, labels, saveSettings);\r\n\t\tdlg.setLocationRelativeTo(this);\r\n\t\tdlg.setVisible(true);\r\n\t\tif (dlg.saveSettings != null) {\r\n\t\t\tsaveSettings = dlg.saveSettings;\r\n\t\t\tfinal String fn = dlg.saveSettings.fileName.getPath();\r\n\t\t\taddRecentEntry(fn);\r\n\t\t\tdoSave();\r\n\t\t}\r\n\t}", "public void saveSettings(View v) {\n EditText apikeytext = (EditText) findViewById(R.id.editapi);\n EditText redcapurltext = (EditText) findViewById(R.id.editredcapurl);\n UserDBHelper udb = new UserDBHelper(this);\n User currentUser = udb.getActiveUser();\n\n String inputApiKey = apikeytext.getText().toString().trim();\n currentUser.setAPIKEY(inputApiKey);\n\n String inputRedcapURL = redcapurltext.getText().toString().trim();\n currentUser.setRedcapURL(inputRedcapURL);\n\n udb.updateUser(currentUser);\n\n Resources res = getResources();\n DisplayMetrics dm = res.getDisplayMetrics();\n Configuration config = res.getConfiguration();\n\n String targetLanguage;\n\n CheckBox cb_en = (CheckBox) findViewById(R.id.cb_english);\n CheckBox cb_pt = (CheckBox) findViewById(R.id.cb_port);\n\n if( cb_en.isChecked() ) {\n targetLanguage = \"en-US\";\n } else {\n targetLanguage = \"pt\";\n }\n\n Locale newLang = new Locale(targetLanguage);\n\n config.locale = newLang;\n res.updateConfiguration(config, dm);\n\n try {\n Intent i = new Intent(getBaseContext(), MainActivity.class);\n startActivity(i);\n finish();\n } catch (Exception e) {}\n }", "public void saveProfiles() throws IOException\n {\n try\n {\n profFile.getParentFile().mkdirs();\n profFile.delete();\n profFile.createNewFile();\n PrettyPrinterXmlWriter pp = new PrettyPrinterXmlWriter(new SimpleXmlWriter(new FileWriter(profFile)));\n pp.writeXmlVersion();\n pp.writeEntity(\"XNATProfiles\");\n if (this.size() != 0)\n {\n for (XNATProfile ip : this)\n {\n pp.writeEntity(\"XNATProfile\")\n .writeAttribute(\"profileName\", ip.getProfileName())\n \n .writeEntity(\"serverURL\")\n .writeText(ip.getServerURL().toString())\n .endEntity() \n // encrypt(sc.getServerURL().toString()));\n \n .writeEntity(\"userid\")\n .writeText(ip.getUserid())\n .endEntity()\n \n .writeEntity(\"projectList\");\n \n for (String is : ip.getProjectList())\n pp.writeEntity(\"project\")\n .writeText(is)\n .endEntity();\n \n pp.endEntity()\n .writeEntity(\"dicomReceiverHost\")\n .writeText(ip.getDicomReceiverHost())\n .endEntity()\n \n .writeEntity(\"dicomReceiverPort\")\n .writeText(ip.getDicomReceiverPort())\n .endEntity()\n \n .writeEntity(\"dicomReceiverAeTitle\")\n .writeText(ip.getDicomReceiverAeTitle())\n .endEntity()\n \n .endEntity();\n }\n }\n pp.writeEntity(\"preferredProfile\")\n .writeText(currentProfile)\n .endEntity()\n .endEntity()\n .close();\n }\n catch (IOException exIO)\n \t\t{\n throw exIO;\n }\n }", "private void saveProperties()\n {\n PSConfigUtils.saveObjectToFile(m_props, getPropertiesFile());\n }", "private static void saveImageQualitySettings(Editor editor, CheckBox small, CheckBox medium, CheckBox original)\n\t{\n\t\tif (medium.isChecked())\n\t\t{\n\t\t\teditor.putInt(HikeConstants.IMAGE_QUALITY, ImageQuality.QUALITY_MEDIUM);\n\t\t}\n\t\telse if (original.isChecked())\n\t\t{\n\t\t\teditor.putInt(HikeConstants.IMAGE_QUALITY, ImageQuality.QUALITY_ORIGINAL);\n\t\t}\n\t\telse\n\t\t{\n\t\t\teditor.putInt(HikeConstants.IMAGE_QUALITY, ImageQuality.QUALITY_SMALL);\n\t\t}\n\t\teditor.commit();\n\t}", "void savePreferences() throws OntimizeJEERuntimeException;", "public void saveUserSettings(DataRecord data) throws ProcessManagerException {\r\n try {\r\n userSettings.update(data, processModel.getUserInfos().toRecordTemplate(\r\n currentRole, getLanguage(), false));\r\n userSettings.save();\r\n \r\n Workflow.getUserManager()\r\n .resetUserSettings(getUserId(), getComponentId());\r\n } catch (WorkflowException we) {\r\n throw new ProcessManagerException(\"ProcessManagerSessionController\",\r\n \"processManager.ERR_SAVE_USERSETTINGS\");\r\n }\r\n }", "public void upload() {\n try {\n BufferedImage bufferedProfile = ImageIO.read(profilePicture.getInputStream());\n FaceImage face = new FaceImage(bufferedProfile);\n\n if (face.foundFace()) {\n\n face.setNoCropMultiplier(1);\n face.setAdditionPadding(20);\n face.setDimension(128, 128);\n BufferedImage profilePicture = face.getScaledProfileFace();\n\n File outfile = new File(Settings.NEW_PROFILE_IMAGE_PATH.replace(\"~~username~~\", student.getUserName()));\n ImageIO.write(profilePicture, \"png\", outfile);\n\n success = true;\n\n student.setProfilePicturePath(\"profile/\" + student.getUserName() + \".png\");\n save();\n\n } else {\n FacesContext.getCurrentInstance().addMessage(\"imageContainer:file\", new FacesMessage(\"Kein Gesicht gefunden!\"));\n\n }\n\n } catch (IOException e) {\n System.err.println(\"something went wrong \" + e.getMessage());\n }\n\n }", "private String saveProfilePicLocally(Bitmap bitmap) {\n FileOutputStream out = null;\n File file = new File(HPIApp.getAppContext().getFilesDir(), userProfile.getUsername());\n boolean success = false;\n\n try {\n out = new FileOutputStream(file);\n bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);\n success = true;\n } catch (Exception e) {\n HPIApp.logger(PREFIX, e.toString(), Log.ERROR);\n } finally {\n try {\n if (out != null) {\n out.close();\n }\n } catch (IOException e) {\n HPIApp.logger(PREFIX, e.toString(), Log.ERROR);\n }\n }\n\n if (success) {\n return file.getPath();\n } else {\n return \"\";\n }\n }", "public void saveCameraPosition() {\n \t\tCameraPosition camera = mMap.getCameraPosition();\n \t\tSharedPreferences settings = context.getSharedPreferences(\"MAP\", 0);\n \t\tSharedPreferences.Editor editor = settings.edit();\n \t\teditor.putFloat(\"lat\", (float) camera.target.latitude);\n \t\teditor.putFloat(\"lng\", (float) camera.target.longitude);\n \t\teditor.putFloat(\"bea\", camera.bearing);\n \t\teditor.putFloat(\"tilt\", camera.tilt);\n \t\teditor.putFloat(\"zoom\", camera.zoom);\n \t\teditor.commit();\n \t}", "private void saveUserInfo() {\n progressBar.setVisibility(View.VISIBLE);\n //get value from fields and convert them to strings\n name = mNameField.getText().toString();\n phone = mPhoneField.getText().toString();\n mAge = mAgeField.getText().toString();\n about=mAboutField.getText().toString();\n loc= mLocationField.getText().toString();\n int selectId = mRadioGroup.getCheckedRadioButtonId();\n\n\n final RadioButton radioButton =getView().findViewById(selectId);\n\n if(radioButton.getText() == null){\n return;\n }\n\n Map userInfo = new HashMap();\n //write where to put values in database\n userInfo.put(\"Name\",name);\n userInfo.put(\"Phone\",phone);\n userInfo.put(\"Age\",mAge);\n userInfo.put(\"About\",about);\n userInfo.put(\"Location\",loc);\n userInfo.put(\"Preferred Gender\", radioButton.getText().toString());\n\n\n //save to database\n mUserDb.updateChildren(userInfo);\n //checks if image has changed\n if (resultUri != null){\n StorageReference filepath = FirebaseStorage.getInstance().getReference().child(\"profileImages\").child(userId);\n Bitmap bitmap = null;\n\n //pass image we got from image uri\n //create a safety net for any unacounted errors\n try {\n bitmap = MediaStore.Images.Media.getBitmap(getContext().getContentResolver(), resultUri);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n //compress image to small size\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.JPEG, 20,baos);\n byte[] data = baos.toByteArray();\n\n //try to upload file\n //try on fail to catch error uploads\n UploadTask uploadTask = filepath.putBytes(data);\n uploadTask.addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(getContext(),\"fail\",Toast.LENGTH_LONG).show();\n }\n });\n\n //do the other case where image upload is successfull\n uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n //grap url from the profile image from the database\n Task<Uri> uriTask = taskSnapshot.getStorage().getDownloadUrl();\n while (!uriTask.isSuccessful());\n Uri downLoadUrl = uriTask.getResult();\n\n Map userInfo = new HashMap();\n //write where to put values in database\n userInfo.put(\"profileImageUrl\",downLoadUrl.toString());\n mUserDb.updateChildren(userInfo);\n\n return;\n }\n });\n\n }else{\n //Toast.makeText(SettingsActivity.this,\"Image load ++\", Toast.LENGTH_LONG).show();\n Toast.makeText(getActivity(),\"Image load ++\", Toast.LENGTH_LONG).show();\n }\n }", "private void saveData() {\r\n\t\tif(mFirstname.getText().toString().trim().length() > 0 &&\r\n\t\t\t\tmLastname.getText().toString().trim().length() > 0 &&\r\n\t\t\t\tmEmail.getText().toString().trim().length() > 0) {\r\n\t\t\tmPrefs.setFirstname(mFirstname.getText().toString().trim());\r\n\t\t\tmPrefs.setLastname(mLastname.getText().toString().trim());\r\n\t\t\tmPrefs.setEmail(mEmail.getText().toString().trim());\r\n\t\t\tif(mMaleBtn.isChecked())\r\n\t\t\t\tmPrefs.setGender(0);\r\n\t\t\telse if(mFemaleBtn.isChecked())\r\n\t\t\t\tmPrefs.setGender(1);\r\n\t\t\tif(!mCalendarSelected.after(mCalendarCurrent)) \r\n\t\t\t\tmPrefs.setDateOfBirth(mCalendarSelected.get(Calendar.YEAR), \r\n\t\t\t\t\t\tmCalendarSelected.get(Calendar.MONTH), \r\n\t\t\t\t\t\tmCalendarSelected.get(Calendar.DAY_OF_MONTH));\r\n\t\t\tToast.makeText(getActivity(), R.string.msg_changes_saved, Toast.LENGTH_LONG).show();\r\n\t\t} else \r\n\t\t\tToast.makeText(getActivity(), R.string.msg_registration_empty_field, Toast.LENGTH_LONG).show();\r\n\t}", "public void save() {\n\t\tpreferences().flush();\n\t}", "public static void saveSettings() {\n\n Writer output = null;\n try {\n output = new BufferedWriter(new FileWriter(getConfigFile()));\n final Set<String> set = m_Settings.keySet();\n final Iterator<String> iter = set.iterator();\n while (iter.hasNext()) {\n final String sKey = iter.next();\n final String sValue = m_Settings.get(sKey);\n output.write(sKey + \"=\" + sValue + \"\\n\");\n }\n }\n catch (final IOException e) {\n Sextante.addErrorToLog(e);\n }\n finally {\n if (output != null) {\n try {\n output.close();\n }\n catch (final IOException e) {\n Sextante.addErrorToLog(e);\n }\n }\n }\n\n }", "public static void save()\n {\n try\n {\n FileOutputStream fOS = new FileOutputStream(propsFile); \n props.store(fOS, \"\");\n fOS.close();\n } catch (IOException e)\n {\n e.printStackTrace();\n }\n }", "void saveInPreferences(NetworkCallInformation userInfo);", "Accessprofile save(Accessprofile accessprofile);", "public static void writeUserProfile(Profile profile) throws IOException {\n\n try (BufferedWriter writer = Files.newBufferedWriter(Paths.get(USER_PROFILE));\n\n CSVPrinter csvPrinter = new CSVPrinter(writer, CSVFormat.EXCEL.withHeader(\"firstName\",\"lastName\",\"email\",\"password\",\"phoneNumber\",\"insuranceCompanyName\",\"insuranceCompanyFax\", \"insuranceCompanyEmail\"));\n ) {\n csvPrinter.printRecord(profile.getFirstName().toString(), profile.getLastName(), profile.getEmail(), profile.getPw(), profile.getPhoneNumber(), profile.getInsuranceCompanyName(), profile.getInsuranceCompanyFax(), profile.getInsuranceCompanyEmail());\n csvPrinter.flush();\n }\n }", "public void saveMixerSettingsLocally() {\n\t\tFileChooser fileChooser = new FileChooser();\n\t\tExtensionFilter filter = new ExtensionFilter(\"TXT files (*.txt)\", \"*.txt\");\n\t\tfileChooser.getExtensionFilters().add(filter);\n\t\tFile file = fileChooser.showSaveDialog(mainContainer.getScene().getWindow());\n\t\tString fullPath;\n\t\ttry {\n\t\t\tfullPath = file.getAbsolutePath();\n\t\t\tif (!fullPath.endsWith(\".txt\")) {\n\t\t\t\tfullPath = fullPath + \".txt\";\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tFileWriter writeFile = new FileWriter(fullPath);\n\t\t\t\twriteFile.write(Double.toString(sliderPitch.getValue()) + \"\\n\");\n\t\t\t\twriteFile.write(Double.toString(sliderEchoLength.getValue()) + \"\\n\");\n\t\t\t\twriteFile.write(Double.toString(sliderDecay.getValue()) + \"\\n\");\n\t\t\t\twriteFile.write(Double.toString(sliderGain.getValue()) + \"\\n\");\n\t\t\t\twriteFile.write(Double.toString(sliderFlangerLength.getValue()) + \"\\n\");\n\t\t\t\twriteFile.write(Double.toString(sliderWetness.getValue()) + \"\\n\");\n\t\t\t\twriteFile.write(Double.toString(sliderLfoFrequency.getValue()) + \"\\n\");\n\t\t\t\twriteFile.write(Float.toString((float) sliderLowPass.getValue()) + \"\\n\");\n\t\t\t\twriteFile.close();\n\t\t\t\tAlert alert = new Alert(AlertType.INFORMATION);\n\t\t\t\talert.setTitle(bundle.getString(\"sMSsaveAlert1Title\"));\n\t\t\t\talert.setHeaderText(bundle.getString(\"sMSsaveAlert1Header\"));\n\t\t\t\talert.showAndWait();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tAlert alert = new Alert(AlertType.ERROR);\n\t\t\t\talert.setTitle(bundle.getString(\"mSSaveAlertTitle\"));\n\t\t\t\talert.setHeaderText(bundle.getString(\"mSSaveAlertHeader\"));\n\t\t\t\talert.setContentText(bundle.getString(\"mSSaveAlertContent\"));\n\t\t\t\talert.showAndWait();\n\t\t\t}\n\t\t} catch (Exception e) {\n\n\t\t}\n\t}", "private void savePreferences() {\n SharedPrefStatic.mJobTextStr = mEditTextJobText.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobSkillStr = mEditTextSkill.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobLocationStr = mEditTextLocation.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobAgeStr = mEditTextAge.getText().toString().replace(\" \", \"\");\n\n SharedPreferences sharedPref = getSharedPreferences(AppConstants.PREF_FILENAME, 0);\n SharedPreferences.Editor editer = sharedPref.edit();\n editer.putString(AppConstants.PREF_KEY_TEXT, SharedPrefStatic.mJobTextStr);\n editer.putString(AppConstants.PREF_KEY_SKILL, SharedPrefStatic.mJobSkillStr);\n editer.putString(AppConstants.PREF_KEY_LOCATION, SharedPrefStatic.mJobLocationStr);\n editer.putString(AppConstants.PREF_KEY_AGE, SharedPrefStatic.mJobAgeStr);\n\n // The commit runs faster.\n editer.apply();\n\n // Run this every time we're building a query.\n SharedPrefStatic.buildUriQuery();\n SharedPrefStatic.mEditIntentSaved = true;\n }", "public boolean saveSettings() {\r\n\t\treturn settings.save();\r\n\t}", "public void saveData(){\n SharedPreferences sharedPreferences = getSharedPreferences(\"SHARED_PREFS\",MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(\"email_pref\",email.getText().toString());\n editor.putString(\"password_pref\",uPassword.getText().toString());\n editor.apply();\n }", "void save() {\r\n if (actionCompleted) {\r\n forget();\r\n } else {\r\n AccountSettings.stateStored = new Bundle();\r\n save(AccountSettings.stateStored);\r\n }\r\n }", "private void saveData() {\n\n SharedPreferences sharedPreferences=getSharedPreferences(\"userInfo\", Context.MODE_PRIVATE);\n SharedPreferences.Editor editor=sharedPreferences.edit();\n\n editor.putString(\"name\",name.getText().toString());\n editor.putString(\"regnum\",regnum.getText().toString());\n editor.putInt(\"count\", count);\n editor.apply();\n\n }", "private void putPersonalInformation() throws SQLException, FileNotFoundException, IOException {\n AdUserPersonalData personal;\n try {\n personal = PersonalDataController.getInstance().getPersonalData(username);\n staff_name = personal.getGbStaffName();\n staff_surname = personal.getGbStaffSurname();\n id_type = \"\"+personal.getGbIdType();\n id_number = personal.getGbIdNumber();\n putProfPic(personal.getGbPhoto());\n phone_number = personal.getGbPhoneNumber();\n mobile_number = personal.getGbMobileNumber();\n email = personal.getGbEmail();\n birthdate = personal.getGbBirthdate();\n gender = \"\"+personal.getGbGender();\n } catch (GB_Exception ex) {\n LOG.error(ex);\n GBMessage.putException(ex);\n }\n }", "@FXML\n\tprivate void onSaveBtn() {\n\t\tSettings settings = Settings.getSingleton();\n\t\t//Set rule setting\n\t\tif(ruleBox.getValue() == \"Standard\") {\n\t\t\tsettings.setRuleType(RuleType.STANDARD);\n\t\t} else {\n\t\t\tsettings.setRuleType(RuleType.CHALLENGE);\n\t\t}\n\t\t\n\t\t//Set number of walls setting\n\t\tsettings.setWalls(wallBox.getValue());\n\t\t//Set show label\n\t\tsettings.setShowLabels(indicateLabel.isSelected());\n\t\t//Set show ghost trails\n\t\t//settings.setShowTrail(ghostTrail.isSelected());\n\t\t\n\t\t//Set board height and width\n\t\tswitch(boardBox.getValue()) {\n\t\tcase \"7x7\":\n\t\t\tsettings.setBoardHeight(7);\n\t\t\tsettings.setBoardWidth(7);\t\t\t\n\t\t\tbreak;\n\t\tcase \"9x9\":\n\t\t\tsettings.setBoardHeight(9);\n\t\t\tsettings.setBoardWidth(9);\t\t\t\n\t\t\tbreak;\n\t\tcase \"11x11\":\n\t\t\tsettings.setBoardHeight(11);\n\t\t\tsettings.setBoardWidth(11);\t\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tsettings.setBoardHeight(9);\n\t\t\t\tsettings.setBoardWidth(9);\n\t\t\t\tbreak;\n\t\t}\n\t\t//Set tile size\n\t\tsettings.setTileSize(tileBox.getValue());\n\t}", "public static void SavePreferences()\n {\n try\n {\n StartSaveAnimation();\n PrintWriter writer = new PrintWriter(preferences_file_name, \"UTF-8\");\n \n writer.print(Utilities.BoolToInt(MusicManager.enable_music) + \"\\r\\n\");\n writer.print(Utilities.BoolToInt(PassiveDancer.englishMode) + \"\\r\\n\");\n \n writer.close();\n }\n catch(Exception e) { System.out.println(\"Problem writing in the file \" + preferences_file_name + \".\"); }\n }", "void updateProfilePhoto(int userId, String filename);", "private void takeAndSave(){\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n //Ensure there's a camera\n if(takePictureIntent.resolveActivity(getPackageManager())!=null){\n File photoFile = null;\n try{\n photoFile = createImageFile();\n }catch (IOException e){\n //Error message, maybe print out\n exit();\n }\n if(photoFile != null){\n Uri photoURI = FileProvider.getUriForFile(this, \"com.example.android.fileprovider\",photoFile);\n takePictureIntent.putExtra(MediaStore.Extra_OUTPUT, photoURI);\n startActivityForResult(takePictureIntent, REQUEST_TAKE_PHOTO);\n }\n }\n }", "private void savePrefsData() {\n SharedPreferences pref = getApplicationContext().getSharedPreferences(\"myPrefs\", MODE_PRIVATE);\n SharedPreferences.Editor editor = pref.edit();\n editor.putBoolean(\"isIntroOpnend\", true);\n editor.commit();\n }", "public void saveGame(){\n updateProperties();\n try {\n output = new FileOutputStream(fileName);\n properties.store(output, null); //saving properties to file\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO SAVE GAME ---\");\n e.printStackTrace();\n } finally {\n if (output != null) {\n try {\n output.close();\n System.out.println(\"--- GAME SAVED ---\");\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO CLOSE OUTPUT ---\");\n e.printStackTrace();\n }\n }\n }\n }", "public void saveInfo(View view){\n SharedPreferences sharedPref = getSharedPreferences(\"userInfo\", Context.MODE_PRIVATE); //This means the info is private and hence secured\n\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(\"username\", usernameInput.getText().toString());\n editor.putString(\"password\", passwordInput.getText().toString());\n editor.apply();\n\n Toast.makeText(this, \"Saved!\", Toast.LENGTH_LONG).show();\n }", "private void save() {\n File personFile = mainApp.getFilmFilePath();\n if (personFile != null) {\n mainApp.saveFilmDataToFile(personFile);\n } else {\n saveAs();\n }\n }", "private void createProfile(ParseUser parseUser){\n final Profile profile = new Profile();\n\n profile.setShortBio(\"\");\n profile.setLongBio(\"\");\n profile.setUser(parseUser);\n\n //default image taken from existing default user\n ParseQuery<ParseObject> query = ParseQuery.getQuery(\"Profile\");\n query.getInBackground(\"wa6q24VD5V\", new GetCallback<ParseObject>() {\n public void done(ParseObject searchProfile, ParseException e) {\n if (e != null) {\n Log.e(TAG, \"Couldn't retrieve default image\");\n e.printStackTrace();\n return;\n }\n else {\n defaultImage = searchProfile.getParseFile(\"profileImage\");\n\n if (defaultImage != null)\n profile.setProfileImage(defaultImage);\n else\n Log.d(TAG, \"Default image is null\");\n }\n }\n });\n\n profile.saveInBackground(new SaveCallback() {\n @Override\n public void done(ParseException e) {\n if (e != null) {\n Log.e(TAG, \"Error while saving\");\n e.printStackTrace();\n return;\n }\n\n Log.d(TAG, \"Created and saved profile\");\n }\n });\n }", "public void SaveButtonOnClickListener(View view) {\n String defaultObjectOwner = ((EditText)findViewById(R.id.settings_default_object_owner_field)).getText().toString().trim();\n presenter.SaveSettings(defaultObjectOwner);\n }", "public void saveInfo(View view) {\n SharedPreferences sharedPref = getSharedPreferences(\"userInfo\", Context.MODE_PRIVATE);\n\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(\"username\", usernameInput.getText().toString());\n editor.putString(\"password\", passwordInput.getText().toString());\n editor.apply();\n\n usernameInput.setText(\"\");\n passwordInput.setText(\"\");\n\n Toast.makeText(this, \"Saved!\", Toast.LENGTH_LONG).show();\n }", "@Override public void saveSettings(Map pProps, Map pSettings) {\n pProps.put(\"$class\", \"com.castorama.searchadmin.adapter.content.impl.CastoramaDocumentAdapter\");\n pProps.put(CDS_PATH, pSettings.get(getSourceTypeInternalName() + PATH));\n pProps.put(PORT, pSettings.get(getSourceTypeInternalName() + PORT));\n pProps.put(HOST_MACHINE, pSettings.get(getSourceTypeInternalName() + HOST_MACHINE));\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(saveSettings()) {\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"设置保存成功\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\tSettingsActivity.this.setResult(RESULT_SAVE_SUCCESS);\n\t\t\t\t\tSettingsActivity.this.finish();\n\t\t\t\t}\n\t\t\t}", "public void saveDetailsOnClick(View view)\n {\n\n //Create Picture object by passing String params set by user.\n Picture picture = new Picture(locationEditText.getText().toString(),\n pictureNameEditText.getText().toString());\n\n //call pushPicture method using instance of Picture to push picture to Firebase\n picture.pushPicture(picture.getLocation(),picture.getName());\n\n\n //Display Toast to let user know that picture has been saved.\n Toast.makeText(PictureActivity.this, R.string.save_toast,\n Toast.LENGTH_SHORT).show();\n\n }", "private Integer uploadProfile(Status status) {\n \t\treturn uploadURL(status.getUser().getProfileImageURL());\n \t}", "private void saveSharedPref() {\n SharedPreferences.Editor editor = this.sharedPreferences.edit();\n if (checkBox.isChecked()) {\n editor.putBoolean(Constants.SP_IS_REMEMBERED_KEY, true);\n }\n editor.apply();\n }", "public void saveInfo(View view){\n SharedPreferences sharedPref = getSharedPreferences(\"userinfo\", Context.MODE_PRIVATE);\n\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(\"username\", usernameInput.getText().toString());\n\n editor.apply();\n Toast.makeText(this,\"Saved!\",Toast.LENGTH_LONG).show();\n }", "public void editProfile() {\n dialog = new Dialog(getContext());\n dialog.setContentView(R.layout.edit_profile);\n\n editUsername = dialog.findViewById(R.id.tv_uname);\n TextView editEmail = dialog.findViewById(R.id.tv_address);\n editImage = dialog.findViewById(R.id.imgUser);\n\n editUsername.setText(user.getUserID());\n editEmail.setText(user.getEmail());\n editEmail.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Toast.makeText(getContext(), \"Email cannot be changed.\", Toast.LENGTH_SHORT).show();\n }\n });\n decodeImage(user.getProfilePic(), editImage);\n editImage.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n startActivityForResult(new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI), 3);\n }\n });\n\n TextView save = dialog.findViewById(R.id.save_edit);\n save.setOnClickListener(new View.OnClickListener() { // save changes\n @Override\n public void onClick(View v) {\n String username = editUsername.getText().toString();\n if(username.equals(\"\")) {\n Toast.makeText(getContext(), \"Username cannot be null\", Toast.LENGTH_SHORT).show();\n return;\n } else if (!checkUsername(username)) {\n Toast.makeText(getContext(), \"Username already exists\", Toast.LENGTH_SHORT).show();\n return;\n }\n user.setUserID(username);\n if(profilePicChanged) {\n user.setProfilePic(profilePic);\n profilePic = null;\n profilePicChanged = false;\n }\n docRef.set(user);\n dialog.dismiss();\n loadDataFromDB();\n }\n });\n\n TextView cancel = dialog.findViewById(R.id.cancel_edit);\n cancel.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n dialog.dismiss(); // cancel changes\n }\n });\n\n dialog.show();\n dialog.getWindow().setLayout(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);\n }", "public static void save() {\n\t\t// Save each user \n\t\t// and list of directories \n\t\t// and files in each directory\n\t\tArrayList<String> usernames = getRegisteredUserNames();\n\t\tUtils.FileUtils.write(\n\t\t\t\tusernames, \n\t\t\t\tGlobal.Constants.LIST_OF_USERS\n\t\t\t\t);\t\n\t\tfor (User user:Global.Variables.registeredUsers) {\n\t\t\tUtils.FileUtils.write(\n\t\t\t\tuser.getDirectoryNames(), \n\t\t\t\tGlobal.Constants.DIRECTORY_LOCATION + user.getName()\n\t\t\t\t);\n\t\t\tsave(user);\n\t\t}\n\t}", "private void updateProfile(PrivateProfile p) {\n final ProgressDialog dialog = new ProgressDialog(SettingsActivity.this);\n dialog.setMessage(getString(R.string.progress_update_profile));\n dialog.show();\n\n // Prepare user inputs for validator\n HashMap<String, Object> fields = new HashMap<String, Object>();\n fields.put(\"firstName\", mFirstName.getText().toString().trim());\n fields.put(\"lastName\", mLastName.getText().toString().trim());\n fields.put(\"homeCity\", mHomeCity.getText().toString().trim());\n fields.put(\"phone\", mPhone.getText().toString().trim());\n fields.put(\"arriveHQBy\", mArriveHQBy.getText().toString().trim());\n fields.put(\"arriveHomeBy\", mArriveHomeBy.getText().toString().trim());\n\n validateFields(fields);\n\n userProfile.setFirstName((String) fields.get(\"firstName\"));\n userProfile.setLastName((String) fields.get(\"lastName\"));\n userProfile.setHomeCity((String) fields.get(\"homeCity\"));\n userProfile.setPhoneNumber((String) fields.get(\"phone\"));\n userProfile.setDriverStatus((Boolean) fields.get(\"driving\"));\n userProfile.setDriverCar((String) fields.get(\"car\"));\n userProfile.setArriveHQBy((String) fields.get(\"arriveHQBy\"));\n userProfile.setArriveHomeBy((String) fields.get(\"arriveHomeBy\"));\n\n userProfile.saveInBackground(new SaveCallback() {\n @Override\n public void done(ParseException e) {\n dialog.dismiss();\n if (e != null) {\n // Show the error message\n Toast.makeText(SettingsActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();\n } else {\n // show user the activity was complete\n Toast.makeText(SettingsActivity.this, R.string.profile_saved, Toast.LENGTH_SHORT).show();\n }\n }\n });\n }" ]
[ "0.72174066", "0.7156655", "0.7053254", "0.6985824", "0.69576555", "0.6903248", "0.6900692", "0.6856288", "0.6761124", "0.6750085", "0.67215776", "0.66871095", "0.6673486", "0.6658079", "0.6622151", "0.6597693", "0.65960854", "0.65771574", "0.6514514", "0.64939046", "0.6413281", "0.63582474", "0.6334035", "0.62939996", "0.6288693", "0.6279732", "0.62690985", "0.6268646", "0.62660635", "0.62315226", "0.6220382", "0.61983484", "0.6193838", "0.61761695", "0.61271906", "0.61155856", "0.6095573", "0.608536", "0.60845274", "0.6071847", "0.60717934", "0.60679156", "0.6055728", "0.6049385", "0.60443336", "0.6043863", "0.6038476", "0.6033754", "0.60081434", "0.6006216", "0.60017633", "0.59927666", "0.59908366", "0.59905475", "0.5989383", "0.5961215", "0.5959697", "0.5954187", "0.59499645", "0.59496355", "0.59462607", "0.59324163", "0.5925005", "0.5921607", "0.5919065", "0.5911614", "0.5909654", "0.5894829", "0.5889357", "0.5889344", "0.5880059", "0.58643246", "0.58544385", "0.58532864", "0.5852332", "0.58507085", "0.5844577", "0.5827726", "0.5826536", "0.5823845", "0.5822808", "0.5812953", "0.5804675", "0.5803088", "0.57981575", "0.5795147", "0.5793249", "0.5792936", "0.5790767", "0.57817984", "0.5775879", "0.5769948", "0.5734023", "0.5731252", "0.572999", "0.57023245", "0.56881404", "0.56867987", "0.5686704", "0.5679578" ]
0.64710385
20
upload image from imageview to Firebase storage
private void uploadPhoto() { // Get the data from an ImageView as bytes ImageView imageView = (ImageView)findViewById(R.id.imgView); imageView.setDrawingCacheEnabled(true); imageView.buildDrawingCache(); Bitmap bitmap = imageView.getDrawingCache(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos); byte[] data = baos.toByteArray(); FirebaseStorage storage = FirebaseStorage.getInstance(); // Create a storage reference from our app StorageReference storageRef = storage.getReferenceFromUrl(Config.FIREBASE_STORAGE_URL); // Create a reference to 'images/profile/userNodeId.jpg' StorageReference mountainImagesRef = storageRef.child("images/profile/"+currentUser.getFireUserNodeId()+".jpg"); // set image name as userid.jpg which is unique UploadTask uploadTask = mountainImagesRef.putBytes(data); uploadTask.addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception exception) { // Handle unsuccessful uploads Toast.makeText(getApplicationContext(),"Photo upload failed!",Toast.LENGTH_SHORT).show(); } }).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() { @Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { // taskSnapshot.getMetadata() contains file metadata such as size, content-type, and download URL. Toast.makeText(getApplicationContext(),"Photo uploaded successfully!",Toast.LENGTH_SHORT).show(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void UploadImageToStorage(){\n final StorageReference filepath = storageRootRef.child(\"MyImages\").child(imageURIFromDevice.getLastPathSegment());\n\n filepath.putFile(imageURIFromDevice).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n // I'll be notified here if my image has been uploaded\n\n // Extract the URI of the image\n filepath.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n // teh result uri of the image on WEB\n Uri downloadURIofImage = uri;\n\n // Pass the URI and ImageView to Picasso\n Picasso.get().load(downloadURIofImage).into(resultImageView);\n }\n });\n\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n\n }\n });\n }", "void UploadToFirebase() {\n // This gives the path name for the storage\n StorageReference photoRef = mStorageRef.child(\"images\").child(selectedImageUri.getLastPathSegment());\n\n // This uploads it into firebase storage\n // Toast makes the little comment appear at the bottom of the screen\n photoRef.putFile(selectedImageUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @SuppressLint(\"ShowToast\")\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Toast toast = Toast.makeText(getApplicationContext(), \"Uploaded\", Toast.LENGTH_SHORT);\n toast.show();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @SuppressLint(\"ShowToast\")\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast toast = Toast.makeText(getApplicationContext(), \"Upload failed\", Toast.LENGTH_SHORT);\n toast.show();\n }\n });\n }", "private void putImageInStorage() {\n final StorageReference ref = storageReference.child(\"images/\" + java.util.UUID.randomUUID().toString());\n ref.putFile(filePath)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n if (taskSnapshot.getMetadata() != null) {\n if (taskSnapshot.getMetadata().getReference() != null) {\n Task<Uri> result = taskSnapshot.getStorage().getDownloadUrl();\n result.addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n imageUrl = uri.toString();\n ChatMessage Message = new\n ChatMessage(null,\n mUsername,\n imageUrl, dateAndTime);\n mFirebaseDatabaseReference.child(CHATS_PATH + chatCode)\n .push().setValue(Message);\n }\n });\n }\n }\n }\n });\n }", "private void uploadFile() {\n // make sure image was selected\n if (mImageUri != null) {\n // set up image file path for firebase storage\n StorageReference fileReference = mStorageRef.child(System.currentTimeMillis()\n + \".\" + getFileExtension(mImageUri));\n\n // create file metadata including the content type\n StorageMetadata metadata = new StorageMetadata.Builder()\n .setContentType(\"image/jpg\")\n .build();\n \n\n // upload the file and metadata\n mUploadTask = fileReference.putFile(mImageUri, metadata)\n .addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n // show progress bar during upload\n double progress = (100.0 * taskSnapshot.getBytesTransferred() / taskSnapshot.getTotalByteCount());\n mProgressBar.setProgress((int) progress);\n }\n });\n // Get download url of the uploaded image\n Task<Uri> urlTask = mUploadTask.continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {\n if (!task.isSuccessful()) {\n throw task.getException();\n }\n // get the download URL\n return fileReference.getDownloadUrl();\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if (task.isSuccessful()) {\n // get download uri\n Uri downloadUri = task.getResult();\n imageUrl = downloadUri.toString();\n String imageDescription = mEditTextFileName.getText().toString().trim();\n // build hashmap to hold object of Upload class\n final Map uploadBody = new HashMap();\n uploadBody.put(\"name\", imageDescription);\n uploadBody.put(\"imageUrl\", imageUrl);\n // get key of the realtime database\n String uploadId = mDatabaseRef.push().getKey();\n // update the realtime database\n mDatabaseRef.child(uploadId).setValue(uploadBody);\n } else {\n // Handle failures\n Toast.makeText(getActivity(), \"Error getting image Url\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n Toast.makeText(getActivity(), \"Upload succesful\", Toast.LENGTH_SHORT).show();\n\n }else {\n Toast.makeText(getActivity(), \"No file selected\", Toast.LENGTH_SHORT).show();\n }\n }", "private void uploadFile() {\n //if there is a file to upload\n if (filePath != null) {\n\n\n final StorageReference storageReference2nd = storageReference.child(System.currentTimeMillis() + \".\" + GetFileExtension(filePath));\n storageReference2nd.putFile(filePath)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n\n /* storageReference2nd.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n final String ImageUrl = uri.toString();\n\n }\n });*/\n\n // Getting Description, Price, Address, Mobile from EditText and store into string variable.\n String TempDescription = Description.getText().toString().trim();\n String TempPrice = Price.getText().toString().trim();\n String TempAddress = Address.getText().toString().trim();\n String TempPhone = Phone.getText().toString().trim();\n String TempImageUrl = ImageUrl;\n\n\n\n\n\n //if the upload is successfull\n\n //and displaying a success toast\n Toast.makeText(postadv.this, \"File Uploaded \", Toast.LENGTH_LONG).show();\n\n\n @SuppressWarnings(\"VisibleForTests\")\n ImageUploadInfo imageUploadInfo = new ImageUploadInfo(TempDescription, TempPrice, TempAddress, TempPhone, storageReference2nd.getDownloadUrl().toString());\n\n // Getting image upload ID.\n String ImageUploadId = databaseReference.push().getKey();\n\n // Adding image upload id s child element into databaseReference.\n databaseReference.child(ImageUploadId).setValue(imageUploadInfo);\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n //if the upload is not successfull\n //hiding the progress dialog\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }\n });\n }\n //if there is not any file\n else {\n Toast.makeText(postadv.this, \"Failed\", Toast.LENGTH_SHORT).show();\n }\n }", "private void uploadPhoto() {\n\n final ProgressDialog pd = new ProgressDialog(this);\n pd.setTitle(\"Uploading Image...\");;\n pd.show();\n\n final String randomKey = UUID.randomUUID().toString();\n StorageReference storageRef = storageReference.child(\"images/\" + randomKey);\n\n storageRef.putFile(imageUri)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n final Task<Uri> firebaseUri = taskSnapshot.getStorage().getDownloadUrl();\n firebaseUri.addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n photoURL = uri.toString();\n }\n });\n\n pd.dismiss();\n Snackbar.make(findViewById(android.R.id.content), \"Image Uploaded.\", Snackbar.LENGTH_LONG).show();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n pd.dismiss();\n Toast.makeText(getApplicationContext(), \"Failed To Upload\", Toast.LENGTH_LONG).show();\n }\n })\n .addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onProgress(@NonNull UploadTask.TaskSnapshot snapshot) {\n double progressPercent = (100.00 * snapshot.getBytesTransferred() / snapshot.getTotalByteCount());\n pd.setMessage(\"Percentage: \" + (int) progressPercent + \"%\");\n }\n });\n }", "public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n @SuppressWarnings(\"VisibleForTests\")\n Uri downloadUrI = taskSnapshot.getDownloadUrl();\n FirebasePost firebasePost = new FirebasePost();\n firebasePost.imageUrl = downloadUrI.toString();\n myImage.child(\"home\").setValue(firebasePost);\n\n\n }", "@Override\n public void onClick(View view) {\n StorageReference myfileRef = storageRef.child(email).child(\"ProfPic.jpg\");\n //StorageReference myfileRef = storageRef.child(\"ProfPic.jpg\");\n viewImage.setDrawingCacheEnabled(true);\n viewImage.buildDrawingCache();\n Bitmap bitmap = viewImage.getDrawingCache();\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);\n byte[] data = baos.toByteArray();\n\n UploadTask uploadTask = myfileRef.putBytes(data);\n uploadTask.addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n Toast.makeText(ProfilePicture.this, \"TASK FAILED\", Toast.LENGTH_SHORT).show();\n }\n }).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Toast.makeText(ProfilePicture.this, \"Upload Successful!\", Toast.LENGTH_SHORT).show();\n //progressBar.setVisibility(View.GONE);\n\n Uri downloadUrl =taskSnapshot.getDownloadUrl();\n String DOWNLOAD_URL = downloadUrl.getPath();\n Log.v(\"Download URL\", DOWNLOAD_URL);\n Toast.makeText(ProfilePicture.this, DOWNLOAD_URL, Toast.LENGTH_SHORT).show();\n }\n });\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (requestCode == PICK_IMAGE_REQUEST && resultCode == RESULT_OK && data != null && data.getData() != null) {\n\n //Obtiene la URI de la imagen\n Uri uri = data.getData();\n\n //Declara un InputStream\n InputStream inputStream = null;\n try {\n //Inicializa el InputStream utilizando como fuente de datos la URI de la imagen\n inputStream = getContentResolver().openInputStream(uri);\n\n //Obtiene una referencia al almacen de Firebase\n StorageReference storageReference = FirebaseStorage.getInstance().getReference();\n //Situa la referencia en la ruta donde se almacena la imagen de perfil del usuario\n storageReference = storageReference.child(\"usuarios\").child(usuario.getId()).child(\"perfil.png\");\n //Crea un objeto UploadTask, utilizado para subir la imagen al almacen de Firebase\n UploadTask uploadTask;\n //Inicializa el UploadTask haciendo una llamada al metodo putStream del objeto StorageReference\n //y pasandole por parametro el InputStream\n uploadTask = storageReference.putStream(inputStream);\n //Añade escuchadores al UploadTask que recibiran los eventos de operacion exitosa u operacion\n //fallida\n uploadTask.addOnFailureListener(new OnFailureListener() {\n /**\n * onFailure: se ejecuta si la operacion fallo\n * @param e\n */\n @Override\n public void onFailure(@NonNull Exception e) {\n //Muestra un Snackbar informando al usuaario del error\n Snackbar.make(ivFotoPerfil,\"Error al subir la imagen al servidor: \"\n + e.getMessage(),\n Snackbar.LENGTH_LONG).show();\n }\n }).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n /**\n * onSuccess: se ejecuta si la operacion se realizo exitosamente\n * @param taskSnapshot\n */\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n\n //Etiqueta para evitar que el IDE se queje de que el metodo getDownloadUrl\n //solo deberia ser visible por tests o en un ambito private\n @SuppressWarnings(\"VisibleForTests\")\n //Obtiene del TaskSnapShot la URI de la imagen\n Uri uri = taskSnapshot.getDownloadUrl();\n //Establece la URL de la imagen de usuario en el objeto Usuario con la nueva URL\n usuario.setImagenUrl(uri.toString());\n\n //Obtiene una referencia a la base de datos\n DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReference();\n //Almacena en la base de datos el objeto Usuario actualizado\n databaseReference.child(\"usuarios\").child(usuario.getId()).setValue(usuario);\n\n //Carga la nueva imagen en el ImageView\n Glide.with(getApplicationContext())\n .load(uri)\n .apply(new RequestOptions().placeholder(R.drawable.iconouser).centerCrop())\n .into(ivFotoPerfil);\n }\n });\n } catch (FileNotFoundException e) {\n //Si no se encontro la imagen, se muestra un Snackbar informando del error al usuario\n //y termina la ejecucion del metodo mediante return\n Snackbar.make(ivFotoPerfil,\"No se ha podido cargar la imagen: \"\n + e.getMessage(),\n Snackbar.LENGTH_LONG).show();\n\n }\n\n }\n }", "private void uploadImageToFirebase(Uri imageUri){\n final StorageReference fileReference = storageReference.child(\"users/\"+fAuth.getCurrentUser().getUid()+\"/profile.jpg\");\n fileReference.putFile(imageUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n fileReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n\n Picasso.get().load(uri).into(profileImage);\n }\n });\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(Profile.this, \"Upload Failed\", Toast.LENGTH_SHORT).show();\n }\n });\n\n }", "public void uploadPic() {\n try {\n if (bitmap == null) {\n Toast.makeText(AddPage.this, \"Please Select Image\", Toast.LENGTH_SHORT).show();\n\n } else {\n if (bitmap != null) {\n\n final DatabaseReference newref = FirebaseDatabase.getInstance().getReference(\"Page\").push();\n FirebaseStorage storage = FirebaseStorage.getInstance();\n\n StorageReference storageRef = storage.getReferenceFromUrl(\"gs://questo-1f35e.appspot.com\");\n // Create a reference to 'images/mountains.jpg'\n StorageReference mountainImagesRef = storageRef.child(\"PageImages\").child(newref.getKey() + \"\");\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);\n byte[] data = baos.toByteArray();\n UploadTask uploadTask = mountainImagesRef.putBytes(data);\n uploadTask.addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n\n }\n\n }).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n // taskSnapshot.getMetadata() contains file metadata such as size, content-type, and download URL.\n Uri downloadUrl = taskSnapshot.getDownloadUrl();\n\n if (downloadUrl != null) {\n // article = new Article(newref.getKey(), date.getTime(), title.getText().toString(), input.getText().toString(), MyData.getMyUser().id, MyData.getMyUser().name, downloadUrl.toString());\n if (dialog != null && dialog.isShowing())\n dialog.dismiss();\n\n upload(downloadUrl.toString());\n\n\n\n\n final String s = name;\n if (s.trim().length() != 0) {\n\n if(MainActivity.rootLayout!=null)\n Snackbar.make(MainActivity.rootLayout, \"Successfully created page \" + s, Snackbar.LENGTH_LONG)\n .setAction(\"Show\", new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n\n Intent intent = new Intent(AddPage.this, PageOpenActivity.class);\n intent.putExtra(\"id\", s);\n startActivity(intent);\n\n }\n }).show();\n\n\n\n if(PageActivity.rootlayout!=null)\n Snackbar.make(PageActivity.rootlayout, \"Successfully created page \" + s, Snackbar.LENGTH_LONG)\n .setAction(\"Show\", new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n\n Intent intent = new Intent(AddPage.this, PageOpenActivity.class);\n intent.putExtra(\"id\", s);\n startActivity(intent);\n\n }\n }).show();\n\n\n\n\n\n }\n\n // FirebaseAuth.getInstance().signOut();\n// finish()\n\n finish();\n }\n }\n });\n }\n }\n } catch (Exception e) {\n FirebaseDatabase.getInstance().getReference(\"Exceptions\").child(Profile.getCurrentProfile().getId()).push().setValue(e.toString());\n\n }\n\n }", "private void uploadImagetoFirebase(Uri imageUri) {\n StorageReference fileRef = storageReference.child(\"/users/\").child(fAuth.getCurrentUser().getUid()).child(\"/profile.png/\");\n fileRef.putFile(imageUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Toast.makeText(editAccount.this, \"Image Uploaded\", Toast.LENGTH_SHORT).show();\n fileRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n\n String userID = fAuth.getCurrentUser().getUid();\n DatabaseReference currentUser_db = FirebaseDatabase.getInstance().getReference().child(\"/Profile/UserInfo/\").child(userID);\n currentUser_db.child(\"imgURL\").setValue(String.valueOf(uri));\n Picasso.get().load(uri).into(editImage);\n\n }\n });\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull @NotNull Exception e) {\n Toast.makeText(editAccount.this, \"Failed\", Toast.LENGTH_SHORT).show();\n }\n });\n\n }", "private void uploadImageToFirebase(Uri imageUri) {\n final StorageReference fileRef = storageReference.child(\"users/\"+FirebaseAuth.getInstance().getCurrentUser().getUid()+\"/profile.jpg\");\n\n fileRef.putFile(imageUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Toast.makeText(ProfilActivity.this, \"Image uploaded\", Toast.LENGTH_SHORT).show();\n fileRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n Picasso.get().load(uri).into(profilImage);\n }\n }\n );\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(ProfilActivity.this, \"Failed\", Toast.LENGTH_SHORT);\n\n }\n });\n }", "private void uploadToCloud()\n {\n final String TAG = \"uploadToCloud.uploadTask\";\n try\n {\n final File f = new File(currentPhotoPath);\n final Uri uri = Uri.fromFile(f);\n metaData = new StorageMetadata.Builder().setContentType(\"image/jpg\").build();\n final StorageReference ref = mStorageRef.child(mAuth.getCurrentUser().getUid() + \"/Pictures/\" + uri.getLastPathSegment());\n uploadTask = ref.putFile(uri, metaData);\n\n uploadTask.addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>()\n {\n @Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot)\n {\n progressBar.setVisibility(View.VISIBLE);\n progressBar.setProgress(Math.toIntExact\n ((taskSnapshot.getBytesTransferred() / taskSnapshot.getTotalByteCount()) * 100));\n Toast.makeText(getActivity(), \"Upload in Progress\", Toast.LENGTH_SHORT).show();\n }\n }).addOnFailureListener(new OnFailureListener()\n {\n @Override\n public void onFailure(@NonNull Exception exception)\n {\n progressBar.setVisibility(View.GONE);\n Log.w(TAG, \"uploadToCloud.uploadTask:failure\", exception);\n Toast.makeText(getActivity(), \"Unable to Upload: \"\n + exception.getMessage(), Toast.LENGTH_SHORT).show();\n }\n }).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()\n {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)\n {\n Task<Uri> urlTask = uploadTask.continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>()\n {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception\n {\n if (!task.isSuccessful())\n {\n throw task.getException();\n }\n return ref.getDownloadUrl();\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>()\n {\n @Override\n public void onComplete(@NonNull Task<Uri> task)\n {\n if (task.isSuccessful())\n {\n Uri downloadUri = task.getResult();\n Image image = new Image(downloadUri.toString());\n mDataRef.child(\"user/\" + mAuth.getCurrentUser().getUid() + \"/imageDownload/\"\n + FilenameUtils.getBaseName(uri.getLastPathSegment())).setValue(image); }\n else\n {\n Log.d(TAG, \"uploadToCloud.uploadTask.continueWithTask:failure\");\n }\n\n progressBar.setVisibility(View.GONE);\n Log.d(TAG, \"uploadToCloud.uploadTask:success\");\n Toast.makeText(getActivity(), \"Upload Complete\", Toast.LENGTH_SHORT).show();\n }\n });\n }\n });\n }\n catch (Exception e)\n {\n Log.d(TAG, \"uploadToCloud.imageCapture:null\");\n Toast.makeText(getActivity(), \"Unable to Upload: Please Load Local Image\", Toast.LENGTH_SHORT).show();\n }\n }", "private void UploadPic(String name){\n if(filepath!=null)\n {\n progressDialog.setTitle(\"Uploading...\");\n progressDialog.show();\n //\"UserProfile/user.jpg\"\n StorageReference imageRef = storageReference.child(firebaseAuth.getCurrentUser().getEmail() + \"/\" + name + \".jpg\" );\n imageRef.putFile(filepath)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n //Get URL to uploaded Content\n progressDialog.hide();\n Toast.makeText(UserInfoForm.this, \"Upload Successful\", Toast.LENGTH_SHORT).show();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.hide();\n Toast.makeText(UserInfoForm.this, \"Upload Failed\", Toast.LENGTH_SHORT).show();\n }\n })\n .addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n double progress = (100.0 * taskSnapshot.getBytesTransferred()/taskSnapshot.getTotalByteCount());\n progressDialog.setMessage( (int)progress + \"% Uploaded\");\n }\n });\n }\n else{\n Toast.makeText(this, \"Upload Failed\", Toast.LENGTH_SHORT).show();\n }\n }", "private void uploadFile(Uri selectedImageUri) {\n String imageName = UUID.randomUUID().toString();\n StorageReference mStorageRefrence = mStorage.getReference().child(\"driver_images\");\n final StorageReference storageReference = mStorageRefrence.child(imageName);\n storageReference.putFile(selectedImageUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n dialog.dismiss();\n storageReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n Glide.with(view).load(uri).apply(new RequestOptions().override(150, 150)).into(driverImage);\n\n if (FirebaseAuth.getInstance().getCurrentUser() != null) {\n Map map = new HashMap();\n map.put(\"photo\", uri.toString());\n FirebaseDatabase.getInstance().getReference(Common.user_driver_tbl).child(mAuth.getCurrentUser().getUid()).updateChildren(map, new DatabaseReference.CompletionListener() {\n @Override\n public void onComplete(@Nullable DatabaseError databaseError, @NonNull DatabaseReference databaseReference) {\n if (databaseError == null) {\n dialog.dismiss();\n Toast.makeText(DriverHome.this, \" information updated successfully!\", Toast.LENGTH_SHORT).show();\n\n } else {\n dialog.dismiss();\n Toast.makeText(DriverHome.this, \" uploading fialed !\", Toast.LENGTH_SHORT).show();\n\n }\n }\n });\n }\n\n }\n });\n }\n }).addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n double progress = (100.0 * taskSnapshot.getBytesTransferred()) / taskSnapshot.getTotalByteCount();\n dialog.setMessage(\"uploading \" + (int) progress + \"%\");\n\n }\n }).addOnFailureListener(new OnFailureListener() {\n\n @Override\n public void onFailure(@NonNull Exception e) {\n\n Toast.makeText(DriverHome.this, \"Error \" + e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n });\n /* .continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {\n if (!task.isSuccessful()) {\n throw task.getException();\n }\n\n // Continue with the task to get the download URL\n return storageReference.getDownloadUrl();\n }\n })*/\n\n }", "private void uploadData() {\n if (imageUri != null) {\n final StorageReference fileReference = firebaseStorage.child(\"imageUploads\")\n .child(System.currentTimeMillis() + \".\" + getFileExtension(imageUri));\n\n uploadTask = fileReference.putFile(imageUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n\n\n Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n\n progressBar.setProgress(0);\n\n }\n //delay upload\n }, 500);\n\n //upload success\n //progressDialog.dismiss();\n Task<Uri> downloadUrl = fileReference.getDownloadUrl();\n downloadUrl.addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n\n imageReference = uri.toString();\n String uploadId = firebaseDatabase.push().getKey();\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd.MM.yyyy 'at' HH:mm z\");\n\n Toast.makeText(SellActivity.this, \"Posting Successful\", Toast.LENGTH_LONG).show();\n ImageUpload upload =\n new ImageUpload(editTextTitle.getText().toString().trim(),\n editTextDesc.getText().toString().trim(),\n imageReference,\n category.trim(),\n price,\n uploadId,\n user.getUid(),\n sdf.format(new Date()));\n\n firebaseDatabase.child(\"category\").child(category).child(uploadId).setValue(upload);\n\n\n //store user's listing history\n firebaseDatabase.child(\"users\").child(user.getUid()).child(\"Sell History\").child(uploadId).setValue(upload);\n firebaseDatabase.child(\"users\").child(user.getUid()).child(\"Sell Current\").child(uploadId).setValue(upload);\n\n endTask();\n\n }\n });\n }\n\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n\n //upload fail\n //progressDialog.dismiss();\n Toast.makeText(SellActivity.this, \"Posting Unsuccessful\", Toast.LENGTH_SHORT).show();\n\n }\n\n }).addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onProgress(@NonNull UploadTask.TaskSnapshot taskSnapshot) {\n\n //show progress while image is uploaded\n double progress = (100.0 * taskSnapshot.getBytesTransferred() / taskSnapshot.getTotalByteCount());\n if (progress < 20) {\n progress = 20;\n }\n progressBar.setProgress((int) progress);\n\n }\n });\n\n } else {\n Toast.makeText(this, \"No file selected\", Toast.LENGTH_SHORT).show();\n }\n }", "private void uploadImageToFirebase(Uri imageUri) {\n final StorageReference fileRef = storageReference.child(\"users/\"+user.getUid()+\"/profile.jpg\");\n fileRef.putFile(imageUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Toast.makeText(Profile.this, \"Profile photo updated\", Toast.LENGTH_SHORT).show();\n fileRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n Picasso.get().load(uri).into(profileimage);\n }\n });\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(Profile.this, \"Error, please try again later\", Toast.LENGTH_SHORT).show();\n }\n });\n }", "public void updateUserInfo(View view){\n findViewById(R.id.loadingPanel).setVisibility(View.VISIBLE);\n\n FirebaseStorage storage = FirebaseStorage.getInstance();\n StorageReference storageRef = storage.getReferenceFromUrl(\"gs://unifriends-d63b5.appspot.com\");\n // Create a reference to \"mountains.jpg\"\n\n StorageReference mountainsRef = storageRef.child(\"usersImage/\" + FirebaseAuth.getInstance().getUid() + \".jpg\");\n\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n bitmap.compress(CompressFormat.JPEG, 100, baos);\n byte[] data = baos.toByteArray();\n\n UploadTask uploadTask = mountainsRef.putBytes(data);\n uploadTask.addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n findViewById(R.id.loadingPanel).setVisibility(View.GONE);\n\n // Handle unsuccessful uploads\n }\n }).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n // taskSnapshot.getMetadata() contains file metadata such as size, content-type, and download URL.\n// Uri downloadUrl = taskSnapshot.getUploadSessionUri();\n Log.d(TAG, \"Image upload done\");\n\n Intent intent = new Intent(Signup2.this, Signup3.class);\n intent.putExtra(\"facialID\", facialID.toString());\n /* pass the facial id to the next activity*/\n findViewById(R.id.loadingPanel).setVisibility(View.GONE);\n startActivity(intent);\n }\n });\n }", "public String addPhotoToFirebase() {\n\n if (selectedImage != null) {\n\n String path = \"img/rescues/\" + UUID.randomUUID().toString();\n StorageReference reference = MainActivity.storageReference.child(path);\n reference.putFile(selectedImage)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n\n }\n });\n Log.d(\"test\", reference.toString());\n\n return path;\n }\n return null;\n\n\n }", "public void nextClicked(View view) {\n createSnapImageView.setDrawingCacheEnabled(true);\n createSnapImageView.buildDrawingCache();\n Bitmap bitmap = createSnapImageView.getDrawingCache();\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);\n final byte[] data = baos.toByteArray();\n\n final UploadTask[] uploadTask = {FirebaseStorage.getInstance().getReference().child(\"images\").child(imageName).putBytes(data)};\n uploadTask[0].addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n // Handle unsuccessful uploads\n Toast.makeText(CreateSnapActivity.this, \"Upload Failed\", Toast.LENGTH_SHORT).show();\n }\n }).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n // taskSnapshot.getMetadata() contains file metadata such as size, content-type, etc.\n\n // ...\n\n final StorageReference ref = FirebaseStorage.getInstance().getReference().child(\"images\").child(imageName);\n uploadTask[0] = ref.putBytes(data);\n\n Task<Uri> urlTask = uploadTask[0].continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {\n if (!task.isSuccessful()) {\n throw task.getException();\n }\n\n // Continue with the task to get the download URL\n return ref.getDownloadUrl();\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if (task.isSuccessful()) {\n Uri downloadUri = task.getResult();\n Log.i(\"URL\", downloadUri.toString());\n\n Intent intent = new Intent(CreateSnapActivity.this, ChooseUserActivity.class);\n intent.putExtra(\"imageURL\", downloadUri.toString());\n intent.putExtra(\"imageName\", imageName);\n intent.putExtra(\"message\", messageEditText.getText().toString());\n startActivity(intent);\n\n } else {\n // Handle failures\n // ...\n }\n\n }\n });\n\n\n }\n\n });\n\n }", "protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == GALLERY_INTETN && resultCode==RESULT_OK) {\n dialog.setMessage(\"Uploading\");\n dialog.show();\n Uri uri= data.getData();\n\n StorageReference filepath= mStorage.child(\"volunteer_aadhar_pic\").child(uri.getLastPathSegment());\n try\n {\n compressed = MediaStore.Images.Media.getBitmap(ApplyAsVolunteer.this.getContentResolver(), uri);\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n compressed.compress(Bitmap.CompressFormat.JPEG, 30, baos);\n byte[] cimg = baos.toByteArray();\n filepath.putBytes(cimg).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)\n {\n path = taskSnapshot.getDownloadUrl();\n //accountref = FirebaseDatabase.getInstance().getReference().child(\"user_details\").child(auth.getUid());\n //accountref.child(\"userImgUrl\").setValue(String.valueOf(path));\n Toast.makeText(ApplyAsVolunteer.this, \"Document uploaded\", Toast.LENGTH_LONG).show();\n //finish();\n //startActivity(getIntent());\n afterText.setVisibility(View.VISIBLE);\n clicksubmit.setVisibility(View.GONE);\n dialog.dismiss();\n }\n });\n }\n }", "public void uploadImageButton(Uri imageUri) {\n title = titleUpdate.getText().toString();\n content = contentUpdate.getText().toString();\n time = timeUpdate.getText().toString();\n place = placeUpdate.getText().toString();\n organize = organizeUpdate.getText().toString();\n\n\n imageReference = firebaseStorage.getReference().child(firebaseAuth.getUid()).child(\"AdminImage\").child(titlestarred).child(\"image\");\n\n if(imageUri == null) {\n imageURL=imageNameUpdate.getText().toString();\n //Log.d(\"kimmy\", imageURL);\n event = new Event(content, fileURL, imageURL, organize, place, time, title);\n eventPathDatabaseReference.setValue(event);\n //uploadFileButton(pdfUri);\n\n }else if(imageUri != null){\n uploadTaskImage = imageReference.putFile(imageUri);\n Task<Uri> urlTask = uploadTaskImage.continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {\n if (!task.isSuccessful()) {\n throw task.getException();\n }\n // Continue with the task to get the download URL\n return imageReference.getDownloadUrl();\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if (task.isSuccessful()) {\n imageURL = task.getResult().toString();\n event = new Event(content, fileURL, imageURL, organize, place, time, title);\n eventPathDatabaseReference.setValue(event);\n }\n else {\n // Handle failures\n // ...\n }\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(getContext(), \"File not Succesfully upload\", Toast.LENGTH_SHORT).show();\n }\n });\n }\n\n }", "private void uploadFile() {\n //checking if file is available\n if (filePath != null) {\n //displaying progress dialog while image is uploading\n final ProgressDialog progressDialog = new ProgressDialog(this);\n progressDialog.setTitle(\"Uploading\");\n progressDialog.show();\n\n //getting the storage reference\n StorageReference sRef = storageReference.child(\"admins/\" + System.currentTimeMillis() + \".\" + getFileExtension(filePath));\n\n //adding the file to reference\n sRef.putFile(filePath).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n //dismissing the progress dialog\n progressDialog.dismiss();\n\n //displaying success toast\n // Toast.makeText(getApplicationContext(), \"File Uploaded \", Toast.LENGTH_LONG).show();\n\n // ba5odha fe string as url\n imageurl = taskSnapshot.getDownloadUrl().toString();\n\n DatabaseReference mDatabase;\n\n mDatabase = FirebaseDatabase.getInstance().getReference();\n\n String s = mDatabase.push().getKey();\n\n Admin a = new Admin(s, name.getText().toString(), email.getText().toString(), phone.getText().toString(), address.getText().toString(), imageurl);\n\n // b3ml save fel firebase lel object of admin\n mDatabase.child(\"admins\").child(s).setValue(a);\n\n Toast.makeText(RegisterAsAdmin.this, \"Registration successful\", Toast.LENGTH_LONG).show();\n FirebaseAuth.getInstance().signOut();\n Intent i = new Intent(RegisterAsAdmin.this, LoginAsAdmin.class);\n startActivity(i);\n finish();\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }\n }).addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n //displaying the upload progress\n double progress = (100.0 * taskSnapshot.getBytesTransferred()) / taskSnapshot.getTotalByteCount();\n progressDialog.setMessage(\"Uploaded \" + ((int) progress) + \"%...\");\n }\n });\n } else {\n Toast.makeText(RegisterAsAdmin.this, \"File Error\", Toast.LENGTH_SHORT).show();\n }\n }", "private void uploadImage() {\n final ProgressDialog pd = new ProgressDialog(this);\n //progress dialog\n pd.setMessage(getResources().getString(R.string.Uploading));\n pd.show();\n\n if (mInageUri != null){\n //upload new profile image to:\n final StorageReference filereference = storageRef.child(System.currentTimeMillis()\n + \".\" + getFileExtension(mInageUri));\n\n uploadTask = filereference.putFile(mInageUri);\n uploadTask.continueWithTask(new Continuation() {\n @Override\n public Object then(@NonNull Task task) throws Exception {\n if (!task.isSuccessful()) {\n throw task.getException();\n }\n return filereference.getDownloadUrl();\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if (task.isSuccessful()) {\n Uri downloadUri = task.getResult();\n String myUrl = downloadUri.toString();\n\n //get uid\n DatabaseReference reference = FirebaseDatabase.getInstance()\n .getReference(\"Users\").child(firebaseUser.getUid());\n\n HashMap<String, Object> hashMap = new HashMap<>();\n hashMap.put(\"imageurl\", \"\" + myUrl);\n\n reference.updateChildren(hashMap);\n\n pd.dismiss();\n Toasty.success(EditProfileActivity.this, R.string.updated, Toast.LENGTH_LONG, true).show();\n } else {\n Toasty.error(EditProfileActivity.this, R.string.Failed, Toast.LENGTH_LONG, true).show();\n }\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toasty.error(EditProfileActivity.this, R.string.Failed, Toast.LENGTH_LONG, true).show();\n }\n });\n }else {\n Toasty.info(EditProfileActivity.this, R.string.NoImageselected, Toast.LENGTH_LONG, true).show();\n }\n }", "private void storeimageinfirestorage(Uri imageuri)\n {\n final StorageReference filepath=mfirebasestorage.child(Current_user +\".jpg\");\n filepath.putFile(imageuri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Toast.makeText(getApplicationContext(),\"image uploaded succesfully\",LENGTH_SHORT).show();\n filepath.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n profileimageurl= uri.toString();\n savetodatabase();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n\n }\n });\n\n\n }\n\n });\n\n\n }", "private void uploadImage() {\n final ProgressDialog pd = new ProgressDialog(MyProfile.this);\n pd.setMessage(\"Uploading...\");\n pd.show();\n\n //if image address is not null --> convert to format that can be stored into firebase\n if(imageUri != null) {\n final StorageReference fileReference = storageReference.child(System.currentTimeMillis() + \".\" + getFileExtension(imageUri));\n\n //puts imageUri into firebase\n uploadTask = fileReference.putFile(imageUri);\n\n uploadTask.continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {\n if(!task.isSuccessful()) {\n throw task.getException();\n }\n return fileReference.getDownloadUrl();\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n //if task successful --> get uri and convert to string to set to \"ProfilePic\" in firebase\n if(task.isSuccessful()) {\n Uri downloadUri = task.getResult();\n String mUri = downloadUri.toString();\n //Log.d(\"uri\", mUri);\n\n //get firebase reference, update map w/ profilePic, and update map in reference\n reference = FirebaseDatabase.getInstance().getReference(\"USERS\").child(firebaseUser.getUid());\n HashMap<String, Object> map = new HashMap<>();\n map.put(\"ProfilePic\", mUri);\n reference.updateChildren(map);\n\n pd.dismiss();\n }\n //if task not successful --> show toast\n else {\n Toast.makeText(getApplicationContext(), \"Upload failed!\", Toast.LENGTH_SHORT).show();\n pd.dismiss();\n }\n }\n }).addOnFailureListener(new OnFailureListener() {\n //show error message for why task failed\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_SHORT).show();\n pd.dismiss();\n }\n });\n }\n else {\n Toast.makeText(getApplicationContext(), \"No image selected\", Toast.LENGTH_SHORT).show();\n }\n }", "private void uploadImageFirebase(String filePath) {\n //compress image here before upload\n //TODO make compression inside task fragment\n String compressFilePath = compressImage(filePath);\n if (compressFilePath == null || compressFilePath.isEmpty()){\n showToast(R.string.error_occurred);\n return;\n }\n File chosenFile = new File(compressFilePath);\n\n Uri file = Uri.fromFile(chosenFile);\n mTaskFragment.uploadPhotoProfile(file);\n }", "private void uploadFile() {\n if (selectedImageUri != null) {\n //displaying a progress dialog while upload is going on\n final ProgressDialog progressDialog = new ProgressDialog(this);\n progressDialog.setTitle(\"Uploading\");\n progressDialog.show();\n\n StorageReference riversRef = storageReference.child(\"Images/Adhaar\"+jill+\"/\"+jack);\n riversRef.putFile(selectedImageUri)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n //if the upload is successfull\n //hiding the progress dialog\n progressDialog.dismiss();\n\n //and displaying a success toast\n Toast.makeText(getApplicationContext(), \"File Uploaded \", Toast.LENGTH_LONG).show();\n Intent step3 = new Intent(step4.this, step4.class);\n startActivity(step3);\n\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n //if the upload is not successfull\n //hiding the progress dialog\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }\n })\n .addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n //calculating progress percentage\n @SuppressWarnings(\"VisibleForTests\") double re=taskSnapshot.getBytesTransferred();\n @SuppressWarnings(\"VisibleForTests\") double rem=taskSnapshot.getBytesTransferred();\n double progress = (100.0 * re) / rem;\n\n //displaying percentage in progress dialog\n progressDialog.setMessage(\"Uploaded \" + ((int) progress) + \"%...\");\n }\n });\n }\n //if there is not any file\n else {\n //you can display an error toast\n }\n }", "private void updateImageToFirebaseStorage() {\n userProfileProgressBar.setVisibility(View.VISIBLE);\n profileImageRef= profileImageRef.child(\"UID \"+currentUserUid).child(\"Current Profile Image\"+\".jpg\");\n if(selectImageUri!=null){\n uploadTask=profileImageRef.putFile(selectImageUri)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n userProfileProgressBar.setVisibility(View.GONE);\n profileImageUrl=taskSnapshot.getDownloadUrl().toString();\n Handler handler=new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n userProfileProgressBar.setProgress(0);\n }\n }, 5000);\n Toast toast=Toast.makeText(getActivity(),\"Your profile pic has been update\",Toast.LENGTH_SHORT);\n toast.setGravity(Gravity.CENTER, 0, 0);\n toast.show();\n Toast.makeText(getActivity(),profileImageUrl,Toast.LENGTH_SHORT);\n databaseReference.child(\"Users Data\").child(\"Sign Up Info\").child(\"UID \"+currentUserUid).child(\"Profile Image Url\").setValue(profileImageUrl);\n // databaseReference.child(\"Users Data\").child(\"Public Profile Images\").child(\"UID \"+currentUserUid).setValue(profileImageUrl);\n }\n\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast toast=Toast.makeText(getActivity(),\"Unable to Update\",Toast.LENGTH_SHORT);\n toast.setGravity(Gravity.CENTER, 0, 0);\n toast.show();\n }\n })\n .addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n double progress=(100.0*taskSnapshot.getBytesTransferred()/taskSnapshot.getTotalByteCount());\n userProfileProgressBar.setProgress((int)progress);\n }\n });\n\n }\n else{\n userProfileProgressBar.setVisibility(View.GONE);\n }\n }", "private void uploadImageToFirebaseStorage() {\n StorageReference profileImageRef =\n FirebaseStorage.getInstance().getReference(\"profilepics/\" + System.currentTimeMillis() + \".jpg\");\n\n if (uriProfileImage != null) {\n profileImageRef.putFile(uriProfileImage)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n //This is not working because it is null\n profileImageUrl = taskSnapshot.getDownloadUrl().toString();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(Profile.this, e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n });\n }\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n\n taskSnapshot.getMetadata().getReference().getDownloadUrl().addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if(task.isSuccessful()){\n FirebaseStorage.getInstance().getReference().child(\"faculty_images\").child(imageIdentifier).getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n Useremail.photouri = uri;\n FirebaseFirestore.getInstance().collection(\"Faculty_Bag\").document(Useremail.email).update(\"photo_uri\",Useremail.photouri.toString()).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Showfancytoasr.show(MainActivity.this,\"Uploading process was successful\");\n progressDialog.dismiss();\n finish();\n startActivity(getIntent());\n }\n });\n }\n });\n }\n }\n });\n }", "public void uploadImg(View view){\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n intent.setType(\"image/*\");\n intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), SELECT_PICTURE);\n }", "public void uploadImage(View v) {\n // When Image is selected from Gallery\n if (imgPath != null && !imgPath.isEmpty()) {\n prgDialog.setMessage(\"Converting Image to Binary Data\");\n prgDialog.show();\n // Convert image to String using Base64\n encodeImagetoString();\n // When Image is not selected from Gallery\n } else {\n Toast.makeText(\n getApplicationContext(),\n \"You must select image from gallery before you try to upload\",\n Toast.LENGTH_LONG).show();\n }\n }", "public void sendToFirebase() {\n\n String imageCategory = imageSpinner.getSelectedItem().toString();\n final Intent intent = new Intent(MainActivity.this, ResultActivity.class);\n\n if(filepath!=null) {\n final ProgressDialog progressDialog = new ProgressDialog(this);\n progressDialog.setTitle(\"Uploading Data...\");\n progressDialog.setMessage(\"In-Progress...\");\n progressDialog.show();\n\n final StorageReference sRef = storageReference.child(\"images/\"+ UUID.randomUUID().toString());\n\n if(imageCategory.equals(\"Medical CBC Report\")) {\n sRef.putFile(filepath).continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {\n if (!task.isSuccessful()){\n throw task.getException();\n }\n return sRef.getDownloadUrl();\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if (task.isSuccessful()){\n Uri downUri = task.getResult();\n progressDialog.dismiss();\n neuralData+=\"imageTag:cbc#\"+\"imageUrl:\"+downUri+\"#\";\n databaseReference.child(\"joel\").setValue(neuralData);\n startActivity(intent);\n }\n }\n });\n } else if(imageCategory.equals(\"Chest X-Ray\")){\n sRef.putFile(filepath).continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {\n if (!task.isSuccessful()){\n throw task.getException();\n }\n return sRef.getDownloadUrl();\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if (task.isSuccessful()){\n Uri downUri = task.getResult();\n progressDialog.dismiss();\n neuralData+=\"imageTag:xray#\"+\"imageUrl:\"+downUri+\"#\";\n databaseReference.child(\"joel\").setValue(neuralData);\n startActivity(intent);\n }\n }\n });\n } else if(imageCategory.equals(\"Breast Histopathology\")) {\n sRef.putFile(filepath).continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {\n if (!task.isSuccessful()){\n throw task.getException();\n }\n return sRef.getDownloadUrl();\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if (task.isSuccessful()){\n Uri downUri = task.getResult();\n progressDialog.dismiss();\n neuralData+=\"imageTag:breast#\"+\"imageUrl:\"+downUri+\"#\";\n databaseReference.child(\"joel\").setValue(neuralData);\n startActivity(intent);\n }\n }\n });\n }\n\n }\n\n if(!neuralData.isEmpty()) {\n final ProgressDialog progressDialog = new ProgressDialog(this);\n progressDialog.setTitle(\"Uploading Data...\");\n progressDialog.setMessage(\"In-Progress...\");\n progressDialog.show();\n databaseReference.child(\"joel\").setValue(neuralData).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n progressDialog.dismiss();\n startActivity(intent);\n }\n });\n\n }\n\n if(neuralData.isEmpty()&&filepath==null) {\n Toast.makeText(this,\"You need to input something!\", Toast.LENGTH_LONG).show();\n }\n }", "private void UploadImage() {\n\n if(imageuri!=null)\n {\n final StorageReference filepath = CustomerImageRef.child(Prevalent.currentOnlineUsers.getPhone_number() + \".jpg\");\n uploadTask = filepath.putFile(imageuri);\n\n uploadTask.continueWithTask(new Continuation() {\n @Override\n public Object then(@NonNull Task task) throws Exception {\n if(!task.isSuccessful())\n {\n throw task.getException();\n }\n\n\n return filepath.getDownloadUrl();\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if (task.isSuccessful())\n {\n Uri downloadUrl = task.getResult();\n myUrl=downloadUrl.toString();\n\n DatabaseReference reference =FirebaseDatabase.getInstance().getReference().child(\"users\");\n\n HashMap<String,Object> hashMap=new HashMap<>();\n hashMap.put(\"Contact_no\",user_phone.getText().toString());\n hashMap.put(\"name\",user_fullname.getText().toString().trim());\n hashMap.put(\"Profilepic_URL\",myUrl);\n\n reference.child(Prevalent.currentOnlineUsers.getPhone_number()).updateChildren(hashMap);\n\n// loadingbar.dismiss();\n\n Toast.makeText(getContext(), \"Uploaded data sucessfully\", Toast.LENGTH_SHORT).show();\n// startActivity(new Intent(getActivity(),HomeFragment.class));\n\n\n getFragmentManager().beginTransaction().replace(R.id.nav_host_fragment, fragment).commit();\n\n\n }\n else\n {\n// loadingbar.dismiss();\n Toast.makeText(getContext(), \"error try again\", Toast.LENGTH_SHORT).show();\n\n\n }\n\n }\n });\n\n }\n else\n {\n Toast.makeText(getContext(), \"image is not selected\", Toast.LENGTH_SHORT).show();\n\n }\n\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == 1) {\n // Make sure the request was successful\n if (resultCode == RESULT_OK) {\n try {\n\n\n imageView.setImageURI(data.getData()); // 이미지 뷰에 삽입\n photoUri = data.getData(); // 이미지 경로 원본\n\n // photostring = getPath(data.getData());\n\n\n\n\n /* StorageReference reference= storageRef.child(System.currentTimeMillis()+ \".\"+getPath(data.getData()));\n Uri file = Uri.fromFile(new File(getPath(data.getData())));\n UploadTask mUploadTask= reference.putFile(file);\n Task<Uri> urlTask = mUploadTask.continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {\n if (!task.isSuccessful()) {\n throw task.getException();\n }\n\n // Continue with the task to get the download URL\n return storageRef.getDownloadUrl();\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if (task.isSuccessful()) {\n Uri downloadUri = task.getResult();\n mDatabase.child(\"images\").child(\"imageUrl\").setValue(downloadUri.toString());\n } else {\n // Handle failures\n // ...\n }\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n // progressDialog.dismiss();\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }\n });*/\n\n\n\n /* photo = getPath(data.getData());\n Log.d(TAG, \"getPath(photoUri)\" + photo + \"\");\n\n\n\n\n\n photostring = photoUri.toString(); // myphotouri String - > Uri로 변환 / 프로필 사진 uri); // myphotouri String - > Uri로 변환 / 프로필 사진 uri\n photostr = photostring;\n*/\n\n\n\n /* // 선택한 이미지에서 비트맵 생성\n InputStream in = getContentResolver().openInputStream(data.getData());\n Bitmap img = BitmapFactory.decodeStream(in);\n in.close();\n // 이미지 표시\n imageView.setImageBitmap(img);*/\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n }", "@Override\n public void onSuccess(byte[] bytes) {\n storageRef.child(\"profilepics/\" + authUser.getUid()+ \".jpg\")\n .putBytes(bytes)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Log.d(\"control\", \"foto subida\");\n }\n });\n }", "public void uploadImage() {\n if (imgPath != null && !imgPath.isEmpty()) {\n //prgDialog.setMessage(\"Converting Image to Binary Data\");\n //prgDialog.show();\n // Convert image to String using Base64\n new EncodeImageToStringTask().execute();\n // When Image is not selected from Gallery\n } else {\n //Toast.makeText(\n // getApplicationContext(),\n // \"You must select image from gallery before you try to upload\",\n // Toast.LENGTH_LONG).show();\n }\n }", "@Override\n public void onSuccess (UploadTask.TaskSnapshot taskSnapshot){\n Toast.makeText(IncomeActivity.this, \"Image uploaded successfully\",\n Toast.LENGTH_SHORT).show();\n }", "@Override\r\n\t\tpublic void onClick(View v) {\n\t\t\tbyte image[] = Global.File2byte(pathImage);\r\n\t\t\t\r\n\t\t\tTransfer.uploadImage(image, new TransferListener() {\r\n\t\t\t\t\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onSucceed(JSONObject obj) {\r\n\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\tLog.e(\"upload\",obj.toString());\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 void onFail(String desc) {\r\n\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t Log.e(\"upload\",desc);\t\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}", "private void uploadFile() {\n if (filePath != null) {\n //displaying a progress dialog while upload is going on\n final ProgressDialog progressDialog = new ProgressDialog(this);\n progressDialog.setTitle(\"Uploading\");\n progressDialog.show();\n\n StorageReference riversRef = mStorageRef.child(previously);\n riversRef.putFile(filePath)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n //if the upload is successfull\n //hiding the progress dialog\n progressDialog.dismiss();\n\n //and displaying a success toast\n Toast.makeText(getApplicationContext(), \"File Uploaded \", Toast.LENGTH_LONG).show();\n // picup =true;\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n //if the upload is not successfull\n //hiding the progress dialog\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }\n })\n .addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n //calculating progress percentage\n double progress = (100.0 * taskSnapshot.getBytesTransferred()) / taskSnapshot.getTotalByteCount();\n\n //displaying percentage in progress dialog\n progressDialog.setMessage(\"Uploaded \" + ((int) progress) + \"%...\");\n }\n });\n }\n //if there is not any file\n else {\n //you can display an error toast\n }\n }", "public void uploadPic(View view) {\n Intent si=new Intent();\n si.setType(\"image/*\");\n si.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(si,1);\n\n\n }", "@Override\n public void onSuccess(Uri uri) {\n Image_Upload upload = new Image_Upload( uri.toString());\n mDatabaseRef.child(String.valueOf(a)).setValue(upload);\n Intent i=new Intent(All_Images.this, More_About_Users.class);\n startActivity(i);\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Toast.makeText(AddingPlace.this,\"image uploaded successfully\",Toast.LENGTH_LONG).show();\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n mStorageRef.child(type).getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n\n //Setting the url to database\n\n reference2.child(type).setValue(uri.toString());\n\n Toast.makeText(UserHomeActivity.this, \"Shared Successfully\", Toast.LENGTH_SHORT).show();\n\n uploadUserImageView.setImageDrawable(getResources().getDrawable(R.drawable.uploadimage));\n\n }\n\n });\n }", "static void uploadImage(String phone, Bitmap userPhoto, Uri imageUri, Context context) {\n FirebaseStorage storage = FirebaseStorage.getInstance();\n StorageReference storageReference = storage.getReference();\n final StorageReference filePath = storageReference.child(\"images\").child(phone);\n if(userPhoto == null)\n {\n filePath.putFile(imageUri).addOnSuccessListener(taskSnapshot ->\n Log.d(\"T2T_UPLOAD_IMAGE\", \"Image uploaded successfully\"));\n }\n else\n {\n filePath.putFile(getImageUri(context, userPhoto)).addOnSuccessListener(taskSnapshot ->\n Log.d(\"T2T_UPLOAD_IMAGE\", \"Image uploaded successfully\"));\n }\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n filePath.getDownloadUrl().addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n String downloadUrl = task.getResult().toString();\n product.setImage(downloadUrl);\n databaseReference.child(\"productos\").child(product.getId()).setValue(product);\n progressDialog.dismiss();\n Intent mainActivityView = new Intent(AddProduct.this, MainActivity.class);\n AddProduct.this.startActivity(mainActivityView);\n Toast.makeText(AddProduct.this, \"¡Producto guardado con éxito!\", Toast.LENGTH_LONG).show();\n }\n });\n }", "private void getImage() {\n StorageReference storageReference = FirebaseStorage.getInstance().getReference();\n StorageReference photoReference = storageReference.child(\"images/\" + globals.chosenProp);\n\n ImageView imageView = (ImageView) findViewById(R.id.ivImage);\n\n final long ONE_MEGABYTE = 1024 * 1024;\n photoReference.getBytes(ONE_MEGABYTE).addOnSuccessListener(new OnSuccessListener<byte[]>() {\n @Override\n public void onSuccess(byte[] bytes) {\n Bitmap bmp = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);\n imageView.setImageBitmap(bmp);\n\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n Toast.makeText(getApplicationContext(), \"No Such file or Path found!\", Toast.LENGTH_LONG).show();\n }\n });\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n imageView.setImageURI(Uri.EMPTY);\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Toast.makeText(DetailsForm.this, \"Image Uploaded Successfully\", Toast.LENGTH_LONG).show();\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n\n //Etiqueta para evitar que el IDE se queje de que el metodo getDownloadUrl\n //solo deberia ser visible por tests o en un ambito private\n @SuppressWarnings(\"VisibleForTests\")\n //Obtiene del TaskSnapShot la URI de la imagen\n Uri uri = taskSnapshot.getDownloadUrl();\n //Establece la URL de la imagen de usuario en el objeto Usuario con la nueva URL\n usuario.setImagenUrl(uri.toString());\n\n //Obtiene una referencia a la base de datos\n DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReference();\n //Almacena en la base de datos el objeto Usuario actualizado\n databaseReference.child(\"usuarios\").child(usuario.getId()).setValue(usuario);\n\n //Carga la nueva imagen en el ImageView\n Glide.with(getApplicationContext())\n .load(uri)\n .apply(new RequestOptions().placeholder(R.drawable.iconouser).centerCrop())\n .into(ivFotoPerfil);\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Toast.makeText(getApplicationContext(),\"Image uploaded\",Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n progressDialog.dismiss();\n\n //displaying success toast\n // Toast.makeText(getApplicationContext(), \"File Uploaded \", Toast.LENGTH_LONG).show();\n\n // ba5odha fe string as url\n imageurl = taskSnapshot.getDownloadUrl().toString();\n\n DatabaseReference mDatabase;\n\n mDatabase = FirebaseDatabase.getInstance().getReference();\n\n String s = mDatabase.push().getKey();\n\n Admin a = new Admin(s, name.getText().toString(), email.getText().toString(), phone.getText().toString(), address.getText().toString(), imageurl);\n\n // b3ml save fel firebase lel object of admin\n mDatabase.child(\"admins\").child(s).setValue(a);\n\n Toast.makeText(RegisterAsAdmin.this, \"Registration successful\", Toast.LENGTH_LONG).show();\n FirebaseAuth.getInstance().signOut();\n Intent i = new Intent(RegisterAsAdmin.this, LoginAsAdmin.class);\n startActivity(i);\n finish();\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View root = inflater.inflate(R.layout.fragment_image_link, container, false);\n ivChoose = root.findViewById(R.id.bt_choose);\n ivUpload = root.findViewById(R.id.bt_upload);\n etName = root.findViewById(R.id.et_name);\n ivResult = root.findViewById(R.id.iv_result);\n tvUrl = root.findViewById(R.id.tv_url);\n storage = FirebaseStorage.getInstance();\n storageRef = storage.getReference();\n\n ivChoose.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Intent photopicker = new Intent(Intent.ACTION_PICK);\n photopicker.setType(\"image/*\");\n startActivityForResult(photopicker, Selected);\n }\n });\n etName.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n\n }\n\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n ivUpload.setEnabled(true);\n\n }\n\n @Override\n public void afterTextChanged(Editable s) {\n\n }\n });\n ivUpload.setEnabled(true);\n ivUpload.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n try {\n UploadImage();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }\n });\n\n return root;\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n StorageReference downloadUrl = taskSnapshot.getStorage();\n downloadImage(downloadUrl);\n Log.e(\"downloadUrl\", \" \" + downloadUrl);\n\n\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n mStorageRef.child(\"url\").getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n\n //Setting the url to database\n\n reference2.child(\"url\").setValue(uri.toString());\n reference2.child(\"name\").setValue(shared.getName());\n reference2.child(\"date\").setValue(date+\"+\"+formattedDate);\n Toast.makeText(UserHomeActivity.this, \"Shared Successfully\", Toast.LENGTH_SHORT).show();\n\n\n uploadUserImageView.setImageDrawable(getResources().getDrawable(R.drawable.uploadimage));\n\n }\n\n });\n }", "public void uploadPhoto(View view) {\n Intent i = new Intent(\n Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n\n startActivityForResult(i, GET_FROM_GALLERY);\n\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n\n final StorageReference ref = FirebaseStorage.getInstance().getReference().child(\"images\").child(imageName);\n uploadTask[0] = ref.putBytes(data);\n\n Task<Uri> urlTask = uploadTask[0].continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {\n if (!task.isSuccessful()) {\n throw task.getException();\n }\n\n // Continue with the task to get the download URL\n return ref.getDownloadUrl();\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if (task.isSuccessful()) {\n Uri downloadUri = task.getResult();\n Log.i(\"URL\", downloadUri.toString());\n\n Intent intent = new Intent(CreateSnapActivity.this, ChooseUserActivity.class);\n intent.putExtra(\"imageURL\", downloadUri.toString());\n intent.putExtra(\"imageName\", imageName);\n intent.putExtra(\"message\", messageEditText.getText().toString());\n startActivity(intent);\n\n } else {\n // Handle failures\n // ...\n }\n\n }\n });\n\n\n }", "@Override\n public void onSuccess(Uri uri) {\n Log.i(\"upload diary\", \"photo in storage\");\n uploadDiary.setPhotoUri(uri.toString());\n db.collection(\"Diary\").document(diary.getTime() + \":\" + diary.getUsername()).set(uploadDiary).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Log.i(\"upload diary\", \"photo succ\");\n }\n });\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n\n imageName.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(final Uri uri) {\n submitInfo.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n String name = productName.getText().toString();\n String price = productPrice.getText().toString();\n String desc = productDes.getText().toString();\n String offer = productOffer.getText().toString();\n\n\n databaseReference = FirebaseDatabase.getInstance().getReference(\"Product\").child(key).child(name);\n ProductUpload productUpload = new ProductUpload(name,desc,price,String.valueOf(uri),user.getUid(),offer);\n databaseReference.setValue(productUpload);\n\n startActivity(new Intent(SubmitProduct.this,ProfileForCompany.class));\n }\n });\n }\n });\n\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if(resultCode == RESULT_OK){\n Bitmap imagem = null;\n try {\n switch (requestCode){\n case SELECAO_GALERIA:\n Uri localImage = data.getData();\n imagem = MediaStore.Images.Media.getBitmap(getContentResolver(), localImage);\n break;\n }\n if(imagem != null){\n //configuração da imagem em Bitmap\n imageView.setImageBitmap(imagem);\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n imagem.compress(Bitmap.CompressFormat.JPEG, 70, baos);\n byte[] dadosImagem = baos.toByteArray();\n\n //referência para pasta no Storage\n final StorageReference imagemRef = storageReference\n .child(\"imagens\")\n .child(\"servicos\")\n .child(idUserLogado)\n .child(imagem + \"jpeg\");\n\n //upload dos bytes da imagem\n UploadTask uploadTask = imagemRef.putBytes(dadosImagem);\n uploadTask.addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(NovoProdutoEmpresaActivity.this,\n \"Erro ao fazer o upload da imagem\", Toast.LENGTH_SHORT).show();\n }\n }).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Toast.makeText(NovoProdutoEmpresaActivity.this,\n \"Sucesso ao fazer o upload da imagem\", Toast.LENGTH_SHORT).show();\n }\n });\n\n //recupera o link de download da imagem\n Task<Uri> urlTask = uploadTask.continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {\n if (!task.isSuccessful()){\n throw task.getException();\n }\n return imagemRef.getDownloadUrl();\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if(task.isSuccessful()){\n Uri downloadUri = task.getResult();\n\n //salva a url na string\n urlImagemSelecionada = downloadUri.toString();\n }\n }\n });\n\n }\n }catch (Exception e){\n e.printStackTrace();\n }\n }\n }", "private void afficherImage() {\n\n //get the link of the storage reference of the user\n StorageReference st = stm.child(\"users/\" + auth.getCurrentUser().getUid());\n try {\n File localFile = File.createTempFile(\"image\", \"png\");\n st.getFile(localFile).addOnSuccessListener(taskSnapshot -> st.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n //load the picture in the activity\n Picasso.with(getActivity()).load(uri).into(image);\n }\n }));\n } catch (IOException e) {\n Log.e(getClass().getName(), e.toString());\n }\n\n\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n if (resultCode == RESULT_OK && requestCode == IMAGE_PICK_CODE && data != null) {\n // set image in amageView.\n Uri uri = data.getData();\n try {\n Bitmap bitmap = MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(), uri);\n profile.setImageBitmap(bitmap);\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n //here you can choose quality factor in third parameter(ex. i choosen 25)\n bitmap.compress(Bitmap.CompressFormat.JPEG, 25, baos);\n byte[] fileInBytes = baos.toByteArray();\n uploadImageToFireStore(fileInBytes);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n progressDialog.setMessage(\"Please wait\");\n progressDialog.dismiss();\n Task<Uri> downloadUrl = taskSnapshot.getStorage().getDownloadUrl();\n image = downloadUrl.toString();\n //Toast.makeText(StudententryActivity.this, \"image path\"+image, Toast.LENGTH_SHORT).show();\n Log.e(\"path\",\"path\"+downloadUrl);\n // Picasso.get().load(downloadUrl).into(imageview);\n Glide.with(context).load(downloadUrl).placeholder(R.mipmap.ic_launcher).into(imageview);\n //imageview.setBackground();\n Toast.makeText(StudententryActivity.this, \"Student Image Set Success\", Toast.LENGTH_SHORT).show();\n\n }", "@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n ref.child(\"user\").child(fUser.getUid()).child(\"age\").setValue(age);\n ref.child(\"user\").child(fUser.getUid()).child(\"bio\").setValue(bio);\n //object to convert image to byte array for storage on firebase\n ByteArrayOutputStream imgConverted = new ByteArrayOutputStream();\n\n //save the image as a .jpg file\n img.compress(Bitmap.CompressFormat.JPEG, 100, imgConverted);\n\n String imageEncoded = Base64.encodeToString(imgConverted.toByteArray(), Base64.DEFAULT);\n ref.child(\"user\").child(fUser.getUid()).child(\"image\").setValue(imageEncoded);\n }", "private void saveUserInfo() {\n progressBar.setVisibility(View.VISIBLE);\n //get value from fields and convert them to strings\n name = mNameField.getText().toString();\n phone = mPhoneField.getText().toString();\n mAge = mAgeField.getText().toString();\n about=mAboutField.getText().toString();\n loc= mLocationField.getText().toString();\n int selectId = mRadioGroup.getCheckedRadioButtonId();\n\n\n final RadioButton radioButton =getView().findViewById(selectId);\n\n if(radioButton.getText() == null){\n return;\n }\n\n Map userInfo = new HashMap();\n //write where to put values in database\n userInfo.put(\"Name\",name);\n userInfo.put(\"Phone\",phone);\n userInfo.put(\"Age\",mAge);\n userInfo.put(\"About\",about);\n userInfo.put(\"Location\",loc);\n userInfo.put(\"Preferred Gender\", radioButton.getText().toString());\n\n\n //save to database\n mUserDb.updateChildren(userInfo);\n //checks if image has changed\n if (resultUri != null){\n StorageReference filepath = FirebaseStorage.getInstance().getReference().child(\"profileImages\").child(userId);\n Bitmap bitmap = null;\n\n //pass image we got from image uri\n //create a safety net for any unacounted errors\n try {\n bitmap = MediaStore.Images.Media.getBitmap(getContext().getContentResolver(), resultUri);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n //compress image to small size\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.JPEG, 20,baos);\n byte[] data = baos.toByteArray();\n\n //try to upload file\n //try on fail to catch error uploads\n UploadTask uploadTask = filepath.putBytes(data);\n uploadTask.addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(getContext(),\"fail\",Toast.LENGTH_LONG).show();\n }\n });\n\n //do the other case where image upload is successfull\n uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n //grap url from the profile image from the database\n Task<Uri> uriTask = taskSnapshot.getStorage().getDownloadUrl();\n while (!uriTask.isSuccessful());\n Uri downLoadUrl = uriTask.getResult();\n\n Map userInfo = new HashMap();\n //write where to put values in database\n userInfo.put(\"profileImageUrl\",downLoadUrl.toString());\n mUserDb.updateChildren(userInfo);\n\n return;\n }\n });\n\n }else{\n //Toast.makeText(SettingsActivity.this,\"Image load ++\", Toast.LENGTH_LONG).show();\n Toast.makeText(getActivity(),\"Image load ++\", Toast.LENGTH_LONG).show();\n }\n }", "public void uploadFileButton(Uri pdfUri) {\n title = titleUpdate.getText().toString();\n content = contentUpdate.getText().toString();\n time = timeUpdate.getText().toString();\n place = placeUpdate.getText().toString();\n organize = organizeUpdate.getText().toString();\n\n fileReference = firebaseStorage.getReference().child(firebaseAuth.getUid()).child(\"FileAdmin\").child(titlestarred).child(\"file\");\n\n if(pdfUri == null){\n imageURL=imageNameUpdate.getText().toString();\n fileURL = fileNameUpdate.getText().toString();\n event = new Event(content, fileURL, imageURL, organize, place, time, title);\n eventPathDatabaseReference.setValue(event);\n uploadImageButton(imageUri);\n\n }else if(pdfUri != null) {\n uploadTaskFile = fileReference.putFile(pdfUri);\n Task<Uri> urlTask = uploadTaskFile.continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {\n if (!task.isSuccessful()) {\n throw task.getException();\n }\n // Continue with the task to get the download URL\n return fileReference.getDownloadUrl();\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if (task.isSuccessful()) {\n fileURL = task.getResult().toString();\n event = new Event(content, fileURL, imageURL, organize, place, time, title);\n eventPathDatabaseReference.setValue(event);\n }\n else {\n // Handle failures\n // ...\n }\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(getContext(), \"File not Succesfully upload\", Toast.LENGTH_SHORT).show();\n }\n });\n uploadImageButton(imageUri);\n }\n\n }", "@Override\n public void onSuccess(Uri uri) {\n\n reference2.child(type).setValue(uri.toString());\n\n Toast.makeText(UserHomeActivity.this, \"Shared Successfully\", Toast.LENGTH_SHORT).show();\n\n uploadUserImageView.setImageDrawable(getResources().getDrawable(R.drawable.uploadimage));\n\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n startActivity(new Intent(getApplicationContext(),ChatApp.class));\n\n Toast.makeText(Image.this, \"Image Uploaded Successfylly\", Toast.LENGTH_SHORT).show();\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n if(resultCode == RESULT_OK) {\n imgView.setImageURI(image_uri);\n// image_uri = data.getData();\n// try {\n// InputStream inputStream = getContentResolver().openInputStream(image_uri);\n// bitmap = BitmapFactory.decodeStream(inputStream);\n// imgView.setImageBitmap(bitmap);\n//// imgView.setVisibility(View.VISIBLE);\n//// btnUpload.setVisibility(View.VISIBLE);\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// Toast.makeText(GambarActivity.this, \"o\", Toast.LENGTH_SHORT).show();\n }\n// super.onActivityResult(requestCode, resultCode, data);\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n mDatabaseUserReference.child(userID).child(\"name\").setValue(username);\n // Reference to the IMAGE of a particular user through userID\n // Can't pass imageUri\n // Get reference to the image stored in Firebase\n String downloadUrl = taskSnapshot.getDownloadUrl().toString();\n mDatabaseUserReference.child(userID).child(\"image\").setValue(downloadUrl);\n\n // Redirect user back to MainActivity\n Intent mainIntent = new Intent(\n SetupActivity.this, MainActivity.class\n );\n startActivity(mainIntent);\n }", "public void uploadImage(@NonNull Uri imageUri) {\n mStorage.uploadImage(imageUri, new FirestoreStorage.UrlReadyCallback() {\n @Override\n public void onSuccess(String url) { mImageId = url; }\n\n @Override\n public void onFailure() { mImageId = null; }\n });\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Task<Uri> uriTask = taskSnapshot.getStorage().getDownloadUrl();\n while (!uriTask.isSuccessful());\n Uri downloadImageUri = uriTask.getResult();\n if (uriTask.isSuccessful())\n {\n //save info with image\n HashMap<String, Object> hashMap = new HashMap<>();\n\n hashMap.put(\"uid\",\"\"+uid_user);\n hashMap.put(\"name\",\"\"+nameSt);\n hashMap.put(\"phone\",\"91\"+phoneSt);\n hashMap.put(\"mail\",\"\"+mailSt);\n hashMap.put(\"profileImage\", \"\"+downloadImageUri);\n hashMap.put(\"timestamp\", \"\" + timpstamp);\n mRef.child(uid_user).setValue(hashMap)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n progressDialog.dismiss();\n Toast.makeText(AddUserActivity.this, \"add user sucessfully\", Toast.LENGTH_SHORT).show();\n goToHomePage();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n progressDialog.dismiss();\n Toast.makeText(AddUserActivity.this, \"\"+e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n });\n }\n }", "@Override\n public void onSuccess(\n UploadTask.TaskSnapshot taskSnapshot) {\n progressDialog.dismiss();\n Toast.makeText(ProfileActivity.this, \"Image Uploaded!!\", Toast.LENGTH_SHORT).show();\n\n }", "public void saveSubjectImage(Uri imageUri, final ImageInterface listner) {\n storageReference = FirebaseStorage.getInstance().getReference();\n collectionReference = db.collection(\"Users\");\n final StorageReference filePath = storageReference.child(\"Subjects_Images\").child(EntityClass.getInstance().getSubjectEmail());\n filePath.putFile(imageUri)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n filePath.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n final String uriLink = uri.toString();\n collectionReference.whereEqualTo(\"UserIdInDB\", EntityClass.getInstance().getUserIdInDb()).get()\n .addOnSuccessListener(new OnSuccessListener<QuerySnapshot>() {\n @Override\n public void onSuccess(QuerySnapshot queryDocumentSnapshots) {\n for (QueryDocumentSnapshot snapshots: queryDocumentSnapshots) {\n\n snapshots.getReference().collection(EntityClass.getInstance().getSubjectEmail()).document(\"SubjectData\").update(\"imageUri\",uriLink);\n listner.statusAndUri(true, null);\n }\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.d(TAG, \"onFailure: \" + e.getMessage());\n listner.statusAndUri(false, null);\n listner.onFailure(e.getMessage());\n }\n });\n\n\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.d(TAG, \"onFailure: \" + e.getMessage());\n listner.statusAndUri(false, null);\n listner.onFailure(e.getMessage());\n }\n });\n\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.d(TAG, \"onFailure: \" + e.getMessage());\n listner.statusAndUri(false, null);\n listner.onFailure(e.getMessage());\n }\n });\n }", "@Override\n public void onComplete(@NonNull Task<Uri> task) {\n if(task.isSuccessful()) {\n Uri downloadUri = task.getResult();\n String mUri = downloadUri.toString();\n //Log.d(\"uri\", mUri);\n\n //get firebase reference, update map w/ profilePic, and update map in reference\n reference = FirebaseDatabase.getInstance().getReference(\"USERS\").child(firebaseUser.getUid());\n HashMap<String, Object> map = new HashMap<>();\n map.put(\"ProfilePic\", mUri);\n reference.updateChildren(map);\n\n pd.dismiss();\n }\n //if task not successful --> show toast\n else {\n Toast.makeText(getApplicationContext(), \"Upload failed!\", Toast.LENGTH_SHORT).show();\n pd.dismiss();\n }\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Task<Uri> uriTask= uploadTask.continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {\n\n if(!task.isSuccessful()){\n\n throw task.getException();\n\n }\n ImageUrl = filepath.getDownloadUrl().toString();\n return filepath.getDownloadUrl();\n\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if(task.isSuccessful()){\n\n ImageUrl = task.getResult().toString();\n //Toast.makeText(getApplicationContext(),\"Image saved to database\" ,Toast.LENGTH_SHORT).show();\n SaveProductInfo();\n }\n }\n });\n }", "private void loadActuality(){\n\n Log.i(\"TAG0\", \"TAG0\");\n if (mPaths.size() > 0){\n Log.i(\"TAG1\", \"TAG1\");\n try {\n File file = new File(mPaths.get(0));\n Bitmap bitmap = new Compressor(this)\n .setMaxWidth(320)\n .setMaxHeight(180)\n .setQuality(90)\n .compressToBitmap(file);\n\n Log.i(\"TAG11\", \"TAG11\");\n final String path = getPathFile();\n StorageReference storageReference = FireBaseUtil.mStorageRef.child(path);\n\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);\n byte[] data = baos.toByteArray();\n\n UploadTask uploadTask = storageReference.putBytes(data);\n\n uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Log.i(\"TAG2\", \"TAG2\");\n url = taskSnapshot.getDownloadUrl().toString();\n\n saveFakenews(url, taskSnapshot.getMetadata().getCreationTimeMillis());\n Log.i(\"TAG3\", \"TAG3\");\n uploading.stop();\n Log.i(\"TAG4\", \"TAG4\");\n }\n });\n }catch (IOException ex){\n Log.e(\"TAG\", ex.getMessage());\n }\n }else {\n Toast.makeText(this,\"Veuillez sélectionner une image\", Toast.LENGTH_SHORT).show();\n }\n }", "private void saveStudentPhotoToFirebaseStorage(final String studentId) {\n // Show progress bar\n mSavingProgressBar.setVisibility(View.VISIBLE);\n\n // Save photo to firebase storage\n final StorageReference photoRef = mStudentPhotosStorageReference.child(studentId);\n photoRef.putBytes(BitmapUtils.bitmapToByteArray(mViewModel.studentPicBitmap)).addOnSuccessListener(\n new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n photoRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n // On success, get the URL link, which will be saved in the student database\n mFirebaseStoragePhotoUri = uri;\n\n String studentPhoto = mFirebaseStoragePhotoUri.toString();\n String studentName = mStudentNameEditText.getText().toString().toLowerCase().trim();\n int studentSex = mStudentSex;\n long studentBirthdate = mStudentBirthdate;\n int studentGrade = Integer.parseInt(mStudentGradeEditText.getText().toString());\n\n Student newStudent = new Student(studentName, studentSex, studentBirthdate,\n studentGrade, mChosenClassesList, studentPhoto, studentId);\n\n mStudentsDatabaseReference.child(studentId).setValue(newStudent);\n\n finish();\n }\n });\n }\n });\n }", "@Override\n public void onClick(View view) {\n storageReference= FirebaseStorage.getInstance().getReference(\"uploadsKarwa\");//files will be uploaded to uploads folder\n databaseReference= FirebaseDatabase.getInstance().getReference(\"uploadsKarwa\");\n openfilechooser();\n\n }", "private void saveProfile()\n {\n mFirebaseUser = mFirebaseAuth.getCurrentUser();\n mDatabase = FirebaseDatabase.getInstance().getReference();\n mUserId = mFirebaseUser.getUid();\n\n StorageReference filePath = mStorage.child(\"UserPic\").child(mImageUri.getLastPathSegment());\n //UserProfile userProfile = new UserProfile();\n filePath.putFile(mImageUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Uri downloadUrl = taskSnapshot.getDownloadUrl();\n mDatabase.child(\"users\").child(mUserId).child(\"userName\").setValue(fname);\n mDatabase.child(\"users\").child(mUserId).child(\"userImage\").setValue(downloadUrl.toString());\n }\n });\n\n }", "@Override\n public void onClick(View view) {\n storageReference= FirebaseStorage.getInstance().getReference(\"uploadsDashara\");//files will be uploaded to uploads folder\n databaseReference= FirebaseDatabase.getInstance().getReference(\"uploadsDashara\");\n openfilechooser();\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_second, container, false);\n\n\n name = v.findViewById(R.id.edittxt_name);\n price = v.findViewById(R.id.edittxt_price);\n place = v.findViewById(R.id.edittxt_place);\n type = v.findViewById(R.id.edittxt_type);\n description = v.findViewById(R.id.edittxt_description);\n fAuth = FirebaseAuth.getInstance();\n db = FirebaseFirestore.getInstance();\n pd = new ProgressDialog(getContext());\n imageView = (ImageView) v.findViewById(R.id.imgSelect);\n ImageUris = new ArrayList<>();\n AptImagesRef = FirebaseStorage.getInstance().getReference().child(\"ApartmentImages\");\n imageView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n OpenGallery();\n }\n });\n\n btnSubmit = (Button) v.findViewById(R.id.btn_submit);\n btnSubmit.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n aname = name.getText().toString().trim();\n aprice = price.getText().toString().trim();\n aplace = place.getText().toString().trim();\n adescription = description.getText().toString().trim();\n atype = type.getText().toString().trim();\n email = FirebaseAuth.getInstance().getCurrentUser().getEmail();\n\n if(ImageUris == null){\n Toast.makeText(getContext(), \"Image is mandatory.\", Toast.LENGTH_SHORT).show();\n imageView.requestFocus();\n }\n\n uploadImage();\n\n }\n });\n return v;\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Task<Uri> uriTask = taskSnapshot.getStorage().getDownloadUrl();\n while (!uriTask.isSuccessful());\n Uri downloadImageUri = uriTask.getResult();\n\n if (uriTask.isSuccessful()){\n\n\n //setup data to save\n HashMap<String,Object> hashMap = new HashMap<>();\n hashMap.put(\"uid\",\"\"+firebaseAuth.getUid());\n hashMap.put(\"email\",\"\"+email);\n hashMap.put(\"name\",\"\"+fullName);\n hashMap.put(\"phone\",\"\"+phoneNumber);\n hashMap.put(\"address\",\"\"+address);\n hashMap.put(\"timestamp\",\"\"+timestamp);\n // hashMap.put(\"code\",\"\"+code);\n hashMap.put(\"accountType\",\"User\");\n // hashMap.put(\"online\",\"true\");\n hashMap.put(\"profileImage\",\"\"+downloadImageUri); //url of uploaded image\n\n //save to db\n DatabaseReference ref = FirebaseDatabase.getInstance().getReference(\"SchoolFirst\");\n ref.child(firebaseAuth.getUid()).setValue(hashMap)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n //db updated\n progressDialog.dismiss();\n startActivity(new Intent(RegisterUserActivity.this,MainActivity.class));\n finish();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n //failed updating db\n progressDialog.dismiss();\n startActivity(new Intent(RegisterUserActivity.this,MainActivity.class));\n finish();\n }\n });\n\n }\n }", "private void uploadFromDataStorage() {\n }", "private void onImageSelected(Uri uri) {\n S3Manager s3Manager = S3Manager.getInstance(getActivity());\n FutureTask<Void> userAuthorized = s3Manager.authUser();\n s3Manager.uploadImage(userAuthorized, uri, new UploadCompleteCallback());\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (requestCode == CHOOSE_IMAGE && resultCode == RESULT_OK && data != null &&\n data.getData() != null) {\n uriProfileImage = data.getData();\n try {\n Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), uriProfileImage);\n profilePic.setImageBitmap(bitmap);\n\n uploadImageToFirebaseStorage();\n Bimage = true;\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "public void uploadProfilePicInStorage(Uri uri, ImageView img){\n ProfileSharedPreferencesRepository.getInstance(application).uploadProfilePicInStorage(uri,img);\n }", "void uploadPicture(Uri uri, ProgressDialog progressDialog);", "private void uploadImage() {\n FileChooser fileChooser = new FileChooser();\n\n //Extension de l'image\n FileChooser.ExtensionFilter extFilter = new FileChooser.ExtensionFilter(\"Fichier image\", \"*.*\");\n fileChooser.getExtensionFilters().addAll(extFilter);\n\n File file = fileChooser.showOpenDialog(null);\n\n try {\n BufferedImage bufferedImage = ImageIO.read(file);\n Image image = SwingFXUtils.toFXImage(bufferedImage, null);\n imageViewAvatar.setImage(image);\n getUser().setAvatar(image);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void databaseUpload() {\n StorageReference reference;\n\n// Toast.makeText(NewBeneficiary2.this, \"\"+by.length, Toast.LENGTH_SHORT).show();\n\n reference = FirebaseStorage.getInstance().getReference().child(\"Applications/\").child(FirebaseAuth.getInstance().getUid() + \"_doc\");\n reference.putBytes(by).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n reference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n String generatedFilePath = uri.toString();\n NewBeneficiary1.applicationModel.setDocPic(generatedFilePath);\n\n FirebaseFirestore.getInstance().document(\"Applications/\"+FirebaseAuth.getInstance().getUid()+\"/\")\n .set(NewBeneficiary1.applicationModel)\n .addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n StatusModel statusModel = new StatusModel();\n statusModel.setStageName(\"Application Submitted\");\n statusModel.setTimestamp(Timestamp.now());\n FirebaseFirestore.getInstance().collection(\"Applications/\"+FirebaseAuth.getInstance().getUid()+\"/Statuses\")\n .document()\n .set(statusModel)\n .addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n Toast.makeText(NewBeneficiary2.this, \"Completed\", Toast.LENGTH_LONG).show();\n dialog.dismiss();\n startActivity(new Intent(NewBeneficiary2.this, MainActivity.class));\n }\n });\n }\n });\n\n }\n });\n }\n });\n\n }", "@Override\n public void onSuccess(Uri uri) {\n\n reference2.child(\"url\").setValue(uri.toString());\n reference2.child(\"name\").setValue(shared.getName());\n reference2.child(\"date\").setValue(date+\"+\"+formattedDate);\n Toast.makeText(UserHomeActivity.this, \"Shared Successfully\", Toast.LENGTH_SHORT).show();\n\n\n uploadUserImageView.setImageDrawable(getResources().getDrawable(R.drawable.uploadimage));\n\n }", "private void uploadImage(byte[] data) {\n final FirebaseUser user = DatabaseContants.getCurrentUser();\n StorageReference profileImageRef = StorageConstants.getUserPhotoRef(user.getUid());\n UploadTask uploadTask = profileImageRef.putBytes(data);\n\n uploadTask.addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n // Handle unsuccessful uploads\n }\n }).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n // taskSnapshot.getMetadata() contains file metadata such as size,\n // content-type, and download URL.\n Uri downloadUrl = taskSnapshot.getDownloadUrl();\n UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder()\n .setPhotoUri(downloadUrl)\n .build();\n\n user.updateProfile(profileUpdates)\n .addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Log.d(TAG, \"User profile updated.\");\n }\n }\n });\n String profileUri = (downloadUrl != null) ? downloadUrl.toString() : \"\";\n DatabaseContants.getCurrentUserRef().child(UserModel.URI_KEY).setValue(profileUri);\n }\n });\n }", "@RequiresApi(api = Build.VERSION_CODES.O)\n private void uploadFile() {\n //if there is a file to upload\n if (filePath != null) {\n //displaying a progress dialog while upload is going on\n final ProgressDialog progressDialog = new ProgressDialog(this);\n progressDialog.setTitle(\"Uploading\");\n progressDialog.show();\n\n final StorageReference riversRef = storageReference.child(\"file\");\n riversRef.putFile(filePath)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n //if the upload is successfull\n //hiding the progress dialog\n riversRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n\n Model model = new Model(uri.toString());\n String modelID = myRef.push().getKey();\n myRef.child(modelID).setValue(model);\n userID = fAuth.getCurrentUser().getUid();\n DocumentReference documentReference = fStore.collection(\"users\").document(userID);\n\n\n Map<String, Object> fuser = new HashMap<>();\n fuser.put(\"FileUrl\", model);\n documentReference.set(fuser, SetOptions.merge());\n Toast.makeText(eeg4.this, \"Uploaded successfully\", Toast.LENGTH_SHORT).show();\n }\n });\n progressDialog.dismiss();\n\n //and displaying a success toast\n Toast.makeText(getApplicationContext(), \"File Uploaded \", Toast.LENGTH_LONG).show();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n //if the upload is not successfull\n //hiding the progress dialog\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }\n })\n .addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n //calculating progress percentage\n double progress = (100.0 * taskSnapshot.getBytesTransferred()) / taskSnapshot.getTotalByteCount();\n\n //displaying percentage in progress dialog\n progressDialog.setMessage(\"Uploaded \" + ((int) progress) + \"%...\");\n }\n });\n }\n //if there is not any file\n else {\n //you can display an error toast\n }\n }", "private void uploadFile() {\n //if there is a file to upload\n if (filePath != null) {\n //displaying a progress dialog while upload is going on\n final ProgressDialog progressDialog = new ProgressDialog(this);\n progressDialog.setTitle(\"Uploading\");\n progressDialog.show();\n\n final StorageReference riversRef = storageReference.child(\"upload/files\").child(filePath.getLastPathSegment());\n riversRef.putFile(filePath)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n //if the upload is successfull\n //hiding the progress dialog\n String myurl=taskSnapshot.getDownloadUrl().toString();\n\n String filepathuri=filePath.toString();\n\n String filename=filepathuri.substring(filepathuri.lastIndexOf(\"/\")+1);\n uploadreferance(myurl,filename);\n progressDialog.dismiss();\n\n //and displaying a success toast\n Toast.makeText(getApplicationContext(), \"File Uploaded \", Toast.LENGTH_LONG).show();\n Intent intent = new Intent(Upload_files.this,navigation_bar.class);\n startActivity(intent);\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n //if the upload is not successfull\n //hiding the progress dialog\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }\n })\n .addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n //calculating progress percentage\n double progress = (100.0 * taskSnapshot.getBytesTransferred())/taskSnapshot.getTotalByteCount();\n\n //displaying percentage in progress dialog\n progressDialog.setMessage(\"Uploaded \" + ((int) progress) + \"%...\");\n }\n });\n }\n //if there is not any file\n else {\n //you can display an error toast\n }\n }", "private void uploadFile(String uploadDate,String uploadMealName) {\n\n Context context = this;\n Thread imageWithMealBinder = new Thread(){\n private Context localContext = context;\n @Override\n public void run(){\n if (mImageUri != null) {\n String address = System.currentTimeMillis() + \".\" + getFileExtension(mImageUri);\n final StorageReference fileReference = mStorageRef.child(address);\n\n\n fileReference.putFile(mImageUri).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(MealViewer.this, e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n }).addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n double progress = (100.0 * taskSnapshot.getBytesTransferred() / taskSnapshot.getTotalByteCount());\n mProgressBar.setProgress((int) progress);\n\n }\n }).continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {\n if (!task.isSuccessful()) {\n throw task.getException();\n }\n return fileReference.getDownloadUrl();\n }\n }).addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(@NonNull Uri downloadUri) {\n Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n mProgressBar.setProgress(0);\n }\n }, 5000);\n\n Toast.makeText(MealViewer.this, R.string.upload_successfull, Toast.LENGTH_SHORT).show();\n Upload upload = new Upload(mealNameTextbox.getText().toString().trim(), downloadUri.toString());\n\n // Make a unique Id - We can change this later.\n String uploadId = mDatabaseRef.push().getKey();\n\n // Use this to get data\n mDatabaseRef.child(uploadId).setValue(upload);\n\n // Get the url\n String imageUrl = upload.getImageUrl();\n\n\n //update the database\n MealCalendar mc =\n GreenFoodChallengeDatabase.getCurrentUser().getMealCalendar();\n\n synchronized (mc){\n Day day = mc.getDay(uploadDate);\n Meal meal = day.getMeal(uploadMealName);\n meal.setImageUrl(imageUrl);\n day.setMeal(meal);\n mc.updateDay(uploadDate,day);\n\n GreenFoodChallengeDatabase.updateCurrentUser();\n }\n\n }\n });\n\n }\n }\n\n };\n imageWithMealBinder.start();\n }", "private void uploadFile(Uri data) {\n\n //displaying a progress dialog while upload is going on\n final ProgressDialog progressDialog = new ProgressDialog(this);\n progressDialog.setTitle(\"Uploading\");\n progressDialog.setCancelable(false);\n progressDialog.show();\n\n StorageReference sRef = mStorageReference.child(cloud_base_path + new_notice_key + \"/\" + attchmentFIleName.replace(\" \",\"_\") + \".pdf\");\n sRef.putFile(data)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @SuppressWarnings(\"VisibleForTests\")\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n\n progressDialog.dismiss();\n\n //and displaying a success toast\n Toast.makeText(getApplicationContext(), \"File Uploaded \", Toast.LENGTH_LONG).show();\n\n Upload upload = new Upload(attchmentFIleName, taskSnapshot.getDownloadUrl().toString());\n\n String newKey = mDatabase.child(\"Global\").child(StartUpActivity.userDetails.getState()).child(\"Notice_Board\").child(new_notice_key).child(\"Attachments\").push().getKey();\n mDatabase.child(\"Global\").child(StartUpActivity.userDetails.getState()).child(\"Notice_Board\").child(new_notice_key).child(\"Attachments\").child(newKey).setValue(upload);\n\n // Update Attachment field\n String atthline = textView_new_notice_vlu.getText().toString() + \"\\n\" + attchmentFIleName +\".pdf\";\n textView_new_notice_vlu.setText(atthline);\n\n // Update Attachments Name\n updateAttachmentsNames();\n\n\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n\n //hiding the progress dialog\n progressDialog.dismiss();\n\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }\n })\n .addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {\n @SuppressWarnings(\"VisibleForTests\")\n @Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n double progress = (100.0 * taskSnapshot.getBytesTransferred()) / taskSnapshot.getTotalByteCount();\n\n //displaying percentage in progress dialog\n progressDialog.setMessage(\"Uploaded \" + ((int) progress) + \"%...\");\n }\n });\n\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if(requestCode == gallaryPick && resultCode == RESULT_OK && data != null){\n imageUri = data.getData();\n try{\n saveTransactionPictureToFirebaseStorage();\n } catch (Exception ex){\n Toast.makeText(this, \"Error occurred, please try again...\", Toast.LENGTH_SHORT).show();\n }\n }\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n dialog.dismiss();\n //Display success toast msg\n Toast.makeText(getApplicationContext(), \"Product Saved\", Toast.LENGTH_SHORT).show();\n\n MenuProduct menuCategory = new MenuProduct(txtProductName.getText().toString(),\n txtCategoryName.getText().toString(),txtProductIngredients.getText().toString(), txtProductDescription.getText().toString(),\n Float.parseFloat(txtPrice.getText().toString()),0,\"\",\n taskSnapshot.getDownloadUrl().toString(),Integer.parseInt(txtCal.getText().toString()),\n Integer.parseInt(txtQuantity.getText().toString()));\n\n //Save image info in to firebase database\n String uploadId = mDatabaseRef.push().getKey();\n mDatabaseRef.child(uploadId).setValue(menuCategory);\n\n clearComponents();\n\n }" ]
[ "0.79454696", "0.7926522", "0.7682931", "0.7675312", "0.7540277", "0.7510523", "0.7505393", "0.745172", "0.74422705", "0.74147004", "0.73951775", "0.7268266", "0.72515744", "0.722805", "0.71983576", "0.71843874", "0.71804005", "0.71541095", "0.71514964", "0.7135309", "0.71301574", "0.71099395", "0.7082393", "0.7078486", "0.7062366", "0.7060028", "0.7051532", "0.7050475", "0.70485157", "0.7027744", "0.7004429", "0.6993674", "0.6981717", "0.69208926", "0.68986607", "0.68955654", "0.6876346", "0.6842184", "0.6837553", "0.6796243", "0.6774411", "0.6746294", "0.67228013", "0.67105246", "0.6702192", "0.6686649", "0.6676654", "0.6657983", "0.6628438", "0.6607347", "0.6600193", "0.65808094", "0.65766335", "0.65583885", "0.65397376", "0.65391755", "0.65325266", "0.65238106", "0.6519801", "0.651174", "0.65099835", "0.6509581", "0.65006155", "0.64979196", "0.6480703", "0.6475788", "0.6455742", "0.64434063", "0.6432564", "0.6427101", "0.6418606", "0.640818", "0.6392625", "0.63803613", "0.6374324", "0.6363398", "0.6350429", "0.6324892", "0.62979144", "0.6297821", "0.6289297", "0.6288335", "0.6283563", "0.62817657", "0.62762856", "0.626617", "0.62481874", "0.62267023", "0.6197592", "0.618945", "0.61839473", "0.61692363", "0.6165889", "0.6161728", "0.61605805", "0.6159343", "0.61532235", "0.6150008", "0.6142363", "0.61392254" ]
0.8245746
0
taskSnapshot.getMetadata() contains file metadata such as size, contenttype, and download URL.
@Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { Toast.makeText(getApplicationContext(),"Photo uploaded successfully!",Toast.LENGTH_SHORT).show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.google.cloud.compute.v1.Metadata getMetadata();", "com.google.cloud.talent.v4beta1.ResponseMetadata getMetadata();", "public ResourceContent getMetadata() throws IOException;", "@java.lang.Override\n public io.grafeas.v1.Metadata getMetadata() {\n return metadata_ == null ? io.grafeas.v1.Metadata.getDefaultInstance() : metadata_;\n }", "public SongMetada getMetadata() {\n\t\treturn metadata;\n\t}", "public Map<String, String> getMetadata() {\n return metadata;\n }", "public Map<String, String> getMetadata() {\n return metadata;\n }", "public Map getMetadata() {\n return metadata;\n }", "@java.lang.Override\n public io.grafeas.v1.MetadataOrBuilder getMetadataOrBuilder() {\n return metadata_ == null ? io.grafeas.v1.Metadata.getDefaultInstance() : metadata_;\n }", "public PDMetadata getMetadata() {\n/* 528 */ PDMetadata retval = null;\n/* 529 */ COSBase mdStream = this.stream.getDictionaryObject(COSName.METADATA);\n/* 530 */ if (mdStream != null)\n/* */ {\n/* 532 */ if (mdStream instanceof COSStream) {\n/* */ \n/* 534 */ retval = new PDMetadata((COSStream)mdStream);\n/* */ }\n/* 536 */ else if (!(mdStream instanceof org.apache.pdfbox.cos.COSNull)) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 542 */ throw new IllegalStateException(\"Expected a COSStream but was a \" + mdStream\n/* */ \n/* 544 */ .getClass().getSimpleName());\n/* */ } \n/* */ }\n/* 547 */ return retval;\n/* */ }", "public Object getMetadata() {\n return this.metadata;\n }", "Metadata getMetaData();", "public Map<String, Object> getMetadata() {\n return metadata;\n }", "@Test(timeout = TIMEOUT)\n public void getMetadataTaskLifecycle() throws Exception {\n final Result<TaskResponse> uploadImportTaskResponseResult = docSDKClient.importUsing().upload(new UploadImportRequest(), jpgTest1InputStream);\n assertThat(uploadImportTaskResponseResult.getStatus()).isEqualTo(HttpStatus.SC_OK);\n\n final TaskResponse uploadImportTaskResponse = uploadImportTaskResponseResult.getBody();\n assertThat(uploadImportTaskResponse.getOperation()).isEqualTo(Operation.IMPORT_UPLOAD);\n\n // Thumbnail\n final GetMetadataTaskRequest getMetadataTaskRequest = new GetMetadataTaskRequest().setInput(uploadImportTaskResponse.getId()).setInputFormat(JPG);\n final Result<TaskResponse> metadataTaskResponseResult = docSDKClient.tasks().metadata(getMetadataTaskRequest);\n assertThat(metadataTaskResponseResult.getStatus()).isEqualTo(HttpStatus.SC_CREATED);\n\n final TaskResponse metadataTaskResponse = metadataTaskResponseResult.getBody();\n assertThat(metadataTaskResponse.getOperation()).isEqualTo(Operation.METADATA);\n\n // Wait\n final Result<TaskResponse> waitMetadataTaskResponseResult = docSDKClient.tasks().wait(metadataTaskResponse.getId());\n assertThat(waitMetadataTaskResponseResult.getStatus()).isEqualTo(HttpStatus.SC_OK);\n\n final TaskResponse waitMetadataTaskResponse = waitMetadataTaskResponseResult.getBody();\n assertThat(waitMetadataTaskResponse.getOperation()).isEqualTo(Operation.METADATA);\n assertThat(waitMetadataTaskResponse.getStatus()).isEqualTo(Status.FINISHED);\n assertThat(waitMetadataTaskResponse.getId()).isEqualTo(metadataTaskResponse.getId());\n\n // Show\n final Result<TaskResponse> showMetadataTaskResponseResult = docSDKClient.tasks().show(metadataTaskResponse.getId());\n assertThat(showMetadataTaskResponseResult.getStatus()).isEqualTo(HttpStatus.SC_OK);\n\n final TaskResponse showMetadataTaskResponse = showMetadataTaskResponseResult.getBody();\n assertThat(showMetadataTaskResponse.getOperation()).isEqualTo(Operation.METADATA);\n assertThat(showMetadataTaskResponse.getStatus()).isEqualTo(Status.FINISHED);\n assertThat(showMetadataTaskResponse.getId()).isEqualTo(metadataTaskResponse.getId());\n assertThat(showMetadataTaskResponse.getResult().getMetadata()).isNotEmpty();\n\n // Delete\n final Result<Void> deleteVoidResult = docSDKClient.tasks().delete(metadataTaskResponse.getId());\n assertThat(deleteVoidResult.getStatus()).isEqualTo(HttpStatus.SC_NO_CONTENT);\n }", "com.google.dataflow.v1beta3.TemplateMetadata getMetadata();", "Map<String, Object> getAllMetadata();", "public java.util.List<MetadataEntry> getMetadataList() {\n return metadata_;\n }", "public ExecutionMetadata getExecutionMetadata();", "public AbstractMetadata getMetadata() {\n\t\treturn metadata;\n\t}", "public PDMetadata getMetadata()\n {\n PDMetadata retval = null;\n COSBase mdStream = stream.getDictionaryObject(COSName.METADATA);\n if (mdStream instanceof COSStream)\n {\n retval = new PDMetadata((COSStream) mdStream);\n } \n else if (mdStream instanceof COSNull)\n {\n // null is authorized\n } \n else if (mdStream != null)\n {\n throw new IllegalStateException(\"Expected a COSStream but was a \"\n + mdStream.getClass().getSimpleName());\n }\n return retval;\n }", "com.google.cloud.compute.v1.MetadataOrBuilder getMetadataOrBuilder();", "public List<Metadata> getMetadata()\n\t{\n\t\treturn mMetadata;\n\t}", "com.google.cloud.talent.v4beta1.ResponseMetadataOrBuilder getMetadataOrBuilder();", "public String getMetaDataFileName() {\n return null;\n }", "public @Nullable MediaMetadata2 getMetadata() {\n return mMetadata;\n }", "@Nullable\n public abstract MediaMetadata getPlaylistMetadata();", "@NonNull\n JsonMap getMetadata();", "@Nullable\n public Metadata getMetadata() {\n return mMetadata;\n }", "public io.grafeas.v1.Metadata getMetadata() {\n if (metadataBuilder_ == null) {\n return metadata_ == null ? io.grafeas.v1.Metadata.getDefaultInstance() : metadata_;\n } else {\n return metadataBuilder_.getMessage();\n }\n }", "private void readMetadata() throws IOException {\n\t\t/*int magicNumber = */ metadataFile.readInt();\n\t\t/*int formatVersion = */ metadataFile.readInt();\n\t\t/*int managerIndex = */ metadataFile.readInt();\n\t\tfileListOffset = metadataFile.readInt() & 0xFFFFFFFFL;\n\t\tpathListOffset = metadataFile.readInt() & 0xFFFFFFFFL;\n\n\t\tmetadataFile.setPosition(fileListOffset);\n\t\treadFileList();\n\t}", "public String getMetaFile() {\r\n return metaFile;\r\n }", "com.google.dataflow.v1beta3.RuntimeMetadata getRuntimeMetadata();", "public void dumpImageMetaData(Uri uri) {\n // BEGIN_INCLUDE (dump_metadata)\n\n // The query, since it only applies to a single document, will only return one row.\n // no need to filter, sort, or select fields, since we want all fields for one\n // document.\n Cursor cursor = getActivity().getContentResolver()\n .query(uri, null, null, null, null, null);\n\n try {\n // moveToFirst() returns false if the cursor has 0 rows. Very handy for\n // \"if there's anything to look at, look at it\" conditionals.\n if (cursor != null && cursor.moveToFirst()) {\n\n // Note it's called \"Display Name\". This is provider-specific, and\n // might not necessarily be the file name.\n String displayName = cursor.getString(\n cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));\n //Toast.makeText(getActivity(),\"Display Name: \"+ displayName, Toast.LENGTH_SHORT).show();\n imageInfo += \"Name:\" + displayName;\n int sizeIndex = cursor.getColumnIndex(OpenableColumns.SIZE);\n // If the size is unknown, the value stored is null. But since an int can't be\n // null in java, the behavior is implementation-specific, which is just a fancy\n // term for \"unpredictable\". So as a rule, check if it's null before assigning\n // to an int. This will happen often: The storage API allows for remote\n // files, whose size might not be locally known.\n String size = null;\n if (!cursor.isNull(sizeIndex)) {\n // Technically the column stores an int, but cursor.getString will do the\n // conversion automatically.\n size = cursor.getString(sizeIndex);\n } else {\n size = \"Unknown\";\n }\n imageInfo += \"Size: \" + size;\n //Toast.makeText(getActivity(),\"Size: \"+size,Toast.LENGTH_SHORT).show();\n }\n } finally {\n if (cursor != null) {\n cursor.close();\n }\n }\n // END_INCLUDE (dump_metadata)\n }", "public List<AbstractMetadata> getMetadata() {\n\t\treturn Collections.unmodifiableList(this.metadata);\n\t}", "@java.lang.Override\n public com.google.protobuf.Struct getMetadata() {\n return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_;\n }", "public NestedSet<Artifact> getInstrumentationMetadataFiles() {\n return instrumentationMetadataFiles;\n }", "public com.opentext.bn.converters.avro.entity.PayloadRef getFileInfo() {\n return fileInfo;\n }", "public com.opentext.bn.converters.avro.entity.PayloadRef getFileInfo() {\n return fileInfo;\n }", "public GenericMetadata getMetadata()\n {\n // return definition metadata\n GenericMetadata metadata = definition.getMetadata();\n if ((metadata != null) && (metadata.getFields() != null) && !metadata.getFields().isEmpty())\n {\n return metadata;\n }\n\n // return node metadata\n return super.getMetadata();\n }", "public Properties getImageMetaData() {\n\t\treturn null;\n\t}", "public String getMetadataURL();", "public EntityMetadata[] getMetadata()\r\n/* 30: */ {\r\n/* 31:30 */ return this.metadata;\r\n/* 32: */ }", "@Override\r\n\tpublic Map<String, Object> getMetadata() {\n\t\treturn null;\r\n\t}", "@Nullable\n @Generated\n @Selector(\"metadata\")\n public native NSDictionary<?, ?> metadata();", "public @Nullable MediaMetadata getMetadata() {\n try {\n return mSessionBinder.getMetadata();\n } catch (RemoteException e) {\n Log.wtf(TAG, \"Error calling getMetadata.\", e);\n return null;\n }\n }", "public Map<String, Variant<?>> GetMetadata();", "@Override\r\n\tpublic String readMetadataFile(String packageName) {\n\t\treturn null;\r\n\t}", "public TaskContextMetadata getTaskContextMetadata()\n {\n return taskContextMetadata;\n }", "public JobMetadata getMetaData() {\n return this.metaData;\n }", "@java.lang.Override\n public entities.Torrent.FileInfo getFileInfo() {\n return fileInfo_ == null ? entities.Torrent.FileInfo.getDefaultInstance() : fileInfo_;\n }", "@java.lang.Override\n public entities.Torrent.FileInfo getFileInfo() {\n return fileInfo_ == null ? entities.Torrent.FileInfo.getDefaultInstance() : fileInfo_;\n }", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "public int getMetadataCount() {\n return metadata_.size();\n }", "public org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata() {\n return metadata_ == null ? org.apache.calcite.avatica.proto.Responses.RpcMetadata.getDefaultInstance() : metadata_;\n }", "public org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata() {\n return metadata_ == null ? org.apache.calcite.avatica.proto.Responses.RpcMetadata.getDefaultInstance() : metadata_;\n }", "public org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata() {\n return metadata_ == null ? org.apache.calcite.avatica.proto.Responses.RpcMetadata.getDefaultInstance() : metadata_;\n }", "public org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata() {\n return metadata_ == null ? org.apache.calcite.avatica.proto.Responses.RpcMetadata.getDefaultInstance() : metadata_;\n }", "public org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata() {\n return metadata_ == null ? org.apache.calcite.avatica.proto.Responses.RpcMetadata.getDefaultInstance() : metadata_;\n }", "public org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata() {\n return metadata_ == null ? org.apache.calcite.avatica.proto.Responses.RpcMetadata.getDefaultInstance() : metadata_;\n }", "public org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata() {\n return metadata_ == null ? org.apache.calcite.avatica.proto.Responses.RpcMetadata.getDefaultInstance() : metadata_;\n }", "public org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata() {\n return metadata_ == null ? org.apache.calcite.avatica.proto.Responses.RpcMetadata.getDefaultInstance() : metadata_;\n }", "public org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata() {\n return metadata_ == null ? org.apache.calcite.avatica.proto.Responses.RpcMetadata.getDefaultInstance() : metadata_;\n }", "public org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata() {\n return metadata_ == null ? org.apache.calcite.avatica.proto.Responses.RpcMetadata.getDefaultInstance() : metadata_;\n }", "public org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata() {\n return metadata_ == null ? org.apache.calcite.avatica.proto.Responses.RpcMetadata.getDefaultInstance() : metadata_;\n }", "public org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata() {\n return metadata_ == null ? org.apache.calcite.avatica.proto.Responses.RpcMetadata.getDefaultInstance() : metadata_;\n }", "public org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata() {\n return metadata_ == null ? org.apache.calcite.avatica.proto.Responses.RpcMetadata.getDefaultInstance() : metadata_;\n }", "public org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata() {\n return metadata_ == null ? org.apache.calcite.avatica.proto.Responses.RpcMetadata.getDefaultInstance() : metadata_;\n }", "com.google.protobuf.Struct getMetadataFields();", "public interface IImageMetadata {\n\n public String getImageType();\n\n public void setImageType(String imageType);\n\n public String getFilename();\n\n public void setFilename(String filename);\n\n public DateTime getLastModified();\n\n public void setLastModified(DateTime d);\n\n public DateTime getCreated();\n\n public void setCreated(DateTime d);\n\n public long getSize();\n\n public void setSize(long size);\n\n public String getReadableSize();\n\n}", "@Override\n\tpublic X3DMetadataObject getMetadata();", "@java.lang.Override\n public boolean hasMetadata() {\n return metadata_ != null;\n }", "@java.lang.Override\n public boolean hasMetadata() {\n return metadata_ != null;\n }", "@java.lang.Override\n public boolean hasMetadata() {\n return metadata_ != null;\n }", "@External(readonly = true)\n\tpublic List<String> get_metadata_fields(){\n\t\t\n\t\treturn this.METADATA_FIELDS;\n\t}", "public io.grafeas.v1.MetadataOrBuilder getMetadataOrBuilder() {\n if (metadataBuilder_ != null) {\n return metadataBuilder_.getMessageOrBuilder();\n } else {\n return metadata_ == null ? io.grafeas.v1.Metadata.getDefaultInstance() : metadata_;\n }\n }", "@JsonGetter(\"metadata\")\n public Object getMetadata ( ) {\n return this.metadata;\n }", "public java.util.List<? extends MetadataEntryOrBuilder> getMetadataOrBuilderList() {\n return metadata_;\n }", "public boolean hasMetadata() {\n return metadata_ != null;\n }", "public boolean hasMetadata() {\n return metadata_ != null;\n }", "public boolean hasMetadata() {\n return metadata_ != null;\n }", "public boolean hasMetadata() {\n return metadata_ != null;\n }", "public boolean hasMetadata() {\n return metadata_ != null;\n }", "public boolean hasMetadata() {\n return metadata_ != null;\n }", "public boolean hasMetadata() {\n return metadata_ != null;\n }", "public boolean hasMetadata() {\n return metadata_ != null;\n }", "public boolean hasMetadata() {\n return metadata_ != null;\n }", "public boolean hasMetadata() {\n return metadata_ != null;\n }", "public boolean hasMetadata() {\n return metadata_ != null;\n }" ]
[ "0.64935243", "0.64189297", "0.6395336", "0.6247609", "0.606587", "0.6050723", "0.6050723", "0.6014259", "0.60110515", "0.5978749", "0.5970988", "0.5959393", "0.5945599", "0.59284866", "0.588414", "0.588289", "0.5859245", "0.5853862", "0.57837296", "0.57690835", "0.5763348", "0.5758009", "0.5753157", "0.57503724", "0.57474107", "0.5738755", "0.5725075", "0.5719411", "0.5668049", "0.5666987", "0.5630975", "0.562997", "0.56081176", "0.5602776", "0.5602643", "0.55981266", "0.55897963", "0.55861026", "0.55814016", "0.55340415", "0.55109274", "0.5509602", "0.55057377", "0.547994", "0.5470272", "0.54538876", "0.54246104", "0.5420395", "0.5414286", "0.5407416", "0.5407416", "0.53821796", "0.53821796", "0.53821796", "0.53821796", "0.53821796", "0.53821796", "0.53821796", "0.53821796", "0.53821796", "0.53821796", "0.53821796", "0.53821796", "0.53821796", "0.53821796", "0.53768826", "0.536853", "0.536853", "0.536853", "0.536853", "0.536853", "0.536853", "0.536853", "0.536853", "0.536853", "0.536853", "0.536853", "0.536853", "0.536853", "0.536853", "0.5349825", "0.5343011", "0.5325715", "0.53250086", "0.53250086", "0.53250086", "0.5315102", "0.5313263", "0.5299972", "0.5288374", "0.5264044", "0.5264044", "0.5264044", "0.5264044", "0.5264044", "0.5264044", "0.5264044", "0.5264044", "0.5264044", "0.5264044", "0.5264044" ]
0.0
-1
Constructs new instance and loads configuration
public BossBar(TAB tab) { this.tab = tab; disabledWorlds = tab.getConfiguration().getConfig().getStringList("disable-features-in-"+tab.getPlatform().getSeparatorType()+"s.bossbar", Arrays.asList("disabled" + tab.getPlatform().getSeparatorType())); toggleCommand = tab.getConfiguration().getBossbarConfig().getString("bossbar-toggle-command", "/bossbar"); defaultBars = tab.getConfiguration().getBossbarConfig().getStringList("default-bars", new ArrayList<>()); permToToggle = tab.getConfiguration().getBossbarConfig().getBoolean("permission-required-to-toggle", false); hiddenByDefault = tab.getConfiguration().getBossbarConfig().getBoolean("hidden-by-default", false); perWorld = tab.getConfiguration().getBossbarConfig().getConfigurationSection("per-world"); for (Object bar : tab.getConfiguration().getBossbarConfig().getConfigurationSection("bars").keySet()){ getLines().put(bar.toString(), BossBarLine.fromConfig(bar.toString())); } for (String bar : new ArrayList<>(defaultBars)) { if (getLines().get(bar) == null) { tab.getErrorManager().startupWarn("BossBar \"&e" + bar + "&c\" is defined as default bar, but does not exist! &bIgnoring."); defaultBars.remove(bar); } } for (Entry<String, List<String>> entry : perWorld.entrySet()) { List<String> bars = entry.getValue(); for (String bar : new ArrayList<>(bars)) { if (getLines().get(bar) == null) { tab.getErrorManager().startupWarn("BossBar \"&e" + bar + "&c\" is defined as per-world bar in world &e" + entry.getKey() + "&c, but does not exist! &bIgnoring."); bars.remove(bar); } } } rememberToggleChoice = tab.getConfiguration().getBossbarConfig().getBoolean("remember-toggle-choice", false); if (isRememberToggleChoice()) { bossbarOffPlayers = tab.getConfiguration().getPlayerData("bossbar-off"); } TAB.getInstance().getPlaceholderManager().getAllUsedPlaceholderIdentifiers().add("%countdown%"); TAB.getInstance().getPlaceholderManager().registerPlaceholder(new ServerPlaceholder("%countdown%", 100) { @Override public String get() { return String.valueOf((getAnnounceEndTime() - System.currentTimeMillis()) / 1000); } }); tab.debug(String.format("Loaded Bossbar feature with parameters disabledWorlds=%s, toggleCommand=%s, defaultBars=%s, permToToggle=%s, hiddenByDefault=%s, perWorld=%s, remember_toggle_choice=%s", disabledWorlds, toggleCommand, defaultBars, isPermToToggle(), hiddenByDefault, perWorld, isRememberToggleChoice())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Config()\n {\n // Load from properties file:\n loadLocalConfig();\n // load the system property overrides:\n getExternalConfig();\n }", "private Config()\n {\n try\n {\n // Load settings from file\n load();\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }", "public Config() {\n this(System.getProperties());\n\n }", "private ConfigurationModel() {\r\n\tloadConfiguration();\r\n }", "private Config() {\n }", "protected Configuration() {\r\n }", "private ConfigReader() {\r\n\t\tsuper();\r\n\t}", "public ConfigsUtils() {\r\n mConfig = new Properties();\r\n try {\r\n mConfig.load(new FileInputStream(CONFIG_FILE_PATH));\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public ConfigExample() {\n }", "private ConfigProperties() {\n\n }", "public Config() {\n\t\t// TODO Auto-generated constructor stub\n\t\t\n\t}", "@Override\n public void init() throws Exception {\n config = new Config();\n }", "public OServerConfiguration() {}", "protected abstract void initializeImpl(Map<String,String> configuration);", "private OptimoveConfig() {\n }", "public void init(Map<String, String> configuration);", "public Configuration(File configFile) {\r\n \t\tproperties = loadProperties(configFile);\r\n \t}", "public Properties() {\n\n\t\tconfig = new java.util.Properties();\n\n\t\ttry {\n\t\t\tInputStream input = new FileInputStream(new File(\n\t\t\t\t\t\"ConfigurationFile.txt\"));\n\t\t\tconfig.load(input);\n\n\t\t} catch (Exception e) {\n\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public IheConfiguration() {\n }", "public BaseClass() {\n\t\t \n\t try {\n\t\t\t \n\t\t\t prop=new Properties();\n\t\t\t \n\t\t\tString path=System.getProperty(\"user.dir\");\n\t\t\t \n\t\t\t // FileInputStream is the pre-defined class\n\t\t\tFileInputStream ip=new FileInputStream(path+\"\\\\src\\\\main\\\\java\\\\com\\\\demoQA\\\\config\\\\Config.Properties\");\n\t\t\t prop.load(ip);\n\t\t} catch (FileNotFoundException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \n\t\t \n\t }", "public WorkflowConfiguration() {\n\t\t\n\t}", "private void GetConfig()\n {\n boolean useClassPath = false;\n if(configFile_ == null)\n {\n useClassPath = true;\n configFile_ = \"data.config.lvg\";\n }\n // read in configuration file\n if(conf_ == null)\n {\n conf_ = new Configuration(configFile_, useClassPath);\n }\n }", "public TestBase() {\n try {\n properties = new Properties();\n FileInputStream fileInputStream = new FileInputStream(\"F:/LearningStuff/PracticalWork\" +\n \"/Frameworks/DataDrivenFrameworkSelenium/src/main/resources/config/config.properties\");\n properties.load(fileInputStream);\n } catch (FileNotFoundException f) {\n f.printStackTrace();\n } catch (IOException i) {\n i.printStackTrace();\n }\n }", "public void loadConfig() {\n\t}", "void init(Config config);", "public static Config getInstance() {\r\n\t\tif (instance == null) {\r\n\t\t\tGson gson = new Gson();\r\n\t\t\ttry {\r\n\t\t\t\tinstance = gson.fromJson(FileUtil.getResourceContent(\"config.data\"), Config.class);\r\n\t\t\t} catch (IOException ex) {\r\n\t\t\t\tSystem.err.println(ex.getMessage());\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn instance;\r\n\t}", "public MecBasicsConfig()\n {\n\n }", "private GameConfig() {}", "public CrawlerConfiguration() {\n\t\tinitConfiguration();\n\t}", "public static void initialize() {\n \tinitialize(new Configuration().configure());\n }", "public ConfigFileReader(){\r\n\t\tBufferedReader reader;\r\n\t\ttry {\r\n\t\t\treader = new BufferedReader(new FileReader(propertyFilePath));\r\n\t\t\tproperties = new Properties();\r\n\t\t\ttry {\r\n\t\t\t\tproperties.load(reader);\r\n\t\t\t\treader.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}catch(FileNotFoundException ex) {\r\n\t\t\tSystem.out.println(\"Configuration.properties not found at \"+propertyFilePath);\r\n\t\t}\r\n\t}", "@Override\n public void init()\n throws InitializationException\n {\n // Create a default configuration.\n String[] def = new String[]\n {\n DEFAULT_RUN_DATA,\n DEFAULT_PARAMETER_PARSER,\n DEFAULT_COOKIE_PARSER\n };\n configurations.put(DEFAULT_CONFIG, def.clone());\n\n // Check other configurations.\n Configuration conf = getConfiguration();\n if (conf != null)\n {\n String key,value;\n String[] config;\n String[] plist = new String[]\n {\n RUN_DATA_KEY,\n PARAMETER_PARSER_KEY,\n COOKIE_PARSER_KEY\n };\n for (Iterator<String> i = conf.getKeys(); i.hasNext();)\n {\n key = i.next();\n value = conf.getString(key);\n int j = 0;\n for (String plistKey : plist)\n {\n if (key.endsWith(plistKey) && key.length() > plistKey.length() + 1)\n {\n key = key.substring(0, key.length() - plistKey.length() - 1);\n config = (String[]) configurations.get(key);\n if (config == null)\n {\n config = def.clone();\n configurations.put(key, config);\n }\n config[j] = value;\n break;\n }\n j++;\n }\n }\n }\n\n\t\tpool = (PoolService)TurbineServices.getInstance().getService(PoolService.ROLE);\n\n if (pool == null)\n {\n throw new InitializationException(\"RunData Service requires\"\n + \" configured Pool Service!\");\n }\n\n parserService = (ParserService)TurbineServices.getInstance().getService(ParserService.ROLE);\n\n if (parserService == null)\n {\n throw new InitializationException(\"RunData Service requires\"\n + \" configured Parser Service!\");\n }\n\n setInit(true);\n }", "private AuditYamlConfigurationLoader(Properties properties)\n {\n this.properties = new Properties(properties);\n }", "public ConfigManager() {\n // Nobody here.\n }", "public SimulationConfig() {\r\n\t}", "public abstract CONFIG build();", "private PropertiesLoader() {\r\n\t\t// not instantiable\r\n\t}", "protected abstract void _init(DynMap config);", "public abstract Configuration configuration();", "public PanoramaConfig() {\n }", "public abstract void loaded() throws ConfigurationException;", "private ProjectConfigurationFactory()\n {}", "public MicroConfiguration() {\n this(\n System.getProperty(\"piranha.version\", MicroConfiguration.class.getPackage().getImplementationVersion()),\n System.getProperty(\"piranha.extensions\", \"micro-core,micro\"),\n System.getProperty(\"piranha.dependencies\", \"\"),\n System.getProperty(\"piranha.repositories\", \"https://repo1.maven.org/maven2\"),\n Boolean.valueOf(System.getProperty(\"piranha.offline\", \"false\")),\n Integer.valueOf(System.getProperty(\"piranha.port\", \"8080\")),\n System.getProperty(\"piranha.root\"),\n System.getProperty(\"piranha.http.server\", \"impl\"),\n\n\n null,\n null,\n null);\n }", "public FtlConfig() {\n cfg = new Configuration(Configuration.VERSION_2_3_30);\n cfg.setClassLoaderForTemplateLoading(this.getClass().getClassLoader(), \"ftl\");\n cfg.setDefaultEncoding(\"UTF-8\");\n cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);\n cfg.setSharedVariable(\"random\",\n new BeansWrapperBuilder(Configuration.VERSION_2_3_30).build().getStaticModels());\n cfg.setLogTemplateExceptions(false);\n cfg.setWrapUncheckedExceptions(true);\n cfg.setFallbackOnNullLoopVariable(false);\n }", "private ApiConfig() {\n }", "private AppConfigLoader() {\r\n\r\n\t\tProperties appConfigPropertySet = new Properties();\r\n\t\tProperties envConfigPropertySet = new Properties();\r\n\r\n\t\ttry {\r\n\r\n\t\t\t// read properties file\r\n\t\t\tInputStream appConfigPropertyStream = AppConfigLoader.class\r\n\t\t\t\t\t.getResourceAsStream(\"/config/baseAppConfig.properties\");\r\n\t\t\tappConfigPropertySet.load(appConfigPropertyStream);\r\n\r\n\t\t\tInputStream envConfigPropertyStream = null;\r\n\r\n\t\t\t// check if current environment is defined (QA, Integration or Staging)\r\n\t\t\tif (System.getProperty(\"environment\") != null) {\r\n\t\t\t\tenvConfigPropertyStream = AppConfigLoader.class\r\n\t\t\t\t\t\t.getResourceAsStream(\"/config/\" + System.getProperty(\"environment\") + \"/appConfig.properties\");\r\n\t\t\t\tSystem.out.println(\"********'ENVIRONMENT Details taken from Runtime'********\");\r\n\t\t\t\tSystem.out.println(\"********'\" + System.getProperty(\"environment\") + \" ENVIRONMENT'********\");\r\n\t\t\t\tenvironment = System.getProperty(\"environment\");\r\n\t\t\t} else {\r\n\t\t\t\tenvConfigPropertyStream = AppConfigLoader.class.getResourceAsStream(\r\n\t\t\t\t\t\t\"/config/\" + appConfigPropertySet.getProperty(\"CurrentEnvironment\") + \"/appConfig.properties\");\r\n\t\t\t\tSystem.out.println(\"********'ENVIRONMENT Details taken from Baseapp config property file'********\");\r\n\t\t\t\tSystem.out.println(\r\n\t\t\t\t\t\t\"********'\" + appConfigPropertySet.getProperty(\"CurrentEnvironment\") + \" ENVIRONMENT'********\");\r\n\t\t\t\tenvironment = appConfigPropertySet.getProperty(\"CurrentEnvironment\");\r\n\t\t\t}\r\n\r\n\t\t\tenvConfigPropertySet.load(envConfigPropertyStream);\r\n\r\n\t\t\tthis.sampleURL = envConfigPropertySet.getProperty(\"SampleUrl\");\r\n\t\t\tthis.sampleAPIURL = envConfigPropertySet.getProperty(\"SampleAPIUrl\");\r\n\r\n\t\t\tthis.sampleDbConnectionString = envConfigPropertySet.getProperty(\"SampleConnectionString\");\r\n\r\n\t\t\tenvConfigPropertyStream.close();\r\n\t\t\tappConfigPropertyStream.close();\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public StorageConfiguration() {\n }", "public ConfigFileReader(){\r\n\t\t \r\n\t\t BufferedReader reader;\r\n\t\t try {\r\n\t\t\t reader = new BufferedReader(new FileReader(propertyFilePath));\r\n\t\t\t properties = new Properties();\r\n\t\t\t try {\r\n\t\t\t\t properties.load(reader);\r\n\t\t\t\t reader.close();\r\n\t\t\t } catch (IOException e) {\r\n\t\t\t\t e.printStackTrace();\r\n\t\t\t }\r\n\t\t } catch (FileNotFoundException e) {\r\n\t\t\t e.printStackTrace();\r\n\t\t\t throw new RuntimeException(\"configuration.properties not found at \" + propertyFilePath);\r\n\t \t } \r\n\t }", "private Conf() {\n // empty hidden constructor\n }", "public PushPluginConfigurationImpl() {\n }", "private static void makeInstance(){\n\n if(settingsFile==null){\n settingsFile = new MetadataFile(SETTINGS_FILE_PATH);\n }\n\n if(!settingsFile.exists()){\n settingsFile.create();\n }\n\n if(tagListeners==null){\n tagListeners= new HashMap<>();\n }\n\n }", "public Configuration() {\r\n\t\tthis.serverAddress = \"127.0.0.1\";\r\n\t\tthis.serverPort = \"2586\";\r\n\t}", "void init (Map<String, String> conf) throws ConfigException;", "private Configuration(String location) {\n this.location = location;\n }", "public ApplicationContext() {\n FileInputStream in;\n props = new Properties();\n try {\n in = new FileInputStream(\"gamesettings.properties\");\n props.load(in);\n } catch (FileNotFoundException ex) {\n props.setProperty(\"name\", \"Player\");\n props.setProperty(\"url\", \"0.0.0.0\");\n \n } catch (IOException ex) {\n props.setProperty(\"name\", \"Player\");\n props.setProperty(\"url\", \"0.0.0.0\");\n }\n }", "public PipelineConfig() {\n super();\n }", "private void init() {\n String METHOD = Thread.currentThread().getStackTrace()[1].getMethodName();\n String msg = null;\n String type = ConstantsIF.RESOURCE;\n ConfigurationIF config = null;\n JSONObject json = null;\n Map<String, String> map = null;\n\n _logger.entering(CLASS, METHOD);\n\n /*\n * Get JSON data from the Config object via the Config Manager\n */\n config = _configMgr.getConfiguration(type);\n\n if (config != null) {\n json = config.getJSON();\n if (json == null) {\n msg = CLASS + \": \" + METHOD + \": JSON data for '\" + type + \"' is null\";\n this.setError(true);\n }\n } else {\n msg = CLASS + \": \" + METHOD + \": Configuration for '\" + type + \"' is null\";\n this.setError(true);\n }\n\n /*\n * setup the Mongo Data Access Object\n */\n if (_MongoDAO == null) {\n map = JSON.convertToParams(JSON.getObject(json, ConfigIF.RS_NOSQL));\n\n try {\n _MongoDAO = MongoFactory.getInstance(map);\n } catch (Exception ex) {\n msg = CLASS + \": \" + METHOD + \": Mongo DAO:\" + ex.getMessage();\n this.setError(true);\n }\n }\n\n if (!this.isError()) {\n this.setState(STATE.READY);\n } else {\n this.setState(STATE.ERROR);\n this.setStatus(msg);\n _logger.log(Level.SEVERE, msg);\n }\n\n _logger.exiting(CLASS, METHOD);\n\n return;\n }", "private void initConfig() {\n Path walletPath;\n Wallet wallet;\n\n // load a CCP\n Path networkConfigPath; \n \n try {\n \t\n \tif (!isLoadFile) {\n // Load a file system based wallet for managing identities.\n walletPath = Paths.get(\"wallet\");\n wallet = Wallet.createFileSystemWallet(walletPath);\n\n // load a CCP\n networkConfigPath = Paths.get(\"\", \"..\", \"basic-network\", configFile);\n \n builder = Gateway.createBuilder();\n \n \tbuilder.identity(wallet, userId).networkConfig(networkConfigPath).discovery(false);\n \t\n \tisLoadFile = true;\n \t}\n } catch (Exception e) {\n \te.printStackTrace();\n \tthrow new RuntimeException(e);\n }\n\t}", "public StorageConfig() {\n }", "public static Configuration getInstance() {\r\n if (INSTANCE == null)\r\n INSTANCE = new Configuration();\r\n else\r\n INSTANCE.loadConfigurationFromDisk();\r\n\r\n return INSTANCE;\r\n }", "public BaseConfig() {\n\t\tlong current = System.currentTimeMillis();\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTimeInMillis(current);\n\t\tthis.start_hours = cal.get(Calendar.HOUR_OF_DAY);\n\t\tthis.start_minutes = cal.get(Calendar.MINUTE);\n\t\tthis.stop_hours = this.start_hours;\n\t\tthis.stop_minutes = this.start_minutes;\n\t\tthis.force_on = false;\n\t\tthis.force_off = false;\n\t\tthis.sensor_type = SensorType.LIGHT;\n\t\tthis.sensing_threshold = .5f;\n\t\tthis.sensorInterval = 3000;\n\t\t/*String address;\n\t\ttry {\n\t\t\taddress = InetAddress.getLocalHost().toString();\n\t\t\taddress = address.substring(address.indexOf('/') + 1);\n\t\t\tserverIP = address;\n\t\t\tserverPort = 9999;\n\t\t} catch (UnknownHostException e) {\n\t\t\t// Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}*/\n\t\t\n\t}", "private void init() {\r\n this.configMapping = ChannelConfigHolder.getInstance().getConfigs();\r\n if (!isValid(this.configMapping)) {\r\n SystemExitHelper.exit(\"Cannot load the configuations from the configuration file please check the channelConfig.xml\");\r\n }\r\n }", "private static synchronized void init() {\n if (CONFIG_VALUES != null) {\n return;\n }\n\n CONFIG_VALUES = new Properties();\n processLocalConfig();\n processIncludedConfig();\n }", "public static void load() {\n try {\n File confFile = SessionService.getConfFileByPath(Const.FILE_CONFIGURATION);\n UtilSystem.recoverFileIfRequired(confFile);\n // Conf file doesn't exist at first launch\n if (confFile.exists()) {\n // Now read the conf file\n InputStream str = new FileInputStream(confFile);\n try {\n properties.load(str);\n } finally {\n str.close();\n }\n }\n } catch (Exception e) {\n Log.error(e);\n Messages.showErrorMessage(114);\n }\n }", "public PropertiesFileConfigurationLoader() {\r\n\r\n Method[] declaredMethods = Builder.class.getDeclaredMethods();\r\n\r\n for (Method method : declaredMethods) {\r\n\r\n this.methods.put(method.getName(), method);\r\n }\r\n }", "public SourceTypeConfiguration() {\n\n\t}", "private void configInit() {\r\n\t\tconfig = pluginInstance.getConfiguration();\r\n\t\tif (!new File(pluginInstance.getDataFolder().getPath() + File.separator + \"config.yml\")\r\n\t\t\t\t.exists()) {\r\n\t\t\tconfig.setProperty(\"reset-deathloc\", true);\r\n\t\t\tconfig.setProperty(\"use-iConomy\", true);\r\n\t\t\tconfig.setProperty(\"creation-price\", 10.0D);\r\n\t\t\tconfig.setProperty(\"deathtp-price\", 50.0D);\r\n\t\t\tconfig.setProperty(\"allow-tp\", true);\r\n\t\t\tconfig.setProperty(\"maxTombStone\", 0);\r\n\t\t\tconfig.setProperty(\"TombKeyword\", \"[Tomb]\");\r\n\t\t\tconfig.setProperty(\"use-tombAsSpawnPoint\", true);\r\n\t\t\tconfig.setProperty(\"cooldownTp\", 5.0D);\r\n\t\t\tconfig.setProperty(\"reset-respawn\", false);\r\n\t\t\tconfig.setProperty(\"maxDeaths\", 0);\r\n\t\t\tconfig.save();\r\n\t\t\tworkerLog.info(\"Config created\");\r\n\t\t}\r\n\t\tconfig.load();\r\n\t}", "public SuperPeer initialize() {\n try {\n // read config file (e.g., all-to-all.config, linear.config)\n Scanner sc = new Scanner(new FileInputStream(this.config));\n\n // process each line\n while (sc.hasNextLine()) {\n // parse and decompose line\n String[] line = sc.nextLine().split(\" \");\n String type = line[0];\n IPv4 peer;\n\n switch (type) {\n case \"c\":\n break;\n case \"s\":\n // SuperPeer definition: 'other' is neighbor to associate with this SuperPeer\n peer = new IPv4(line[1]);\n if (this.equals(peer)) {\n this.neighbors.add(line[2]);\n }\n break;\n case \"p\":\n // peer definition: 'other' is peer to associate with this SuperPeer\n peer = new IPv4(line[1]);\n if (this.equals(peer)) {\n this.leafs.add(line[2]);\n }\n break;\n default:\n this.log(String.format(\"Unknown type '%s'. Ignoring...\", type));\n break;\n }\n }\n sc.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return this;\n }", "public void initialize() {\n if (!BungeeBan.getInstance().getDataFolder().exists()) {\n BungeeBan.getInstance().getDataFolder().mkdirs();\n }\n File file = this.getConfigurationFile();\n if (!file.exists()) {\n try {\n file.createNewFile();\n if (this.defaultConfig != null) {\n try (InputStream is = BungeeBan.getInstance().getResourceAsStream(this.defaultConfig);\n OutputStream os = new FileOutputStream(file)) {\n ByteStreams.copy(is, os);\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n this.reload();\n }", "private void load() {\n if (loaded) {\n return;\n }\n loaded = true;\n\n if(useDefault){\n ConfigFileLoader.setSource(\n new MhttpdBaseConfigurationSource(\n Bootstrap.getMhttpdBaseFile(), \"server-embed.xml\"));\n }else {\n ConfigFileLoader.setSource(\n new MhttpdBaseConfigurationSource(\n Bootstrap.getMhttpdBaseFile(), getConfigFile()));\n }\n Digester digester = createStartDigester();\n try (ConfigurationSource.Resource resource = ConfigFileLoader.getSource().getServerXml()) {\n InputStream inputStream = resource.getInputStream();\n InputSource inputSource = new InputSource(resource.getUri().toURL().toString());\n inputSource.setByteStream(inputStream);\n digester.push(this);\n digester.parse(inputSource);\n } catch (Exception e) {\n return;\n }\n\n }", "private AppConfigContent() {}", "void construct() throws FndException\n {\n if (DEBUG) debug(\"ASPConfig.construct()\");\n String cfgdir = getASPManager().getASPConfigFileDir();\n\n synchronized(getClass())\n {\n configfile = ASPConfigFile.getDir(cfgdir);\n if( !configfile.initialized ) configfile.construct(getASPPage());\n }\n parameters = (Hashtable)configfile.params.clone();\n srv_fmt = (ServerFormatter)configfile.srv_fmt.clone();\n }", "private void initialiseByHand() {\n Configuration production = new Configuration(\"api.example.com\", false, 2000);\n Configuration staging = new Configuration(\"api-staging.example.com\", false, 2000);\n Configuration debug = new Configuration(\"api-dev.example.com\", true, 1000);\n Map<String, Configuration> baseVariants = new HashMap<>();\n baseVariants.put(PRODUCTION, production);\n baseVariants.put(STAGING, staging);\n baseVariants.put(DEBUG, debug);\n Neanderthal.initialise(this, baseVariants, PRODUCTION);\n }", "public ConfigurationMaintainer() {\n\t}", "public T loadConfig(File file) throws IOException;", "public ConfigParserHandler() {\n\t}", "static ConfigImpl load(Path source) {\n log.info(\"Loading config from \" + source);\n\n ConfigImpl ret = null;\n\n if (Files.exists(source)) {\n try {\n try {\n ret = loadJson(source);\n } catch (JsonParseException e) {\n // It's invalid Json ... maybe it is a properties file instead?\n ret = loadProperties(source);\n }\n } catch (IOException e) {\n log.info(\"Failed to load config file \" + source + \". Assuming empty config\", e);\n }\n } else {\n log.info(\"Config source \" + source + \" not found. Assuming empty config\");\n }\n\n if (ret == null) {\n ret = new ConfigImpl();\n }\n\n return ret;\n }", "private OspfConfigUtil() {\n\n }", "public ConfigMetadataProcessor() {\n }", "public ConfigFile(String fileName, String encoding) {\n InputStream inputStream = null;\n try {\n inputStream = getClassLoader().getResourceAsStream(fileName); // properties.load(ConfigFile.class.getResourceAsStream(fileName));\n if (inputStream == null) {\n throw new IllegalArgumentException(\"Properties file not found in classpath: \" + fileName);\n }\n\n properties = new Properties();\n if (fileName.endsWith(\"yml\")){\n isYml = true;\n properties= new Yaml().loadAs(new InputStreamReader(inputStream, encoding),Properties.class);\n }else\n properties.load(new InputStreamReader(inputStream, encoding));\n } catch (IOException e) {\n throw new RuntimeException(\"Error loading properties file.\", e);\n } finally {\n if (inputStream != null) try {\n inputStream.close();\n } catch (IOException e) {\n LogKit.error(e.getMessage(), e);\n }\n }\n }", "public void newConfig ()\n {\n Class<?> clazz = group.getRawConfigClasses().get(0);\n try {\n ManagedConfig cfg = (ManagedConfig)PreparedEditable.PREPARER.apply(\n clazz.newInstance());\n if (cfg instanceof DerivedConfig) {\n ((DerivedConfig)cfg).cclass = group.getConfigClass();\n }\n newNode(cfg);\n } catch (Exception e) {\n log.warning(\"Failed to instantiate config [class=\" + clazz + \"].\", e);\n }\n }", "public void loadConfigs() {\n\t configYML = new ConfigYML();\n\t configYML.setup();\n }", "public PackageBuilderConfiguration(ClassLoader classLoader,\r\n Properties properties) {\r\n init( classLoader,\r\n properties );\r\n }", "private void init() {\n\t\tif ( PropertiesConfigurationFilename == null ) {\n\t\t\tlogger.info(\"config.properties is default\");\n\t\t\tconfigProp = createDefaultProperties();\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tlogger.info(\"config.properties is \"+ PropertiesConfigurationFilename.getAbsolutePath());\n\t\t\t\tconfigProp = new PropertiesConfiguration();\n\t\t\t\tconfigProp.load(PropertiesConfigurationFilename);\n\t\t\t} catch (ConfigurationException e) {\n\t\t\t\tlogger.error(\"Unable to open config file: \" + PropertiesConfigurationFilename.getAbsolutePath(), e);\n\t\t\t\tlogger.info(\"config.properties is default\");\n\t\t\t\tconfigProp = createDefaultProperties();\n\t\t\t}\n\t\t}\n\n\n\t\t// Load the locale information\n\t\tString locale = configProp.getString(\"locale\");\n\n\t\tconfigProp.setProperty(\"zmMsg\", ResourceBundle.getBundle(\"ZmMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"zhMsg\", ResourceBundle.getBundle(\"ZhMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"ajxMsg\", ResourceBundle.getBundle(\"AjxMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"i18Msg\", ResourceBundle.getBundle(\"I18nMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"zsMsg\", ResourceBundle.getBundle(\"ZsMsg\", new Locale(locale)));\n\n\t}", "public ValidateConfiguration() {\n super();\n }", "public Configuration(Properties props) {\n test = Boolean.valueOf(props.getProperty(\"test\", \"false\"));\n name = props.getProperty(\"name\", \"OpenCraft Server\");\n message = props.getProperty(\"message\", \"http://opencraft.sf.net/\");\n maximumPlayers = Integer.valueOf(props.getProperty(\"max_players\", \"16\"));\n publicServer = Boolean.valueOf(props.getProperty(\"public\", \"false\"));\n verifyNames = Boolean.valueOf(props.getProperty(\"verify_names\", \"false\"));\n spongeRadius = Integer.valueOf(props.getProperty(\"sponge_radius\", \"2\"));\n gameMode = props.getProperty(\"game_mode\", CTFGameMode.class.getName());\n statsPostURL = props.getProperty(\"statsPostURL\");\n discordURL = props.getProperty(\"discordURL\");\n discordToken = props.getProperty(\"discordToken\");\n welcomeMessage = props.getProperty(\"welcomeMessage\");\n Constants.PORT = Integer.valueOf(props.getProperty(\"port\"));\n Constants.WEB_PORT = Integer.valueOf(props.getProperty(\"webPort\"));\n }", "public Config createConfig(String filename);", "public ExcelImportConfig() {\n super();\n }", "public Computer() {\n\t\tconfiguration = new HashMap<>();\n\t}", "public static void load() {\n tag = getPlugin().getConfig().getString(\"Tag\");\n hologram_prefix = getPlugin().getConfig().getString(\"Prefix\");\n hologram_time_fixed = getPlugin().getConfig().getBoolean(\"Hologram_time_fixed\");\n hologram_time = getPlugin().getConfig().getInt(\"Hologram_time\");\n hologram_height = getPlugin().getConfig().getInt(\"Hologram_height\");\n help_message = getPlugin().getConfig().getStringList(\"Help_message\");\n hologram_text_lines = getPlugin().getConfig().getInt(\"Max_lines\");\n special_chat = getPlugin().getConfig().getBoolean(\"Special_chat\");\n radius = getPlugin().getConfig().getBoolean(\"Radius\");\n radius_distance = getPlugin().getConfig().getInt(\"Radius_distance\");\n chat_type = getPlugin().getConfig().getInt(\"Chat-type\");\n spectator_enabled = getPlugin().getConfig().getBoolean(\"Spectator-enabled\");\n dataType = getPlugin().getConfig().getInt(\"Data\");\n mySQLip = getPlugin().getConfig().getString(\"Server\");\n mySQLDatabase = getPlugin().getConfig().getString(\"Database\");\n mySQLUsername = getPlugin().getConfig().getString(\"Username\");\n mySQLPassword = getPlugin().getConfig().getString(\"Password\");\n\n }", "public ExamMagicDataModule(Configuration config){\r\n\t\tthis.config = config;\r\n\t}", "public BaseTest() {\n\n String path = System.getProperty(\"user.dir\") + \"/src/test/resources/config.properties\";\n prop = new Properties();\n /** Stream to read the spreadsheet. */\n FileInputStream fis = null;\n try {\n fis = new FileInputStream(path);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n try {\n prop.load(fis);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n }", "public SimpleXMLPipelineConfiguration() {\n configurations = new HashMap();\n }", "private static void loadConfig() {\n\t\trxID = (Integer) ConfigStoreRedstoneWireless.getInstance(\n\t\t\t\t\"WirelessRedstone\").get(\"Receiver.ID\", Integer.class,\n\t\t\t\tnew Integer(rxID));\n\t\ttxID = (Integer) ConfigStoreRedstoneWireless.getInstance(\n\t\t\t\t\"WirelessRedstone\").get(\"Transmitter.ID\", Integer.class,\n\t\t\t\tnew Integer(txID));\n\t}", "public KedaConfiguration() {\n }", "public ServerConfigImpl() {\n this.expectations = new ExpectationsImpl(globalEncoders, globalDecoders);\n this.requirements = new RequirementsImpl();\n }", "public static void readConfiguration() throws IOException {\n synchronized (Configuration.class) {\n Properties props = new Properties();\n InputStream is = new FileInputStream(Constants.ROOT_PATH + \"/opencraft.properties\");\n try {\n props.load(is);\n configuration = new Configuration(props);\n } finally {\n is.close();\n }\n }\n }", "public static Configuration constructFromYamlFile(String path) {\r\n\t\tFileManager fm = new FileManager(path);\r\n\t\t\r\n\t\tString serverAddress = fm.getString(\"server-properties.address\");\r\n\t\tString serverPort = fm.getString(\"server-properties.port\");\r\n\t\t\r\n//\t\tSystem.out.println(serverAddress + \":\" + serverPort);\r\n\t\t\r\n\t\treturn new Configuration(serverAddress, serverPort);\r\n\t}", "private void initalConfig() {\n \t\tconfig = new Configuration(new File(getDataFolder(),\"BeardStat.yml\"));\n \t\tconfig.load();\n \t\tconfig.setProperty(\"stats.database.type\", \"mysql\");\n \t\tconfig.setProperty(\"stats.database.host\", \"localhost\");\n \t\tconfig.setProperty(\"stats.database.username\", \"Beardstats\");\n \t\tconfig.setProperty(\"stats.database.password\", \"changeme\");\n \t\tconfig.setProperty(\"stats.database.database\", \"stats\");\n \n \t\tconfig.save();\n \t}", "public void init() {\n this.properties = loadProperties(\"/project3.properties\");\n }", "private ConfigurationKeys() {\n // empty constructor.\n }" ]
[ "0.7210464", "0.7115091", "0.7019286", "0.6987587", "0.6877753", "0.6842131", "0.66892254", "0.66276145", "0.65854377", "0.65282816", "0.6498849", "0.6436363", "0.6388046", "0.6381612", "0.63674015", "0.63630545", "0.63493854", "0.63446146", "0.6342706", "0.6339595", "0.6328311", "0.62649524", "0.62563485", "0.62465715", "0.6245208", "0.6242108", "0.6238516", "0.6231882", "0.6228236", "0.6206802", "0.62050277", "0.6199455", "0.6185042", "0.61645865", "0.615429", "0.6149764", "0.6143694", "0.61299187", "0.61236614", "0.61230093", "0.6122549", "0.61062825", "0.610232", "0.6070797", "0.6060654", "0.6056445", "0.6046429", "0.60437435", "0.6036627", "0.60349417", "0.60313517", "0.6030333", "0.60272616", "0.6023569", "0.6017584", "0.6004471", "0.59907264", "0.5989421", "0.59891886", "0.59805226", "0.59653664", "0.5963578", "0.59514177", "0.59473586", "0.593799", "0.5937028", "0.59338063", "0.5897208", "0.5895439", "0.5886877", "0.5880653", "0.5871312", "0.586901", "0.5866047", "0.5855597", "0.5844137", "0.5842281", "0.5841059", "0.58388054", "0.58371204", "0.5825035", "0.58246166", "0.58094954", "0.57982", "0.57894224", "0.57847124", "0.57826227", "0.57779235", "0.5774966", "0.5773889", "0.5769087", "0.5767923", "0.57660145", "0.5762814", "0.5761584", "0.57596755", "0.57581973", "0.5750842", "0.57484204", "0.5746682", "0.57456285" ]
0.0
-1
Clears and resends all bossbars to specified player
public void detectBossBarsAndSend(TabPlayer p) { p.getActiveBossBars().clear(); if (playersInDisabledWorlds.contains(p) || !p.hasBossbarVisible()) return; showBossBars(p, defaultBars); showBossBars(p, getAnnouncements()); showBossBars(p, perWorld.get(tab.getConfiguration().getWorldGroupOf(perWorld.keySet(), p.getWorldName()))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void run() {\n for(MessageManager temp : plugin.playerBossBars.values()){\n if(temp.bossBar.getPlayers().size() > 0){\n temp.advanceBar();\n\n BossBarMessage currentMessage = temp.getCurrentMessageObject();\n temp.bossBar.setTitle(currentMessage.barMessage);\n temp.bossBar.setColor(currentMessage.barColor);\n temp.bossBar.setStyle(currentMessage.barStyle);\n }\n }\n }", "public void bossReset(){\n bossTimer.start();\n this.getView().setTranslateX(x);\n this.getView().setTranslateY(y);\n this.getView().setRotate(0);\n bossTimer.start();\n setHitPoints(getDefaultHp());\n }", "public void killAllArmorstands(JuggernautPlayer player){\n player.removeEntities(armorstandProgressbarID, armorstandItemID, armorstandClaimProgressID, armorstandResetChestID, armorstandInfoID, armorstandClaimInfoID);\n }", "protected void withdrawAll(Player player) {\n\t\tItemContainer container = this.item_containers.get(player);\n\n\t\tif (container.isEmpty()) {\n\t\t\tplayer.message(\"There is nothing in this container to withdraw!\");\n\t\t\treturn;\n\t\t}\n\t\tplayer.inventory.addAll(container);\n\t\tcontainer.clear();\n\t\tupdateOfferComponents();\n\t}", "private synchronized void sendDecreaceHealth(){\r\n\t\t\tfor(PrintWriter p : players){\r\n\t\t\t\tif(p != null){\r\n\t\t\t\t\tp.println(\"6\");\r\n\t\t\t\t\tp.println(Integer.toString(x));\r\n\t\t\t\t\tp.println(Integer.toString(y));\r\n\t\t\t\t\tp.flush();\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\t\r\n\t\t}", "private void endFreeze(Player player) {\r\n\t\tFrozenPlayerInfo info = frozenPlayers.remove(player.getUniqueId());\r\n\r\n\t\t// Again, two packets are sent, though we do not modify them this time.\r\n\t\tplayer.setAllowFlight(info.allowFlight);\r\n\t\tplayer.setFlying(info.isFlying);\r\n\t}", "public static void resetMana(Player player) {\n\t\tif (mode!=Mode.BOSSBAR) return;\n\t\tProfile profile = Profile.loadOrCreate(player);\n\t\tif (!manaBar.containsKey(player.getUniqueId())) {\n\t\t\tServerBossBar bar = ServerBossBar.builder().from(baseBar).percent(1f).build();\n\t\t\tbar.addPlayer(player);\n\t\t\tmanaBar.put(player.getUniqueId(), bar);\n\t\t}\n\t\tif (profile.getRaceData().isPresent()) {\n\t\t\ttry {\n\t\t\t\tvirtualMax.put(player.getUniqueId(), \n\t\t\t\t\t\t(int)engine.evaluate(\n\t\t\t\t\t\t\t\tspawnMana.replace(\"level\", String.valueOf(profile.getRaceData().get().getLevel()))\n\t\t\t\t\t\t\t\t) );\n\t\t\t} catch (Exception e) {\n\t\t\t\tvirtualMax.put(player.getUniqueId(), 10);\n\t\t\t\tWarCraft.w(\"Could not compute mana level!\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tvirtualMana.put(player.getUniqueId(), (double)virtualMax.get(player.getUniqueId()));\n\t\t}\n\t}", "private void showBossBars(TabPlayer p, List<String> bars) {\n\t\tif (bars == null) return;\n\t\tfor (String defaultBar : bars) {\n\t\t\tBossBarLine bar = getLines().get(defaultBar);\n\t\t\tif (bar.isConditionMet(p) && !p.getActiveBossBars().contains(bar)) {\n\t\t\t\tbar.create(p);\n\t\t\t\tp.getActiveBossBars().add(bar);\n\t\t\t}\n\t\t}\n\t}", "public void endBattle() {\n for (BattleEffect btlEff : effectsToRemove) {\n btlEff.remove();\n }\n playerInCombat.resetHealthAndMana();\n }", "public static void clearInventoryCrafting(Player player)\n\t{\n\t\tPlayerInventory inv = player.getInventory();\n\t\tfor(int i = 0; i < 4; i++)\n\t\t\tinv.setItem(1 + i, null);\n\t}", "public void cleanToAll() {\n\t\tfor(ClientThread player: players) {\n\t\t\tplayer.send(new Package(\"CLEAN\",null));\n\t\t}\n\t}", "public void youBrokeSon(){\n\t\tcoinList.clear();\n\t}", "public synchronized void removeTheWarrior(){\n charactersOccupiedTheLocation[0]=null;\n notifyAll();\n }", "public void removeFromQueue(Player player) {\n }", "public static void clearHands()\n\t{\n\t\tfor(int i=0;i<dealersCards.size();)\n\t\t{\n\t\t\tdealersCards.remove(0);\n\t\t}\n\t\tfor(int i=0;i<playersCards.size();)\n\t\t{\n\t\t\tplayersCards.remove(0);\n\t\t}\n\t}", "public void clearBalls();", "public void trackBullets(){\n // bossbullet control, if it hit the bound, remove the bullet\n for(int i = 0; i < bossBullets.size(); i++){\n Bullet tempBullet = bossBullets.get(i);\n tempBullet.update();\n tempBullet.drawBullet();\n // print (tempBullet.posX, tempBullet.posY,'\\n');\n if(tempBullet.detectBound()){\n bossBullets.remove(i);\n continue;\n }\n\n if(tempBullet.hitObject(Main.player) && !Main.player.invincible){\n Main.player.decreaseHealth(1);\n Main.player.posX = width / 2;\n Main.player.posY = height * 9 / 10;\n Main.player.invincible = true;\n Main.player.invincibleTime = millis();\n }\n\n }\n }", "public void killBoss() {\n\t\tSystem.out.println(this.name+\"已经击杀一名敌方英雄...\");\n\t}", "public void flushQueue() {\n // Ignore if queue is empty\n if (playersQueue.isEmpty())\n return;\n\n // Get status of target server\n ServerInfoGetter mainServerInfo = ServerInfoGetter.awaitServerInfo(Config.target);\n\n // Allow player to join the main server - 1s (ping timeout) + ~500ms (connection time) < 2s (interval)\n if (mainServerInfo.isOnline && mainServerInfo.playerCount < Config.maxPlayers && Math.min(Config.maxPlayers - mainServerInfo.playerCount, playersQueue.size()) > 0) {\n try {\n mutex.acquire();\n\n ProxiedPlayer player = null;\n\n // try to find the first player that got not kicked recently\n for (ProxiedPlayer testPlayer : playersQueue) {\n if (kickedPlayers.containsKey(testPlayer)) continue;\n\n player = testPlayer;\n break;\n }\n\n // if no player was found return\n if (player == null) return;\n\n playersQueue.remove(player);\n\n if (player.isConnected()) {\n ProxiedPlayer finalPlayer = player;\n ServerInfo targetServer = ProxyServer.getInstance().getServerInfo(Config.target);\n\n if (isNotConnected(player, targetServer)) {\n Callback<Boolean> cb = (result, error) -> {\n if (result) {\n Main.log(\"flushQueue\", \"§3§b\" + finalPlayer.toString() + \"§3 connected to §b\" + Config.target + \"§3. Queue count is \" + playersQueue.size() + \". Main count is \" + (mainServerInfo.playerCount + 1) + \" of \" + Config.maxPlayers + \".\");\n } else {\n Main.log(\"flushQueue\", \"§c§b\" + finalPlayer.toString() + \"s§c connection to §b\" + Config.target + \"§c failed: \" + error.getMessage());\n finalPlayer.sendMessage(TextComponent.fromLegacyText(\"§cConnection to \" + Config.serverName + \" failed!§r\"));\n playersQueue.add(finalPlayer);\n }\n };\n\n player.sendMessage(TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', Config.messageConnecting) + \"§r\"));\n player.connect(targetServer, cb);\n } else {\n player.disconnect(TextComponent.fromLegacyText(\"§cYou are already connected to \" + Config.serverName + \"!\"));\n Main.log(\"flushQueue\", \"§c§b\" + player.toString() + \"§c was disconnected because there was already a connection for this account to the server.\");\n }\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n mutex.release();\n }\n }\n }", "public static void appendRedemption(Player player) {\n\t\tdouble heal = (player.getMaxPrayer() * 2.5) / 10;\n\t\tplayer.gfx0(436);\n\t\tplayer.prayer = 0;\n\t\tplayer.constitution += heal;\n\t\tplayer.sendMessage(\"Healed \" + heal);\n\t\tplayer.getPA().refreshSkill(3);\n\t\tplayer.getPA().refreshSkill(5);\n\t}", "public void clearBids(){\n this.bids.clear();\n setRequested();\n }", "@Override\r\n public void uncall() {\r\n Player player = MbPets.getInstance().getServer().getPlayer(getOwner());\r\n if (player != null) {\r\n if (getEntity().getInventory().getDecor() != null) {\r\n if (player.getInventory().firstEmpty() >= 0) {\r\n player.getInventory().addItem(getEntity().getInventory().getDecor());\r\n } else {\r\n player.getWorld().dropItemNaturally(player.getLocation(),\r\n getEntity().getInventory().getDecor());\r\n }\r\n }\r\n }\r\n super.uncall();\r\n }", "public void clearingResult() {\n\t\tview.writeLog(\"----All players have stopped drawing cards.----\");\n\t\tcountAllPoints();\n\t\tint dealerPoints = dealer.points;\n\t\tview.writeLog(\"The dealer (\" + dealer.name +\") got \"+ dealerPoints+\" points.\");\n\t\tfor(ClientThread player: players) {\n\t\t\tif(player != dealer) {\n\t\t\t\tif(dealerPoints > player.points) {\t//Losers.\n\t\t\t\t\tplayer.send(new Package(\"MESSAGE\",\"Dealer: \"+dealerPoints +\", you: \"+player.points+\". You lose a stack.\"));\n\t\t\t\t\tplayer.send(new Package(\"END\",-1));\n\t\t\t\t\tlosers ++;\n\t\t\t\t}else if(dealerPoints < player.points){\t//Winners.\n\t\t\t\t\tplayer.send(new Package(\"MESSAGE\",\"Dealer: \"+dealerPoints +\", you: \"+player.points+\". You win a stack.\"));\n\t\t\t\t\tplayer.send(new Package(\"END\",1));\n\t\t\t\t\twinners ++;\n\t\t\t\t}else {\t//Those who have same points with dealer.\n\t\t\t\t\tplayer.send(new Package(\"MESSAGE\",\"Dealer: \"+dealerPoints +\", you: \"+player.points+\". Your stacks remains.\"));\n\t\t\t\t\tplayer.send(new Package(\"END\",0));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Deal with the dealer.\n\t\tint dealerStackChange = losers - winners;\n\t\tview.writeLog(\"The dealer wins \"+ dealerStackChange +\"stack(s).\");\n\t\tdealer.send(new Package(\"MESSAGE\",winners +\" player defeat you, \"+losers+\" lose. Stack change: \"+dealerStackChange));\n\t\tdealer.send(new Package(\"END\", dealerStackChange));\n\t\tendGame();\n\t}", "public static void clearAllInventory(Player player)\n\t{\n\t\tplayer.getInventory().clear();\n\t\tInventoryUtils.clearArmor(player);\n\t\tInventoryUtils.clearInventoryCrafting(player);\n\t\tInventoryUtils.clearCursor(player);\n\t}", "public void kickOut(){\n Iterator<Player> iter = players.iterator();\n while (iter.hasNext()){\n Player player = iter.next();\n if(player.isBankrupt(minBet)){\n iter.remove();\n System.out.println(player + \" runs out of cash!\");\n }\n }\n }", "public void emptyBullets() {\n for(int i = 0; i < bossBullets.size(); i++){\n Bullet tempBullet = bossBullets.get(i);\n bossBullets.remove(i);\n }\n }", "public void dealerOut() {\n\t\tview.writeLog(\"Dealer: \"+PointCounter.countPoint(dealer.clientCards)+\", DEALER OUT!\");\n\t\tint dealerLosingStack = 0;\n\t\tfor(ClientThread player:players) {\n\t\t\tif(player != dealer) {\n\t\t\t\tplayer.send(new Package(\"MESSAGE\",\"The dealer's points is over 21. You win a stack!\"));\n\t\t\t\tplayer.send(new Package(\"END\",1));\n\t\t\t\tdealerLosingStack++;\n\t\t\t}\n\t\t}\n\t\tint dealerStackChange = losers - dealerLosingStack;\n\t\tdealer.send(new Package(\"MESSAGE\",\"Over 21! You lose \"+dealerLosingStack+\" stacks. \"));\t\n\t\tdealer.send(new Package(\"END\",dealerStackChange+1));\t\n\t\tendGame();\n\t}", "public void clear() {\n for (int i = 0; i < if_you_items.length; i++) {\n if_you_items[i].setEnabled(true);\n }\n for (int i = 0; i < then_we_items.length; i++) {\n then_we_items[i].setEnabled(true);\n }\n non_promised_ministries.clear();\n non_promised_ministries.addAll(all_ministries);\n // if not at war, can't ask/offer peace\n if (game.getDiplomacy().getDiplomaticState(game.getTurn(), faction) != C.DS_WAR) {\n if_you_items[IfYouWill.PEACE.ordinal()].setEnabled(false);\n then_we_items[ThenWeWill.PEACE.ordinal()].setEnabled(false);\n }\n if (faction > C.HOUSE5) { // non-house\n non_promised_ministries.clear();\n if_you_items[IfYouWill.TECH.ordinal()].setEnabled(false);\n then_we_items[ThenWeWill.TECH.ordinal()].setEnabled(false);\n if_you_items[IfYouWill.VOTES.ordinal()].setEnabled(false);\n then_we_items[ThenWeWill.VOTES.ordinal()].setEnabled(false);\n return;\n }\n // search for promised votes and ministries in pending contracts of sender\n for (Contract con : game.getDiplomacy().getSentContracts()) {\n for (Term term : con.getTerms()) {\n if (term.getDonor() == game.getTurn()) {\n switch (term.getType()) {\n case VOTES:\n System.out.println(\"DBG no votes\");\n then_we_items[ThenWeWill.VOTES.ordinal()].setEnabled(false);\n break;\n case MINISTRY:\n non_promised_ministries.remove(new Integer(term.getAmount()));\n break;\n case MONEY:\n break;\n case STATE:\n break;\n case TECH:\n break;\n default:\n throw new AssertionError();\n }\n }\n if (term.getDonor() == faction) {\n switch (term.getType()) {\n case VOTES:\n System.out.println(\"DBG no votes\");\n if_you_items[IfYouWill.VOTES.ordinal()].setEnabled(false);\n break;\n case MINISTRY:\n non_promised_ministries.remove(new Integer(term.getAmount()));\n break;\n case MONEY:\n break;\n case STATE:\n break;\n case TECH:\n break;\n default:\n throw new AssertionError();\n }\n }\n }\n }\n // search for promised votes and ministries for sender and for receiver\n // those that are made with sender\n if (game.getRegency().getVotes()[game.getTurn()][Regency.CANDIDATE_IDX] > -1\n || game.getRegency().getVotes()[faction][Regency.CANDIDATE_IDX] == game.getTurn()) {\n then_we_items[ThenWeWill.VOTES.ordinal()].setEnabled(false);\n if_you_items[IfYouWill.VOTES.ordinal()].setEnabled(false);\n }\n int[] promises = game.getDiplomacy().getMinistryPromises(game.getTurn());\n for (int i = 0; i < promises.length; i++) {\n if (promises[i] > -1) {\n non_promised_ministries.remove(new Integer(promises[i]));\n }\n }\n promises = game.getDiplomacy().getMinistryPromises(faction);\n for (int i = 0; i < promises.length; i++) {\n if (promises[i] == game.getTurn()) {\n non_promised_ministries.remove(new Integer(promises[i]));\n }\n }\n if (non_promised_ministries.isEmpty()) {\n then_we_items[ThenWeWill.MINISTRY.ordinal()].setEnabled(false);\n if_you_items[IfYouWill.MINISTRY.ordinal()].setEnabled(false);\n }\n }", "private void resetArena() {\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team0-X:\" + SPAWN_CIRCLE0_X);\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team0-Y:\" + SPAWN_CIRCLE0_Y);\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team0-Radius:1\");\r\n\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team1-X:\" + SPAWN_CIRCLE1_X);\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team1-Y:\" + SPAWN_CIRCLE1_Y);\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team1-Radius:1\");\r\n\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team2-X:\" + SPAWN_CIRCLE2_X);\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team2-Y:\" + SPAWN_CIRCLE2_Y);\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team2-Radius:1\");\r\n\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team3-X:\" + SPAWN_CIRCLE3_X);\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team3-Y:\" + SPAWN_CIRCLE3_Y);\r\n m_botAction.sendUnfilteredPublicMessage(\"?set Spawn:Team3-Radius:1\");\r\n\r\n if(m_ensureLock) {\r\n m_ensureLock = false;\r\n m_botAction.toggleLocked();\r\n }\r\n }", "private void clearPlayer(Graphics g){\n\t\tg.clearRect(b.p.getxOld(),b.p.getyOld(),Player.SIZE,Player.SIZE);\n\t}", "void clean(Player p);", "public void sendUpdate() {\n int i = 1;\n\n Deque<ProxiedPlayer> removePlayers = new LinkedList<>();\n\n for (ProxiedPlayer player : playersQueue) {\n Server playerServer = player.getServer();\n\n // Player is not connected OR Player Server is not the Queue Server\n if (!player.isConnected() || !playerServer.getInfo().getName().equals(Config.queue)) {\n removePlayers.add(player);\n continue;\n }\n\n player.sendMessage(TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', Config.messagePosition.replaceAll(\"%position%\", Integer.toString(i))) + \"§r\"));\n\n i++;\n }\n\n for (ProxiedPlayer player : removePlayers) {\n try {\n // Remove Player from the queue\n mutex.acquire();\n playersQueue.remove(player);\n\n Main.log(\"sendUpdate\", \"§3§b\" + player.toString() + \"§3 was removed from §b\" + Config.queue + \"§3 (wrong server or disconnected). Queue count is \" + playersQueue.size() + \".\");\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n mutex.release();\n }\n }\n }", "public static void handleHealGroup(Player player) {\n\t\t\n\t}", "public void flush() {\n try {\n dhi.set(hotels);\n } catch (Exception e) {\n e.getMessage();\n }\n }", "public void deal() {\r\n\t\tfor(Player p : players) {\r\n\t\t\tp.recieveCards();\r\n\t\t}\r\n\t\t/*Deals the cards onto the board, 5 cards */\r\n\t\tfor(int i = 0; i < 5; i++) {\r\n\t\t\tboard.add(gameDeck.deal());\r\n\t\t}\r\n\t}", "public synchronized void gameOver(PlayerHandler playerHandler) {\n\n winner();\n\n if (temporaryGame) {\n for (Game game : Server.getGames().values()) {\n if (game.equals(this)) {\n Server.getGames().remove(playerHandler.getGameRoom());\n //return; //(if not commented, does not remove the !fixed game.\n System.out.println(\"game \" + this.name + \" removed from map\");\n }\n }\n }\n\n resetGameRoom();\n\n }", "@Override\n \tpublic void onPlayerRespawn(EntityPlayer player) {\n \t\t\n \t\tNBTTagCompound compound = player.getEntityData();\n \t\tif (!compound.hasKey(EntityPlayer.PERSISTED_NBT_TAG)) return;\n \t\tNBTTagCompound persistent = compound.getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG);\n \t\tif (!persistent.hasKey(\"Backpack\")) return;\n \t\tNBTTagCompound backpack = persistent.getCompoundTag(\"Backpack\");\n \t\t\n \t\tint size = backpack.getInteger(\"count\");\n \t\tItemStack[] contents = new ItemStack[size];\n \t\tNbtUtils.readItems(contents, backpack.getTagList(\"Items\"));\n \t\t\n \t\tItemBackpack.getBackpackData(player).contents = contents;\n \t\t\n \t\tpersistent.removeTag(\"Backpack\");\n \t\tif (persistent.hasNoTags())\n \t\t\tcompound.removeTag(EntityPlayer.PERSISTED_NBT_TAG);\n \t\t\n \t}", "public final void consume(Player player, Collection<ItemStack> items)\n\t{\n\t\tInventoryHelper.remove(player, items);\n\t}", "public static void clearBidsMade() {\r\n\t\tFrameUtils.player1Bid.select(\"\");\r\n\t\tFrameUtils.player2Bid.select(\"\");\r\n\t\tFrameUtils.player3Bid.select(\"\");\r\n\t\t\r\n\t\tMain.player1Bid = \"\";\r\n\t\tMain.player2Bid = \"\";\r\n\t\tMain.player3Bid = \"\";\r\n\t\t\r\n\t\t//Only clear the fourth player bid if playing 3 handed game.\r\n\t\tif (!Main.isThreeHanded) {\r\n\t\t\tFrameUtils.player4Bid.select(\"\");\r\n\t\t\tMain.player4Bid = \"\";\r\n\t\t}\r\n\t}", "private void deal() {\n int index = 0;\n while (!deck.isEmpty()) {\n Card card = deck.get(0);\n players.get(index).receiveCard(card);\n deck.remove(0);\n if (index < players.size() - 1) {\n index++;\n } else {\n index = 0;\n }\n }\n }", "public static void bankInventoryAndEquipment(Player player) {\n\t\tplayer.bankIsFullWhileUsingPreset = false;\n\t\tBankButtons.depositInventoryItems(player, false);\n\t\tBankButtons.depositWornItems(player, false, false, false);\n\t}", "@Override\r\n\t\t\t\tpublic void run() {\n\t\t\t\t\t\r\n\t\t\t\t\tfor(Entity as: Bukkit.getWorld(\"world\").getEntities()) {\r\n\t\t\t\t\t\tif(as instanceof ArmorStand) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tas.remove();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//TOPS\r\n\t\t\t\t\r\n\t\t\t\t\tif(MetodosWarps.containsWarp(\"topkills\")) {\r\n\t\t\t\t\t getTop(locTopKILLS,\"Kills\");\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žAžlTOP KILLS ATUALIZADO COM SUCESSO! \\n \");\t\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žcžlO TOP KILLS NAO PODE SER CARREGADO, POIS A WARP topkills NAO ESTA SETADA! \\n \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(MetodosWarps.containsWarp(\"topcoins\")) {\r\n\t\t\t\t\t getTop(locTopCoins,\"Coins\");\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žAžlTOP COINS ATUALIZADO COM SUCESSO! \\n \");\t\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žcžlO TOP COINS NAO PODE SER CARREGADO, POIS A WARP topkills NAO ESTA SETADA! \\n \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(MetodosWarps.containsWarp(\"top1v1\")) {\r\n\t\t\t\t\t getTop(locTop1v1,\"wins\");\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žAžlTOP 1v1 ATUALIZADO COM SUCESSO! \\n \");\t\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žcžlO TOP 1v1 NAO PODE SER CARREGADO, POIS A WARP top1v1 NAO ESTA SETADA! \\n \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Caixa misteriosa\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(MetodosWarps.containsWarp(\"misteryBox\")) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t Spawn(misteryBox, \"žažlCAIXA MISTERIOSA\",misteryBox.getY()-1.7);\r\n\t\t\t\t\t Spawn(misteryBox, \"žežlEM BREVE!\",misteryBox.getY()-2);\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žAžlMYSTERYBOX ATUALIZADO COM SUCESSO! \\n \");\t\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tBukkit.getConsoleSender().sendMessage(\" \\n žcžlO TOP COINS NAO PODE SER CARREGADO, POIS A WARP misteryBox NAO ESTA SETADA! \\n \");\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "public void unfreezePlayer(Player player) {\r\n\t\tif (isFrozen(player)) {\r\n\t\t\tendFreeze(player);\r\n\t\t}\r\n\t}", "public void clearEnemies() {\n\t\tIterator<Entity> it = entities.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tEntity e = it.next();\n\t\t\t//Skip playerfish\n\t\t\tif (e instanceof PlayerFish) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t//Kill and remove the entity\n\t\t\te.kill();\n\t\t\tit.remove();\n\t\t}\n\t\t\n\t\t//Remove all non playerfish from collidables\n\t\tcollidables.removeIf(c -> !(c instanceof PlayerFish));\n\t\tdrawables.removeIf(c -> !(c instanceof PlayerFish));\n\t}", "private void makeBoss()\r\n {\r\n maxHealth = 1000;\r\n health = maxHealth;\r\n \r\n weapon = new Equip(\"Claws of Death\", Equip.WEAPON, 550);\r\n armor = new Equip(\"Inpenetrable skin\", Equip.ARMOR, 200);\r\n }", "public static void hardestBoss() {\r\n // Get array with names of bosses.\r\n BossNames[] names = BossNames.values();\r\n\r\n // Get array of damage/attack points of the bosses.\r\n Boss boss = new Boss();\r\n int bossDamage[] = boss.getBossDamage();\r\n\r\n // Calculate max damage/attack points using for-each loop.\r\n int maxDamage = bossDamage[0];\r\n for (int damage : bossDamage) {\r\n if (damage > maxDamage) {\r\n maxDamage = damage;\r\n }\r\n }\r\n\r\n // Search array for maxDamage to calculate index.\r\n int index = -1;\r\n for (int i = 0; i < bossDamage.length; i++) {\r\n if (bossDamage[i] == maxDamage) {\r\n index = i;\r\n }\r\n }\r\n\r\n if (index != -1) {\r\n console.println(\"The boss with the greatest attack points is \" + names[index] + \".\");\r\n }\r\n }", "public void onUpdate()\n {\n super.onUpdate();\n\n if (!this.worldObj.isRemote && this.getBossHP() != this.health)\n {\n this.setBossHP();\n }\n }", "public void onCraftGuiClosed(EntityPlayer par1EntityPlayer)\n {\n super.onCraftGuiClosed(par1EntityPlayer);\n\n for (int i = 0; i < 4; ++i)\n {\n ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i);\n\n if (itemstack != null)\n {\n par1EntityPlayer.dropPlayerItem(itemstack);\n }\n }\n\n this.craftResult.setInventorySlotContents(0, (ItemStack)null);\n }", "public void cleanStatuses(){\n\n System.out.println(\"cleaning battle statuses: \");\n // for(MovingEntity enemy: enemies){\n for(MovingEntity enemy: battleEnemies){\n for (Status enemyStatus: enemy.getStatusList()) {\n if (enemyStatus != null) enemyStatus.endStatus(enemy);\n }\n }\n\n //for(MovingEntity friendly: friendlies){\n for(MovingEntity friendly: battleAllies){\n System.out.println(\"cleaning battle statuses for: \" + friendly.getID());\n System.out.println(friendly.getStatusIDs().toString());\n if (friendly.getStatusIDs().contains(\"Tranced\")) {\n // kill off tranced entities\n friendly.setCurrHP(0);\n }\n for (Status friendlyStatus: friendly.getStatusList()) {\n System.out.println(\"status was: \" + friendlyStatus.getID());\n if (friendlyStatus != null) friendlyStatus.endStatus(friendly);\n }\n }\n\n }", "@Override\r\n\tpublic void run() {\n\t\tif (!Debug.override)\r\n\t\t\tdebug.i(\"BattleRunnable commiting\");\r\n\t\ttry {\r\n\t\t\tfor (Player p : Bukkit.getServer().getOnlinePlayers()) {\r\n\t\t\t\tArenaPlayer ap = ArenaPlayer.parsePlayer(p.getName());\r\n\t\t\t\t\r\n\t\t\t\tString name = PVPArenaAPI.getArenaNameByLocation(p.getLocation());\r\n\t\t\t\t\r\n\t\t\t\tif (p.hasPermission(\"pvparena.admin\")) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!Debug.override) {\r\n\t\t\t\t\tdebug.i(\"arena pos: \" + String.valueOf(name), p);\r\n\t\t\t\t\tdebug.i(\"arena IN : \" + String.valueOf(ap.getArena()), p);\r\n\t\t\t\t}\n\t\t\t\t\r\n\t\t\t\tif (name == null || name.equals(\"\")) {\r\n\t\t\t\t\tcontinue; // not physically in an arena\r\n\t\t\t\t}\r\n\t\t\t\t\n\t\t\t\tif (ap.getArena() == null || !ap.getArena().getName().equals(name)) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (ap.getArena() != null) {\r\n\t\t\t\t\t\tif (ap.getArena().getArenaConfig().getBoolean(CFG.MODULES_BATTLEFIELDGUARD_ENTERDEATH)) {\r\n\t\t\t\t\t\t\tap.get().setLastDamageCause(new EntityDamageEvent(ap.get(), DamageCause.CUSTOM, 1000));\r\n\t\t\t\t\t\t\tap.get().setHealth(0);\r\n\t\t\t\t\t\t\tap.get().damage(1000);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tap.getArena().playerLeave(p, CFG.TP_EXIT, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tArena a = ArenaManager.getArenaByName(name);\r\n\t\t\t\t\tif (a.getArenaConfig().getBoolean(CFG.MODULES_BATTLEFIELDGUARD_ENTERDEATH)) {\r\n\t\t\t\t\t\tp.setLastDamageCause(new EntityDamageEvent(p, DamageCause.CUSTOM, 1000));\r\n\t\t\t\t\t\tp.setHealth(0);\r\n\t\t\t\t\t\tp.damage(1000);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ta.tpPlayerToCoordName(p, \"exit\");\r\n\t\t\t\t\t}\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}", "public void refill() {\n\t\tfor(int i = 0; i < chests.size(); i++)\r\n\t\t\tchests.get(i).refill();\r\n\t}", "void removeAllSpawn();", "public void killAll() {\n for (Map.Entry<Integer, Enemy> entry :enemies.entrySet()) {\n if (!!!entry.getValue().isDead()) {\n entry.getValue().setHealth(0);\n }\n }\n }", "public void cmdClearGames(User teller) {\n tournamentService.clearSchedule();\n tournamentService.flush();\n command.qtell(teller, \" Okay, I''ve cleared the schedule. Tell me \\\"show\\\" to see.\");\n command.sendCommand(\"-notify *\");\n }", "@Override\n public void summonHorsesToPaddock(){\n rl.lock();\n try{\n System.out.println(\"B : Trying to summon horse...\");\n //change broker state\n// MyThreadBroker broker = (MyThreadBroker) Thread.currentThread();\n// broker.broker_states = MyThreadBroker.Broker_States.ANNOUNCING_NEXT_RACE;\n //change log\n log.setBrokerState(MyThreadBroker.Broker_States.ANNOUNCING_NEXT_RACE);\n log.changeLog();\n keep_waiting = false;\n stable_horses.signal(); \n }finally{\n rl.unlock();\n }\n \n }", "public void healPokemon() {\r\n\t\tfor (Pokemon p : ownedPokemon) {\r\n\t\t\tp.resetCurrentHP();\r\n\t\t}\r\n\t}", "public void respawnAll(Player player) {\r\n\t\tfor(Integer eid : entityIDs) {\r\n\t\t\tItem3DInfo info = entityInfo.get(eid);\r\n\t\t\tint standID = standIDs.get(eid);\r\n\t\t\t\r\n\t\t\tspawnOldZombie(player, info.getWorldName(), info.getX(), info.getY(), info.getZ(),\r\n\t\t\t\t\tinfo.getRotation(), info.getItemID(), eid, standID);\r\n\t\t}\r\n\t}", "public void removeTomb(String player) {\r\n\t\ttombs.remove(player);\r\n\t}", "private void sendPlantToAll(int x ,int y){\r\n\t\tfor(PrintWriter p : players){\r\n\t\t\tif(p != null){\r\n\t\t\t\tsendPlant(p,x,y);\r\n\t\t\t\tp.flush();\r\n\t\t\t}else{\r\n\t\t\t\treturn;\r\n\t\t\t}\t\r\n\t\t}\t\r\n\t}", "public void run()\n {\n List<Entity> ms = new LinkedList<Entity>(monsters);\n for (Entity e : ms)\n if (e.isDead())\n monsters.remove(e);\n \n // Compare the current size with the previous size.\n if (monsters.size() < spawnThread.getPreviousSize() || spawnThread.getPreviousSize() == 0 || bossWave != null)\n {\n resetIdleTimer();\n return;\n }\n \n // Clear all player inventories, and \"kill\" all players.\n List<Player> ps = new LinkedList<Player>(arenaPlayers);\n for (Player p : ps)\n {\n MAUtils.clearInventory(p);\n MAUtils.tellPlayer(p, Msg.FORCE_END_IDLE);\n playerDeath(p);\n }\n }", "public BossBar(TAB tab) {\n\t\tthis.tab = tab;\n\t\tdisabledWorlds = tab.getConfiguration().getConfig().getStringList(\"disable-features-in-\"+tab.getPlatform().getSeparatorType()+\"s.bossbar\", Arrays.asList(\"disabled\" + tab.getPlatform().getSeparatorType()));\n\t\ttoggleCommand = tab.getConfiguration().getBossbarConfig().getString(\"bossbar-toggle-command\", \"/bossbar\");\n\t\tdefaultBars = tab.getConfiguration().getBossbarConfig().getStringList(\"default-bars\", new ArrayList<>());\n\t\tpermToToggle = tab.getConfiguration().getBossbarConfig().getBoolean(\"permission-required-to-toggle\", false);\n\t\thiddenByDefault = tab.getConfiguration().getBossbarConfig().getBoolean(\"hidden-by-default\", false);\n\t\tperWorld = tab.getConfiguration().getBossbarConfig().getConfigurationSection(\"per-world\");\n\t\tfor (Object bar : tab.getConfiguration().getBossbarConfig().getConfigurationSection(\"bars\").keySet()){\n\t\t\tgetLines().put(bar.toString(), BossBarLine.fromConfig(bar.toString()));\n\t\t}\n\t\tfor (String bar : new ArrayList<>(defaultBars)) {\n\t\t\tif (getLines().get(bar) == null) {\n\t\t\t\ttab.getErrorManager().startupWarn(\"BossBar \\\"&e\" + bar + \"&c\\\" is defined as default bar, but does not exist! &bIgnoring.\");\n\t\t\t\tdefaultBars.remove(bar);\n\t\t\t}\n\t\t}\n\t\tfor (Entry<String, List<String>> entry : perWorld.entrySet()) {\n\t\t\tList<String> bars = entry.getValue();\n\t\t\tfor (String bar : new ArrayList<>(bars)) {\n\t\t\t\tif (getLines().get(bar) == null) {\n\t\t\t\t\ttab.getErrorManager().startupWarn(\"BossBar \\\"&e\" + bar + \"&c\\\" is defined as per-world bar in world &e\" + entry.getKey() + \"&c, but does not exist! &bIgnoring.\");\n\t\t\t\t\tbars.remove(bar);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\trememberToggleChoice = tab.getConfiguration().getBossbarConfig().getBoolean(\"remember-toggle-choice\", false);\n\t\tif (isRememberToggleChoice()) {\n\t\t\tbossbarOffPlayers = tab.getConfiguration().getPlayerData(\"bossbar-off\");\n\t\t}\n\t\tTAB.getInstance().getPlaceholderManager().getAllUsedPlaceholderIdentifiers().add(\"%countdown%\");\n\t\tTAB.getInstance().getPlaceholderManager().registerPlaceholder(new ServerPlaceholder(\"%countdown%\", 100) {\n\n\t\t\t@Override\n\t\t\tpublic String get() {\n\t\t\t\treturn String.valueOf((getAnnounceEndTime() - System.currentTimeMillis()) / 1000);\n\t\t\t}\n\t\t});\n\t\ttab.debug(String.format(\"Loaded Bossbar feature with parameters disabledWorlds=%s, toggleCommand=%s, defaultBars=%s, permToToggle=%s, hiddenByDefault=%s, perWorld=%s, remember_toggle_choice=%s\",\n\t\t\t\tdisabledWorlds, toggleCommand, defaultBars, isPermToToggle(), hiddenByDefault, perWorld, isRememberToggleChoice()));\n\t}", "private void finishArenaPlayer(Player p, boolean dead)\n {\n if (!arenaPlayers.contains(p) && !lobbyPlayers.contains(p))\n return;\n \n removeClassPermissions(p);\n MAUtils.clearInventory(p);\n \n if (dead) restoreInvAndGiveRewardsDelayed(p);\n else restoreInvAndGiveRewards(p);\n \n ArenaPlayer ap = arenaPlayerMap.get(p);\n if (ap != null)\n ap.setDead(true);\n }", "public void endGame()\r\n {\r\n for (Cell c : gameBoard.bombList)\r\n {\r\n if (c.isBomb())\r\n {\r\n if (c.getText() == \"X\")\r\n {\r\n c.setId(\"correctFlag\");\r\n }\r\n else\r\n {\r\n c.setId(\"bombClicked\");\r\n }\r\n }\r\n else if (c.getText() == \"X\")\r\n {\r\n c.setId(\"incorrectFlag\");\r\n }\r\n c.setDisable(true);\r\n }\r\n if (gameBoard.emptyRemaining == 0)\r\n {\r\n win();\r\n }\r\n else\r\n {\r\n lose();\r\n }\r\n System.out.println(\"Game Over...\");\r\n scoreBoard.resetBtn.setDisable(false);\r\n }", "public void flush() {\n mMessages.postToServer();\n }", "public void notifyAlienKilled() {\n\t\talienCount--;\n\t\t\n\t\tif (alienCount <= 0) {\n\t\t\tround++;\n\t\t\tif(round % 1 == 0) {\n\t\t\t\tinitBoss();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tinitEntitiesNoShip();\n\t\t\t}\n//\t\t\tnotifyWin();\n\t\t\t// System.out.println(\"Score: \" + score);\n\t\t}\n\t\t\n\t\t// if there are still some aliens left then they all need to get faster, so\n\t\t// speed up all the existing aliens\n\t\tfor (int i=0;i<entities.size();i++) {\n\t\t\tEntity entity = (Entity) entities.get(i);\n\t\t\t\n\t\t\tif (entity instanceof AlienEntity) {\n\t\t\t\t// speed up by 2%\n\t\t\t\tentity.setHorizontalMovement(entity.getHorizontalMovement() * 1.02);\n\t\t\t}\n\t\t}\n\t}", "public void deal() {\r\n\t\twhile(! deck.isEmpty()) {\r\n\t\t\tplayer1.addToUnplayedPile(deck.deal());\r\n\t\t\tplayer2.addToUnplayedPile(deck.deal());\r\n\t\t}\r\n\t}", "public void autosimulateCombat() {\n\n int monstersRemainingHealth = monster.getHealth() - player.getPower();\n int playersRemainingHealth = player.getHealth() - monster.getPower();\n\n while (player.getHealth() > 0 && monster.getHealth() > 0) {\n\n monster.setHealth(monstersRemainingHealth);\n monstersRemainingHealth = monster.getHealth() - player.getPower();\n\n\n player.setHealth(playersRemainingHealth);\n playersRemainingHealth = player.getHealth() - monster.getPower();\n\n }\n isPlayerDefeated();\n return;\n }", "public void clearLobbies() {\n\t\tlobbies.clear();\n\t}", "public void checkBombs(final Integer tile){\n if(bombs_location.contains(tile)){\n if(invulnerable){\n showTimedAlertDialog(\"PHEW!\", \"Your GODMODE saved your life\", 5);\n invulnerable = false;\n return;\n }\n invulnerable = false;\n Lejos.makeSound_Boom();\n hp = hp-1;\n DrawHP();\n bombs_location.remove(tile);\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n MultiplayerManager.getInstance().SendMessage(\"bomb_remove \" + revertTile(tile).toString());\n }\n }, 1000);\n if(hp==0){\n onLose();\n }\n showTimedAlertDialog(\"PWNED!\", \"You just stepped on a mine\", 3);\n }\n }", "public void depositeAll(Player player) {\n\t\tInventory inventory = player.inventory;\n\t\tif (inventory.isEmpty()) {\n\t\t\tplayer.message(\"There is nothing in your inventory to deposit!\");\n\t\t\treturn;\n\t\t}\n\t\tfor (int index = 0; index < inventory.size(); index++) {\n\t\t\tItem item = inventory.get(index);\n\n\t\t\tif (item == null || !item.isTradeable()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthis.item_containers.get(player).add(item);\n\t\t\tinventory.remove(item, index, false);\n\t\t}\n\t\tinventory.refresh();\n\t\tupdateOfferComponents();\n\t}", "public static void playerEffectivelyEndsBattlePhase() {\r\n for (int index = 1; index <= 5; index++){\r\n SummonedMonster MonsterCPU = SummonedMonster.getNthSummonedMonster(index, false);\r\n if (MonsterCPU.isExisting) {\r\n MonsterCPU.canStillAttackThisTurn = false;\r\n }\r\n }\r\n endAttack(false);\r\n }", "public static void clearWinners(){winners.clear();}", "public void onContainerClosed(EntityPlayer playerIn)\n {\n super.onContainerClosed(playerIn);\n\n if (!this.worldObj.isRemote)\n {\n for (int i = 0; i < 9; ++i)\n {\n ItemStack itemstack = this.craftMatrix.removeStackFromSlot(i);\n\n if (itemstack != null)\n {\n playerIn.dropItem(itemstack, false);\n }\n }\n }\n }", "private synchronized void sendAdvance(){\r\n\t\t\tfor(PrintWriter p : players){\r\n\t\t\t\tif(p != null){\r\n\t\t\t\t\tp.println(\"5\");\r\n\t\t\t\t\tp.println(Integer.toString(x));\r\n\t\t\t\t\tp.println(Integer.toString(y));\r\n\t\t\t\t\tp.flush();\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t}", "static void boss_fight() {\n miss_choice = miss.nextInt(2);//random used to determie a miss or a hit\n playerhealth = 3500;\n nagahealth = 3500;\n bosshealth = 10000;//#enemyobject-the actual boss that has created the game play(antagonsit)\n System.out.println(\"You have recently leveled up and have increased your HP to 3500. Be careful...\");\n System.out.println(\"You can now cast 8 different types of spells...\");\n enter = next.nextLine();\n System.out.println(\"These spells include fire, ice, wind, lightening, throw rocks, sacred sword, \");\n System.out.println(\"cosmic rays, and teleport\");\n enter = next.nextLine();\n System.out.println(\"Naga has his own spells don't worry about him...\");\n enter = next.nextLine();\n System.out.println(\"'I can use 3 different types of dark magic and 2 different types of normal attacks'\");\n System.out.println(\"Don't worry, we got this \"+ username + \".\");\n enter = next.nextLine();\n System.out.println(\"ALL OR NOTHING!!! GHAAAA!!!\");\n enter = next.nextLine();\n monsterisalive = true;\n //#while \n /* while loop that will let players fight the boss */\n while(monsterisalive){\n System.out.println(\"It is your turn...which move will you use:\");\n System.out.println(\"fire, ice, wind, lightening, throw rocks, sacred sword, cosmic rays, teleport, or heal.\");\n attack = next.nextLine();\n if(attack.contains(\"fire\")) {\n System.out.println(\"Alright, I'm fired up...FOOOSH!!!\");\n bosshealth = bosshealth-30; //player deals damage\n System.out.println(\"WHOA! The witch lost 30 HP. The boss now has \" + bosshealth + \" HP.\" );\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if(answer.contains(\"ice\")) {\n System.out.println(\"Alright, it's gonna be a little chilly...GHAAAA!!!\");\n bosshealth = bosshealth-20;\n System.out.println(\"BRRR... The evil witch lost 20 HP. The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if(answer.contains(\"lightening\")) {\n System.out.println(\"Someone's gonna get fried today! ZAAAAP!!!\");\n bosshealth = bosshealth-40;\n System.out.println(\"OUCH!!! The evil witch lost 40 HP. The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP\");\n }else if (answer.contains(\"throw rocks\")) {\n System.out.println(\"Incoming Boulder...BOOOOOMM!!!\");\n bosshealth = bosshealth-30;\n System.out.println(\"The witch lost 30 HP. It now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if (answer.contains(\"sacred swords\")) {\n System.out.println(username + \" summons the guardians of the 9 sacred swords, and \");\n System.out.println(\"the guardians released their swords to punish the wicked witch...\");\n enter = next.nextLine();\n System.out.println(\"The 9 swords punctures the wicked releasing powerful, positive energy.\");\n bosshealth = bosshealth-150;\n System.out.println(\"ZHHHHNGG!!! BOOOM!!! Ouch...the boss lost 150 HP. The boss now has \" + bosshealth);\n System.out.println(\"HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if (answer.contains(\"cosmic rays\")) {\n System.out.println(username + \" casts a spell that absorbs all of the radiation from space...\");\n System.out.println(\"Then a large light bombards the witch and inflicts 130 HP.\");\n bosshealth = bosshealth-130;\n enter = next.nextLine();\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n }else if (answer.contains(\"teleport\")) {\n System.out.println(username + \" creates a blue portal and jumps inside the portal...\");\n enter = next.nextLine();\n System.out.println(username + \" then teleports behind the witch and strikes...Then jumps back in...\");\n enter = next.nextLine();\n System.out.println(\"Then appears in the rear side and strikes the boss again and quickly disappears...\");\n enter = next.nextLine();\n System.out.println(\"Finally...\" + username + \" strikes again on top of the witch.\");\n enter = next.nextLine();\n bosshealth = bosshealth-210;\n System.out.println(\"WOW!!!\" + username + \" inflicted 210 HP. The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if(answer.contains(\"wind\")) {\n System.out.println(\"Alright, let's finish this up...WHIRL!!!\");\n bosshealth = bosshealth-10;\n System.out.println(\"The evil witch lost 10 HP. The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if (answer.contains(\"heal\")){\n healing_challenge3();\n System.out.println(\"\\n\");\n System.out.println(username + \"'s HP increased 300 health points and now have \" + playerhealth + \".\");\n System.out.println(\"The boss still has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n }else{\n System.out.println(\"Please make sure you type everything correctly next time. You lost a turn...\");\n }\n \n if(bosshealth <= zero) { //check to see if boss is still alive\n System.out.println(\"You defeated the boss...Congratulations, you have won the war.\");\n enter = next.nextLine();\n System.out.println(\"The witch has disappeared, vanished forever in a black hole that consumed the boss.\");\n enter = next.nextLine();\n System.out.println(\"That is the last time you'll ever see that hideous thing ever again.\");\n monsterisalive = false;\n endgame();\n // It's Naga's turn\n }else if (bosshealth > zero) {\n System.out.println(\"It's Naga's turn...You can do this Naga!\");\n naga_attacks = naga.nextInt(6);\n if(naga_attacks == 0){\n System.out.println(\"Naga used shadow force...\");\n System.out.println(\"Naga disappears in a pitch black vortex...\");\n enter = next.nextLine();\n System.out.println(\"GHAAAAR!!!\");\n enter = next.nextLine();\n System.out.println(\"Naga flies out of his vortex and rams into the witch. YOUCH!\");\n System.out.println(\"The boss lost 180 HP.\");\n bosshealth = bosshealth-180;//Naga deals damage\n enter = next.nextLine();\n System.out.println(\"The evil witch now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n }else if (naga_attacks == 1) {\n System.out.println(\"Naga used firebreath...A large dark ember sparks from naga's mouth and \");\n System.out.println(\"begins to build up. The large black fire surrounds the witch and burns the witch\");\n enter = next.nextLine();\n System.out.println(\"'ARGHH! You will pay for that', the witch screamed.\");\n enter = next.nextLine();\n bosshealth = bosshealth-200;\n System.out.println(\"WHOA!!! The fiery breath inflicted 200 HP. The boss now has\" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n }else if (naga_attacks == 2) {\n System.out.println(\"Naga used his blades of terror to torture the witch...\");\n System.out.println(\"Naga creates a strong whirlwind with his wings and released thousands of sharp\");\n System.out.println(\"scales that severely wounded the witch. SHINGG!!!\");\n enter = next.nextLine();\n bosshealth = bosshealth-150;\n System.out.println(\"OWWW!!! The boss lost 150 HP and now has \" + bosshealth + \"HP.\");\n enter = next.nextLine();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\"); \n }else if (naga_attacks == 3) {\n System.out.println(\"Naga used wings of Justice. \");\n enter = next.nextLine();\n System.out.println(\"Naga flies up high and plunges down toward the witch...\");\n System.out.println(\"Naga uppercuts the witch with his large wings and knocks the witch off her feet.\");\n enter = next.nextLine();\n bosshealth = bosshealth-210;\n System.out.println(\"YIKES!!! Naga inflicted 210 HP. The boss has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n }else if (naga_attacks == 4) {\n System.out.println(\"Naga used tail whip...\");\n System.out.println(\"SWWWSSS!!! BRMMM!!!\");\n System.out.println(\"Naga sets himself apart and lunges forward with his tail and thrusts the witch\");\n System.out.println(\"off the arena...\");\n enter = next.nextLine();\n System.out.println(\"The witch teleports herself back into the arena, but loses 60 HP because of this.\");\n bosshealth = bosshealth-60;\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"Now Naga has \" + nagahealth + \" HP.\");\n }else if (naga_attacks == 5) {\n healing_naga_challenge3();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n System.out.println(\"\\n\");\n System.out.println(\"The boss still has \" + bosshealth + \" HP.\");\n }\n }\n \n if(bosshealth <= zero) { //check to see if boss is still alive\n //#win\n /* This is the conditions to win. The boss's health must equal to or less than zero. If you win the \n boolean monsterisalive is equal to false and the player will come to the endgame method to \n displayt he credits...\n */\n System.out.println(\"You defeated the boss...Congratulations, you have won the war.\");\n enter = next.nextLine();\n System.out.println(\"The witch has disappeared, vanished forever in a black hole that consumed the boss.\");\n enter = next.nextLine();\n System.out.println(\"That is the last time you'll ever see that hideous thing ever again.\");\n monsterisalive = false;\n endgame();\n //it's the boss's turn\n }else if (bosshealth > zero) { //if it is still greater than zero...\n System.out.println(\"It's the monster's turn...brace yourselves\");\n System.out.println(\"'The witch has 8 different spells that she can use...she's very strong...\");\n System.out.println(\"BE CAREFUL,' stated Naga.\");\n enter = next.nextLine();\n System.out.println(\"Are you ready to feel what pain really is? Prepare yourself...\");\n System.out.println(\"ARGGHHH!!! BRRRM!!!\");\n enter = next.nextLine();\n System.out.println(\"Naga and \"+ username + \" are on their guard ready to defend against the witches attacks\");\n enter = next.nextLine();\n System.out.println(\"Here I go...\");\n enter = next.nextLine();\n which = pick.nextInt(2);//decide which one will get hit: player or Naga\n boss_attacks = boss.nextInt(9);//decides which\n if (boss_attacks == 0) {\n System.out.println(\"'Night Shadow!'\");\n //this will determine which player gets hit; you or Naga\n if(which == 0) { //player gets hit\n enter = next.nextLine();\n System.out.println(\"The witch summons a dark cloud from above with her staff...\");\n enter = next.nextLine();\n /* #enemyobject\n The witch affects the protagonist/player by harming the player's health through savage attacks that \n inflicts large amounts of damage to the player. \n */\n System.out.println(\"The dark cloud duplicates and strikes \" + username + \".\");\n enter = next.nextLine();\n System.out.println(\"Ouch \" + username + \" loses 200 HP.\");\n playerhealth = playerhealth-200;\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (which == 1) { //naga gets hit\n enter = next.nextLine();\n System.out.println(\"The witch summons a dark cloud from above with her staff...\");\n enter = next.nextLine();\n System.out.println(\"The dark cloud duplicates and strikes Naga. Naga collapses\");\n enter = next.nextLine();\n System.out.println(\"Ouch Naga loses 200 HP.\");\n nagahealth = nagahealth-200;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 1) {\n System.out.println(\"'Shadow Blade!'\");\n //this will determine who will get hit\n if (which == 0) { // player gets hit\n System.out.println(\"The witch's staff transforms into a deadly blade.\");\n System.out.println(\"The blade has \" + username + \"'s face on the back...\");\n enter = next.nextLine();\n System.out.println(\"Watch out \" + username + \". She's on to you...\");\n enter = next.nextLine();\n System.out.println(\"The witch charges up and strikes \" + username + \".\");\n System.out.println(\"SLASH...SHING!!!\");\n enter = next.nextLine();\n System.out.println(\"OUCH!!! \" + username + \" loses 150 HP.\");\n playerhealth = playerhealth-150;\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (which == 1) { //naga gets hit\n System.out.println(\"The witch's staff transforms into a deadly blade.\");\n System.out.println(\"The blade has a black dragon symbol on the edge...\");\n enter = next.nextLine();\n System.out.println(\"'Naga she's on to you. WATCH OUT!' \" + username + \" screams.\");\n System.out.println(\"SLASH...SHING!!!\");\n enter = next.nextLine();\n System.out.println(\"OUCH!!! naga loses 150 HP.\");\n nagahealth = nagahealth-150;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 2) {\n System.out.println(\"Dragon spiral!\");\n if(which == 0) { //player gets hit\n System.out.println(\"The witch summons a red and purple dragon underground...\");\n System.out.println(\"The red and purple dragon shoots out red and purple flames that fuse\");\n System.out.println(\"together to form a gigantic half red and purple flame.\");\n enter = next.nextLine();\n System.out.println(\"Look out \" + username + \".\");\n System.out.println(\"FOOOSH!!! The burning lava like embers engulf \" + username + \".\");\n enter = next.nextLine();\n System.out.println(\"ARRHHH!!! \" + username + \" loses 300 HP.\");\n playerhealth = playerhealth-300;\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (which == 1) { //naga gets hit\n System.out.println(\"The witch summons a red and purple dragon underground...\");\n System.out.println(\"The red and purple dragon shoots out red and purple flames that fuse\");\n System.out.println(\"together to form a gigantic half red and purple flame.\");\n enter = next.nextLine();\n System.out.println(\"'Look out Naga,' \" + username + \" stated.\");\n System.out.println(\"FOOOSH!!! The burning lava like embers engulf Naga.\");\n enter = next.nextLine();\n System.out.println(\"ARRHHH!!! Naga loses 300 HP.\");\n nagahealth = nagahealth-300;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 3) {\n System.out.println(\"Take over\");\n enter = next.nextLine();\n System.out.println(\"The witch summons the demons and releases them from a black portal she created\");\n System.out.println(\"Gouls, bats, and other hideous creatures emerged from the darkness\");\n if(which == 0) {// player gets hit\n System.out.println(\"The creatures targets \" + username + \".\");\n enter = next.nextLine();\n System.out.println(\"Watch out \" + username + \".\");\n System.out.println(\"GARRRL!!! SCRAA!!! FOOSHING!!!\");\n enter = next.nextLine();\n System.out.println(\"AHHH!!! \" + username + \" gets bitten, beaten, and scratched ...\");\n playerhealth = playerhealth-50;\n System.out.println(username + \" loses 50 HP. You now have \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (which == 1) {\n System.out.println(\"The creatures targets Naga.\");\n enter = next.nextLine();\n System.out.println(\"'Watch out Naga,' \" + username + \" stated.\");\n System.out.println(\"GARRRRL!!! SCRAAA!!! FOOOSHHING!!!\");\n enter = next.nextLine();\n nagahealth = nagahealth-50;\n System.out.println(\"ARRGGG!!! Naga loses 50 HP. Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 4) {\n System.out.println(\"dark cosmic swords!!!\");\n System.out.println(\"GHAAA!!!\");\n enter = next.nextLine();\n System.out.println(\"There are 5 darks lands in her reign, which means 5 different swords in her possession.\");\n System.out.println(\"Sword 1 released fire...\");\n System.out.println(\"FOOSHHH!!!\");\n enter = next.nextLine();\n System.out.println(\"Sword 2 released water...\");\n System.out.println(\"GURLG!!! FSHHH!!!\");\n enter = next.nextLine();\n System.out.println(\"Sword 3 released ice...\");\n System.out.println(\"SHING!!! BRRRRR!!!\");\n enter = next.nextLine();\n System.out.println(\"Sword 4 released wind...\");\n System.out.println(\"WHIRL!!! WHIRL!!! GUSHHH!!!\");\n enter = next.nextLine();\n System.out.println(\"Sword 5 released lightening...\");\n System.out.println(\"ZHNGGG!!! BAM!!!! BRVRMM!!!\");\n System.out.println(\"The ground ruptures and collides on \" + username + \" and Naga.\");\n enter = next.nextLine();\n System.out.println(\"These swords have just released the dark elements of the earth!\");\n System.out.println(\"YOUCH!!! Both Naga and \" + username + \" lost 220 HP.\");\n enter = next.nextLine();\n playerhealth = playerhealth-220;\n nagahealth = nagahealth-220;\n System.out.println(username + \" now has \" + playerhealth + \" HP and Naga has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }else if (boss_attacks == 5) {\n System.out.println(\"Knock down!\");\n if(miss_choice == 0) {//boss miss\n System.out.println(\"The witch summons a dark spell from her staff.\");\n enter = next.nextLine();\n System.out.println(\"An evil figure lurks in the shadows...'Can you see it Naga?' \");\n System.out.println(username + \" said.\");\n enter = next.nextLine();\n System.out.println(\"'No...I can't see a thing.\");\n enter = next.nextLine();\n System.out.println(\"Suddenly, you see a big shadow coming at Naga.\");\n enter = next.nextLine();\n System.out.println(username + \" sends a fireball flying at the shadowy figure and it disappears.\");\n System.out.println(\"Naga then sees the figure coming towards \" + username + \" and sends a flame\");\n System.out.println(\"at the shadow...The figure plunges back into the witches staff. \");\n enter = next.nextLine();\n System.out.println(\"'I guess you saw that coming, won't happen ever again!' the witch exclaimed.\");\n enter = next.nextLine();\n System.out.println(\"You dodged the witches attack!\");\n enter = next.nextLine();\n playerhealth = playerhealth-0;\n nagahealth = nagahealth-0;\n System.out.println(username + \" still has \" + playerhealth + \" HP.\");\n System.out.println(\"Naga still has \" + nagahealth + \" HP.\");\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (miss_choice == 1) { //boss hits\n System.out.println(\"The witch summons a dark spell from her staff.\");\n enter = next.nextLine();\n System.out.println(\"An evil figure lurks in the shadows...'Can you see it Naga?' \");\n System.out.println(username + \" said.\");\n enter = next.nextLine();\n System.out.println(\"'No...I can't see a thing.\");\n enter = next.nextLine();\n System.out.println(\"Suddenly, you see a big shadow coming at Naga.\");\n enter = next.nextLine();\n System.out.println(username + \" sends a fireball flying at the shadowy figure, but you missed!\");\n System.out.println(\"The shadowy figure steals 50 HP of Naga's health.\");\n nagahealth = nagahealth-50;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The shadowy figure then turns towards \" + username + \".\");\n System.out.println(\"Naga spits out a large fire, but misses the figure...\");\n System.out.println(\"The shadowy figure steals 50 HP of \" + username + \".\");\n playerhealth = playerhealth-50;\n System.out.println(username + \" still has \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 6) {\n System.out.println(\"Volcanic Eruption!\");\n if(miss_choice == 0) {//the boss misses\n System.out.println(\"The witch casts a spell that creates a series of volcanoes around you.\");\n System.out.println(\"The witch then forces the volcanoes to spit lava out...\");\n System.out.println(\"However, you saw that coming already. You and Naga jumped out of the way\");\n enter = next.nextLine();\n System.out.println(\"You dodged the attack!\");\n playerhealth = playerhealth-0;\n nagahealth = nagahealth-0;\n System.out.println(username + \" has \" + playerhealth + \" HP, and Naga has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (miss_choice == 1) {//the boss is able to hit you\n System.out.println(\"The witch summons the evil lava guardian...\");\n System.out.println(\"She then points her staff directly at...\");\n if(which == 0){//player gets hit\n System.out.println(username);\n enter = next.nextLine();\n System.out.println(\"Watch out!!!\");\n System.out.println(\"GURGLLE!!! FSH!!!\");\n System.out.println(\"The lava erupts like a fountain lake and basks \" + username + \".\");\n System.out.println(username + \" loses 100 HP.\");\n enter = next.nextLine();\n playerhealth = playerhealth-100;\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }else if (which == 1){ //naga gets hit\n System.out.println(\"Naga\");\n enter = next.nextLine();\n System.out.println(\"Watch out!\");\n System.out.println(\"GURGLRE!!! FSH!!!\");\n System.out.println(\"The lava shoots out at Naga's face, feet, and back...\");\n System.out.println(\"Removing all of his scales in the process\");\n System.out.println(\"Naga loses 100 HP.\");\n enter = next.nextLine();\n nagahealth = nagahealth-100;\n System.out.println(username + \" has \" + playerhealth + \" HP.\");\n System.out.println(\"Naga has \" + nagahealth + \" HP.\");\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }\n }\n }else if (boss_attacks == 7) {\n System.out.println(\"Satin's Spear\");\n System.out.println(\"The witch uses her staff to summon her friend Satin...\");\n enter = next.nextLine();\n System.out.println(\"EXTERMINATE THEM!!!\");\n if(miss_choice == 0){ //boss missed\n System.out.println(\"Yes ma'm...\");\n System.out.println(\"Statin launches his spear...\");\n enter = next.nextLine();\n System.out.println(\"BUT, Naga and \" + username + \" were able to dodge the attack!\");\n System.out.println(\"MISS!\");\n enter = next.nextLine();\n System.out.println(\"OOPS!\");\n playerhealth = playerhealth-0;\n nagahealth = nagahealth-0;\n System.out.println(username + \" has \" + playerhealth + \" and Naga has \" + nagahealth + \" HP.\");\n System.out.println(\"The boss has \"+ bosshealth + \" HP.\");\n }else if(miss_choice == 1){//boss gets a hit\n System.out.println(\"Yes ma'm...\");\n System.out.println(\"URGGGHAAA!!!\");\n enter = next.nextLine();\n System.out.println(\"Satin launches his spear, which duplicated...\");\n System.out.println(\"The spear is still launching up on the air...\");\n enter = next.nextLine();\n if(which == 0) { //player gets hit\n System.out.println(username + \" wants to protect his friend so he jumps forward to block\");\n System.out.println(\"the threatening spear from piercing his friend...\");\n enter = next.nextLine();\n System.out.println(\"However, in doing so the spear lands on \" + username + \".\");\n System.out.println(\"The spear erupts into pieces, shattering \" + username + \"'s legs.\");\n enter = next.nextLine();\n System.out.println(\"The wound heals but inflicts 300 damage to \" + username + \".\");\n playerhealth = playerhealth-300;\n System.out.println(username + \" has \" + playerhealth + \" HP.\");\n }else if(which == 1) { //Naga gets hit\n System.out.println(\"Naga tries to shield \" + username + \" and successfully does.\");\n System.out.println(\"BUT, in doing so the spear pierces Naga's well-armored belly.\");\n enter = next.nextLine();\n System.out.println(\"The spear automatically drills deeper until Naga can't fight anymore...\");\n System.out.println(\"The wound heals, but dealt 300 damage to Naga.\");\n nagahealth = nagahealth-300;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n }\n }\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }else if (boss_attacks == 8) {\n System.out.println(\"Health Spell...\");\n System.out.println(\"The evil witch raised her staff and a blue vortex emerged.\");\n System.out.println(\"\\n\");\n System.out.println(\"However, the witch suddenly jumps into the vortex and after a while jumps out.\");\n System.out.println(\"OH NO!!! She tried to heal herself...\");\n bosshealth = bosshealth + 350;\n if(bosshealth == 10000) {\n System.out.println(\"She already had a maximum health of \" + bosshealth + \" HP. So it didn't work.\");\n System.out.println(\"\\n\");\n }else if(bosshealth > 10000) {\n bosshealth = 10000;\n System.out.println(\"The boss currently now \" + bosshealth + \" HP.\");\n }else{\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }\n }\n }\n //#lose-player loses all of HP \n if(playerhealth <= zero) { //in case player loses all of his/her health\n System.out.println(\"OH NO!!!\" + username + \" lost was defeated!\");\n System.out.println(\"Naga currently has \" + nagahealth + \" HP.\");\n System.out.println(\"Better luck next time...\");\n monsterisalive = false;\n replaybossfight();\n }\n //#lose-naga's HP is equal to or less than zero\n if(nagahealth <= zero) { // in case Naga loses all of his/her health\n System.out.println(\"OH NO!!! Naga lost all of his health and was defeated!\");\n System.out.println(username + \" currently has \" + playerhealth + \" HP.\");\n System.out.println(\"Better luck next time...\");\n monsterisalive = false;\n replaybossfight();\n }\n \n }\n \n }", "private void autoship(World world, EntityPlayer player, List<ItemStack> list) {\n Iterator<ItemStack> it = list.iterator();\n while (it.hasNext()) {\n ItemStack stack = it.next();\n if (BlockStorage.hasShippedItem(world, player, stack)) {\n it.remove();\n }\n }\n }", "public static void clearBoard(){\n for(int i = 0; i < Board.X_UPPER_BOUND * Board.Y_UPPER_BOUND ; i++){\n Board.board[i] = null;\n }\n white_player.setpieceList(null);\n black_player.setpieceList(null);\n }", "public void drop() {\n\t\t// Has player waited cooldown before trying to fire again?\n\t\tif (System.currentTimeMillis() - this.lastFired > Config.WEAPON_COOLDOWN_TIME * 1000) {\n\t\t\t\n\t\t\t// Can this airship drop bombs?\n\t\t\tif (this.properties.DROPS_BOMB) {\n\t\t\t\tBlock[] cannons = getCannons();\n\t\t\t\tint numfiredcannons = 0;\n\t\t\t\tfor (int i = 0; i < cannons.length; i++) {\n\t\t\t\t\tif (cannons[i] != null && cannons[i].getRelative(0, -1, 0).getType().equals(Material.AIR) && cannonHasTnt(cannons[i], Config.NUM_TNT_TO_DROP_BOMB)) {\n\t\t\t\t\t\tif (numfiredcannons < this.properties.MAX_NUMBER_OF_CANNONS ) {\n\t\t\t\t\t\t\tnumfiredcannons++;\n\t\t\t\t\t\t\tlastFired = System.currentTimeMillis();\n\t\t\t\t\t\t\twithdrawTnt(cannons[i], Config.NUM_TNT_TO_DROP_BOMB);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Spawn primed tnt firing downwards TODO: maybe add sound effects for tnt firing? :P\n\t\t\t\t\t\t\tTNTPrimed tnt = cannons[i].getWorld().spawn(cannons[i].getLocation().clone().add(0, -1, 0), TNTPrimed.class);\n\t\t\t\t\t\t\ttnt.setVelocity(new Vector(0, -0.5, 0));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// More cannons on ship than allowed. Not all fired - can break out of loop now.\n\t\t\t\t\t\t\tplayer.sendMessage(ChatColor.AQUA + \"Some cannons did not fire. Max cannon limit is \" + ChatColor.GOLD + this.properties.MAX_NUMBER_OF_CANNONS);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\tplayer.sendMessage(ChatColor.GOLD + this.properties.SHIP_TYPE + \" CANNOT DROP BOMBS\");\n\t\t} else\n\t\t\tplayer.sendMessage(ChatColor.GOLD + \"COOLING DOWN FOR \" + ChatColor.AQUA + (int)(Math.round(6 - (System.currentTimeMillis() - this.lastFired) / 1000)) + ChatColor.GOLD + \" MORE SECONDS\");\n\t}", "public void endTurn(int player)\r\n/* 282: */ {\r\n/* 283:320 */ for (AgentModel model : this.agentModels.values()) {\r\n/* 284:322 */ if (model.getPlayer() == player)\r\n/* 285: */ {\r\n/* 286:324 */ model.clearMovementStack();\r\n/* 287:325 */ model.setAp(0);\r\n/* 288: */ }\r\n/* 289: */ }\r\n/* 290: */ }", "public void resetStatusEffects() {\r\n\t\tfor (Pokemon p : ownedPokemon) {\r\n\t\t\tp.resetStats();\r\n\t\t}\r\n\t}", "private void resetPlayer() {\r\n List<Artefact> inventory = currentPlayer.returnInventory();\r\n Artefact item;\r\n int i = inventory.size();\r\n\r\n while (i > 0) {\r\n item = currentPlayer.removeInventory(inventory.get(i - 1).getName());\r\n currentLocation.addArtefact(item);\r\n i--;\r\n }\r\n currentLocation.removePlayer(currentPlayer.getName());\r\n locationList.get(0).addPlayer(currentPlayer);\r\n currentPlayer.setHealth(3);\r\n }", "public void fullyHeal() {\n removeStatus();\n getActualMoves().restoreAllPP();\n healHealthFraction(1);\n }", "private void sendZombies(PrintWriter stream){\r\n\t\tfor(Zombie z: zombies){\r\n\t\t\tz.sendData(stream);\r\n\t\t}\r\n\t}", "public void dealInitialPlayerHands() {\n\t\tint temp = 0;\n\t\tSystem.out.println(\"This is the deck size before dealing: \" + this.tileDeck.deckSize());\n\t\tSystem.out.println(\"_______________________________________________\");\n\t\tfor (Player p : this.playerList) {\n\t\t\ttemp++;\n\t\t\tfor (int i = 0; i < 14; i ++) {\n\t\t\t\tp.hand.add(this.tileDeck.dealTile());\n\t\t\t}\n\t\t\tp.sort();\n\t\t\tSystem.out.println(\"Player \" + temp + \"'s hand: \" + p.getHandTiles());\n\t\t\tSystem.out.println(\"_______________________________________________\");\n\t\t}\n\t\t//System.out.println(this.tileDeck.deckSize());\n\t}", "public void tickBombs() {\r\n\t\tfor (int i = 0; i < bombs.length; i++) {\r\n\t\t\tBomb b = bombs[i];\r\n\t\t\tif (b != null) {\r\n\t\t\t\tif (b.isTicking()) {\r\n\t\t\t\t\tb.tick();\r\n\t\t\t\t} else if (b.isExploding()) {\r\n\t\t\t\t\tif (b.getExplosionTicks() == b.getMaxExplosionTicks()) {\r\n\t\t\t\t\t\texplodeBomb(b);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tb.tick();\r\n\t\t\t\t} else if (b.hasFinished()) {\r\n\t\t\t\t\tclearExplosions(b);\r\n\t\t\t\t\tbombs[i] = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void handleBakePie(Player player) {\n\t\t\n\t}", "private GameObject spawnBoss(LogicEngine in_logicEngine,LevelManager in_manager)\r\n\t{\n\t\tGameObject go = new GameObject(\"data/\"+GameRenderer.dpiFolder+\"/redcube.png\",in_logicEngine.SCREEN_WIDTH/2,LogicEngine.rect_Screen.getHeight()+50,0);\r\n\t\tboss = go;\r\n\t\t\r\n\t\tboss.i_animationFrameRow = 1;\r\n\t\tboss.i_animationFrame =0;\r\n\t\tboss.i_animationFrameSizeWidth =75;\r\n\t\tboss.i_animationFrameSizeHeight =93;\r\n\t\t\r\n\t\tboss.v.setMaxForce(1);\r\n\t\tboss.v.setMaxVel(5);\r\n\t\tboss.stepHandlers.add( new BounceOfScreenEdgesStep());\r\n\t\t\r\n\t\t\r\n\t\tboss_arrive.setAttribute(\"arrivedistance\", \"50\", null);\r\n\t\tboss.stepHandlers.add( new CustomBehaviourStep(boss_arrive));\r\n\t\tboss.isBoss = true;\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\tHitpointShipCollision c = new HitpointShipCollision(boss, 150, 40, true,1);\r\n\t\t\r\n\t\tif(Difficulty.isMedium())\r\n\t\t\tc.f_numberOfHitpoints = 200;\r\n\t\t\r\n\t\tif(Difficulty.isHard())\r\n\t\t\tc.f_numberOfHitpoints = 250;\r\n\t\t\r\n\t\tif(Difficulty.isMedium())\r\n\t\t\ti_bossBubbleEvery = 125;\r\n\t\t\r\n\t\tif(Difficulty.isHard())\r\n\t\t\ti_bossBubbleEvery = 100;\r\n\t\t\r\n\t\t\r\n\t\tc.addHitpointBossBar(in_logicEngine);\r\n\t\tc.setExplosion(Utils.getBossExplosion(boss));\r\n\t\tboss.collisionHandler = c;\r\n\t\t\r\n\t\tboss.allegiance = GameObject.ALLEGIANCES.ENEMIES;\r\n\t\t//initial velocity of first one \r\n\t\tboss.v.setVel(new Vector2d(0,-5));\r\n\t\t\r\n\t\tGameObject Tadpole1 = in_manager.spawnTadpole(in_logicEngine);\r\n\t\tGameObject Tadpole2 = in_manager.spawnTadpole(in_logicEngine);\r\n\t\t\r\n\t\tGameObject Bubble = null;\r\n\t\t\r\n\t\t\r\n\t\tBubble = spawnBossBubble(in_logicEngine, 0, 3);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tTadpole1.v.setVel(new Vector2d(-10,5));\r\n\t\tTadpole2.v.setVel(new Vector2d(10,5));\r\n\t\tBubble.v.setVel(new Vector2d(0,-5));\r\n\t\t\r\n\t\tLaunchShipsStep l1 = new LaunchShipsStep(Tadpole1 , 50, 5, 1, false);\r\n\t\tLaunchShipsStep l2 = new LaunchShipsStep(Tadpole2, 50, 5, 1, true);\r\n\t\tLaunchShipsStep l3 = new LaunchShipsStep(Bubble, i_bossBubbleEvery, 1, 1, true);\r\n\t\tl1.b_addToBullets = true;\r\n\t\tl2.b_addToBullets = true;\r\n\t\t\r\n\t\tboss.stepHandlers.add(l1);\r\n\t\tboss.stepHandlers.add(l2);\r\n\t\tboss.stepHandlers.add(l3);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\td_eye = new Drawable();\r\n\t\td_eye.i_animationFrameSizeHeight=8;\r\n\t\td_eye.i_animationFrameSizeWidth=8;\r\n\t\td_eye.i_animationFrameRow = 3;\r\n\t\td_eye.str_spritename = \"data/\"+GameRenderer.dpiFolder+\"/eye.png\";\r\n\t\t\r\n\t\tboss.visibleBuffs.add(d_eye);\r\n\t\t\r\n\t\treturn boss;\r\n\t}", "void bust() {\n\t\t_loses++;\n\t\t//_money -= _bet;\n\t\tclearHand();\n\t\t_bet = 0;\n\t}", "@Override\r\n\tpublic void reset() {\r\n\t\tairCrafts.clear();\r\n\t}", "public void run() \n\t\t\t{\n\t\t\t\tif (Math.abs(player.getLocation().getX() - playerLoc.getX()) > 1\n\t\t\t\t\t\t|| Math.abs(player.getLocation().getY() - playerLoc.getY()) > 1\n\t\t\t\t\t\t|| Math.abs(player.getLocation().getZ() - playerLoc.getZ()) > 1)\n\t\t\t\t{\n\t\t\t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You cannot move while bandaging!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tString name = player.getCustomName();\n\t\t\t\tif (name == null)\n\t\t\t\t\tname = player.getName();\n\t\t\t\t\n\t\t\t\t//Check that the recipient is still in roughly the same location\n\t\t\t\t//Skip if self-heal\n\t\t\t\tif (!player.equals(recipient))\n\t\t\t\t\tif (Math.abs(recipient.getLocation().getX() - recipientLoc.getX()) > 1\n\t\t\t\t\t\t|| Math.abs(recipient.getLocation().getY() - recipientLoc.getY()) > 1\n\t\t\t\t\t\t|| Math.abs(recipient.getLocation().getZ() - recipientLoc.getZ()) > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You cannot bandage your patient while they are moving!\");\n\t\t\t\t\t\trecipient.sendMessage(ChatColor.YELLOW + name + \" cannot bandage you while you are moving!\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Remove item from player's inventory.\n\t \t\tplayer.getInventory().removeItem(new ItemStack(Material.getMaterial(item.toUpperCase()), 1));\n\t \t\tplayer.updateInventory();\n\t \t\t\t\n\t \t\t//Heal the other player.\n\t \t\trecipient.setHealth(recipient.getHealth() + amountToHeal);\n\n\t \t\t//Award experience.\n\t \t\tProfessionStats prof = new ProfessionStats(perms, data, config, player.getUniqueId());\n\t \t\t\n\t \t\tif (!prof.isPracticeFatigued(profession))\n\t \t\t\taddExperience(player, profession, config.getInt(\"healing.\" + item + \".exp\"));\n\t \t\t\t\n\t \t\t//Notify both parties.\n\t \t\tif (!player.equals(recipient))\n\t \t\t{\t \t\t\n\t \t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You bandaged \" + recipient.getName() + \"'s wounds.\");\n\t \t\t\trecipient.sendMessage(ChatColor.YELLOW + player.getName() + \" bandaged your wounds.\");\n\t \t\t}\n\t \t\telse\n\t \t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You bandaged your wounds.\");\n\t\t\t }", "public void onContainerClosed(EntityPlayer par1EntityPlayer) {\r\n super.onContainerClosed(par1EntityPlayer);\r\n \r\n if (!this.worldObj.isRemote) {\r\n for (int i = 0; i < 9; ++i) {\r\n ItemStack stack = this.craftMatrix.getStackInSlotOnClosing(i);\r\n \r\n if (stack != null) {\r\n par1EntityPlayer.dropPlayerItemWithRandomChoice(stack, false);\r\n }\r\n }\r\n }\r\n }", "@EventHandler\r\n\tpublic void Playerleave(PlayerQuitEvent e) {\r\n\t\tPlayer p = e.getPlayer();\r\n\t\tString pname = p.getName();\r\n\t\tp.getInventory().clear();\r\n\t\t Bukkit.broadcastMessage(\"\" + ChatColor.RED + ChatColor.WHITE + \"BMT | \" + pname + ChatColor.RESET + \"Heeft de server verlaten!\" + \"\");\r\n\t}", "public void syncRemoveQueue() {\n if (!this.removeQueue.isEmpty()) {\n CommonPacket packet = PacketType.OUT_ENTITY_DESTROY.newInstance(this.removeQueue);\n this.removeQueue.clear();\n Player p = this.playerRef.get();\n if (p != null) {\n PacketUtil.sendPacket(p, packet);\n }\n }\n }", "void emptyManaPools(Ability source);", "public void resetHealth() {\n\t\tthis.health = this.getCombatDefinition().getMaxHealth();\n\t}", "@EventHandler(priority = EventPriority.MONITOR)\n public void PlayerQuit(PlayerQuitEvent e){\n plugin.playerIslands.remove(e.getPlayer().getName());\n }", "private void handleCombat(PlayerHealth playerHealth) {\n if (playerHealth.getHealthLevel() == 0) {\n loseScreen();\n }\n }", "void closeInventory(Player player, CloseReason reason);", "public void addKill(ArenaPlayer player) {\n \t\tTeam t = getTeam(player);\n \t\tt.addKill(player);\n \t}", "public void actionPerformed(ActionEvent e){\n\t\t\tt.rotateStick(mx, my);\n\t\t\tfor (int i = 0; i < bombers.size(); i ++){ //manages the dropping of the bombs of the bombers\n\t\t\t\t if (bombers.get(i).exists) bombers.get(i).moveBomber();\n\t\t\t\t bombers.get(i).manageDropping(t);\n\t\t \t}\n\t\t\tfor(int i = 0; i < bombers.size(); i ++){ //manages the removing of the bombers from the array\n\t\t\t\tif (bombers.get(i).exists == false && bombers.get(i).startboomtimer == false) bombers.remove(i);\n\t\t\t}\n\t\t\t\n\t\t\tif (bombers.isEmpty()){ //manages what happens after waveclear is complete\n\t\t\t\tnumplanes ++;\n\t\t\t\t\n\t\t\t\tif (numplanes <= 4){ //if the waves have not maxed out and you have not beat the game, crete question panel to move on\n\t\t\t\t\tmoveframe = new JFrame (\"Move on\");\n\t\t\t\t\t\n\t\t\t\t\tRandom rand = new Random();\n\t\t\t\t\tmoveframe.setSize(500,320);\n\t\t\t\t\tQuestion question1 = questions.get(rand.nextInt(questions.size()));\n\t\t\t\t\tQuestion question2;\n\t\t\t\t\tdo {\n\t\t\t\t\t\tquestion2 = questions.get(rand.nextInt(questions.size()));\n\t\t\t\t\t} while(question2.equals(question1));\n\t\t\t\t\tmoveframe.getContentPane().add(new QuestionPanelLoss(question1, question2, 1), BorderLayout.CENTER);\n\t\t\t\t\tmoveframe.setLocationRelativeTo(null);\n\t\t\t\t\tmoveframe.setVisible(true);\n\n\t\t\t\t\t\n\t\t\t\t\ttime.stop();\n\t\t\t\t}\n\t\t\t\telse{ //make a congragulatory frame if you clear all the waves\n\t\t\t\t\tmoveframe = new JFrame (\"gratz u won\");\n\t\t\t\t\tmoveframe.setSize(300,200);\n\t\t\t\t\tmoveframe.getContentPane().add(new JLabel(\"YAYYY U WON\"), BorderLayout.CENTER);\n\t\t\t\t\tmoveframe.setLocationRelativeTo(null);\n\t\t\t\t\tmoveframe.setVisible(true);\n\t\t\t\t\tJButton exit = new JButton(\"exit\");\n\t\t\t\t\texit.addActionListener(new TwoTime());\n\t\t\t\t\tmoveframe.getContentPane().add(exit, BorderLayout.SOUTH);\n\t\t\t\t\ttime.stop();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\trepaint();\n\t\t\t \n\t\t}" ]
[ "0.65392506", "0.6041375", "0.5934355", "0.5921941", "0.5689756", "0.56707096", "0.5577483", "0.55551505", "0.55225694", "0.5521384", "0.55083257", "0.5480475", "0.53885245", "0.53842086", "0.5373688", "0.5317341", "0.5312041", "0.52733505", "0.5269063", "0.52570146", "0.5247795", "0.5232244", "0.5212205", "0.5208023", "0.5196913", "0.51889116", "0.51869434", "0.51866996", "0.5179893", "0.5156985", "0.5153847", "0.51535237", "0.515265", "0.5145715", "0.51401436", "0.513717", "0.5108859", "0.509401", "0.50838464", "0.5083369", "0.5083045", "0.50825936", "0.5073848", "0.50692105", "0.5062053", "0.5060598", "0.5057695", "0.50513774", "0.50424355", "0.50418437", "0.5040142", "0.50361156", "0.502114", "0.50157225", "0.5010487", "0.5009801", "0.5007174", "0.50035876", "0.4997412", "0.49959803", "0.49793106", "0.49740586", "0.49679452", "0.4961728", "0.49551135", "0.49509892", "0.49458995", "0.4943783", "0.49379107", "0.4932376", "0.49316677", "0.49294427", "0.49242738", "0.49239042", "0.4916623", "0.49129748", "0.49064788", "0.49046862", "0.4896959", "0.4895794", "0.48957092", "0.48941875", "0.48933166", "0.48911545", "0.48855275", "0.4883454", "0.488276", "0.48806214", "0.4877537", "0.48702186", "0.48666874", "0.4866303", "0.4865633", "0.4860961", "0.4854697", "0.48537144", "0.4850168", "0.48498031", "0.48452413", "0.48417112" ]
0.6577018
0
Shows bossbars to player if display condition is met
private void showBossBars(TabPlayer p, List<String> bars) { if (bars == null) return; for (String defaultBar : bars) { BossBarLine bar = getLines().get(defaultBar); if (bar.isConditionMet(p) && !p.getActiveBossBars().contains(bar)) { bar.create(p); p.getActiveBossBars().add(bar); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void run() {\n for(MessageManager temp : plugin.playerBossBars.values()){\n if(temp.bossBar.getPlayers().size() > 0){\n temp.advanceBar();\n\n BossBarMessage currentMessage = temp.getCurrentMessageObject();\n temp.bossBar.setTitle(currentMessage.barMessage);\n temp.bossBar.setColor(currentMessage.barColor);\n temp.bossBar.setStyle(currentMessage.barStyle);\n }\n }\n }", "public void detectBossBarsAndSend(TabPlayer p) {\n\t\tp.getActiveBossBars().clear();\n\t\tif (playersInDisabledWorlds.contains(p) || !p.hasBossbarVisible()) return;\n\t\tshowBossBars(p, defaultBars);\n\t\tshowBossBars(p, getAnnouncements());\n\t\tshowBossBars(p, perWorld.get(tab.getConfiguration().getWorldGroupOf(perWorld.keySet(), p.getWorldName())));\n\t}", "public abstract BossBar show();", "public static void main(String[] args) {\n\t\tint myHp = 100;\r\n\t\tint bossHp = 100;\r\n\t\t\r\n\t\tmyHp = myHp - 99;\r\n\t\tbossHp = bossHp - 100;\r\n\t\t\r\n\t\tif(myHp > 0 && bossHp <= 0) {\r\n\t\t\tSystem.out.println(\"my win\");\r\n\t\t}else if(myHp <= 0 && bossHp<= 0) {\r\n\t\t\tSystem.out.println(\"draw\");\r\n\t\t}else if(myHp <= 0 && bossHp > 0) {\r\n\t\t\tSystem.out.println(\"boss win\");\r\n\t\t}\r\nSystem.out.println(!true);\r\nSystem.out.println(!false);\r\n\t}", "public void showFightSetup(PlayerStats enemyStats, PlayerStats stats, Card card) {\n\t\t\tJLabel title = new JLabel();\r\n\t\t\ttitle.setText(\"Commit troops to fight!\");\r\n\t\t\ttitle.setFont(new Font(\"Arial\", Font.BOLD, 18));\r\n\t\t\tcontent.add(title);\r\n\t\t\r\n\t\t\t//Initialize label\r\n\t\t\tJLabel troopsToCommit = new JLabel();\r\n\t\t\ttroopsToCommit.setFont(new Font(\"Arial\", Font.BOLD, 18));\r\n\t\t\ttroopsToCommit.setAlignmentX(Component.CENTER_ALIGNMENT);\r\n\t\t\r\n\t\t\tJSlider slider = new JSlider(0, enemyStats.getArmySize(), 0); //From 0 to the population minus the minimum population that cannot be in the army.\r\n\t\t\tslider.setPreferredSize(new Dimension(width - 30, 90));\r\n\t\t\tslider.setMajorTickSpacing(250);\r\n\t\t\tslider.setMinorTickSpacing(100);\r\n\t\t\tslider.setPaintLabels(true);\r\n\t\t\tslider.setPaintTicks(true);\r\n\t\t\tslider.addChangeListener(new ChangeListener() {\r\n\t\t\t\tpublic void stateChanged(ChangeEvent event) {\r\n\t\t\t\t\tint change = slider.getValue();\r\n\t\t\t\t\ttroopsToCommit.setText(\"Troops: \" + change + \"\\n\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tcontent.add(slider);\r\n\t\t\r\n\t\t\t//This is the amount of troops the enemy has.\r\n\t\t\tJLabel enemyTroops = new JLabel(\"Enemy Troops: \" + card.getTroopContribution());\r\n\t\t\tenemyTroops.setFont(new Font(\"Arial\", Font.BOLD, 18));\r\n\t\t\tenemyTroops.setAlignmentX(Component.CENTER_ALIGNMENT);\r\n\t\t\r\n\t\t\tJButton fight = new JButton(\"FIGHT!\");\r\n\t\t\tfight.setFont(new Font(\"Arial\", Font.BOLD, 18));\r\n\t\t\tfight.setAlignmentX(Component.CENTER_ALIGNMENT);\r\n\t\t\tfight.addMouseListener(new MouseAdapter() {\r\n\t\t\t\tpublic void mousePressed(MouseEvent evt) {\r\n\t\t\t\t\tSystem.out.println(\"Starting fight on \" + card.getName());\r\n\t\t\t\t\t\r\n\t\t\t\t\tint enemyTroops = slider.getValue();\r\n\t\t\t\t\tBattle battle = new Battle(card.getTroopContribution(), card.getDefensiveBonus(), enemyTroops);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Subtract dead troops from the card's troop contributions\r\n\t\t\t\t\tdefenseSurvivors = battle.getDefenseSurvivors();\r\n\t\t\t\t\tdefenseDead = card.getTroopContribution() - defenseSurvivors;\r\n\t\t\t\t\tSystem.out.println(\"Defense Dead: \" + defenseDead);\r\n\t\t\t\t\tSystem.out.println(\"Defense Alive: \" + defenseSurvivors);\r\n\t\t\t\t\tcard.subTroops(defenseDead);\r\n\t\t\t\t\r\n\t\t\t\t\t//This is the number of dead enemy troops\r\n\t\t\t\t\toffenseSurvivors = battle.getOffenseSurvivors();\r\n\t\t\t\t\toffenseDead = enemyTroops - offenseSurvivors;\r\n\t\t\t\t\tSystem.out.println(\"Offense Alive: \" + offenseSurvivors);\r\n\t\t\t\t\tSystem.out.println(\"Offense Dead: \" + offenseDead);\r\n\t\t\t\t\tenemyStats.subTroops(offenseDead);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//If the enemy wins we give them an award.\r\n\t\t\t\t\tif (defenseSurvivors == 0) { //A reward of resources\r\n\t\t\t\t\t\tint statResources = stats.getResource();\r\n\t\t\t\t\t\tremovedResources = (int) (statResources * 0.05);\r\n\t\t\t\t\t\tstats.removeResources(removedResources);\r\n\t\t\t\t\t\tenemyStats.addResources(removedResources);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (card.getPop() > U.planetMinPop) { //A reward of population\r\n\t\t\t\t\t\t\tremovedPop = (int) (card.getPop() * 0.15);\r\n\t\t\t\t\t\t\tcard.removePop(removedPop);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tint enemyCurPop = enemyStats.getPopulation();\r\n\t\t\t\t\t\t\tenemyStats.setPopulation(enemyCurPop + removedPop);\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//Update stats\r\n\t\t\t\t\tstats.getUser().updateSideNav();\r\n\t\t\t\t\tenemyStats.getUser().updateSideNav();\r\n\t\t\r\n\t\t\t\t\thideFightSetup();\r\n\t\t\r\n\t\t\t\t\t//Shows the results\r\n\t\t\t\t\tshowResults();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\r\n\t\t\r\n\t\t\t//This will holder everything under the slider\r\n\t\t\tJPanel holder = new JPanel();\r\n\t\t\tholder.setLayout(new BoxLayout(holder, BoxLayout.Y_AXIS));\r\n\t\t\tholder.setPreferredSize(new Dimension(width - 30, 200));\r\n\t\t\tholder.setBackground(modalColor.brighter());\r\n\t\t\tholder.add(enemyTroops);\r\n\t\t\tholder.add(troopsToCommit);\r\n\t\t\tholder.add(Box.createRigidArea(new Dimension(width, 15)));\r\n\t\t\tholder.add(fight);\r\n\t\t\tcontent.add(holder);\r\n\t}", "private void bust() {\n //Dialog box pop-up\n JOptionPane.showMessageDialog(this, this.getPlayerName() + \" busted with a value of: \" + this.getValue(), \"BUSTED!\", JOptionPane.INFORMATION_MESSAGE);\n busted = true; //Hand busted\n }", "private GameObject spawnBoss(LogicEngine in_logicEngine,LevelManager in_manager)\r\n\t{\n\t\tGameObject go = new GameObject(\"data/\"+GameRenderer.dpiFolder+\"/redcube.png\",in_logicEngine.SCREEN_WIDTH/2,LogicEngine.rect_Screen.getHeight()+50,0);\r\n\t\tboss = go;\r\n\t\t\r\n\t\tboss.i_animationFrameRow = 1;\r\n\t\tboss.i_animationFrame =0;\r\n\t\tboss.i_animationFrameSizeWidth =75;\r\n\t\tboss.i_animationFrameSizeHeight =93;\r\n\t\t\r\n\t\tboss.v.setMaxForce(1);\r\n\t\tboss.v.setMaxVel(5);\r\n\t\tboss.stepHandlers.add( new BounceOfScreenEdgesStep());\r\n\t\t\r\n\t\t\r\n\t\tboss_arrive.setAttribute(\"arrivedistance\", \"50\", null);\r\n\t\tboss.stepHandlers.add( new CustomBehaviourStep(boss_arrive));\r\n\t\tboss.isBoss = true;\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\tHitpointShipCollision c = new HitpointShipCollision(boss, 150, 40, true,1);\r\n\t\t\r\n\t\tif(Difficulty.isMedium())\r\n\t\t\tc.f_numberOfHitpoints = 200;\r\n\t\t\r\n\t\tif(Difficulty.isHard())\r\n\t\t\tc.f_numberOfHitpoints = 250;\r\n\t\t\r\n\t\tif(Difficulty.isMedium())\r\n\t\t\ti_bossBubbleEvery = 125;\r\n\t\t\r\n\t\tif(Difficulty.isHard())\r\n\t\t\ti_bossBubbleEvery = 100;\r\n\t\t\r\n\t\t\r\n\t\tc.addHitpointBossBar(in_logicEngine);\r\n\t\tc.setExplosion(Utils.getBossExplosion(boss));\r\n\t\tboss.collisionHandler = c;\r\n\t\t\r\n\t\tboss.allegiance = GameObject.ALLEGIANCES.ENEMIES;\r\n\t\t//initial velocity of first one \r\n\t\tboss.v.setVel(new Vector2d(0,-5));\r\n\t\t\r\n\t\tGameObject Tadpole1 = in_manager.spawnTadpole(in_logicEngine);\r\n\t\tGameObject Tadpole2 = in_manager.spawnTadpole(in_logicEngine);\r\n\t\t\r\n\t\tGameObject Bubble = null;\r\n\t\t\r\n\t\t\r\n\t\tBubble = spawnBossBubble(in_logicEngine, 0, 3);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tTadpole1.v.setVel(new Vector2d(-10,5));\r\n\t\tTadpole2.v.setVel(new Vector2d(10,5));\r\n\t\tBubble.v.setVel(new Vector2d(0,-5));\r\n\t\t\r\n\t\tLaunchShipsStep l1 = new LaunchShipsStep(Tadpole1 , 50, 5, 1, false);\r\n\t\tLaunchShipsStep l2 = new LaunchShipsStep(Tadpole2, 50, 5, 1, true);\r\n\t\tLaunchShipsStep l3 = new LaunchShipsStep(Bubble, i_bossBubbleEvery, 1, 1, true);\r\n\t\tl1.b_addToBullets = true;\r\n\t\tl2.b_addToBullets = true;\r\n\t\t\r\n\t\tboss.stepHandlers.add(l1);\r\n\t\tboss.stepHandlers.add(l2);\r\n\t\tboss.stepHandlers.add(l3);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\td_eye = new Drawable();\r\n\t\td_eye.i_animationFrameSizeHeight=8;\r\n\t\td_eye.i_animationFrameSizeWidth=8;\r\n\t\td_eye.i_animationFrameRow = 3;\r\n\t\td_eye.str_spritename = \"data/\"+GameRenderer.dpiFolder+\"/eye.png\";\r\n\t\t\r\n\t\tboss.visibleBuffs.add(d_eye);\r\n\t\t\r\n\t\treturn boss;\r\n\t}", "public abstract BossBar hide();", "void show() {\n if (!isDead) {\n for (int i = 0; i < bullets.size(); i++) {//show bullets\n bullets.get(i).show();\n }\n if (immortalityTimer >0) {//no need to decrease immortalityCounter if its already 0\n immortalityTimer--;\n }\n\n if (immortalityTimer >0 && floor(((float)immortalityTimer)/5)%2 ==0) {//needs to appear to be flashing so only show half of the time\n } else {\n\n Constants.processing.pushMatrix();\n Constants.processing.translate(this.position.x, this.position.y);\n Constants.processing.rotate(rotation);\n\n //actually draw the player\n Constants.processing.fill(0);\n Constants.processing.noStroke();\n Constants.processing.beginShape();\n int size = 12;\n\n //black triangle\n Constants.processing.vertex(-size - 2, -size);\n Constants.processing.vertex(-size - 2, size);\n Constants.processing.vertex(2 * size - 2, 0);\n Constants.processing.endShape(CLOSE);\n Constants.processing.stroke(255);\n\n //white out lines\n Constants.processing.line(-size - 2, -size, -size - 2, size);\n Constants.processing.line(2 * size - 2, 0, -22, 15);\n Constants.processing.line(2 * size - 2, 0, -22, -15);\n if (boosting) {//when boosting draw \"flames\" its just a little triangle\n boostCount--;\n if (floor(((float)boostCount)/3)%2 ==0) {//only show it half of the time to appear like its flashing\n Constants.processing.line(-size - 2, 6, -size - 2 - 12, 0);\n Constants.processing.line(-size - 2, -6, -size - 2 - 12, 0);\n }\n }\n Constants.processing.popMatrix();\n }\n }\n for (int i = 0; i < asteroids.size(); i++) {//show asteroids\n asteroids.get(i).show();\n }\n }", "public void act() \n {\n CreatureWorld playerWorld = (CreatureWorld)getWorld();\n\n if( getHealthBar().getCurrent() <= 0 )\n {\n getWorld().showText(\"Charmander has fainted...\", getWorld().getWidth()/2, getWorld().getHeight()/2 + 26);\n Greenfoot.delay(30);\n }\n }", "public void checkVisible(Status status) {\n if (status == Status.GAMEOVER) {\n this.exit.setVisible(true);\n this.name.setVisible(true);\n this.score.setVisible(true);\n this.text.setVisible(true);\n this.textField.setVisible(true);\n } else{\n this.exit.setVisible(false);\n this.name.setVisible(false);\n this.score.setVisible(false);\n this.text.setVisible(false);\n this.textField.setVisible(false);\n }\n }", "static void boss_fight() {\n miss_choice = miss.nextInt(2);//random used to determie a miss or a hit\n playerhealth = 3500;\n nagahealth = 3500;\n bosshealth = 10000;//#enemyobject-the actual boss that has created the game play(antagonsit)\n System.out.println(\"You have recently leveled up and have increased your HP to 3500. Be careful...\");\n System.out.println(\"You can now cast 8 different types of spells...\");\n enter = next.nextLine();\n System.out.println(\"These spells include fire, ice, wind, lightening, throw rocks, sacred sword, \");\n System.out.println(\"cosmic rays, and teleport\");\n enter = next.nextLine();\n System.out.println(\"Naga has his own spells don't worry about him...\");\n enter = next.nextLine();\n System.out.println(\"'I can use 3 different types of dark magic and 2 different types of normal attacks'\");\n System.out.println(\"Don't worry, we got this \"+ username + \".\");\n enter = next.nextLine();\n System.out.println(\"ALL OR NOTHING!!! GHAAAA!!!\");\n enter = next.nextLine();\n monsterisalive = true;\n //#while \n /* while loop that will let players fight the boss */\n while(monsterisalive){\n System.out.println(\"It is your turn...which move will you use:\");\n System.out.println(\"fire, ice, wind, lightening, throw rocks, sacred sword, cosmic rays, teleport, or heal.\");\n attack = next.nextLine();\n if(attack.contains(\"fire\")) {\n System.out.println(\"Alright, I'm fired up...FOOOSH!!!\");\n bosshealth = bosshealth-30; //player deals damage\n System.out.println(\"WHOA! The witch lost 30 HP. The boss now has \" + bosshealth + \" HP.\" );\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if(answer.contains(\"ice\")) {\n System.out.println(\"Alright, it's gonna be a little chilly...GHAAAA!!!\");\n bosshealth = bosshealth-20;\n System.out.println(\"BRRR... The evil witch lost 20 HP. The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if(answer.contains(\"lightening\")) {\n System.out.println(\"Someone's gonna get fried today! ZAAAAP!!!\");\n bosshealth = bosshealth-40;\n System.out.println(\"OUCH!!! The evil witch lost 40 HP. The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP\");\n }else if (answer.contains(\"throw rocks\")) {\n System.out.println(\"Incoming Boulder...BOOOOOMM!!!\");\n bosshealth = bosshealth-30;\n System.out.println(\"The witch lost 30 HP. It now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if (answer.contains(\"sacred swords\")) {\n System.out.println(username + \" summons the guardians of the 9 sacred swords, and \");\n System.out.println(\"the guardians released their swords to punish the wicked witch...\");\n enter = next.nextLine();\n System.out.println(\"The 9 swords punctures the wicked releasing powerful, positive energy.\");\n bosshealth = bosshealth-150;\n System.out.println(\"ZHHHHNGG!!! BOOOM!!! Ouch...the boss lost 150 HP. The boss now has \" + bosshealth);\n System.out.println(\"HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if (answer.contains(\"cosmic rays\")) {\n System.out.println(username + \" casts a spell that absorbs all of the radiation from space...\");\n System.out.println(\"Then a large light bombards the witch and inflicts 130 HP.\");\n bosshealth = bosshealth-130;\n enter = next.nextLine();\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n }else if (answer.contains(\"teleport\")) {\n System.out.println(username + \" creates a blue portal and jumps inside the portal...\");\n enter = next.nextLine();\n System.out.println(username + \" then teleports behind the witch and strikes...Then jumps back in...\");\n enter = next.nextLine();\n System.out.println(\"Then appears in the rear side and strikes the boss again and quickly disappears...\");\n enter = next.nextLine();\n System.out.println(\"Finally...\" + username + \" strikes again on top of the witch.\");\n enter = next.nextLine();\n bosshealth = bosshealth-210;\n System.out.println(\"WOW!!!\" + username + \" inflicted 210 HP. The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if(answer.contains(\"wind\")) {\n System.out.println(\"Alright, let's finish this up...WHIRL!!!\");\n bosshealth = bosshealth-10;\n System.out.println(\"The evil witch lost 10 HP. The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if (answer.contains(\"heal\")){\n healing_challenge3();\n System.out.println(\"\\n\");\n System.out.println(username + \"'s HP increased 300 health points and now have \" + playerhealth + \".\");\n System.out.println(\"The boss still has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n }else{\n System.out.println(\"Please make sure you type everything correctly next time. You lost a turn...\");\n }\n \n if(bosshealth <= zero) { //check to see if boss is still alive\n System.out.println(\"You defeated the boss...Congratulations, you have won the war.\");\n enter = next.nextLine();\n System.out.println(\"The witch has disappeared, vanished forever in a black hole that consumed the boss.\");\n enter = next.nextLine();\n System.out.println(\"That is the last time you'll ever see that hideous thing ever again.\");\n monsterisalive = false;\n endgame();\n // It's Naga's turn\n }else if (bosshealth > zero) {\n System.out.println(\"It's Naga's turn...You can do this Naga!\");\n naga_attacks = naga.nextInt(6);\n if(naga_attacks == 0){\n System.out.println(\"Naga used shadow force...\");\n System.out.println(\"Naga disappears in a pitch black vortex...\");\n enter = next.nextLine();\n System.out.println(\"GHAAAAR!!!\");\n enter = next.nextLine();\n System.out.println(\"Naga flies out of his vortex and rams into the witch. YOUCH!\");\n System.out.println(\"The boss lost 180 HP.\");\n bosshealth = bosshealth-180;//Naga deals damage\n enter = next.nextLine();\n System.out.println(\"The evil witch now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n }else if (naga_attacks == 1) {\n System.out.println(\"Naga used firebreath...A large dark ember sparks from naga's mouth and \");\n System.out.println(\"begins to build up. The large black fire surrounds the witch and burns the witch\");\n enter = next.nextLine();\n System.out.println(\"'ARGHH! You will pay for that', the witch screamed.\");\n enter = next.nextLine();\n bosshealth = bosshealth-200;\n System.out.println(\"WHOA!!! The fiery breath inflicted 200 HP. The boss now has\" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n }else if (naga_attacks == 2) {\n System.out.println(\"Naga used his blades of terror to torture the witch...\");\n System.out.println(\"Naga creates a strong whirlwind with his wings and released thousands of sharp\");\n System.out.println(\"scales that severely wounded the witch. SHINGG!!!\");\n enter = next.nextLine();\n bosshealth = bosshealth-150;\n System.out.println(\"OWWW!!! The boss lost 150 HP and now has \" + bosshealth + \"HP.\");\n enter = next.nextLine();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\"); \n }else if (naga_attacks == 3) {\n System.out.println(\"Naga used wings of Justice. \");\n enter = next.nextLine();\n System.out.println(\"Naga flies up high and plunges down toward the witch...\");\n System.out.println(\"Naga uppercuts the witch with his large wings and knocks the witch off her feet.\");\n enter = next.nextLine();\n bosshealth = bosshealth-210;\n System.out.println(\"YIKES!!! Naga inflicted 210 HP. The boss has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n }else if (naga_attacks == 4) {\n System.out.println(\"Naga used tail whip...\");\n System.out.println(\"SWWWSSS!!! BRMMM!!!\");\n System.out.println(\"Naga sets himself apart and lunges forward with his tail and thrusts the witch\");\n System.out.println(\"off the arena...\");\n enter = next.nextLine();\n System.out.println(\"The witch teleports herself back into the arena, but loses 60 HP because of this.\");\n bosshealth = bosshealth-60;\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"Now Naga has \" + nagahealth + \" HP.\");\n }else if (naga_attacks == 5) {\n healing_naga_challenge3();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n System.out.println(\"\\n\");\n System.out.println(\"The boss still has \" + bosshealth + \" HP.\");\n }\n }\n \n if(bosshealth <= zero) { //check to see if boss is still alive\n //#win\n /* This is the conditions to win. The boss's health must equal to or less than zero. If you win the \n boolean monsterisalive is equal to false and the player will come to the endgame method to \n displayt he credits...\n */\n System.out.println(\"You defeated the boss...Congratulations, you have won the war.\");\n enter = next.nextLine();\n System.out.println(\"The witch has disappeared, vanished forever in a black hole that consumed the boss.\");\n enter = next.nextLine();\n System.out.println(\"That is the last time you'll ever see that hideous thing ever again.\");\n monsterisalive = false;\n endgame();\n //it's the boss's turn\n }else if (bosshealth > zero) { //if it is still greater than zero...\n System.out.println(\"It's the monster's turn...brace yourselves\");\n System.out.println(\"'The witch has 8 different spells that she can use...she's very strong...\");\n System.out.println(\"BE CAREFUL,' stated Naga.\");\n enter = next.nextLine();\n System.out.println(\"Are you ready to feel what pain really is? Prepare yourself...\");\n System.out.println(\"ARGGHHH!!! BRRRM!!!\");\n enter = next.nextLine();\n System.out.println(\"Naga and \"+ username + \" are on their guard ready to defend against the witches attacks\");\n enter = next.nextLine();\n System.out.println(\"Here I go...\");\n enter = next.nextLine();\n which = pick.nextInt(2);//decide which one will get hit: player or Naga\n boss_attacks = boss.nextInt(9);//decides which\n if (boss_attacks == 0) {\n System.out.println(\"'Night Shadow!'\");\n //this will determine which player gets hit; you or Naga\n if(which == 0) { //player gets hit\n enter = next.nextLine();\n System.out.println(\"The witch summons a dark cloud from above with her staff...\");\n enter = next.nextLine();\n /* #enemyobject\n The witch affects the protagonist/player by harming the player's health through savage attacks that \n inflicts large amounts of damage to the player. \n */\n System.out.println(\"The dark cloud duplicates and strikes \" + username + \".\");\n enter = next.nextLine();\n System.out.println(\"Ouch \" + username + \" loses 200 HP.\");\n playerhealth = playerhealth-200;\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (which == 1) { //naga gets hit\n enter = next.nextLine();\n System.out.println(\"The witch summons a dark cloud from above with her staff...\");\n enter = next.nextLine();\n System.out.println(\"The dark cloud duplicates and strikes Naga. Naga collapses\");\n enter = next.nextLine();\n System.out.println(\"Ouch Naga loses 200 HP.\");\n nagahealth = nagahealth-200;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 1) {\n System.out.println(\"'Shadow Blade!'\");\n //this will determine who will get hit\n if (which == 0) { // player gets hit\n System.out.println(\"The witch's staff transforms into a deadly blade.\");\n System.out.println(\"The blade has \" + username + \"'s face on the back...\");\n enter = next.nextLine();\n System.out.println(\"Watch out \" + username + \". She's on to you...\");\n enter = next.nextLine();\n System.out.println(\"The witch charges up and strikes \" + username + \".\");\n System.out.println(\"SLASH...SHING!!!\");\n enter = next.nextLine();\n System.out.println(\"OUCH!!! \" + username + \" loses 150 HP.\");\n playerhealth = playerhealth-150;\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (which == 1) { //naga gets hit\n System.out.println(\"The witch's staff transforms into a deadly blade.\");\n System.out.println(\"The blade has a black dragon symbol on the edge...\");\n enter = next.nextLine();\n System.out.println(\"'Naga she's on to you. WATCH OUT!' \" + username + \" screams.\");\n System.out.println(\"SLASH...SHING!!!\");\n enter = next.nextLine();\n System.out.println(\"OUCH!!! naga loses 150 HP.\");\n nagahealth = nagahealth-150;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 2) {\n System.out.println(\"Dragon spiral!\");\n if(which == 0) { //player gets hit\n System.out.println(\"The witch summons a red and purple dragon underground...\");\n System.out.println(\"The red and purple dragon shoots out red and purple flames that fuse\");\n System.out.println(\"together to form a gigantic half red and purple flame.\");\n enter = next.nextLine();\n System.out.println(\"Look out \" + username + \".\");\n System.out.println(\"FOOOSH!!! The burning lava like embers engulf \" + username + \".\");\n enter = next.nextLine();\n System.out.println(\"ARRHHH!!! \" + username + \" loses 300 HP.\");\n playerhealth = playerhealth-300;\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (which == 1) { //naga gets hit\n System.out.println(\"The witch summons a red and purple dragon underground...\");\n System.out.println(\"The red and purple dragon shoots out red and purple flames that fuse\");\n System.out.println(\"together to form a gigantic half red and purple flame.\");\n enter = next.nextLine();\n System.out.println(\"'Look out Naga,' \" + username + \" stated.\");\n System.out.println(\"FOOOSH!!! The burning lava like embers engulf Naga.\");\n enter = next.nextLine();\n System.out.println(\"ARRHHH!!! Naga loses 300 HP.\");\n nagahealth = nagahealth-300;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 3) {\n System.out.println(\"Take over\");\n enter = next.nextLine();\n System.out.println(\"The witch summons the demons and releases them from a black portal she created\");\n System.out.println(\"Gouls, bats, and other hideous creatures emerged from the darkness\");\n if(which == 0) {// player gets hit\n System.out.println(\"The creatures targets \" + username + \".\");\n enter = next.nextLine();\n System.out.println(\"Watch out \" + username + \".\");\n System.out.println(\"GARRRL!!! SCRAA!!! FOOSHING!!!\");\n enter = next.nextLine();\n System.out.println(\"AHHH!!! \" + username + \" gets bitten, beaten, and scratched ...\");\n playerhealth = playerhealth-50;\n System.out.println(username + \" loses 50 HP. You now have \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (which == 1) {\n System.out.println(\"The creatures targets Naga.\");\n enter = next.nextLine();\n System.out.println(\"'Watch out Naga,' \" + username + \" stated.\");\n System.out.println(\"GARRRRL!!! SCRAAA!!! FOOOSHHING!!!\");\n enter = next.nextLine();\n nagahealth = nagahealth-50;\n System.out.println(\"ARRGGG!!! Naga loses 50 HP. Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 4) {\n System.out.println(\"dark cosmic swords!!!\");\n System.out.println(\"GHAAA!!!\");\n enter = next.nextLine();\n System.out.println(\"There are 5 darks lands in her reign, which means 5 different swords in her possession.\");\n System.out.println(\"Sword 1 released fire...\");\n System.out.println(\"FOOSHHH!!!\");\n enter = next.nextLine();\n System.out.println(\"Sword 2 released water...\");\n System.out.println(\"GURLG!!! FSHHH!!!\");\n enter = next.nextLine();\n System.out.println(\"Sword 3 released ice...\");\n System.out.println(\"SHING!!! BRRRRR!!!\");\n enter = next.nextLine();\n System.out.println(\"Sword 4 released wind...\");\n System.out.println(\"WHIRL!!! WHIRL!!! GUSHHH!!!\");\n enter = next.nextLine();\n System.out.println(\"Sword 5 released lightening...\");\n System.out.println(\"ZHNGGG!!! BAM!!!! BRVRMM!!!\");\n System.out.println(\"The ground ruptures and collides on \" + username + \" and Naga.\");\n enter = next.nextLine();\n System.out.println(\"These swords have just released the dark elements of the earth!\");\n System.out.println(\"YOUCH!!! Both Naga and \" + username + \" lost 220 HP.\");\n enter = next.nextLine();\n playerhealth = playerhealth-220;\n nagahealth = nagahealth-220;\n System.out.println(username + \" now has \" + playerhealth + \" HP and Naga has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }else if (boss_attacks == 5) {\n System.out.println(\"Knock down!\");\n if(miss_choice == 0) {//boss miss\n System.out.println(\"The witch summons a dark spell from her staff.\");\n enter = next.nextLine();\n System.out.println(\"An evil figure lurks in the shadows...'Can you see it Naga?' \");\n System.out.println(username + \" said.\");\n enter = next.nextLine();\n System.out.println(\"'No...I can't see a thing.\");\n enter = next.nextLine();\n System.out.println(\"Suddenly, you see a big shadow coming at Naga.\");\n enter = next.nextLine();\n System.out.println(username + \" sends a fireball flying at the shadowy figure and it disappears.\");\n System.out.println(\"Naga then sees the figure coming towards \" + username + \" and sends a flame\");\n System.out.println(\"at the shadow...The figure plunges back into the witches staff. \");\n enter = next.nextLine();\n System.out.println(\"'I guess you saw that coming, won't happen ever again!' the witch exclaimed.\");\n enter = next.nextLine();\n System.out.println(\"You dodged the witches attack!\");\n enter = next.nextLine();\n playerhealth = playerhealth-0;\n nagahealth = nagahealth-0;\n System.out.println(username + \" still has \" + playerhealth + \" HP.\");\n System.out.println(\"Naga still has \" + nagahealth + \" HP.\");\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (miss_choice == 1) { //boss hits\n System.out.println(\"The witch summons a dark spell from her staff.\");\n enter = next.nextLine();\n System.out.println(\"An evil figure lurks in the shadows...'Can you see it Naga?' \");\n System.out.println(username + \" said.\");\n enter = next.nextLine();\n System.out.println(\"'No...I can't see a thing.\");\n enter = next.nextLine();\n System.out.println(\"Suddenly, you see a big shadow coming at Naga.\");\n enter = next.nextLine();\n System.out.println(username + \" sends a fireball flying at the shadowy figure, but you missed!\");\n System.out.println(\"The shadowy figure steals 50 HP of Naga's health.\");\n nagahealth = nagahealth-50;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The shadowy figure then turns towards \" + username + \".\");\n System.out.println(\"Naga spits out a large fire, but misses the figure...\");\n System.out.println(\"The shadowy figure steals 50 HP of \" + username + \".\");\n playerhealth = playerhealth-50;\n System.out.println(username + \" still has \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 6) {\n System.out.println(\"Volcanic Eruption!\");\n if(miss_choice == 0) {//the boss misses\n System.out.println(\"The witch casts a spell that creates a series of volcanoes around you.\");\n System.out.println(\"The witch then forces the volcanoes to spit lava out...\");\n System.out.println(\"However, you saw that coming already. You and Naga jumped out of the way\");\n enter = next.nextLine();\n System.out.println(\"You dodged the attack!\");\n playerhealth = playerhealth-0;\n nagahealth = nagahealth-0;\n System.out.println(username + \" has \" + playerhealth + \" HP, and Naga has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (miss_choice == 1) {//the boss is able to hit you\n System.out.println(\"The witch summons the evil lava guardian...\");\n System.out.println(\"She then points her staff directly at...\");\n if(which == 0){//player gets hit\n System.out.println(username);\n enter = next.nextLine();\n System.out.println(\"Watch out!!!\");\n System.out.println(\"GURGLLE!!! FSH!!!\");\n System.out.println(\"The lava erupts like a fountain lake and basks \" + username + \".\");\n System.out.println(username + \" loses 100 HP.\");\n enter = next.nextLine();\n playerhealth = playerhealth-100;\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }else if (which == 1){ //naga gets hit\n System.out.println(\"Naga\");\n enter = next.nextLine();\n System.out.println(\"Watch out!\");\n System.out.println(\"GURGLRE!!! FSH!!!\");\n System.out.println(\"The lava shoots out at Naga's face, feet, and back...\");\n System.out.println(\"Removing all of his scales in the process\");\n System.out.println(\"Naga loses 100 HP.\");\n enter = next.nextLine();\n nagahealth = nagahealth-100;\n System.out.println(username + \" has \" + playerhealth + \" HP.\");\n System.out.println(\"Naga has \" + nagahealth + \" HP.\");\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }\n }\n }else if (boss_attacks == 7) {\n System.out.println(\"Satin's Spear\");\n System.out.println(\"The witch uses her staff to summon her friend Satin...\");\n enter = next.nextLine();\n System.out.println(\"EXTERMINATE THEM!!!\");\n if(miss_choice == 0){ //boss missed\n System.out.println(\"Yes ma'm...\");\n System.out.println(\"Statin launches his spear...\");\n enter = next.nextLine();\n System.out.println(\"BUT, Naga and \" + username + \" were able to dodge the attack!\");\n System.out.println(\"MISS!\");\n enter = next.nextLine();\n System.out.println(\"OOPS!\");\n playerhealth = playerhealth-0;\n nagahealth = nagahealth-0;\n System.out.println(username + \" has \" + playerhealth + \" and Naga has \" + nagahealth + \" HP.\");\n System.out.println(\"The boss has \"+ bosshealth + \" HP.\");\n }else if(miss_choice == 1){//boss gets a hit\n System.out.println(\"Yes ma'm...\");\n System.out.println(\"URGGGHAAA!!!\");\n enter = next.nextLine();\n System.out.println(\"Satin launches his spear, which duplicated...\");\n System.out.println(\"The spear is still launching up on the air...\");\n enter = next.nextLine();\n if(which == 0) { //player gets hit\n System.out.println(username + \" wants to protect his friend so he jumps forward to block\");\n System.out.println(\"the threatening spear from piercing his friend...\");\n enter = next.nextLine();\n System.out.println(\"However, in doing so the spear lands on \" + username + \".\");\n System.out.println(\"The spear erupts into pieces, shattering \" + username + \"'s legs.\");\n enter = next.nextLine();\n System.out.println(\"The wound heals but inflicts 300 damage to \" + username + \".\");\n playerhealth = playerhealth-300;\n System.out.println(username + \" has \" + playerhealth + \" HP.\");\n }else if(which == 1) { //Naga gets hit\n System.out.println(\"Naga tries to shield \" + username + \" and successfully does.\");\n System.out.println(\"BUT, in doing so the spear pierces Naga's well-armored belly.\");\n enter = next.nextLine();\n System.out.println(\"The spear automatically drills deeper until Naga can't fight anymore...\");\n System.out.println(\"The wound heals, but dealt 300 damage to Naga.\");\n nagahealth = nagahealth-300;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n }\n }\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }else if (boss_attacks == 8) {\n System.out.println(\"Health Spell...\");\n System.out.println(\"The evil witch raised her staff and a blue vortex emerged.\");\n System.out.println(\"\\n\");\n System.out.println(\"However, the witch suddenly jumps into the vortex and after a while jumps out.\");\n System.out.println(\"OH NO!!! She tried to heal herself...\");\n bosshealth = bosshealth + 350;\n if(bosshealth == 10000) {\n System.out.println(\"She already had a maximum health of \" + bosshealth + \" HP. So it didn't work.\");\n System.out.println(\"\\n\");\n }else if(bosshealth > 10000) {\n bosshealth = 10000;\n System.out.println(\"The boss currently now \" + bosshealth + \" HP.\");\n }else{\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }\n }\n }\n //#lose-player loses all of HP \n if(playerhealth <= zero) { //in case player loses all of his/her health\n System.out.println(\"OH NO!!!\" + username + \" lost was defeated!\");\n System.out.println(\"Naga currently has \" + nagahealth + \" HP.\");\n System.out.println(\"Better luck next time...\");\n monsterisalive = false;\n replaybossfight();\n }\n //#lose-naga's HP is equal to or less than zero\n if(nagahealth <= zero) { // in case Naga loses all of his/her health\n System.out.println(\"OH NO!!! Naga lost all of his health and was defeated!\");\n System.out.println(username + \" currently has \" + playerhealth + \" HP.\");\n System.out.println(\"Better luck next time...\");\n monsterisalive = false;\n replaybossfight();\n }\n \n }\n \n }", "public void onUpdate()\n {\n super.onUpdate();\n\n if (!this.worldObj.isRemote && this.getBossHP() != this.health)\n {\n this.setBossHP();\n }\n }", "public void toggleMiniHealthBars() {\n miniHealthBarVisible = !miniHealthBarVisible;\n }", "BossBar createBossBar(String title, float health, BossColor color, BossStyle style);", "private void makeLeaderboardVisible(){\n if(leaderBoardBar!=null){\n leaderBoardBar.animate().alpha(1).setDuration(800).setInterpolator(new DecelerateInterpolator(2.0f));\n }\n }", "public BossBar(TAB tab) {\n\t\tthis.tab = tab;\n\t\tdisabledWorlds = tab.getConfiguration().getConfig().getStringList(\"disable-features-in-\"+tab.getPlatform().getSeparatorType()+\"s.bossbar\", Arrays.asList(\"disabled\" + tab.getPlatform().getSeparatorType()));\n\t\ttoggleCommand = tab.getConfiguration().getBossbarConfig().getString(\"bossbar-toggle-command\", \"/bossbar\");\n\t\tdefaultBars = tab.getConfiguration().getBossbarConfig().getStringList(\"default-bars\", new ArrayList<>());\n\t\tpermToToggle = tab.getConfiguration().getBossbarConfig().getBoolean(\"permission-required-to-toggle\", false);\n\t\thiddenByDefault = tab.getConfiguration().getBossbarConfig().getBoolean(\"hidden-by-default\", false);\n\t\tperWorld = tab.getConfiguration().getBossbarConfig().getConfigurationSection(\"per-world\");\n\t\tfor (Object bar : tab.getConfiguration().getBossbarConfig().getConfigurationSection(\"bars\").keySet()){\n\t\t\tgetLines().put(bar.toString(), BossBarLine.fromConfig(bar.toString()));\n\t\t}\n\t\tfor (String bar : new ArrayList<>(defaultBars)) {\n\t\t\tif (getLines().get(bar) == null) {\n\t\t\t\ttab.getErrorManager().startupWarn(\"BossBar \\\"&e\" + bar + \"&c\\\" is defined as default bar, but does not exist! &bIgnoring.\");\n\t\t\t\tdefaultBars.remove(bar);\n\t\t\t}\n\t\t}\n\t\tfor (Entry<String, List<String>> entry : perWorld.entrySet()) {\n\t\t\tList<String> bars = entry.getValue();\n\t\t\tfor (String bar : new ArrayList<>(bars)) {\n\t\t\t\tif (getLines().get(bar) == null) {\n\t\t\t\t\ttab.getErrorManager().startupWarn(\"BossBar \\\"&e\" + bar + \"&c\\\" is defined as per-world bar in world &e\" + entry.getKey() + \"&c, but does not exist! &bIgnoring.\");\n\t\t\t\t\tbars.remove(bar);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\trememberToggleChoice = tab.getConfiguration().getBossbarConfig().getBoolean(\"remember-toggle-choice\", false);\n\t\tif (isRememberToggleChoice()) {\n\t\t\tbossbarOffPlayers = tab.getConfiguration().getPlayerData(\"bossbar-off\");\n\t\t}\n\t\tTAB.getInstance().getPlaceholderManager().getAllUsedPlaceholderIdentifiers().add(\"%countdown%\");\n\t\tTAB.getInstance().getPlaceholderManager().registerPlaceholder(new ServerPlaceholder(\"%countdown%\", 100) {\n\n\t\t\t@Override\n\t\t\tpublic String get() {\n\t\t\t\treturn String.valueOf((getAnnounceEndTime() - System.currentTimeMillis()) / 1000);\n\t\t\t}\n\t\t});\n\t\ttab.debug(String.format(\"Loaded Bossbar feature with parameters disabledWorlds=%s, toggleCommand=%s, defaultBars=%s, permToToggle=%s, hiddenByDefault=%s, perWorld=%s, remember_toggle_choice=%s\",\n\t\t\t\tdisabledWorlds, toggleCommand, defaultBars, isPermToToggle(), hiddenByDefault, perWorld, isRememberToggleChoice()));\n\t}", "public void DisplayWithShield() {\n\t\tplayers = new ArrayList<Player>();\n\t\tplayer1 = new Player(\"Nick\");\n\t\tplayer2 = new Player(\"Ausitn\");\n\t\tplayers.add(player1);\n\t\tplayers.add(player2);\n\t\tgame = new GameState();\n\t\tgame.initializeServer(players);\n\t\tRulesEngine.setColour(game, String.valueOf(Type.BLUE));\n\t\t\n\t\tgame.setTurn(0);\n\t\t\n\t\t\n\t\t//create cards to be added to player's hand and target's display\n\t\tCard purpleCard = new Card(Type.PURPLE, 3);\n\t\tCard greenCard = new Card(Type.GREEN, 1);\n\t\tCard yellowCard = new Card(Type.YELLOW, 2);\n\t\tCard blueCard = new Card(Type.BLUE, 3);\n\t\tCard redCard = new Card(Type.RED, 4);\n\t\tCard squire = new Card(Type.WHITE, 2);\n\t\tCard maiden = new Card (Type.WHITE, 6);\n\t\tCard shield = new Card(Type.ACTION, Card.SHIELD);\n\t\t\n\t\t//Give one of the players a riposte card to play\n\t\tCard riposte = new Card(Type.ACTION, Card.RIPOSTE);\n\t\tgame.getAllPlayers().get(0).getHand().add(riposte);\n\t\t\n\t\t//Give target player a custom display\n\t\tgame.getDisplay(1).add(redCard);\n\t\tgame.getDisplay(1).add(purpleCard);\n\t\tgame.getDisplay(1).add(blueCard);\n\t\tgame.getDisplay(1).add(greenCard);\n\t\tgame.getDisplay(1).add(squire);\n\t\tgame.getDisplay(1).add(yellowCard);\n\t\tgame.getDisplay(1).add(maiden);\n\t\tgame.getShield(1).add(shield); //give player a shield\n\t}", "public void gameOver() {\r\n grid.exposeMines();\r\n this.displayGrid();\r\n System.out.println(\"Better luck next time!\");\r\n }", "@Override\n\tpublic void show () {\n overWorld = new Sprite(new TextureRegion(new Texture(Gdx.files.internal(\"Screens/overworldscreen.png\"))));\n overWorld.setPosition(0, 0);\n batch = new SpriteBatch();\n batch.getProjectionMatrix().setToOrtho2D(0, 0, 320, 340);\n\n // Creates the indicator and sets it to the position of the first grid item.\n indicator = new MapIndicator(screen.miscAtlases.get(2));\n // Creates the icon of Daur that indicates his position.\n icon = new DaurIcon(screen.miscAtlases.get(2));\n // Sets the mask position to zero, as this screen does not lie on the coordinate plane of any tiled map.\n screen.mask.setPosition(0, 0);\n screen.mask.setSize(320, 340);\n Gdx.input.setInputProcessor(inputProcessor);\n\n // Creates all relevant text.\n createText();\n // Sets numX and numY to the position of Daur on the map.\n numX = storage.cellX;\n numY = storage.cellY;\n indicator.setPosition(numX * 20, numY * 20 + 19);\n // Sets the icon to the center of this cell.\n icon.setPosition(numX * 20 + 10 - icon.getWidth() / 2, numY * 20 + 29 - icon.getHeight() / 2);\n // Creates all the gray squares necessary.\n createGraySquares();\n }", "private void renderDynamicEntityHealthBars() {\n\t\tfor (DynamicEntity entity: dynamicEntities) {\n\t\t\tif (entity.hasHealth && entity.getHealth() > 0) {\n\t\t\t\tdrawHealthBarAt(entity.getX() + entity.getWidth() / 2 - HEALTH_BAR_WIDTH / 2, entity.getY(), entity.getHealthPercentage());\n\t\t\t}\n\t\t}\n\t}", "public void show() {\r\n\t\tif (getSpawnLocation() == null)\r\n\t\t\treturn;\r\n\r\n\t\tif (!checkItem()) {\r\n\t\t\titem \t= getWorld().dropItem(getSpawnLocation(), getItemStack());\r\n\t\t\titem.setVelocity(new Vector(0, 0.1, 0));\r\n\t\t\titem.setPickupDelay(1000);\r\n\t\t\t\r\n\t\t}\r\n\t\tisVisible \t= true;\r\n\t}", "public void drawHealthBar() {}", "public void actualShowWorldChest(){\n\t\tElement el = nifty.getScreen(\"hud\").findElementByName(\"WorldChest\");\n\t\tel.show();\n\t\tfor(Item it : screenManager.getInventoryManager().getOpenWorldChest()){\n\t\t\tif(it.getInventoryPosition() != null){\n\t\t\t\tElement toHide = nifty.getScreen(\"hud\").findElementByName(\"hoverstats-\"+it.getId());\n\t\t\t\tif(toHide!=null){\n\t\t\t\t\ttoHide.setVisible(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void display() {\n Game game = PiggysRevenge.getCurrentGame();\n int bricks = 0;\n House house = game.getHouse();\n if (game.getHouse().isCompleted()) {\n try {\n bricks = GameControl.calcNumberOfBricks(house.getLength(), house.getWidth(), house.getHeight(), house.getStories());\n } catch (GameControlException ex) {\n this.console.println(ex.getMessage());\n }\n } else {\n bricks = 0;\n }\n int turns = game.getTurns();\n boolean hasEaten = game.getPlayer().isHasEaten();\n boolean wolfKilled = game.isWolfKilled();\n int result = 0;\n try {\n result = GameControl.calcScore(bricks, turns, hasEaten, wolfKilled);\n } catch (GameControlException ex) {\n this.console.println(ex.getMessage());\n }\n if (result>0) {\n this.console.println(\"+\" + (bricks*10) + \" Points for building the house.\");\n this.console.println(\"-\" + (turns*10) + \" Points for the number of turns taken (\" + turns + \" turns).\");\n } else {\n this.console.println(\"You get no points if you do not build a house,\"\n + \"\\neat the roast beef, or kill the wolf.\");\n }\n if (hasEaten) {\n this.console.println(\"+1000 Points for eating roast beef.\");\n }\n if (wolfKilled) {\n this.console.println(\"+2000 Points for killing the wolf.\");\n }\n this.console.println(\"\\nYOUR SCORE IS: \" + result);\n\n if (gameOver) {\n HighScore[] highScores;\n\n File varTmpDir = new File(\"highscores.txt\");\n\n if (varTmpDir.exists()) {\n try (FileInputStream fips = new FileInputStream(\"highscores.txt\");\n ObjectInputStream input = new ObjectInputStream(fips);) {\n \n\n highScores = (HighScore[]) input.readObject();\n highScores[10] = new HighScore(game.getPlayer().getName(), result, house);\n\n for (int n = 0; n < highScores.length; n++) {\n for (int m = 0; m < highScores.length - 1 - n; m++) {\n if (highScores[m].getScore() < highScores[m + 1].getScore()\n || \"---\".equals(highScores[m].getName())) {\n HighScore swapHighScore = highScores[m];\n highScores[m] = highScores[m + 1];\n highScores[m + 1] = swapHighScore;\n }\n }\n }\n\n try (FileOutputStream fops = new FileOutputStream(\"highscores.txt\");\n ObjectOutputStream output = new ObjectOutputStream(fops);) {\n \n output.writeObject(highScores);\n this.console.println(\"Score saved successfully\");\n \n } catch (Exception e) {\n ErrorView.display(\"ScoreView\", e.getMessage());\n }\n } catch (Exception e) {\n ErrorView.display(\"ScoreView\", e.getMessage());\n }\n\n } else {\n try (FileOutputStream fops = new FileOutputStream(\"highscores.txt\");\n ObjectOutputStream output = new ObjectOutputStream(fops);) {\n \n\n highScores = new HighScore[11];\n for (int i = 0; i < highScores.length; i++){\n highScores[i] = new HighScore(\"---\", 0, new House(5, 5, 6, 1));\n \n }\n\n highScores[0] = new HighScore(game.getPlayer().getName(), result, house);\n output.writeObject(highScores);\n this.console.println(\"New highscore file created. Score saved successfully\");\n } catch (Exception e) {\n ErrorView.display(\"ScoreView\", e.getMessage());\n }\n\n }\n }\n }", "public void drawBomber(Graphics g){\n\t\t\tif (exists){\n\t\t\t\tif (!startredtimer){ //if everything is normal\n\t\t\t\t\t\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tg.fillOval(x,y+10,100,30);\n\t\t\t\t\tg.fillOval(x+25,y,50,20);\n\t\t\t\t}\n\t\t\t\telse{ //if it needs to be in red because it has recently been hit by something\n\t\t\t\t\t\n\t\t\t\t\tg.setColor(Color.red);\n\t\t\t\t\tg.fillOval(x,y +10,100,30);\n\t\t\t\t\tg.fillOval(x+25,y,50,20);\n\t\t\t\t}\n\t\t\t\tg.setColor(Color.RED);\n\t\t\t\tg.drawRect(x,y-15,100,4);\n\t\t\t//\tg.drawRect(x,y-15,100,2);\n\t\t\t\tg.fillRect(x, y-15, health*25, 4); \n\t\t\t\t\n\t\t\t}\n\t\t\telse if(startboomtimer) { //if the plane has been destroyed and you want to draw it in red\n\t\t\t\tif (boomtimer<5) { g.drawImage(boom, x,y, 100, 100, null);}\n\t\t\t\telse if (boomtimer < 10) g.drawImage(boom, x + 38, y + 12, 50, 50, null);\n\t\t\t\telse if (boomtimer == 15) startboomtimer = false;\n\t\t\t\tboomtimer++;\n\t\t\t\t\n\t\t\t}\t\n\t\t\tif (dropping)b.drawBomb(g); //draws the bomb if the bomb is dropping only\n\n\t\t}", "private boolean gameOver() {\r\n\t\treturn (lifeBar == null || mehran == null);\r\n\t}", "public static void hardestBoss() {\r\n // Get array with names of bosses.\r\n BossNames[] names = BossNames.values();\r\n\r\n // Get array of damage/attack points of the bosses.\r\n Boss boss = new Boss();\r\n int bossDamage[] = boss.getBossDamage();\r\n\r\n // Calculate max damage/attack points using for-each loop.\r\n int maxDamage = bossDamage[0];\r\n for (int damage : bossDamage) {\r\n if (damage > maxDamage) {\r\n maxDamage = damage;\r\n }\r\n }\r\n\r\n // Search array for maxDamage to calculate index.\r\n int index = -1;\r\n for (int i = 0; i < bossDamage.length; i++) {\r\n if (bossDamage[i] == maxDamage) {\r\n index = i;\r\n }\r\n }\r\n\r\n if (index != -1) {\r\n console.println(\"The boss with the greatest attack points is \" + names[index] + \".\");\r\n }\r\n }", "void showUI(Player player) {\n\t\tString title = (this.range!=-1 ? \"BCL:\"+this.getOwnerName()+\"@\"+this.getLoc() : \"New \"+(this.isAdminChunkLoader()?\"Admin \":\"\")+\"BetterChunkLoader\");\n\t\tif (title.length()>32) {\n\t\t\ttitle=title.substring(0, 32);\n\t\t}\n\t\tInventory inventory = Bukkit.createInventory(this, 9, title);\n\n\t\taddInventoryOption(inventory, 0, Material.REDSTONE_TORCH_ON, \"Remove\");\n\t\t\n\t\tfor (byte i=0; i<5; i++) {\n\t\t\taddInventoryOption(inventory, i+2, Material.MAP, \"Size \"+this.sizeX(i)+(this.getRange()==i?\" [selected]\":\"\"));\n\t\t}\n\t\t\n\t\tplayer.openInventory(inventory);\n\t}", "private void displayWinScreen() {\n if (crewState.getShip().getShieldLevel() > 0) {\n new EventPopupWindow(String.format(\"You Won:\\nYou managed to collect all %d parts.\\n\\n\"\n + \"Score: %d\",\n getShipPartsNeededCount(),\n getScore()));\n } else {\n new EventPopupWindow(String.format(\"Although your ship is toast, you technically \"\n + \"still won the game. None of the parts are useful anymore, you will die on \"\n + \"this planet, but according to the job description you did everything that \"\n + \"was required. At least you can say you followed the spec, right?\\n\\n\"\n + \"Score: %d\",\n getShipPartsNeededCount(),\n getScore()));\n }\n }", "protected void renderHealth(Screen screen) {\n\t\tif (health >= 250) screen.renderMob((int) x, (int) y - 1, Sprite.health_10);\n\t\telse if (health >= 225) screen.renderMob((int) x, (int) y - 1, Sprite.health_9);\n\t\telse if (health >= 200) screen.renderMob((int) x, (int) y - 1, Sprite.health_8);\n\t\telse if (health >= 175) screen.renderMob((int) x, (int) y - 1, Sprite.health_7);\n\t\telse if (health >= 150) screen.renderMob((int) x, (int) y - 1, Sprite.health_6);\n\t\telse if (health >= 125) screen.renderMob((int) x, (int) y - 1, Sprite.health_5);\n\t\telse if (health >= 100) screen.renderMob((int) x, (int) y - 1, Sprite.health_4);\n\t\telse if (health >= 75) screen.renderMob((int) x, (int) y - 1, Sprite.health_3);\n\t\telse if (health >= 50) screen.renderMob((int) x, (int) y - 1, Sprite.health_2);\n\t\telse if (health >= 25) screen.renderMob((int) x, (int) y - 1, Sprite.health_1);\n\t}", "@Override\n\tpublic void show() {\n\t\tcontainer = new Table();\n//\t\tcontainer.background(skin.getDrawable(\"darkenWorld\"));\n\t\tcontainer.setSize(width, height);\n\t\t\n\t\tdarken = new Image(skin.getDrawable(\"darkenWorld\"));\n\t\tdarken.setSize(width, height);\n\t\t\n\t\ttimer.start();\n\t\t\n\t\ttrainingBag = new TrainingBag(width, height);\n\t\t\n\t\tBitmapFont font = new BitmapFont(Gdx.files.internal(\"fontSmall-export.fnt\"),\n\t\t Gdx.files.internal(\"fontSmall-export.png\"), false);\n\t\t\n\t\t\n\t\tLabelStyle labelStyle = new LabelStyle();\n\t\tlabelStyle.font = font;\n\t\t\n\t\ttimeLeft = new Label(timeString + \" 20\", labelStyle);\n\t\ttimeLeft.setPosition(width - timeLeft.getWidth(), height - timeLeft.getHeight());\n\t\t\n\t\thits = new Label(hitsString + \"0\" + amountString, labelStyle);\n\t\thits.setPosition(0, height - timeLeft.getHeight());\n\t\t\n\t\t\n\t\tcontainer.row();\n\t\tcontainer.add(trainingBag);\n\t\t\n\t\tgroup.addActor(darken);\n\t\tgroup.addActor(container);\n\t\tgroup.addActor(timeLeft);\n\t\tgroup.addActor(hits);\n\t}", "public boolean isTheBoss()\r\n\t{\r\n\t\treturn false;\r\n\t}", "public static void bullyAttack(){\n int punch = player.getHealth() - bullyHitPoints ;\n player.setHealth(punch);\n //Step 2: Conditional dialogue\n if(bullyHitPoints > 50) {\n System.out.println(textparser.getMassiveDamage() + bullyHitPoints + textparser.getToYou());\n }else if(bullyHitPoints > 25){\n System.out.println(textparser.getPunch() + bullyHitPoints + textparser.getToYou());\n }else{\n System.out.println(textparser.getDidntHurtMuch() + bullyHitPoints + textparser.getToYou());\n }\n }", "@Override\r\n\tpublic void display() {\n\t\tif (silenced.contains(caster))\r\n\t\t\tdead = true;\r\n\t\tif (lastloc == null)\r\n\t\t\tlastloc = loc;\r\n\t\tdir = loc.toVector().subtract(lastloc.toVector());\r\n\t\tif (speed > 2)\r\n\t\t\tParUtils.dropItemEffectVector(loc.clone().add(0,1,0), Material.CACTUS, 1,1, 1,dir);\r\n\t\t\t\r\n\t\t\t//ParUtils.createFlyingParticle(Particles.CRIT, loc.clone().add(0,2.5,0), 0, 0, 0, 1, 5, dir.normalize());\r\n\t\t//ParUtils.createRedstoneParticle(loc.clone().add(0,2.5,0), 0.5,0.5, 0.5, 1, Color.GREEN, 1.5F);\r\n\t}", "private void makeBoss()\r\n {\r\n maxHealth = 1000;\r\n health = maxHealth;\r\n \r\n weapon = new Equip(\"Claws of Death\", Equip.WEAPON, 550);\r\n armor = new Equip(\"Inpenetrable skin\", Equip.ARMOR, 200);\r\n }", "public void paintBoss(Graphics g, Boss b)\n {\n double x = Driver.scale*(topLeftX + mapWidth/2 + scale * b.getXPos() - BOSS_ICON_WIDTH/2 );\n double y = Driver.scale*(topLeftY + mapHeight/2 + scale * b.getYPos() - BOSS_ICON_WIDTH/2 );\n\n g.drawImage(b.getMapIcon().getImage(), (int)x, (int)y, (int)BOSS_ICON_WIDTH, (int)BOSS_ICON_WIDTH, this);\n g.setColor(Color.RED);\n }", "public void Fire()\n {\n Random random = new Random();\n int randNum = random.nextInt(limit);\n\n //Check to see if this bomb is dropped\n if(!owner.BehindInvader() && !this.Visible() && randNum == HIT_VAL)\n {\n //Set this bomb to visible\n this.Visible(true);\n this.PlaySound();\n this.x = this.owner.X();\n this.y = this.owner.Y();\n }\n\n //Check for collision with the defender\n if(Bomb.enemy.Visible() && this.Visible() && this.Collision(Bomb.enemy))\n {\n Bomb.enemy.Hit();\n this.Visible(false);\n }\n //Move the bomb down\n else if(this.Visible())\n {\n this.y++;\n\n //Check for collision with the floor\n if(this.y >= GameConstants.GROUND - this.imageHeight)\n {\n this.Visible(false);\n }\n //Check for collision with the barriers\n for(Barrier barrier : Bomb.barriers.Barriers())\n {\n for(BarrierBlock block : barrier.BarrierBlocks())\n {\n if(this.Collision(block))\n {\n block.Visible(false);\n //Removal could cause Comodification issue\n block.Damaged(true);\n this.Visible(false);\n //May not need this return\n return;\n }\n }\n }\n }\n }", "public int useBomb(){\n //do harm while the animation start\n //cause harm to the boss\n println(\"BEFORE Main.boss.health: \"+Main.boss.health);\n int count = 0;\n if ((Main.boss.alive) && (Main.boss.posY != -1)){\n Main.boss.decreaseHealth(10);\n if(Main.boss.health <= 0){\n Main.boss.alive = false;\n Main.boss.deadTime = millis();\n Main.score += 100;\n bossKilled = true;\n }\n }\n println(\"AFTER Main.boss.health: \"+Main.boss.health);\n //remove all bullets\n Main.boss.emptyBullets();\n //kill all the enemies\n for(int j = 0; j < Main.enemies.size(); j++){\n Enemy tempEnemy = Main.enemies.get(j);\n tempEnemy.alive = false;\n tempEnemy.deadTime = millis();\n count ++;\n }\n // fill(0,0,0);\n // rect(0,0,width,height);\n return count;\n }", "public void display() {\n String box = \"\\n+--------------------------------------------+\\n\";\n String header = \"| \" + name;\n String lvlStat = \"Lv\" + level;\n for (int i=0; i<42-name.length()-lvlStat.length(); i++) {\n header += \" \";\n }\n header += lvlStat + \" |\\n\";\n System.out.println(box + header + \"| \" + getHealthBar() + \" |\" + box);\n }", "public void areaEffect(Player player){\n if(object.getProperties().containsKey(\"endLevel\")) {\n System.out.println(\"Fin du level\");\n setCategoryFilter(GameTest.DESTROYED_BIT);\n PlayScreen.setEndLevel();\n }\n\n if(object.getProperties().containsKey(\"startBossFight\")) {\n\n System.out.println(\"Start Boss Fight\");\n setCategoryFilter(GameTest.DESTROYED_BIT);\n\n TiledMapTileLayer.Cell cell = new TiledMapTileLayer.Cell();\n cell.setTile(tileSet.getTile(910));\n layer.setCell(99, 6, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(99, 7, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(99, 8, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(99, 9, cell);\n\n cell.setTile(tileSet.getTile(910));\n layer.setCell(100, 6, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(100, 7, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(100, 8, cell);\n cell.setTile(tileSet.getTile(910));\n layer.setCell(100, 9, cell);\n\n PlayScreen.cameraChangeBoss(true);\n setCategoryFilterFixture(GameTest.GROUND_BIT, PlayScreen.getFixtureStartBoss());\n\n }\n\n if(object.getProperties().containsKey(\"blueKnight\")) {\n System.out.println(\"Changement en bleu\");\n setCategoryFilter(GameTest.DESTROYED_BIT);\n getCell().setTile(null);\n PlayScreen.setColorKnight(\"blue\");\n }\n\n if(object.getProperties().containsKey(\"greyKnight\")) {\n System.out.println(\"Changement en gris\");\n setCategoryFilter(GameTest.DESTROYED_BIT);\n getCell().setTile(null);\n PlayScreen.setColorKnight(\"grey\");\n }\n\n if(object.getProperties().containsKey(\"redKnight\")) {\n System.out.println(\"Changement en rouge\");\n setCategoryFilter(GameTest.DESTROYED_BIT);\n getCell().setTile(null);\n PlayScreen.setColorKnight(\"red\");\n }\n\n }", "public void checkBehavior() {\n\t\tif (behaviorStage == 1) {\n\t\t\tif (screen.score >= 100) {\n\t\t\t\tshow();\n\t\t\t}\n\t\t\tif (active) {\n\t\t\t\tif (health <= maxHealth / 2f) {\n\t\t\t\t\tleave();\n\t\t\t\t\tbehaviorStage = 2;\n\t\t\t\t}\n\t\t\t\tif (screen.score < 100) {\n\t\t\t\t\tleave();\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (behaviorStage == 2) {\n\t\t\tif (screen.score >= 200) {\n\t\t\t\tshow();\n\t\t\t}\n\t\t\tif (active) {\n\t\t\t\tif (screen.score < 200) {\n\t\t\t\t\tleave();\n\t\t\t\t}\n\t\t\t\tif (health <= 0) {\n\t\t\t\t\tleave();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void displayOutMarbles(int outMarblesCount, Player player) {\n System.out.println(player.getPlayerName()+\" a mis hors jeu \"+outMarblesCount+\" bille(s) du joueurs adverse !\");\n }", "@Override\n\tpublic void render(Graphics g) {\n\t\tg.setColor(Color.RED);\n\t\tg.drawRect((int) xPosition, (int) yPosition, width, height);\n\n\t\tif (health == 3) {\n\n\t\t\tg.setColor(Color.RED);\n\t\t\tg.fillRect((int) xPosition + 1, (int) yPosition + 1, width / 3, height - 2);\n\n\t\t\tg.setColor(Color.RED);\n\t\t\tg.fillRect((int) xPosition + width / 3, (int) yPosition + 1, width / 3, height - 2);\n\n\t\t\tg.setColor(Color.RED);\n\t\t\tg.fillRect((int) (xPosition + width) - (width / 3) - 2, (int) yPosition + 1, (width / 3) + 1, height - 2);\n\n\t\t} else if (health == 2) {\n\n\t\t\tg.setColor(Color.RED);\n\t\t\tg.fillRect((int) xPosition + 1, (int) yPosition + 1, width / 3, height - 2);\n\n\t\t\tg.setColor(Color.RED);\n\t\t\tg.fillRect((int) xPosition + width / 3, (int) yPosition + 1, width / 3, height - 2);\n\n\t\t} else if (health == 1) {\n\n\t\t\t// Flash health bar.\n\t\t\tif (healthFlashTimer <= healthFlashLength / 2) {\n\n\t\t\t\tg.setColor(Color.RED);\n\t\t\t\tg.fillRect((int) xPosition + 1, (int) yPosition + 1, width / 3, height - 2);\n\t\t\t} else {\n\n\t\t\t\tif (healthFlashTimer >= healthFlashLength)\n\t\t\t\t\thealthFlashTimer = 0;\n\t\t\t}\n\n\t\t\thealthFlashTimer++;\n\t\t}\n\t}", "public String showHealthBar(String target) {\n if (target == \"player\") {\n return \"(\" + playerShipHealth + \"/\" + playerShipHealthMax + \")\";\n } else if (target == \"enemy\") {\n return \"(\" + enemyShipHealth + \"/\" + enemyShipHealthMax + \")\";\n } else{ return null; }\n }", "public void paintComponent(Graphics g) {\n\n\t\t\tif (death==false) {//if we arent dead, the game must be drawn\n\t\t\t\tif (background!=null) {//draw background\n\t\t\t\t\tg.drawImage(background.getImage(), background.getX(), background.getY(), this);\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 (blocks!=null) {//draw the blocks. from the list\n\t\t\t\t\t//System.out.println(\"Yes\");\n\t\t\t\t\tfor (int x = blocks.size()-1; x>= 0; x--) {\n\t\t\t\t\t\tif (blocks.get(x).getDisable()) {//if the blocks are disabled, destroy\n\t\t\t\t\t\t\tblocks.remove(x);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor (int t = 0; t<blocks.size(); t++) {//now draw the blocks.\n\t\t\t\t\t\t//System.out.printf(\"%d %d %d %d\\n\",blocks.get(t).getX(), blocks.get(t).getY(), blocks.get(t).getWidth(), blocks.get(t).getHeight());\n\t\t\t\t\t\tg.setColor(blocks.get(t).getColor());\n\t\t\t\t\t\tg.fillRect(blocks.get(t).getX(), blocks.get(t).getY(), blocks.get(t).getWidth(), blocks.get(t).getHeight());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (slider!=null) {//if the slider isnt null, draw it\n\t\t\t\t\t//System.out.printf(\"%d %d\\n\",slider.getX(), slider.getY());\n\t\t\t\t\tg.drawImage(slider.getImage(), slider.getX(), slider.getY(), this);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (ball!=null) {//draw ball.\n\t\t\t\t\tg.drawImage(ball.getImage(), ball.getX(), ball.getY(), this);\n\t\t\t\t}\n\t\t\t\tfor (PowerUp power: powerUps) {//draw all of the powerups\n\t\t\t\t\tg.drawImage(power.getImage(), power.getX(), power.getY(), this);\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\t//draw bottom frame\n\t\t\t\t\n\t\t\t\tg.setColor(new Color(0,0,0));\n\t\t\t\tg.fillRect(0, GamePlay.getScreenHeight()-h, GamePlay.getScreenWidth(), h);//this is the menu bar\n\t\t\t\t\n\t\t\t\t//draw score\n\t\t\t\tg.setColor(new Color(255,255,255));\n\t\t\t\tg.setFont(new Font(\"Helvetica\", Font.PLAIN, 32));\n\t\t\t\tg.drawString(String.format(\"Score: %d\", score), GamePlay.getScreenWidth() - 5 - g.getFontMetrics().stringWidth(String.format(\"Score: %d\", score)), GamePlay.getScreenHeight() - 5 - 32);\n\t\t\t\t\n\t\t\t\t//paused\n\t\t\t\tif (stopped) {\n\t\t\t\t\tg.drawString(\"Paused\", 10, 42);//upper left corner of the screen. just say paused so user knows\n\t\t\t\t}\n\t\t\t\t//lives\n\t\t\t\tint livesFontSize=15;\n\t\t\t\tg.setFont(new Font(\"Helvetica\", Font.PLAIN, livesFontSize));\n\t\t\t\tg.drawString(String.format(\"Lives: %d\", lives), 20+5+pauseButton.getWidth(), GamePlay.getScreenHeight()-h+(2+livesFontSize));\n\t\t\t\t\n\t\t\t\tfor (int x=0; x<lives; x++) {//draw one ball for every life they have. \n\t\t\t\t\t//System.out.println(\"hey\");\n\t\t\t\t\tg.drawImage(ball.getImage(), 5+pauseButton.getWidth()+20+(5+ball.getWidth())*x, GamePlay.getScreenHeight()-(h/2)-(ball.getHeight())+(livesFontSize/2), this);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//logo\n\t\t\t\tg.drawImage(logo.getImage(), GamePlay.getScreenWidth()/2-logo.getWidth()/2, GamePlay.getScreenHeight() - (h/2) - (logo.getHeight()/2)-10, this);\n\t\t\t\t\n\t\t\t\t//pause button\n\t\t\t\tg.drawImage(pauseButton.getImage(), 5, GamePlay.getScreenHeight() - (h/2) - pauseButton.getHeight()/2 -10 , this);\n\t\t\t\t\n\t\t\t} else {//this means the player died.\n\t\t\t\t\n\t\t\t\t//draw black background \n\t\t\t\t\n\t\t\t\t//draw logo\n\t\t\t\tlogo.resize(400,100);\n\t\t\t\tg.setColor(new Color(0,0,0));\n\t\t\t\tg.fillRect(0, 0, GamePlay.getScreenWidth(), GamePlay.getScreenHeight());\n\t\t\t\tg.drawImage(logo.getImage(), GamePlay.getScreenWidth()/2 - logo.getWidth()/2, 100, this);\n\t\t\t\t\n\t\t\t\tg.setColor(new Color(255,255,255));//draw game over text\n\t\t\t\tg.setFont(new Font(\"Helvetica\", Font.PLAIN, 60));\n\t\t\t\tg.drawString(\"Game Over!\", GamePlay.getScreenWidth()/2 - g.getFontMetrics().stringWidth(\"Game Over!\")/2, GamePlay.getScreenHeight()/2 - 30);\n\t\t\t\t\n\t\t\t\t//draw score. \n\t\t\t\tg.drawString(String.format(\"Your Score: %d\", score), GamePlay.getScreenWidth()/2 - g.getFontMetrics().stringWidth(String.format(\"Your Score: %d\", score))/2, GamePlay.getScreenHeight()/2 + 100);\n\t\t\t}\n\t\t\t\n\t\t}", "@Override\n\tpublic void hideContents() {\n\t\tprogram.remove(Play);\n\t\tprogram.remove(Settings);\n\t\tprogram.remove(Credits);\n\t\tprogram.remove(Exit);\n\t\tprogram.remove(tank);\n\t\tprogram.remove(barrel);\n\t\tprogram.remove(explosion);\n\t\tprogram.remove(title);\n\t\tshootCounter = 0;\n\t\tdelayCounter = 0;\n\t\tbarrel = new GameImage(\"../media/TanksPNGS/large_greenTank_cannon.png\");\n\t\tbarrel.setLocation(15, 475);\n\t\tp = false;\n\t\ts= false;\n\t\tc = false;\n\t\tq = false;\n\t}", "public void thisHorse() {\n\t\tHorsesView horses = (HorsesView) manager.getPanel(Constants.H_VIEW_NAME);\n\t\tif (horses.getPhv().getAmount().isEmpty() || !horses.getPhv().getAmount().matches(\"[-+]?\\\\d*\\\\.?\\\\d+\")\n\t\t\t\t|| Float.parseFloat(horses.getPhv().getAmount()) <= 0) {\n\t\t\tnew Dialeg().setWarningText(\"You must enter a positive amount!\");\n\t\t} else {\n\t\t\thorses.getPhv().obreDialeg();\n\t\t\tif (horses.getPhv().getDialeg().getResult() == JOptionPane.OK_OPTION) {\n\t\t\t\tString name = horses.getPhv().getHorseName();\n\t\t\t\thorseBet = new Bet(Double.parseDouble(horses.getPhv().getAmount()), name);\n\t\t\t\ttry {\n\t\t\t\t\tmanager.getServer().enviarTrama(new Betting(horseBet));\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\thorses.getPhv().dispose();\n\t\t\t}\n\t\t}\n\t}", "public static void showCombatInterface(Player player, int weapon) {\n\t\tString itemName = ItemAssistant.getItemName(weapon);\n\t\tfor (int i = 0; i < unarmedItemNames.length; i++) {\n\t\t\tif (itemName.toLowerCase().equals(unarmedItemNames[i])) {\n\t\t\t\tplayer.playerAssistant.setSidebarInterface(0, 5855); // punch, kick, block\n\t\t\t\tplayer.getPA().sendFrame126(itemName, 5857);\n\t\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t\t\tCombatInterface.updateClickedCombatStyle(player);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tboolean doNotChange = false;\n\t\tif ((GameType.isPreEoc() && weapon == 19780)) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 4705);\n\t\t\tplayer.getPA().sendFrame246(426, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 4708);\n\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t\tdoNotChange = true;\n\t\t} else if (itemName.toLowerCase().contains(\"whip\")\n\t\t\t\t|| itemName.toLowerCase().contains(\"abyssal tentacle\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 12290); // flick, lash, deflect\n\t\t\tplayer.getPA().sendFrame246(12291, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 12293);\n\t\t\treAdjustCombatStyle(player, \"AGGRESSIVE\", ServerConstants.CONTROLLED);\n\t\t\tdoNotChange = true;\n\t\t} else if (itemName.toLowerCase().contains(\"chinchompa\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 27500); // first param\n\t\t\tplayer.getPA().sendFrame126(itemName, 27503); // first param + 2\n\t\t\treAdjustCombatStyle(player, \"DEFENSIVE\", ServerConstants.CONTROLLED);\n\t\t\tdoNotChange = true;\n\t\t} else if (itemName.toLowerCase().contains(\"dagger\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 2276); // stab, lunge, slash, block\n\t\t\tplayer.getPA().sendFrame246(2277, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 2279);\n\t\t}\n\t\telse if (itemName.toLowerCase().contains(\"bow\") || itemName.toLowerCase().contains(\"ballista\") || itemName.toLowerCase().contains(\"cannon\") || itemName.toLowerCase().contains(\"javelin\") || itemName.toLowerCase().contains(\"throwing\") || itemName.toLowerCase().contains(\"dragon thrownaxe\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 1764); // accurate, rapid, longrange\n\t\t\tplayer.getPA().sendFrame246(1765, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 1767);\n\t\t\treAdjustCombatStyle(player, \"DEFENSIVE\", ServerConstants.CONTROLLED);\n\t\t} else if (!itemName.toLowerCase().contains(\"saradomin sword\") && !itemName.toLowerCase().contains(\"blessed sword\") && !itemName.toLowerCase().contains(\"2h\") && (\n\t\t\t\titemName.toLowerCase().contains(\"rapier\") || itemName.toLowerCase().contains(\"sword\") && !itemName.toLowerCase().contains(\"godsword\") && !itemName.toLowerCase()\n\t\t\t\t .contains(\n\t\t\t\t\t\t \"longsword\"))\n\t\t\t\t|| itemName.toLowerCase().contains(\"toktz-xil-ek\") || itemName.toLowerCase().contains(\"toktz-xil-ak\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 2276); // stab, lunge, slash, block\n\t\t\tplayer.getPA().sendFrame246(2277, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 2279);\n\t\t} else if (itemName.toLowerCase().contains(\"staff\") || itemName.toLowerCase().contains(\"wand\") || itemName.toLowerCase().contains(\"staff of light\")\n\t\t\t\t|| itemName.toLowerCase().contains(\"trident\") || itemName.toLowerCase().contains(\"thammaron's sceptre\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 328); // bash, pound, focus.\n\t\t\tplayer.getPA().sendFrame246(329, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 331);\n\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t\tdoNotChange = true;\n\t\t}\n\t\telse if (itemName.toLowerCase().contains(\"dart\") || itemName.toLowerCase().contains(\"knife\") || itemName.toLowerCase().contains(\"blowpipe\") || itemName.toLowerCase()\n\t\t .contains(\n\t\t\t\t \"toktz-xil-ul\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 4446); // accurate, rapid, longrange\n\t\t\tplayer.getPA().sendFrame246(4447, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 4449);\n\t\t\treAdjustCombatStyle(player, \"DEFENSIVE\", ServerConstants.CONTROLLED);\n\t\t} else if (itemName.toLowerCase().contains(\"pickaxe\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 5570); // spike, impale, smash, block\n\t\t\tplayer.getPA().sendFrame246(5571, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 5573);\n\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t\tdoNotChange = true;\n\t\t} else if (itemName.toLowerCase().contains(\"axe\") || itemName.toLowerCase().contains(\"hatchet\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 1698); // chop, hack, smash, block\n\t\t\tplayer.getPA().sendFrame246(1699, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 1701);\n\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t\tdoNotChange = true;\n\t\t} else if (itemName.toLowerCase().contains(\"claws\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 7762);\n\t\t\tplayer.getPA().sendFrame246(7763, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 7765);\n\t\t} else if (itemName.toLowerCase().contains(\"halberd\") || itemName.toLowerCase().contains(\"scythe\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 8460); // jab, swipe, fend\n\t\t\tplayer.getPA().sendFrame246(8461, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 8463);\n\t\t\treAdjustCombatStyle(player, \"ACCURATE\", ServerConstants.AGGRESSIVE);\n\t\t} else if (itemName.toLowerCase().contains(\"spear\") || itemName.toLowerCase().contains(\"hasta\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 4679); // lunge, swipe, pound, block\n\t\t\tplayer.getPA().sendFrame246(4680, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 4682);\n\t\t\treAdjustCombatStyle(player, \"AGGRESSIVE ACCURATE\", ServerConstants.CONTROLLED);\n\t\t\tdoNotChange = true;\n\t\t} else if (itemName.toLowerCase().contains(\"mace\") || itemName.toLowerCase().contains(\"barrelchest\") || itemName.toLowerCase().contains(\"flail\") || itemName.toLowerCase()\n\t\t .contains(\n\t\t\t\t \"cane\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 3796);\n\t\t\tplayer.getPA().sendFrame246(3797, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 3799);\n\t\t} else if (itemName.toLowerCase().contains(\"maul\") || itemName.toLowerCase().contains(\"hammer\") || itemName.toLowerCase().contains(\"tzhaar-ket-om\")\n\t\t || itemName.toLowerCase().contains(\"dinh's\") || itemName.contains(\"spade\") || itemName.contains(\"club\")) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 425); // war hamer equip.\n\t\t\tplayer.getPA().sendFrame246(426, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 428);\n\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t\tdoNotChange = true;\n\t\t} else if (itemName.toLowerCase().contains(\"godsword\") || itemName.toLowerCase().contains(\"2h\") || itemName.toLowerCase().contains(\"saradomin sword\")\n\t\t\t\t|| itemName.toLowerCase().contains(\"sara's blessed sword\")\n\t\t\t\t|| (GameType.isPreEoc() && weapon == 19780)) {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 4705); // Godsword.\n\t\t\tplayer.getPA().sendFrame246(426, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 4708);\n\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t\tdoNotChange = true;\n\t\t} else {\n\t\t\tplayer.playerAssistant.setSidebarInterface(0, 2423); // chop, slash, lunge, block\n\t\t\tplayer.getPA().sendFrame246(2424, 200, weapon);\n\t\t\tplayer.getPA().sendFrame126(itemName, 2426);\n\t\t}\n\t\tswitch (weapon) {\n\t\t\tcase 20779:\n\t\t\t\tplayer.playerAssistant.setSidebarInterface(0, 425); // war hamer equip.\n\t\t\t\tplayer.getPA().sendFrame246(426, 200, weapon);\n\t\t\t\tplayer.getPA().sendFrame126(itemName, 428);\n\t\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t\t\tdoNotChange = true;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Whip is the only main weapon where the aggressive option is controlled, so make it easier by if i use whip and switch to another weapon, it puts the other weapon\n\t\t//on aggressive instead of longrange/lunge.\n\t\tif (player.wasWearingAggressiveSharedXpWeapon && !doNotChange) {\n\t\t\treAdjustCombatStyle(player, \"CONTROLLED\", ServerConstants.AGGRESSIVE);\n\t\t}\n\t\tplayer.wasWearingAggressiveSharedXpWeapon = false;\n\t\tCombatInterface.updateClickedCombatStyle(player);\n\t}", "public String showdown() {\n if(this.playerH.Rank() < this.serverH.Rank()|| \n (this.playerH.Rank() == this.serverH.Rank() && this.playerH.getSecondaryRank() < this.serverH.getSecondaryRank()) ||\n (this.playerH.Rank() == this.serverH.Rank() && this.playerH.getSecondaryRank() == this.serverH.getSecondaryRank() && this.playerH.getAuxRank() < this.serverH.getAuxRank())){\n if(this.playerBet <= this.serverBet){\n this.money_server += this.playerBet + this.serverBet;\n }\n else{\n this.money_server+= this.serverBet + this.serverBet; \n this.money_player += this.playerBet - this.serverBet;\n }\n }\n else if(this.playerH.Rank() > this.serverH.Rank()|| \n (this.playerH.Rank() == this.serverH.Rank() && this.playerH.getSecondaryRank() > this.serverH.getSecondaryRank()) ||\n (this.playerH.Rank() == this.serverH.Rank() && this.playerH.getSecondaryRank() == this.serverH.getSecondaryRank() && this.playerH.getAuxRank() > this.serverH.getAuxRank())){\n if(this.playerBet >= this.serverBet){\n this.money_player += this.playerBet + this.serverBet;\n }\n else{\n this.money_player += 2*this.playerBet;\n this.money_server += this.serverBet-this.playerBet;\n }\n }\n else{\n \n this.money_player += this.playerBet;\n this.money_server += this.serverBet;\n }\n this.playerBet = 0;\n this.serverBet = 0;\n this.state = -1;\n return \"show\"+this.serverH.toString();\n }", "public void makeVisible(int guess) {\n\t\t\n\t\t// \n\t\tif (guess == 5)\n\t\t{\t\n\t\t\theadShape.setVisible(true);\n\t\t}\n\t\telse if (guess == 4)\n\t\t{\t\n\t\t\tspine.setVisible(true);\n\t\t}\n\t\telse if (guess == 3)\n\t\t{\t\n\t\t\tleftArmLine.setVisible(true);\n\t\t}\n\t\telse if (guess == 2)\n\t\t{\t\n\t\t\trightArmLine.setVisible(true);\n\t\t}\n\t\telse if (guess == 1)\n\t\t{\t\n\t\t\tleftLegLine.setVisible(true);\n\t\t}\n\t\telse if (guess == 0)\n\t\t{\t\t\n\t\t\trightLegLine.setVisible(true);\n\t\t\tGameOver();\n\t\t\n\t\t}\n\t\t\n\t}", "public void displayWin()\n {\n if(player1 instanceof GameController){\n player1.gameOver(1);\n } else {\n player2.gameOver(1);\n }\n }", "public void show() {\n isVisible = true;\n this.saveBorderColor(playerColor);\n this.setBorderColor(playerColor);\n }", "public void displayHurtbox(Graphics2D g2d, Hero[] players) {\n this.weapon.updateHurtbox(this, this.state, this.dir);\n for (int i = 0; i < this.weapon.getNumHurtboxes(); i++) {\n this.weapon.getHurtboxes()[i]\n .display(g2d, players, this.activeAttackState);\n }\n }", "public void displayGame()\n { \n System.out.println(\"\\n-------------------------------------------\\n\");\n for(int i=3;i>=0;i--)\n {\n if(foundationPile[i].isEmpty())\n System.out.println(\"[ ]\");\n else System.out.println(foundationPile[i].peek());\n }\n System.out.println();\n for(int i=6;i>=0;i--)\n {\n for(int j=0;j<tableauHidden[i].size();j++)\n System.out.print(\"X\");\n System.out.println(tableauVisible[i]);\n }\n System.out.println();\n if(waste.isEmpty())\n System.out.println(\"[ ]\");\n else System.out.println(waste.peek());\n if(deck.isEmpty())\n System.out.println(\"[O]\");\n else System.out.println(\"[X]\");\n }", "private void statsActionPerformed(ActionEvent evt) {\n\t\t//if the reels are nor spinning perform the the action\n\t\tif (!isSpining)\n\t\t\tnew StatsGUIInterface().setVisible(true);\n\t}", "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 }", "public void render(Graphics g) {\n\t\tg.setColor(Color.MAGENTA);\n\t\tg.fillRect(x, y, 50, 50);\n\t\t\n\t\tg.setColor(Color.white);\n\t\tg.drawRect(x, y, 50, 50);\n\t\t\n\t\tg.setColor(Color.gray);\n\t\tg.fillRect(x, y - 10, 50, 2);\n\t\t\n\t\tg.setColor(Color.red);\n\t\tg.fillRect(x, y - 10, bossHealth, 2);\n\t}", "Boolean isBoss();", "private void showBomb() {\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n if (state[i][j] == 'X')\n stateGame[i][j] = 'X';\n }\n }\n }", "public void drawHealth(Graphics2D g2d) {\t\n\t\tg2d.setColor(new Color(0,0,0,200));\n\t\tint w = StagePanel.boardRectSize;\n\t\tint h = StagePanel.boardRectSize/6;\n\t\tint x = (int)getRectHitbox().getCenterX() - w/2;\n\t\tint y = (int)getRectHitbox().getCenterY() - parentGP.boardRect.getSize()/2;\n\t\t\n\t\tRectangle maxHealthShieldRect = new Rectangle(x, y, w, h);\n\t\tg2d.fill(maxHealthShieldRect);\n\t\tfloat unitHealthSize = (w*(1.0f/(maxHealth+maxShield)));\n\t\tRectangle maxHealthRect = new Rectangle(x,y, (int)(unitHealthSize * health), h);\n\t\tRectangle maxShieldRect = new Rectangle(x+(int)(unitHealthSize * health),y, (int)(unitHealthSize * shield), h);\n\t\tg2d.setColor(Commons.cHealth);\n\t\tg2d.fill(maxHealthRect);\n\t\tg2d.setColor(Commons.cShield);\n\t\tg2d.fill(maxShieldRect);\n\t\tg2d.setStroke(new BasicStroke(3)); \n\t\tg2d.setColor(Color.BLACK);\n\t\tg2d.draw(maxHealthShieldRect);\n\t\tif(parentGP.boardRect == StagePanel.curHoverBR || parentGP == StagePanel.curSelectedGP) {\n\t\t\tdrawHealthValues(g2d, x, y,StagePanel.boardRectSize/5);\n\t\t}\n\t}", "private void showHealthLevel()\n {\n showText(\"Health Level: \" + healthLevel, 120, 25);\n }", "public static void battleStatus(){\n Program.terminal.println(\"________________TURN \"+ turn +\"________________\");\n Program.terminal.println(\"\");\n Program.terminal.println(\" +-------------------- \");\n Program.terminal.println(\" |Name:\"+ currentMonster.name);\n Program.terminal.println(\" |HP: \" + currentMonster.currentHp+\"/\"+currentMonster.hp);\n Program.terminal.println(\" |\" + barGauge(1));\n Program.terminal.println(\" +-------------------- \");\n Program.terminal.println(\"\");\n Program.terminal.println(\"My HP:\" + MainCharacter.hpNow +\"/\"+ MainCharacter.hpMax + \" \" + barGauge(2));\n Program.terminal.println(\"My MP:\" + MainCharacter.mpNow +\"/\"+ MainCharacter.mpMax + \" \" + barGauge(3));\n Program.terminal.println(\"\");\n askAction();\n }", "public void displayWinner(Player player) {\n System.out.println(\"Partie terminée !\");\n System.out.println(player.getPlayerName()+\" remporte la partie avec les billes \"+player.getColor().toString(true));\n System.out.println(\"――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――\");\n }", "public void drawHealthBar() {\n\t\td.setColor(Color.GREEN);\n\t\td.setFont(f1);\n\t\td.drawString(\"Health\", 387, 43);\n\t\td.setFont(f);\n\t\td.fillRect(227, 48, health * 100, 25);\n\t\td.setColor(Color.BLACK);\n\t\td.drawLine(327, 48, 327, 73);\n\t\td.drawLine(427, 48, 427, 73);\n\t\td.drawLine(527, 48, 527, 73);\n\t\td.drawRect(227, 48, 400, 25);\n\t}", "private void checks(){\n if (check(true)){\n changeBottomPane(\"White is in check! :(\");\n }\n else if (check(false)){\n changeBottomPane(\"Black is in check!!!!!!!!!!!\");\n }\n else{\n changeBottomPane(\"\");\n }\n }", "private void toggleGraveyardHandler() {\n ((ChessPanel) this.getParent()).getGraveyard(1).setVisible(\n !((ChessPanel) this.getParent()).getGraveyard(1).isVisible());\n ((ChessPanel) this.getParent()).getGraveyard(2).setVisible(\n !((ChessPanel) this.getParent()).getGraveyard(2).isVisible());\n }", "private void drawCharacterConditionals(Canvas canvas)\n {\n if (announceDamage && damageToAnnounce > 0)\n {\n flashDamagedPieceTimer--;\n\n //the flashDamagedPieceSwitch runs from 0 - 12,\n // but the FacePiece is only drawn during 0 - 5.\n //That means it is drawn slightly less than half the time,\n // with a \"draw / don't draw\" phase lasting several iterations.\n if (flashDamagedPieceTimer > 0) {\n flashDamagedPieceSwitch++;\n } else {flashDamagedPiece = false;}\n\n if (flashDamagedPieceSwitch > 12)\n {\n flashDamagedPieceSwitch = 0;\n }\n\n // Display visual information about damage inflicted, or HP absorbed.\n damageAnnouncementTimer--;\n paint.setTextSize(122);\n paint.setColor(Color.RED);\n canvas.drawText(\"-\" + damageToAnnounce + \" HP!\", x + 5, y + 230, paint);\n\n if (damageAnnouncementTimer <= 0)\n {\n announceDamage = false;\n flashDamagedPiece = false;\n antagonistDamage = 0;\n heroDamage = 0;\n }\n }\n\n if (announceHealthBenefit && healthBenefitToAnnounce > 0)\n {\n healthBenefitAnnouncementTimer--;\n paint.setTextSize(142);\n paint.setColor(getResources().getColor(R.color.yellow));\n canvas.drawText(\"+\" + healthBenefitToAnnounce + \" HP!\", x + 37, y + 650, paint);\n\n if (healthBenefitAnnouncementTimer <= 0)\n {\n announceHealthBenefit = false;\n }\n }\n }", "public void run() \n\t\t\t{\n\t\t\t\tif (Math.abs(player.getLocation().getX() - playerLoc.getX()) > 1\n\t\t\t\t\t\t|| Math.abs(player.getLocation().getY() - playerLoc.getY()) > 1\n\t\t\t\t\t\t|| Math.abs(player.getLocation().getZ() - playerLoc.getZ()) > 1)\n\t\t\t\t{\n\t\t\t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You cannot move while bandaging!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tString name = player.getCustomName();\n\t\t\t\tif (name == null)\n\t\t\t\t\tname = player.getName();\n\t\t\t\t\n\t\t\t\t//Check that the recipient is still in roughly the same location\n\t\t\t\t//Skip if self-heal\n\t\t\t\tif (!player.equals(recipient))\n\t\t\t\t\tif (Math.abs(recipient.getLocation().getX() - recipientLoc.getX()) > 1\n\t\t\t\t\t\t|| Math.abs(recipient.getLocation().getY() - recipientLoc.getY()) > 1\n\t\t\t\t\t\t|| Math.abs(recipient.getLocation().getZ() - recipientLoc.getZ()) > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You cannot bandage your patient while they are moving!\");\n\t\t\t\t\t\trecipient.sendMessage(ChatColor.YELLOW + name + \" cannot bandage you while you are moving!\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Remove item from player's inventory.\n\t \t\tplayer.getInventory().removeItem(new ItemStack(Material.getMaterial(item.toUpperCase()), 1));\n\t \t\tplayer.updateInventory();\n\t \t\t\t\n\t \t\t//Heal the other player.\n\t \t\trecipient.setHealth(recipient.getHealth() + amountToHeal);\n\n\t \t\t//Award experience.\n\t \t\tProfessionStats prof = new ProfessionStats(perms, data, config, player.getUniqueId());\n\t \t\t\n\t \t\tif (!prof.isPracticeFatigued(profession))\n\t \t\t\taddExperience(player, profession, config.getInt(\"healing.\" + item + \".exp\"));\n\t \t\t\t\n\t \t\t//Notify both parties.\n\t \t\tif (!player.equals(recipient))\n\t \t\t{\t \t\t\n\t \t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You bandaged \" + recipient.getName() + \"'s wounds.\");\n\t \t\t\trecipient.sendMessage(ChatColor.YELLOW + player.getName() + \" bandaged your wounds.\");\n\t \t\t}\n\t \t\telse\n\t \t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You bandaged your wounds.\");\n\t\t\t }", "@Override\n public void showMessage() {\n MessageHandler.getInstance()\n .writeMessage(\"This Base is different! \\n Behold!\");\n Player p = ((RomInntrenger) GameApplication.getInstance()).getClosestPlayer(transform.getGlobalPosition());\n p.getCurrentWeapon().setWeaponBase(cli);\n collider.destroy();\n destroy();\n\n }", "public void atBattleStartPreDraw() {\n\n this.flash();\n ArrayList<Integer> orbs = new ArrayList();\n orbs.add(1);\n orbs.add(2);\n orbs.add(3);\n orbs.add(4);\n\n for (int i = 0; i < 2; i++) {\n\n Integer o = orbs.get(AbstractDungeon.cardRng.random(orbs.size() - 1));\n\n switch (o) {\n case 1:\n AbstractDungeon.actionManager.addToBottom(new SlimeSpawnAction(new AttackSlime(), false, true));\n break;\n case 2:\n AbstractDungeon.actionManager.addToBottom(new SlimeSpawnAction(new ShieldSlime(), false, true));\n break;\n case 3:\n AbstractDungeon.actionManager.addToBottom(new SlimeSpawnAction(new SlimingSlime(), false, true));\n break;\n case 4:\n AbstractDungeon.actionManager.addToBottom(new SlimeSpawnAction(new PoisonSlime(), false, true));\n break;\n }\n }\n\n com.megacrit.cardcrawl.dungeons.AbstractDungeon.actionManager.addToBottom(new com.megacrit.cardcrawl.actions.defect.IncreaseMaxOrbAction(1));\n AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(AbstractDungeon.player, AbstractDungeon.player, new PotencyPower(AbstractDungeon.player, AbstractDungeon.player, 1), 1));\n\n\n }", "public void trackBullets(){\n // bossbullet control, if it hit the bound, remove the bullet\n for(int i = 0; i < bossBullets.size(); i++){\n Bullet tempBullet = bossBullets.get(i);\n tempBullet.update();\n tempBullet.drawBullet();\n // print (tempBullet.posX, tempBullet.posY,'\\n');\n if(tempBullet.detectBound()){\n bossBullets.remove(i);\n continue;\n }\n\n if(tempBullet.hitObject(Main.player) && !Main.player.invincible){\n Main.player.decreaseHealth(1);\n Main.player.posX = width / 2;\n Main.player.posY = height * 9 / 10;\n Main.player.invincible = true;\n Main.player.invincibleTime = millis();\n }\n\n }\n }", "public void checkHealth(){\n if (this.getHealth() < this.initialHealth/2){\n this.setImgSrc(\"/students/footballstudent1.png\");\n this.getTile().setImage(\"/students/footballstudent1.png\");\n }\n }", "boolean isVisible(Player player, Entity entity);", "public void show(Graphics g) {\n for (int row = 0; row < grid.length; row++) { //iterate through the array\r\n for (int col = 0; col < grid[0].length; col++) {\r\n if (grid[row][col]==true) //if the value is \"alive\"\r\n {\r\n g.setColor(Color.black); //display black square\r\n } else {\r\n g.setColor(Color.white); //otherwise display white square\r\n }\r\n g.fillRect(col * 5 + 2, row * 5 + 2, 5, 5); // fill the square in\r\n }\r\n }\r\n }", "private void decide(double playerA, double playerMod, double monA, double monMod, Element pType, Element mType){\n double decider = (playerA * playerMod) - (monA * monMod);\n \n if(decider > 0){//case that the player won\n \n //subtract from the monsters health\n monHealth--;\n \n //diplay new monsters health\n String H = \"\";\n for(int i = 0; i < monHealth; i++){\n H += \"❤ \";\n }\n lblMonHealth.setText(H);\n \n //message to the user\n JOptionPane.showMessageDialog(null, \"You hit your opponent\\n\"\n + \"Info:\\n\"\n + \"You Chose \" + pType.toString() + \" -> \" + playerA + \" * \" + playerMod + \" = \" + (playerA*playerMod) + \"\\n\"\n + \"Opponent chose \" + mType.toString() + \" -> \" + monA + \" * \" + monMod + \" = \" + (monA*monMod));\n \n if(monHealth <= 0){//in the case that the monster dies\n //message to user that they win the encounter\n JOptionPane.showMessageDialog(null, \"Great work!\\nYou Win!\\n\\nYou earned \" + expGain + \" experience\");\n //add XP\n c.setXP(c.getXP() + exp);\n \n \n if(c.getXP() >= 20){//in the case that the player has enough XP to win the game\n //display the win screen\n this.setVisible(false);\n new gameWon(c).setVisible(true);\n }else{//otherwise\n //go back to home\n this.setVisible(false);\n new home(c).setVisible(true); \n }\n \n }\n \n }else if(decider < 0){//case in which the monster won\n \n //the player looses one health\n playerHealth--;\n //update on screen\n String H = \"\";\n for(int i = 0; i < playerHealth; i++){\n H += \"❤ \";\n }\n lblPlayerHealth.setText(H);\n \n //message and rundown to the user\n JOptionPane.showMessageDialog(null, \"Ah, you've been hit\\n\"\n + \"Info:\\n\"\n + \"You Chose \" + pType.toString() + \" -> \" + playerA + \" * \" + playerMod + \" = \" + (playerA*playerMod) + \"\\n\"\n + \"Opponent chose \" + mType.toString() + \" -> \" + monA + \" * \" + monMod + \" = \" + (monA*monMod));\n //If the player dies to the monster\n if(playerHealth <= 0){\n //gameover screen\n this.setVisible(false);\n new gameOver(c).setVisible(true);\n }\n \n }else{//otherwise it was a tie\n //message with rundown\n JOptionPane.showMessageDialog(null, \"tie, nobody wins\\n\"\n + \"Info:\\n\"\n + \"You Chose \" + pType.toString() + \" -> \" + playerA + \" * \" + playerMod + \" = \" + (playerA*playerMod) + \"\\n\"\n + \"Opponent chose \" + mType.toString() + \" -> \" + monA + \" * \" + monMod + \" = \" + (monA*monMod));\n }\n }", "public void showGameBoard(Player player){\n\t\tFeatherBoardAPI.removeScoreboardOverride(player, \"build-battle-lobby\");\n\n\t\tFeatherBoardAPI.showScoreboard(player,\"build-battle-game\");\n\t}", "public void setHasBoss(boolean val) {\n hasBoss = val;\n }", "private void showLeaderboardBar() {\n if (leaderBoardBar != null) {\n leaderBoardBar.animate().translationY(0);\n }\n }", "public void lookAround() {\n\t\t\tdisplay(\"The room is full of gold!\");\n\t\t}", "private void handleCombat(PlayerHealth playerHealth) {\n if (playerHealth.getHealthLevel() == 0) {\n loseScreen();\n }\n }", "@Override\r\n public void onGameEnded() {\r\n this.setVisible(true);\r\n }", "public void showLobby() {\n \t\tgameMain.showScreen(lobby);\n \t}", "@Override\n protected void paintForeground(Graphics2D g) {\n g.setColor(Color.MAGENTA);\n g.setFont(new Font(\"Calibri\", Font.BOLD,20));\n g.drawString(\"Villain Carnage\",5,30);\n g.setFont(new Font(\"Calibri\", Font.BOLD, 15));\n g.drawString((\"Level 1\"),20,60);\n \n \n \n //g.drawImage(ballIcon, 2,2, this);\n \n g.drawString(\"Ball Count :\" + villain.getBallCount(), 20,120 );\n \n //g.drawImage(heartIcon, 20,40, this);\n g.drawString(\"Lives left : \" + villain.getLives(),20,150);\n \n // Sets all the appropriate GUI components for this level, including ball count and \n // lives count which will be incremented/decremented as the player collides with it's\n // respective object\n \n }", "public void deadcheck()\n\t{\n\t\tif (this.shield <= 0)\n\t\t{\n\t\t\tthis.drawMissile = false;\n\t\t}\n\t\telse \n\t\t\tthis.drawMissile = true;\n\t}", "public boolean showPlayer(){\n\t\t\n\t\tSystem.out.println(\"\\t\"+color+\"\\t \"+playermoney+\"\\t \\t\"+totalminions+\" \\t\"+totalbuildings+\" \\t\\t\"+personalityCard.cardName);\n\t\treturn true;\n\t}", "public void displayDamageIndicator(Graphics2D g2d) {\n //so the damage indicator won't turn translucent\n g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,\n 1f));\n this.damageIndicator.display(g2d, this.damageTaken);\n }", "public void display(JPanel panel, Graphics2D g2d, Hero[] players) {\n int[] pos = {(int)(this.x), (int)(this.y), \n this.imageWidth, this.imageHeight};\n int[] newPos = Zoom.getDisplayPos(g2d, players, pos);\n float opacity;\n if (this.state.equals(\"dodge\")) {\n opacity = 0.5f;\n } else {\n opacity = 1f;\n }\n\n g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,\n opacity));\n g2d.drawImage(this.sprites.get(this.state)[this.spriteNum],\n newPos[0], newPos[1], newPos[2], newPos[3],\n panel);\n }", "private void checkVictory()\n {\n if(throne.getEnemyHealth() <= 0)\n {\n System.out.println(\"Congrats! The land is now free from all chaos and destruction. You are now very rich and wealthy. Yay\");\n alive = false;\n }\n }", "@Override\n public void show() {\n player = new Player(game.getAssetManager().get(\"player.png\", Texture.class), world, new Vector2(1, 2));\n floor = new Floor(game.getAssetManager().get(\"floor.png\", Texture.class), world, new Vector2(0, 0 + 0.5f), 20f, 1f);\n hud = new HUD();\n\n stage.addActor(floor);\n stage.addActor(player);\n\n //TODO: AUTOGENERATE when the player goes up.\n platforms.clear();\n int ax = (int) (Math.random() * 5 + 0);\n platforms.add(new Platform(game.getAssetManager().get(\"platform.png\", Texture.class), world, new Vector2(ax, 3), 1.2f, 0.3f));\n for (int i = 3; i <= 25; i++) {\n\n int x, y;\n x = (int) (Math.random() * 4.5 + 0.5);\n y = ((int) (Math.random() * 3 + 1)) + i;\n\n while ((x < ax && x > ax + 1f) && (x > ax && x < ax - 1f)) {\n x = (int) (Math.random() * 4.5 + 0.5);\n }\n Gdx.app.log(\"kk\",x+\"x\"+y);\n platforms.add(new Platform(game.getAssetManager().get(\"platform.png\", Texture.class), world, new Vector2(x, y), 1f, 0.3f));\n ax = x;\n }\n\n for (Platform platform : platforms) {\n stage.addActor(platform);\n }\n\n stage.getCamera().position.set(cameraInitialPosition);\n stage.getCamera().update();\n\n playing = false;\n jumps = 0;\n lastPlatformTouched = 0;\n\n song.play();\n\n }", "public void paintComponent(Graphics g){\n\t\t\tsuper.paintComponent(g);\n\t\t\tg.setColor(Color.black);\n\t\t\tg.fillRect(0,0,getWidth(), getHeight());//paints the background black\n\t\t\tt.drawTank(g);//draws the tank\n\t\t\tboolean b = false;\n\t\t\tfor (int i = 0; i < t.bullets.size(); i++){ //draws the bullets. if the bullets either hit a plane or go off the screen, they are removed from the array to not clog up memory\n\t\t\t\tt.bullets.get(i).drawBullet(g);\n\t\t\t\tt.bullets.get(i).move();\n\n\t\t\t\tfor (int j = 0; j < bombers.size(); j++){ //draws the bombers, removes them if they are shot down\n\t\t\t\t\tif (bombers.get(j).checkHit(t.bullets.get(i))) {t.bullets.remove(i); b = true; break;}\n\t\t\t\t}\t\t\t\t\n\t\t\t\tif (!b)\n\t\t\t\t\tif (t.bullets.get(i).bx < 0 || t.bullets.get(i).bx > 1090 || t.bullets.get(i).by < 0 || t.bullets.get(i).by > 730) t.bullets.remove(i);\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < bombers.size(); i ++){ \n\t\t\t\tbombers.get(i).drawBomber(g);\n\t\t\t}\n\t\t \tif (t.lost == true){ //manages the loosing of the game\n\t\t\t\t\n\t\t\t\tif (t.startboomtimer){\n\t\t\t\t\tif (t.boomtimer < 10) g.drawImage(boom2, t.x +25, 565, 100, 60, null);\n\t\t\t\t\telse if (t.boomtimer < 20) g.drawImage(boom2, t.x,535, 150,100,null);\n\t\t\t\t\telse if (t.boomtimer == 30) t.startboomtimer = false;\n\t\t\t\t\tt.boomtimer ++;\n\t\t\t\t}\n\t\t\t\tg.setColor(Color.WHITE);\n\t\t\t\tg.setFont(new Font(\"Times New Roman\", Font.BOLD, 50));\n\t\t\t\tg.drawString(\"YOU LOST :(\", 400, 300);\n\t\t\t\tif (t.onetime == 31){ //this method adds a question panel so that when you loose you can revive yourself with the questions\n\t\t\t\t\t\n\t\t\t\t\tmoveframe = new JFrame (\"Move on\");\n\t\t\t\t\t\n\t\t\t\t\tmoveframe.setSize(510,320);\n\t\t\t\t\tRandom rand = new Random();\n\t\t\t\t\tQuestion question1 = questions.get(rand.nextInt(questions.size())); //selects 2 seperate questions from the question array to be used\n\t\t\t\t\tQuestion question2;\n\t\t\t\t\tdo {\n\t\t\t\t\t\tquestion2 = questions.get(rand.nextInt(questions.size()));\n\t\t\t\t\t} while(question2.equals(question1));\n\t\t\t\t\t\n\t\t\t\t\tmoveframe.getContentPane().add(new QuestionPanelLoss(question1, question2, 0), BorderLayout.CENTER); //adds the questionpanel\n\t\t\t\t\tmoveframe.setLocationRelativeTo(null);;\n\t\t\t\t\tmoveframe.setVisible(true);\n\n\t\t\t\t\t\n\t\t\t\t\ttime.stop();\n\t\t\t\t}\n\t\t\t\tt.onetime ++ ;\n\t\t\t\n\t\t\t}\n\n\n\t\t}", "public boolean myHealthVisible()\n\t{\n\t\tIntBitmap lifeBar = IntBitmap.getInstance(takeScreenshot(ScreenRegion.LIFE_RECT));\n\t\tRatioFilter.maintainRatio(lifeBar, FilterType.LIFE);\n\t\tBinaryImage bin = lifeBar.toGreyscale().doubleCutoff(30);\n\t\treturn bin.countWhite() > 1000;\n\t\t//return imageMatches(IntBitmap.getInstance(takeScreenshot(ScreenRegion.FIND_HEALTH_RECT)), ImageLibrary.MY_HEALTH_ICON.get());\n\t}", "@SubscribeEvent\n public void onTickServerTick(ClientTickEvent event) {\n if (!hypixel()) return;\n if (mc.theWorld != null && mc.theWorld.getScoreboard() != null && mc.theWorld.getScoreboard().getObjectiveInDisplaySlot(1).getDisplayName() != null) {\n String firstLine = mc.theWorld.getScoreboard().getObjectiveInDisplaySlot(1).getDisplayName();\n bedwars = firstLine.contains(\"BED \");\n }\n }", "public GameLogic() {\n this.display = createScreen();\n playerShipHealth = 30;\n enemyShipHealth = 20;\n playerShield = 1;\n enemyShield = 1;\n playerMissile = 10;\n enemyMissile = 5;\n\n isPlayerPilotDamaged = false;\n isPlayerGunLDamaged = false;\n isPlayerGunMDamaged = false;\n isPlayerShieldDamaged = false;\n isPlayerEngineDamaged = false;\n\n isEnemyPilotDamaged = false;\n isEnemyGunLDamaged = false;\n isEnemyGunMDamaged = false;\n isEnemyShieldDamaged = false;\n isEnemyEngineDamaged = false;\n\n playerEvasionPercent = .3;\n enemyEvasionPercent = .3;\n\n }", "public void standBJ() {\n\t\tif (blackjack.isOkBet()) {\n\t\t\t((BlackjackView) manager.getPanel(Constants.BJ_VIEW_NAME)).standAction();\n\n\t\t\twhile (blackjack.getCount(2, false, 17)) {\n\t\t\t\t((BlackjackView) manager.getPanel(Constants.BJ_VIEW_NAME)).addCard(blackjack.giveCard(2), 2);\n\t\t\t}\n\n\t\t\tif (blackjack.getCount(2, true, 21)) {\n\t\t\t\tJOptionPane.showMessageDialog(((BlackjackView) manager.getPanel(Constants.BJ_VIEW_NAME)), \"You win!\",\n\t\t\t\t\t\t\"DEALER BUSTS\", JOptionPane.PLAIN_MESSAGE);\n\t\t\t\tblackjack.stand(true);\n\t\t\t} else {\n\t\t\t\tif (blackjack.getCount(1, true, blackjack.getCardCount(2))) {\n\t\t\t\t\tJOptionPane.showMessageDialog(((BlackjackView) manager.getPanel(Constants.BJ_VIEW_NAME)),\n\t\t\t\t\t\t\t\"You win!\", \"YOU WIN\", JOptionPane.PLAIN_MESSAGE);\n\t\t\t\t\tblackjack.stand(true);\n\t\t\t\t} else if (blackjack.getCount(1, false, blackjack.getCardCount(2))) {\n\t\t\t\t\tJOptionPane.showMessageDialog(((BlackjackView) manager.getPanel(Constants.BJ_VIEW_NAME)),\n\t\t\t\t\t\t\t\"You lose!\", \"YOU LOSE\", JOptionPane.PLAIN_MESSAGE);\n\t\t\t\t\tblackjack.stand(false);\n\t\t\t\t} else {\n\t\t\t\t\tJOptionPane.showMessageDialog(((BlackjackView) manager.getPanel(Constants.BJ_VIEW_NAME)),\n\t\t\t\t\t\t\t\"You push.\", \"PUSH\", JOptionPane.PLAIN_MESSAGE);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresetBJTable();\n\t\t} else\n\t\t\tJOptionPane.showMessageDialog(manager.getPanel(Constants.BJ_VIEW_NAME), \"You must bet something\", \"ERROR\",\n\t\t\t\t\tJOptionPane.PLAIN_MESSAGE);\n\t}", "@Override\n public void onEntityUpdate() {\n if (!(world.provider instanceof WorldProviderLimbo || world.provider instanceof WorldProviderDungeonPocket)) {\n setDead();\n super.onEntityUpdate();\n return;\n }\n\n super.onEntityUpdate();\n\n // Check for players and update aggro levels even if there are no players in range\n EntityPlayer player = world.getClosestPlayerToEntity(this, MAX_AGGRO_RANGE);\n boolean visibility = player != null && player.canEntityBeSeen(this);\n updateAggroLevel(player, visibility);\n\n // Change orientation and face a player if one is in range\n if (player != null) {\n facePlayer(player);\n if (!world.isRemote && isDangerous()) {\n // Play sounds on the server side, if the player isn't in Limbo.\n // Limbo is excluded to avoid drowning out its background music.\n // Also, since it's a large open area with many Monoliths, some\n // of the sounds that would usually play for a moment would\n // keep playing constantly and would get very annoying.\n playSounds(player.getPosition());\n }\n\n if (visibility) {\n // Only spawn particles on the client side and outside Limbo\n if (world.isRemote && isDangerous()) {\n spawnParticles(player);\n }\n\n // Teleport the target player if various conditions are met\n if (aggro >= MAX_AGGRO && !world.isRemote && ModConfig.monoliths.monolithTeleportation && !player.isCreative() && isDangerous()) {\n aggro = 0;\n Location destination = WorldProviderLimbo.getLimboSkySpawn(player);\n TeleportUtils.teleport(player, destination, 0, 0);\n player.world.playSound(null, player.getPosition(), ModSounds.CRACK, SoundCategory.HOSTILE, 13, 1);\n }\n }\n }\n }", "public void drawBeast(Graphics g, JPanel p) {\n\tif (isVisible()) {\n\t g.drawImage(this.getImage(), this.getX(), this.getY(), p);\n\t g.setColor(Color.WHITE);\n\t g.drawString(Integer.toString(hp), this.getX() + 40, this.getY() + 15);\n\t g.drawString(Integer.toString(arm), this.getX() + 40, this.getY() + 25);\n\t g.drawString(Integer.toString(dmg), this.getX() + 40, this.getY() + 35);\n\t}\n }", "protected void checkInFront()\n {\n d = (Defender)getOneObjectAtOffset(getImage().getWidth()/4, 0, Defender.class);\n if (d != null )\n {\n\n frontEmpty= false;\n d.takeDamage(damage);\n }\n\n else\n {\n frontEmpty = true;\n }\n }", "public void showLobbyBoard(Player player){\n\t\tFeatherBoardAPI.showScoreboard(player,\"build-battle-lobby\");\n\t}", "public void printCurrentBattlers() {\n //System.out.println(\"Char hp: \" + character.getCurrHP());\n System.out.printf(\"battle Allies: \");\n for (MovingEntity e: battleAllies) {\n System.out.printf(\"%s \",e.getID());\n }\n System.out.printf(\"\\n\");\n\n System.out.printf(\"battle Enemies: \");\n for (MovingEntity e: battleEnemies) {\n if (e.getBattleBehaviour() instanceof ZombieBattleBehaviour) {\n System.out.printf(\"Z\");\n }\n System.out.printf(\"%s \",e.getID());\n }\n System.out.printf(\"\\n\");\n }" ]
[ "0.65924305", "0.6560896", "0.64090943", "0.63771784", "0.60405344", "0.6009085", "0.5976579", "0.5968275", "0.59679186", "0.59467363", "0.5908623", "0.58698434", "0.5868271", "0.5816631", "0.580829", "0.5777006", "0.5763518", "0.57600594", "0.57312757", "0.5727791", "0.572096", "0.5720028", "0.5718403", "0.5716473", "0.5714678", "0.5690908", "0.56894016", "0.5687782", "0.56730753", "0.56571585", "0.5646744", "0.5634987", "0.56216383", "0.561748", "0.56140894", "0.55780727", "0.5576404", "0.55639416", "0.5559824", "0.5558407", "0.5555934", "0.5554011", "0.55438656", "0.5534803", "0.55301726", "0.55225086", "0.5521885", "0.55177736", "0.5514523", "0.5505997", "0.5504575", "0.5495664", "0.5494806", "0.5493484", "0.54864275", "0.5484234", "0.547816", "0.54754347", "0.5471817", "0.5466552", "0.5449081", "0.5435767", "0.54187346", "0.5412799", "0.5407772", "0.5402901", "0.53987986", "0.53952813", "0.53927493", "0.53922427", "0.5389789", "0.53876394", "0.53780776", "0.5368864", "0.5367937", "0.5364379", "0.53630704", "0.53554636", "0.53529423", "0.5351741", "0.53501284", "0.5347604", "0.5346494", "0.5346063", "0.53401196", "0.5337242", "0.533449", "0.5333779", "0.53328514", "0.53322035", "0.53302443", "0.5329368", "0.5309633", "0.53067446", "0.52972716", "0.5296148", "0.52940035", "0.52907234", "0.5287906", "0.52787364" ]
0.66323465
0
Returns line from specified uuid
public BossBarLine getLine(UUID id) { for (BossBarLine line : getLines().values()) { if (line.getUuid() == id) return line; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Line getLine(String targetLine);", "LineItem getLineItemById(Integer lineItemId);", "public abstract String getLine(int lineNumber);", "public String getLine(int lineNumber) {\n if (list.size()>lineNumber)\n return list.get(lineNumber);\n else\n return null; // Requested line number outside range\n }", "@Nullable\n public Diff.Line getLineInHunk(int hunkIdx, int lineOfHunk) {\n AtomicLong out = new AtomicLong();\n int e = jniGetLineInHunk(out, getRawPointer(), hunkIdx, lineOfHunk);\n if (ENOTFOUND.getCode() == e) {\n return null;\n }\n Error.throwIfNeeded(e);\n return new Diff.Line(out.get());\n }", "public String getLineId() {\n return lineId;\n }", "String getLine (int line);", "public String getIdString(CharSequence line) {\n\t\tList<String> values = parseCsvLine(line);\n\t\treturn values.get(id);\n\t}", "public String getSourceLine (int line);", "public void setUuid(String uuid)\n {\n this.uuid = uuid;\n }", "abstract protected T getRecordFromLine(String line) throws DataImportException ;", "public void setUuid(String uuid) {\n this.uuid = uuid;\n }", "public void setUuid(String uuid) {\n this.uuid = uuid;\n }", "public void setUuid(String uuid) {\n this.uuid = uuid;\n }", "public void setUuid(String uuid) {\n this.uuid = uuid;\n }", "java.lang.String getUUID();", "@Override\r\n\tpublic FyTestRecord findByUuid(String uuid) {\n\t\treturn testRecordDao.findByUuid(uuid);\r\n\t}", "public abstract String getLineupId();", "private String getUUIDByUserIdentity(String identity) {\n\t\tString userUUID = null;\n\t\tJSONObject jsonObj;\n\t\ttry {\n\t\t\tjsonObj = new JSONObject(identity);\n\t\t\tif (jsonObj.has(\"entryuuid\"))\n\t\t\t\tuserUUID = jsonObj.getJSONArray(\"entryuuid\").getString(0);\n\t\t\telse if (jsonObj.has(\"entryUUID\"))\n\t\t\t\tuserUUID = jsonObj.getJSONArray(\"entryUUID\").getString(0); // TODO\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Add\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// by\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Alston\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// @20150917\n\t\t\telse if (jsonObj.has(\"uid\")) // TODO Add by Alston @20150917\n\t\t\t\tuserUUID = jsonObj.getJSONArray(\"uid\").getString(0); // TODO Add\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// by\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Alston\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// @20150917\n\t\t} catch (JSONException e) {\n\t\t\tlogger.error(\"JSONException: \", e);\n\t\t}\n\n\t\treturn userUUID;\n\t}", "String getUuid();", "public void setUuid(String uuid);", "public void setUuid(String uuid);", "public void setUuid(String uuid);", "public void setUuid(java.lang.String uuid) {\n this.uuid = uuid;\n }", "public SupplierSettlementLine getLine(long objectId, long lineId) throws CoreException {\n try (Response response = clientApi.get(SUPPLIER_SETTLEMENTS + objectId + LINES + lineId, null)) {\n return (SupplierSettlementLine) readResponse(response, SupplierSettlementLine.class);\n }\n }", "public void setUuid(String uuid) {\n\t\tthis.uuid = uuid;\n\t}", "@Override\r\n\tpublic Newstrategypojo getline(int id) {\n\t\treturn dao.getline(id);\r\n\t}", "public Row getRow (int line) {\n return rowCache.get(line);\n }", "public ItemEntity getItemByUUID(String uuid) {\n try {\n return entityManager.createNamedQuery(\"itemByUUID\", ItemEntity.class).setParameter(\"uuid\", uuid).getSingleResult();\n } catch (NoResultException nre) {\n return null;\n }\n }", "public Number getLineId() {\n return (Number) getAttributeInternal(LINEID);\n }", "public String getLine(int line) {\n if (line > 14)\n return null;\n if (line < 0)\n return null;\n return getOrCreateTeam(line).getValue();\n }", "public String getLine ()\n {\n return line;\n }", "public Number getLineId() {\n return (Number)getAttributeInternal(LINEID);\n }", "public Number getLineId() {\n return (Number)getAttributeInternal(LINEID);\n }", "public final int getLine()\n\t{\n\t\treturn address >>> 8 & 0x0F;\n\t}", "public CharSequence getLineContents(int line) {\n getLock().getReadLock();\n try {\n return lines.getLineContents(line);\n } finally {\n getLock().relinquishReadLock();\n }\n }", "public abstract String getUuid();", "public String getUuid() {\n return this.uuid;\n }", "User getUserByUUID(String uuid);", "public void load(UUID uuid) {\n async(() -> {\n ResultSet set = null;\n SQLStatement statement = new SQLStatement(\"SELECT `json` FROM `player_info` WHERE `player`=?\");\n statement.set(1, uuid);\n try {\n set = query(statement);\n if (set.next()) {\n String json = set.getString(\"json\");\n PlayerInfo info = KitSQL.GSON.fromJson(json, PlayerInfo.class);\n info.setUuid(uuid);\n } else {\n new PlayerInfo(uuid);\n }\n } catch (SQLException e) {\n e.printStackTrace();\n } finally {\n try {\n if(set != null && !set.isClosed()) {\n set.close();\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n });\n }", "IRegion getLineInformation(int line) throws BadLocationException;", "public String getUuid()\n {\n return this.uuid;\n }", "String getDescription(String uuid) throws DatabaseException;", "@Override\n public String readLine() throws IOException {\n checkBuffer(-1);\n this.randomAccessFile.seek(this.fileOffset + this.bufferPointer.bufferOffset);\n String line = this.randomAccessFile.readLine();\n this.fileOffset = this.randomAccessFile.getFilePointer();\n this.bufferPointer.invalidate();\n return line;\n }", "MediaMetadata get(String uuid);", "public String getUuid() {\r\n return uuid;\r\n }", "public String getUuid() {\r\n return uuid;\r\n }", "public String getUuid() {\r\n return uuid;\r\n }", "public void setUuid(String _uuid) {\n this._uuid = _uuid;\n }", "@Override\n public PurchaseOrderLine getOrderLine(int index) {\n return orderLines.get(index);\n }", "SmsCleanBagLine selectByPrimaryKey(String id);", "public String getId(){\n\t\treturn uuid;\n\t}", "private String getLine(final int index) {\n Element elem = TextUtils.getParagraphElement(document, index);\n if (elem == null) {\n return null;\n }\n int start = elem.getStartOffset();\n int length = elem.getEndOffset() - start;\n String result = null;\n try {\n result = document.getText(start, length);\n } catch (final BadLocationException e) {\n }\n return result;\n }", "public String getUUID() {\n return uuid;\n }", "private String getLineAt(int linenum) {\n\t\ttry {\n\t\t\tint start = mainTextArea.getLineStartOffset(linenum);\n\t\t\tint end = mainTextArea.getLineEndOffset(linenum);\n\t\t\treturn mainTextArea.getText(start, end - start);\n\t\t} catch (BadLocationException e) {\n\t\t\treturn (\"\");\n\t\t}\n\t}", "public void setLineId(String line_id)\r\n {\r\n this.line_id = line_id;\r\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public String getUuid() {\n return uuid;\n }", "public UUID getUuid() { return uuid; }", "public String getLine();", "@Override\n public Client get(String uuid) {\n return null;\n }", "public void setUuid(Integer uuid) {\n this.uuid = uuid;\n }", "@Override\n\tpublic void setUuid(String uuid);", "public String getLine()\n\t{\n\t\ttry\n\t\t{\n\t\t\tline = reader.readLine();\n\t\t} catch (IOException ioe)\n\t\t{\n\t\t\t//\n\t\t}\n\n\t\treturn line;\n\t}", "axiom Object readLine(Object BufferedReader(FileReaderr f)) {\n\treturn f.get(0);\n }", "String snippet(int line);", "int getLineOfOffset(int offset) throws BadLocationException;", "public abstract String getFirstLine();", "private String findLine(String line, String search){\n List<String> lines = line.lines().collect(Collectors.toList());\n for (String l: lines) {\n if(l.contains(search)){\n return l;\n }\n }\n return \"\";\n }", "public String getUuid() {\n\t\treturn uuid;\n\t}", "List<Notification> getNotifications(String lineID);", "@Override\r\n\tpublic Unit getUnit(String uuid) {\n\r\n\t\treturn unitRepo.getUnit(uuid);\r\n\t}", "public String getLine() {\n\t\treturn line.toString();\n\t}", "UUID getUUID();", "long getLockOwnersID(String uuid) throws DatabaseException;", "public int getLine() {return _line;}", "VirtualFile getFile(String uuid);", "private void setUUID(UUID uuid) {\n this.uuid = uuid;\n }", "String getMutantLog(String mutant_name)\n {\n try\n {\n File myFile = new File(MutationSystem.MUTANT_PATH, \"mutation_log\");\n String strLine;\n LineNumberReader lReader = new LineNumberReader(new FileReader(myFile));\n while ((strLine=lReader.readLine()) != null)\n {\n if (strLine.indexOf(mutant_name) == 0)\n {\n return strLine;\n }\n }\n } catch (FileNotFoundException e1)\n {\n System.err.println(e1);\n } catch (IOException e2)\n {\n System.err.println(e2);\n }\n return null;\n }", "public Line getLine()\n {\n return line;\n }", "public String getUuid() {\n return _uuid;\n }", "public Line getLine(Line.Info paramInfo) throws LineUnavailableException {\n/* 128 */ Line.Info info = getLineInfo(paramInfo);\n/* */ \n/* 130 */ if (info != null && info instanceof Port.Info) {\n/* 131 */ for (byte b = 0; b < this.portInfos.length; b++) {\n/* 132 */ if (info.equals(this.portInfos[b])) {\n/* 133 */ return getPort(b);\n/* */ }\n/* */ } \n/* */ }\n/* 137 */ throw new IllegalArgumentException(\"Line unsupported: \" + paramInfo);\n/* */ }", "public String filterBleMessage(String line) {\n System.out.println(\"Filtering messages...\");\n String regexStr = \"\\\\s+Data:\\\\s[a-zA-Z0-9]{20,100}\";\n String regexStrCur = \"\\\\s+Data:\\\\sbeac[a-zA-Z0-9]{20,100}\";\n String regx1 = \"Service Data \\\\(UUID [0-9a-zA-Z]{4,10}\\\\): [A-Za-z0-9]{20,40}\";\n String regx2 = \"\\\\s*Service\\\\sData\\\\s\\\\(UUID [a-zA-z0-9]{10}\\\\): [a-zA-z0-9]{32,50}\";\n String serviceDataRegex = \"Service\\\\sData\\\\s\\\\(UUID [a-zA-z0-9]{2,10}\\\\): [a-zA-z0-9]{32}\";\n Pattern pattern = Pattern.compile(regexStrCur);\n Matcher matcher = pattern.matcher(line);\n if (matcher.find()) {\n System.out.println(\"Regex Matched...\");\n int start = matcher.start();\n int end = matcher.end();\n line = line.substring(start, end);\n line = line.trim();\n line = line.replace(\"Data: beac\", \"\");\n System.out.println(\"Encoded Data: \" + line);\n return line.trim();\n } else {\n System.out.println(\"Didn't Match anything\");\n return \"\";\n }\n }", "public static String findLine(String filename, String substring) {\n String foundLine = \"\";\n try {\n FileReader fr = new FileReader(new File(filename));\n BufferedReader br = new BufferedReader(fr);\n String s;\n while ((s = br.readLine()) != null) {\n if(s.startsWith(substring)) {\n foundLine = s;\n break;\n }\n }\n br.close();\n fr.close();\n } catch (FileNotFoundException ex) {\n } catch (IOException ex) {\n }\n return foundLine;\n }", "@Override\n public String getNodeId() throws IOException {\n return getFirstLineOfFile(nodeIdPath);\n }", "public Integer getUuid() {\n return uuid;\n }", "public static Line CreateLine(String id) { return new MyLine(id); }", "public String getLine() {\n return this.line;\n }", "public void setUuid(UUID uuid);", "private Actor getActorFromData(String[] line){\n Actor actor = new Actor(line[AppVariables.actorID].trim(), \n line[AppVariables.actorName].trim());\n return actor;\n }", "private SensorReading extractReading(String line) {\n\t\tList<Integer> tempArray = new ArrayList<Integer>();\n\t\tString[] sr = line.split(\",\");\n\t\tfor(int i=0; i<sr.length; i++) {\n\t\t\tint num = Integer.MIN_VALUE;\n\t\t\ttry {\n\t\t\t\tnum = Integer.parseInt(sr[i]);\n\t\t\t} catch(NumberFormatException nfe) {\n\t\t\t\t// if num is not integer, skip the current line\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\ttempArray.add(num);\n\t\t}\t\t\t\n\t\tif(tempArray.size() == sr.length) {\n\t\t\treturn new SensorReading(tempArray, zeroValues);\n\t\t}\n\t\treturn null;\n\t}", "public String getUUIDFromAAALegacy(String token) throws Exception {\n\t\tString uuid = null;\n\n\t\tHttpURLConnection httpConn;\n\t\thttpConn = this.setHttpConnection(openAMLocation\n\t\t\t\t+ \"/identity/attributes?subjectid=\" + token\n\t\t\t\t+ \"&attributenames=entryUUID\");\n\t\tthis.setGetHttpConnection(httpConn);\n\n\t\tBufferedReader br = this.getHttpInputReader(httpConn);\n\t\tString str;\n\t\tString uuidTag = \"userdetails.attribute.value=\";\n\n\t\tif (httpConn.getResponseCode() == 200) {\n\t\t\twhile ((str = br.readLine()) != null) {\n\t\t\t\tlogger.info(\"{}\", str);\n\t\t\t\tint location = str.indexOf(uuidTag);\n\t\t\t\tif (location != -1) {\n\t\t\t\t\tuuid = str.substring(location + uuidTag.length());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn uuid;\n\t}" ]
[ "0.6019565", "0.58068407", "0.58025116", "0.57899904", "0.57654524", "0.57311887", "0.5699747", "0.5637183", "0.5601512", "0.55803937", "0.55602384", "0.5502162", "0.5502162", "0.5502162", "0.5502162", "0.5495497", "0.54812425", "0.5457945", "0.5428027", "0.54219353", "0.5386285", "0.5386285", "0.5386285", "0.5370338", "0.5369936", "0.5364074", "0.5343275", "0.534012", "0.5331437", "0.5325749", "0.5311455", "0.5306992", "0.5306294", "0.5306294", "0.53056127", "0.5298007", "0.52961326", "0.52831125", "0.5279578", "0.5278065", "0.5263226", "0.52491486", "0.5232383", "0.52272636", "0.52203274", "0.5211075", "0.5211075", "0.5211075", "0.5210437", "0.52097046", "0.518454", "0.517859", "0.5174248", "0.51741153", "0.5172646", "0.5147157", "0.5135214", "0.5135214", "0.5135214", "0.5135214", "0.5135214", "0.5135214", "0.5135214", "0.5135214", "0.5135214", "0.5135214", "0.51163447", "0.51090246", "0.5103875", "0.50973827", "0.50926286", "0.5091369", "0.50733554", "0.5068149", "0.50632393", "0.50622773", "0.50612724", "0.5053169", "0.5040722", "0.50358295", "0.5028023", "0.50178367", "0.50107205", "0.50094706", "0.5008515", "0.50061446", "0.50048107", "0.5004452", "0.5001727", "0.49948937", "0.49793756", "0.49771348", "0.49769348", "0.49683112", "0.49665496", "0.4964705", "0.496314", "0.4956786", "0.4956538", "0.49528766" ]
0.6407595
0
/ access modifiers changed from: protected
@Override // p2189io.reactivex.Single /* renamed from: a */ public void mo129801a(SingleObserver<? super T> aaVar) { this.f110527a.subscribe(new C32104a(aaVar)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void prot() {\n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private abstract void privateabstract();", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void smell() {\n\t\t\n\t}", "public abstract Object mo26777y();", "protected void h() {}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "protected abstract Set method_1559();", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public abstract void mo70713b();", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "protected Doodler() {\n\t}", "public abstract void mo27386d();", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "private PropertyAccess() {\n\t\tsuper();\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public abstract void mo56925d();", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void init() {\n }", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "public abstract void mo27385c();", "@Override\r\n\t\t\tpublic void buscar() {\n\r\n\t\t\t}", "@Override\n public void memoria() {\n \n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void smthAbstr() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "public abstract void mo30696a();", "abstract int pregnancy();", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "@Override\n public void init() {\n\n }", "@Override\n void init() {\n }", "@Override\n\tpublic void leti() \n\t{\n\t}", "private TMCourse() {\n\t}", "public abstract void mo35054b();", "@Override\n public void init() {\n }", "@Override\n\tpublic void buscar() {\n\t\t\n\t}", "private Infer() {\n\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void erstellen() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public final void mo51373a() {\n }", "protected void method_3848() {\r\n super.method_3848();\r\n }", "protected FanisamBato(){\n\t}", "public abstract Object mo1771a();", "public abstract void m15813a();", "public void gored() {\n\t\t\n\t}", "@Override\n public void get() {}", "@Override\n\tpublic void dibuja() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "private Get() {}", "private Get() {}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "public abstract void mo27464a();", "public abstract String mo41079d();", "@Override\n\tpublic void classroom() {\n\t\t\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\n\tpublic void verkaufen() {\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void logic() {\n\n\t}", "public abstract void mo102899a();", "@SuppressWarnings(\"unused\")\n private void _read() {\n }", "public abstract void mo42329d();", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "public void method_4270() {}", "public abstract void mo6549b();", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void function() {\n\t\t\n\t}", "protected void init() {\n // to override and use this method\n }" ]
[ "0.7375736", "0.7042321", "0.6922649", "0.6909494", "0.68470824", "0.6830288", "0.68062353", "0.6583185", "0.6539446", "0.65011257", "0.64917654", "0.64917654", "0.64733833", "0.6438831", "0.64330196", "0.64330196", "0.64295477", "0.6426414", "0.6420484", "0.64083177", "0.6406691", "0.6402136", "0.6400287", "0.63977665", "0.63784796", "0.6373787", "0.63716805", "0.63680965", "0.6353791", "0.63344383", "0.6327005", "0.6327005", "0.63259363", "0.63079315", "0.6279023", "0.6271251", "0.62518364", "0.62254924", "0.62218183", "0.6213994", "0.6204108", "0.6195944", "0.61826825", "0.617686", "0.6158371", "0.6138765", "0.61224854", "0.6119267", "0.6119013", "0.61006695", "0.60922325", "0.60922325", "0.6086324", "0.6083917", "0.607071", "0.6070383", "0.6067458", "0.60568124", "0.6047576", "0.6047091", "0.60342956", "0.6031699", "0.6026248", "0.6019563", "0.60169774", "0.6014913", "0.6011912", "0.59969044", "0.59951806", "0.5994921", "0.599172", "0.59913194", "0.5985337", "0.59844744", "0.59678656", "0.5966894", "0.5966894", "0.5966894", "0.5966894", "0.5966894", "0.5966894", "0.59647757", "0.59647757", "0.59616375", "0.5956373", "0.5952514", "0.59497356", "0.59454703", "0.5941018", "0.5934147", "0.5933801", "0.59318185", "0.5931161", "0.5929297", "0.5926942", "0.5925829", "0.5924853", "0.5923296", "0.5922199", "0.59202504", "0.5918595" ]
0.0
-1
(nonJavadoc) Method declared on Wizard.
@Override public void addPages() { this.mainPage = new SNLFilePage(this.workbench, this.selection); this.addPage(this.mainPage); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IWizard getWizard();", "public interface WizardActions {\n\n /**\n * Return the options back to default\n */\n public void returnDefault();\n\n /**\n * Apply the current settings without closing the wizard page\n */\n public void apply();\n\n /**\n * Save the current settings\n */\n public void save();\n\n}", "public void setWizard(IWizard newWizard);", "public interface IWizard {\n\n /**\n * Returns the action that accepts wizard modification and builds the report view.\n * \n * @return\n */\n BuildAction getBuildAction();\n\n /**\n * Returns the action that discards wizard modification and builds the report view.\n * \n * @return\n */\n CancelAction getCancelAction();\n}", "public interface IWizardPage extends IDialogPage {\r\n\t/**\r\n\t * Returns whether the next page could be displayed.\r\n\t *\r\n\t * @return <code>true</code> if the next page could be displayed,\r\n\t * and <code>false</code> otherwise\r\n\t */\r\n\tpublic boolean canFlipToNextPage();\r\n\r\n\t/**\r\n\t * Returns this page's name.\r\n\t *\r\n\t * @return the name of this page\r\n\t */\r\n\tpublic String getName();\r\n\r\n\t/**\r\n\t * Returns the wizard page that would to be shown if the user was to\r\n\t * press the Next button.\r\n\t *\r\n\t * @return the next wizard page, or <code>null</code> if none\r\n\t */\r\n\tpublic IWizardPage getNextPage();\r\n\r\n\t/**\r\n\t * Returns the wizard page that would to be shown if the user was to\r\n\t * press the Back button.\r\n\t *\r\n\t * @return the previous wizard page, or <code>null</code> if none\r\n\t */\r\n\tpublic IWizardPage getPreviousPage();\r\n\r\n\t/**\r\n\t * Returns the wizard that hosts this wizard page.\r\n\t *\r\n\t * @return the wizard, or <code>null</code> if this page has not been\r\n\t * added to any wizard\r\n\t * @see #setWizard\r\n\t */\r\n\tpublic IWizard getWizard();\r\n\r\n\t/**\r\n\t * Returns whether this page is complete or not.\r\n\t * <p>\r\n\t * This information is typically used by the wizard to decide\r\n\t * when it is okay to finish.\r\n\t * </p>\r\n\t *\r\n\t * @return <code>true</code> if this page is complete, and\r\n\t * <code>false</code> otherwise\r\n\t */\r\n\tpublic boolean isPageComplete();\r\n\r\n\t/**\r\n\t * Sets the wizard page that would typically be shown\r\n\t * if the user was to press the Back button.\r\n\t * <p>\r\n\t * This method is called by the container.\r\n\t * </p>\r\n\t *\r\n\t * @param page the previous wizard page\r\n\t */\r\n\tpublic void setPreviousPage(IWizardPage page);\r\n\r\n\t/**\r\n\t * Sets the wizard that hosts this wizard page.\r\n\t * Once established, a page's wizard cannot be changed\r\n\t * to a different wizard.\r\n\t *\r\n\t * @param newWizard the wizard\r\n\t * @see #getWizard\r\n\t */\r\n\tpublic void setWizard(IWizard newWizard);\r\n}", "public NewEntryWizard()\n {\n setNeedsProgressMonitor( true );\n }", "public NewPageWizard(IXWikiSpace sapce)\n {\n super();\n setWindowTitle(\"Add New Page...\");\n setNeedsProgressMonitor(false);\n this.space = sapce;\n }", "public AddValidatorWizard() {\n super();\n initPages();\n setWindowTitle(Messages.title_newValidator);\n }", "public AbstractWizardPage()\n {\n super(true);\n }", "@Override\n\tpublic void create(IWizardEntity entity, WizardRunner runner) {\n\t\t\n\t}", "public IWizardPage getNextPage();", "@Override\n public void onStepClick(int index) {\n }", "public void testRegisterWizardPanel() {\n System.out.println(\"registerWizardPanel\");\n Object id = null;\n WizardPanelDescriptor panel = null;\n Wizard instance = new Wizard();\n instance.registerWizardPanel(id, panel);\n }", "public WizardModel(){ \n wp = new HashMap<Object,WizardPanelDescriptor>();\n step = 1;\n }", "protected boolean wizardhook_validateFinish() {\n return true;\n }", "public NewReviewWizard() {\n super();\n setNeedsProgressMonitor(true);\n setWindowTitle(\"New Review\");\n setHelpAvailable(false);\n }", "public interface ActionDelegate {\n /** Performs some actions in response to a user's choosing entering a Project Name on the wizardS. */\n void onSelectProject();\n \n \n\n }", "@Override\n public void addPages() {\n super.addPages();\n page1 = new NewReviewWizardPage();\n addPage(page1);\n }", "public void testWizards() {\n // open new file wizard\n NewFileWizardOperator nfwo = NewFileWizardOperator.invoke();\n nfwo.selectProject(\"SampleProject\");\n nfwo.selectCategory(\"Java\");\n nfwo.selectFileType(\"Java Class\");\n // go to next page\n nfwo.next();\n // create operator for the next page\n NewJavaFileNameLocationStepOperator nfnlso = new NewJavaFileNameLocationStepOperator();\n nfnlso.txtObjectName().typeText(\"MyNewClass\");\n // finish wizard\n //nfnlso.finish();\n // cancel wizard\n nfnlso.cancel();\n }", "public void testGenericWizards() {\n // open new project wizard\n NewProjectWizardOperator npwo = NewProjectWizardOperator.invoke();\n npwo.selectCategory(\"Java Web\");\n npwo.selectProject(\"Web Application\");\n npwo.next();\n // create operator for next page\n WizardOperator wo = new WizardOperator(\"Web Application\");\n JTextFieldOperator txtName = new JTextFieldOperator((JTextField) new JLabelOperator(wo, \"Project Name:\").getLabelFor());\n txtName.clearText();\n txtName.typeText(\"MyApp\");\n wo.cancel();\n }", "protected DummyWizardPage()\n {\n super( \"\" ); //$NON-NLS-1$\n setTitle( Messages.getString( \"NewEntryWizard.NoConnectonSelected\" ) ); //$NON-NLS-1$\n setDescription( Messages.getString( \"NewEntryWizard.NoConnectonSelectedDescription\" ) ); //$NON-NLS-1$\n setImageDescriptor( BrowserCommonActivator.getDefault().getImageDescriptor(\n BrowserCommonConstants.IMG_ENTRY_WIZARD ) );\n setPageComplete( true );\n }", "public TableEditorWizard(Table table) {\t\n\t\tcreateDialog(table);\n\t}", "protected abstract AbstractPerfCakeEditWizard createWizard(IStructuredSelection selection);", "public StandardSetCreationSelectionWizardPage(String pageName) {\r\n\r\n super(\"standardSetCreationSelectionWizardPage\");\r\n setMessage(pageName);\r\n\r\n }", "public interface WizardScenePage {\n int pageBack = -1;\n int pageHere = -1;\n int pageNext = -1;\n\n abstract public boolean allowsPageBack();\n\n abstract public boolean allowsPageNext();\n\n abstract public boolean isPageValidate();\n\n abstract public void doCanceled();\n\n abstract public void doFinished();\n\n abstract public void doPageBack();\n\n abstract public void doPageHelp();\n\n abstract public void doPageNext();\n}", "CartogramWizardGoToStepAction (CartogramWizard wizard, int step)\n\t{\n\t\tmWizard = wizard;\n\t\tmStep = step;\n\t}", "public void addPages() {\n //super.addPages(); //<--- notice we're overriding here\n mainPage = new NewTargetWizardPage(\"newFilePage1\", getSelection());//$NON-NLS-1$\n mainPage.setTitle(TITLE);\n mainPage.setDescription(DESCRIPTION); \n addPage(mainPage);\n }", "@Override\n\tpublic void editTutorial() {\n\t\t\n\t}", "public NewTargetFileWizard() {\n super();\n }", "@NotNull\n WizardPage flipToFirst();", "public BJADWizard<T> getWizard()\n {\n return this.wizard;\n }", "public AbstractSOAProjectWizardPage(String pageName) {\r\n\t\tsuper(pageName);\r\n\t}", "public WizardContainer getWizardContainer()\n {\n return wizardContainer;\n }", "@Override\r\n\tpublic void mypage() {\n\t\t\r\n\t}", "private void goGuide() {\n }", "public NewReactionAcquisitionWizardPage() {\n\t\tsuper(\"SpectrumWizardPage\");\n\t\tsetTitle(\"Predicted from MEDEA wizard\");\n\t\tsetDescription(\"This wizard specifies he name of the file of the\" +\n\t\t\t\t\"predicted reaction. It is need to have into this folder other \" +\n\t\t\t\t\"folder with the name: -\");\n\t}", "public void setPreviousPage(IWizardPage page);", "@Override\r\n\tpublic void action() {\n\t\t\r\n\t}", "public ButtonWizard(DialogueSystem system) {\n this.system = system;\n currentAction = new JLabel();\n currentJoint = new JLabel();\n }", "private Wizard(final FXFinder javafxFinder) {\n this.javafxFinder = javafxFinder;\n wizard = new JFrame(\"Apache SIS setup\");\n final Container content = wizard.getContentPane();\n content.setLayout(new BorderLayout());\n /*\n * Back, Next, Cancel button.\n */\n { // For keeping variables in a local scope.\n final Box buttons = Box.createHorizontalBox();\n buttons.setBorder(new EmptyBorder(9, 12, 9, 15)); // Top, left, bottom, right.\n backButton = createButton(buttons, BACK); buttons.add(Box.createHorizontalStrut(10));\n nextButton = createButton(buttons, NEXT); buttons.add(Box.createHorizontalStrut(30));\n cancelButton = createButton(buttons, CANCEL);\n backButton.setEnabled(false);\n\n final JPanel bottom = new JPanel(new BorderLayout());\n bottom.add(new JSeparator(), BorderLayout.NORTH);\n bottom.add(buttons, java.awt.BorderLayout.EAST);\n content.add(bottom, BorderLayout.SOUTH);\n }\n /*\n * Navigation panel on the left side with the following titles\n * (currently shown page is highlighted):\n *\n * - Introduction\n * - Download\n * - Set directory\n * - Summary\n */\n final WizardPage[] pages = WizardPage.values();\n {\n titles = new JLabel[pages.length];\n final EmptyBorder padding = new EmptyBorder(3, 0, 3, 0);\n final Box summary = Box.createVerticalBox();\n for (int i=0; i<pages.length; i++) {\n final String title = (i == 0 ? SELECTED_TITLE_BULLET : TITLE_BULLET) + pages[i].title;\n final JLabel label = new JLabel(title, JLabel.LEFT);\n label.setForeground(i == 0 ? SELECTED_TITLE_COLOR : TITLE_COLOR);\n label.setBorder(padding);\n summary.add(titles[i] = label);\n }\n final JPanel pane = new JPanel();\n pane.setBackground(new Color(169, 204, 227));\n pane.setBorder(new EmptyBorder(40, 15, 9, 24)); // Top, left, bottom, right.\n pane.add(summary);\n content.add(pane, BorderLayout.WEST);\n }\n /*\n * The main content where text is shown, together with download button, directory chooser, etc.\n * The content of each page is created by `createPage(…)`. They all have in common to start with\n * a description text formatted in HTML.\n */\n {\n final Font font = new Font(Font.SERIF, Font.PLAIN, 14);\n javafxPath = new JLabel();\n javafxPath.setBorder(JAVAFX_PATH_BORDER);\n javafxPathError = new JLabel();\n javafxPathError.setForeground(Color.RED);\n javafxPathError.setFont(font);\n inflateProgress = new JProgressBar();\n cardPanel = new JPanel(new CardLayout());\n cardPanel.setBorder(new EmptyBorder(30, 30, 9, 30)); // Top, left, bottom, right.\n cardPanel.setBackground(Color.WHITE);\n for (final WizardPage page : pages) {\n cardPanel.add(createPage(page, font), page.name());\n // The initially visible component is the first added.\n }\n currentPage = pages[0];\n content.add(cardPanel, BorderLayout.CENTER);\n }\n wizard.setSize(WIDTH, 500); // Must be before `setLocationRelativeTo(…)`.\n wizard.setResizable(false);\n wizard.setLocationRelativeTo(null);\n wizard.addWindowListener(new WindowAdapter() {\n @Override public void windowClosing(WindowEvent event) {\n javafxFinder.cancel();\n }\n });\n }", "@Override\n\tpublic boolean performFinish() {\n\t\tIWizardPage[] pages = this.getPages();\n\t\tBindFlowWizardPage bindpage = (BindFlowWizardPage) pages[0];\n\t\tString flowName = bindpage.getFlowName();\n\t\tcompositeService.setFlowname(flowName);\n\t\tIWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();\n\t\tString compositeFilePath = (new StringBuilder(\"/\")).append(projectName)\n\t\t\t\t.append(BipConstantUtil.CompositePath).append(compositeService.getBaseinfo().getServiceId()).append(\".composite\").toString();\n\t\tIFile compositeFile = root.getFile(new Path(compositeFilePath));\n\t\tcompositeService.setProject(compositeFile.getProject());\n\t\tHelpUtil.writeObject(compositeService, compositeFile);\n//\t\tShell shell = PlatformUI.getWorkbench().getModalDialogShellProvider().getShell();\n\t\t//给table赋值\n\t\ttable_flow.removeAll();\n\t\tTableItem tableItem = new TableItem(table_flow, SWT.NONE);\n\t\t// 判断是否绑定流程 20160531\n\t\tString flownamePath = \"\";\n\t\t// 判断是否绑定流程\n\t\tif (flowName != null) {\n\t\t\tflownamePath = flowName.substring(0, flowName.indexOf(\".\"));\n\t\t}\n\t\ttableItem.setText(0, flownamePath);\n\t\ttableItem.setText(1, flowName);\n\t\t\n//\t\tMessageDialog.openInformation(shell, \"绑定流程\", \"绑定成功\");\n\t\t//保存流程不用再刷新菜单 20160531\n//\t\tTreeView view = (TreeView) page.findView(\"wizard.view1\");\n//\t\tif (null != view) {\n//\t\t\tview.reload();\n//\t\t}\n\t\treturn true;\n\t}", "protected void setupUI() {\n\n }", "@Override\n public void setupPanel()\n {\n\n }", "public abstract void activateWithConfiguration( WizardPageConfiguration configuration );", "protected void setWizard(BJADWizard<T> wizard)\n {\n this.wizard = wizard;\n }", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "@Override\n public void definitionListItem()\n {\n }", "@Override\nprotected void doPage(Frame frame,Circuit circuit, IPlug plug, PageContext ctx) {\n\t\n}", "@Override\r\n\tprotected IWizardPage updatePage(int index) {\r\n\t\tIHeadlessWizardContainer hwc = (IHeadlessWizardContainer) getContainer();\r\n\t\tif(!( hwc instanceof WizardContainer )){\r\n\t\t\thwc.updateButtons();\r\n\t\t\treturn super.updatePage(index);\r\n\t\t}\r\n\t\tWizardContainer container = (WizardContainer) hwc;\t\r\n\r\n\t\tIndexStore is = getIndexStore(index);\r\n\t\tString ts = ( is.titleStyle == null )? this.titleStyle: is.titleStyle;\r\n\t\tsetBarStyle( container.getToolBar(), index, ts );\r\n\t\tString bs = ( is.buttonStyle == null )? this.buttonbarStyle: is.buttonStyle;\r\n\t\tcontainer.setButtons( is.getButtons() );\r\n\t\tsetBarStyle( container.getButtonBar(), index, bs );\r\n\r\n\t\tfor( Buttons button: is.getButtons() ){\r\n\t\t\tcontainer.setButtonEnabled(button, is.isButtonEnabled(button));\r\n\t\t}\r\n\r\n\t\tboolean choice = ( index > 0 );\r\n\t\t\r\n\t\tif( this.needsPreviousAndNextButtons() ){\r\n\t\t\tcontainer.setButtonEnabled( IButtonWizardContainer.Buttons.PREVIOUS, choice);\t\t\r\n\t\t\tchoice = ( index < container.size() - 1 );\r\n\t\t\tcontainer.setButtonEnabled( IButtonWizardContainer.Buttons.NEXT, choice);\r\n\t\t}\r\n\t\tchoice = ( index >= container.getFinishIndex() );\r\n\t\tcontainer.setButtonEnabled( IButtonWizardContainer.Buttons.FINISH, choice);\r\n\t\tcontainer.updateButtons();\r\n\t\tfor( Buttons button: is.getButtons() ){\r\n\t\t\tcontainer.buttonVisible( button, is.isButtonVisible(button));\r\n\t\t}\r\n\r\n\t\treturn super.updatePage(index);\r\n\t}", "public ImportRequirementWizardPageSelectFormat(String pageName, PageController pageController)\n {\n super(pageName);\n controller = pageController;\n }", "public void addPages() {\t\t\n\t\tpage1 = new Opera2ActionsTransformationWizardPage1(selection, operaModel);\n\t\taddPage(page1);\t\n\t}", "private ShowCreateAnswerPage() {\n this.service = UserService.retrieve();\n this.validator = Validator.retrieve();\n }", "public abstract WizardPageConfiguration getConfiguration();", "@Override\n public void fireInitialStateViewEvents() {\n ViewEvents.fireWizardButtonEnabledEvent(getPanelName(), WizardButton.FINISH, false);\n\n }", "public void initByEngine( WizardEngine e )\n {\n initDialog();\n\n // Each wizard dialog must contains Next and Back commands\n // A better solution is not to include Back command on the first dialog\n // and not to include Next command on the last dialog\n // This leave as an exercise to readers\n addCommand( NEXT_COMMAND );\n addCommand( BACK_COMMAND );\n\n this.engine = e;\n\n super.setCommandListener( this );\n }", "@Override\r\n\t\tpublic void create() {\n\t\t\tsuper.create();\r\n\t\t\tsuper.getOKButton().setEnabled(false);\r\n\t\t\tsuper.setTitle(Messages.MoveUnitsWizardPage1_Topolog__2);\r\n\t\t\tsuper.setMessage(Messages.MoveUnitsWizardPage1_Select_a_name_source_folder_and_a_);\r\n\t\t\tsuper.getShell().setText(Messages.MoveUnitsWizardPage1_Topolog__2);\r\n\t\t}", "@Override\r\n public org.eclipse.jface.wizard.IWizardPage getNextPage() {\r\n\r\n StandardSetMeasuringPointSelectionWizardPage page2 = (StandardSetMeasuringPointSelectionWizardPage) super.getNextPage();\r\n if (radios[0].getSelection()) {\r\n page2.loadMonitorAndMeasuringpointInput();\r\n return page2;\r\n\r\n } else {\r\n page2.loadOnlyMeasuringpointInput();\r\n return page2;\r\n }\r\n\r\n }", "public void autoDetails() {\n\t\t\r\n\t}", "public CSSImportWizard() {\n\t\tsuper();\n\t\tsetNeedsProgressMonitor(true);\n\t}", "public IWizardPage getPreviousPage();", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public void testGetDialog() {\n System.out.println(\"getDialog\");\n Wizard instance = new Wizard();\n JDialog result = instance.getDialog();\n assertNotNull(result);\n }", "@Override\r\n\tpublic void addPages() {\n\t\tprojectPage = new NewProjectWizardPage();\r\n\t\taddPage(projectPage);\r\n\t}", "public NewCZ_DPPHRProcessPage(){ super(); }", "@Override\n public void visit(final Wizard wizard) {\n wizard.getFirstAbility().changeAllVictimModifier(DAMAGE_MODIFIER_FOR_WIZARD);\n wizard.getSecondAbility().changeAllVictimModifier(DAMAGE_MODIFIER_FOR_WIZARD);\n // anunt magicianul de ajutorul ingerului\n wizard.getEvent().anEventHappened(wizard, this, \"help\");\n // ofer Xp jucatorului pentru a trece la nivelul urmator\n wizard.gainXp(getNewXp(wizard));\n }", "public NewTestWizardPage() {\n\t\tsuper(true, \"New Groovy Test Settings\");\n\n\t\tsetTitle(\"Groovy Test Class\");\n\t\tsetDescription(\"Create a new Groovy unit test class\");\n\t}", "@Override\n\tpublic void addPages() {\n\t\t_fileWizard = new NewPlotFilenameWizardPage(selection);\n\t\t_scaleWizard = new ScaleWizardPage(selection);\n\t\t_coastWizard = new CoastWizardPage(selection);\n\t\t_gridWizard = new GridWizardPage(selection);\n\n\t\t// check there's ETOPO data before we add the page\n\t\t_etopoWizard = new ETOPOWizardPage(selection);\n\n\t\taddPage(_fileWizard);\n\t\taddPage(_scaleWizard);\n\t\taddPage(_coastWizard);\n\t\taddPage(_gridWizard);\n\t\tif (_etopoWizard.isAvailable())\n\t\t\taddPage(_etopoWizard);\n\t}", "@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}", "@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}", "public GuidedWizardPanel()\r\n\t{\t\r\n\t\tVerticalPanel panel = new VerticalPanel();\r\n\t\t\r\n\t\twizardPanel = new WizardPanel(panelList, groupLabels);\r\n\t\twizardPanel.addSaveListener(this);\r\n\t\tpanel.add(wizardPanel);\r\n\r\n\t\t// set up listener relationships\r\n\t\tsolvingForPanel.addSolvingForListener(powerPanel);\r\n\t\tsolvingForPanel.addSolvingForListener(perGroupSampleSizePanel);\r\n\t\tsolvingForPanel.addSolvingForListener(resultsPanel);\r\n\t\t// listeners for outcome measures\r\n\t\toutcomesPanel.addOutcomesListener(hypothesisIndependentPanel);\r\n\t\toutcomesPanel.addOutcomesListener(hypothesisRepeatedPanel);\r\n\t\toutcomesPanel.addOutcomesListener(meanDifferencesIndependentPanel);\r\n\t\toutcomesPanel.addOutcomesListener(meanDifferencesPanel);\r\n\t\toutcomesPanel.addOutcomesListener(variabilityIndependentPanel);\r\n\t\toutcomesPanel.addOutcomesListener(variabilityRepeatedPanel);\r\n\t\toutcomesPanel.addOutcomesListener(variabilityCovariateOutcomePanel);\r\n\t\t// listeners for predictor information\r\n\t\tcatPredictorsPanel.addPredictorsListener(relativeGroupSizePanel);\r\n\t\tcatPredictorsPanel.addPredictorsListener(hypothesisIndependentPanel);\r\n\t\tcatPredictorsPanel.addPredictorsListener(hypothesisRepeatedPanel);\r\n\t\tcatPredictorsPanel.addPredictorsListener(meanDifferencesIndependentPanel);\r\n\t\tcatPredictorsPanel.addPredictorsListener(meanDifferencesPanel);\r\n\t\t// listeners for relative group sizes\r\n\t\trelativeGroupSizePanel.addRelativeGroupSizeListener(hypothesisIndependentPanel);\r\n\t\trelativeGroupSizePanel.addRelativeGroupSizeListener(hypothesisRepeatedPanel);\r\n\t\t// listeners for baseline covariates\r\n\t\tcovariatePanel.addCovariateListener(meanDifferencesIndependentPanel);\r\n\t\tcovariatePanel.addCovariateListener(meanDifferencesPanel);\r\n\t\t// TODO: covariatePanel.addCovariateListener(meanDifferencesRepeatedPanel);\r\n\t\tcovariatePanel.addCovariateListener(hypothesisIndependentPanel);\r\n\t\tcovariatePanel.addCovariateListener(hypothesisRepeatedPanel);\r\n\t\tcovariatePanel.addCovariateListener(variabilityIndependentPanel);\r\n\t\t// TODO: covariatePanel.addCovariateListener(variabilityRepeatedPanel);\r\n\t\tcovariatePanel.addCovariateListener(variabilityCovariatePanel);\r\n\t\tcovariatePanel.addCovariateListener(variabilityCovariateOutcomePanel);\r\n\t\tcovariatePanel.addCovariateListener(optionsTestsPanel);\r\n\t\tcovariatePanel.addCovariateListener(optionsPowerMethodsPanel);\r\n\t\t// listeners for repeated measures \r\n\t\trepeatedMeasuresPanel.addRepeatedMeasuresListener(hypothesisIndependentPanel);\r\n\t\trepeatedMeasuresPanel.addRepeatedMeasuresListener(hypothesisRepeatedPanel);\r\n\t\t// listeners for hypotheses\r\n\t\thypothesisIndependentPanel.addHypothesisListener(meanDifferencesIndependentPanel);\r\n\t\thypothesisRepeatedPanel.addHypothesisListener(meanDifferencesRepeatedPanel);\r\n\t\t// group size listeners\r\n\t\trelativeGroupSizePanel.addRelativeGroupSizeListener(hypothesisIndependentPanel);\r\n\t\t// variability listeners\r\n\t\tvariabilityIndependentPanel.addVariabilityListener(variabilityCovariateOutcomePanel);\r\n\t\tvariabilityCovariatePanel.addVariabilityListener(variabilityCovariateOutcomePanel);\r\n\t\toptionsDisplayPanel.addChartOptionsListener(resultsPanel);\r\n\t\t// callbacks to fill in the power curve options screen\r\n\t\talphaPanel.addAlphaListener(optionsDisplayPanel);\r\n\t\toptionsTestsPanel.addTestListener(optionsDisplayPanel);\r\n\t\toptionsPowerMethodsPanel.addPowerMethodListener(optionsDisplayPanel);\r\n\t\toptionsPowerMethodsPanel.addQuantileListener(optionsDisplayPanel);\r\n\t\toptionsPowerMethodsPanel.addQuantileCheckboxListener(optionsDisplayPanel);\r\n\t\toptionsPowerMethodsPanel.addPowerCheckboxListener(optionsDisplayPanel);\r\n\t\tmeanDifferencesScalePanel.addBetaScaleListener(optionsDisplayPanel);\r\n\t\tperGroupSampleSizePanel.addPerGroupSampleSizeListener(optionsDisplayPanel);\r\n\t\trelativeGroupSizePanel.addRelativeGroupSizeListener(optionsDisplayPanel);\r\n\t\tvariabilityScalePanel.addSigmaScaleListener(optionsDisplayPanel);\r\n\t\t// initialize\r\n\t\tinitWidget(panel);\r\n\t}", "@Override\r\n public void show()\r\n {\r\n\r\n }", "@Override\r\n public void show()\r\n {\r\n\r\n }", "@Override\n public boolean canFinish() {\n IWizardPage page = getContainer().getCurrentPage();\n return super.canFinish() && page == getPages()[getPageCount()-1];\n }", "public void clickedPresentationNew() {\n\t\t\n\t}", "@Override\n\tpublic void action() {\n\n\t}", "@Override\n\tpublic void step2() {\n\t\t\n\t}", "public Reqif10ModelWizardInitialObjectCreationPage(String pageId) {\r\n \t\t\tsuper(pageId);\r\n \t\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n public void doHelpAction() {\n BIReportService.getInstance().traceHelpClick(project.getBasePath(), ConversionHelpEnum.PATH_SETTING);\r\n\r\n ApplicationManager.getApplication().invokeLater(() -> {\r\n BrowserUtil.browse(allianceDomain + HmsConvertorBundle.message(\"directory_url\"));\r\n }, ModalityState.any());\r\n }", "ProjectSelectionPanel(ProjectWizardPanel wizard) {\n this.wizard = wizard;\n initComponents();\n init();\n destination.getDocument().addDocumentListener(new DocumentListener() {\n public void insertUpdate(DocumentEvent e) { updateValidity(); }\n public void removeUpdate(DocumentEvent e) { updateValidity(); }\n public void changedUpdate(DocumentEvent e) {}\n });\n updateValidity();\n jRadioInsideEclipse.setSelected(true);\n enableLocation(false);\n TableColumn column = projectTable.getColumnModel().getColumn(0);\n column.setMaxWidth(25);\n column.setMinWidth(25);\n }", "@Override\n\tpublic void step() {\n\t\t\n\t}", "@Override\n\tpublic void step() {\n\t\t\n\t}", "@Override\n protected void onWizardStarting(@NotNull ModelWizard.Facade wizard) {\n String finishedText = message(\"android.sdk.manager.installer.install.finished\");\n myValidatorPanel.registerValidator(myInstallationFinished, new TrueValidator(Validator.Severity.INFO, finishedText));\n\n String installError = message(\"android.sdk.manager.installer.install.error\");\n myValidatorPanel.registerValidator(myInstallFailed, new FalseValidator(installError));\n\n myBackgroundAction.setWizard(wizard);\n\n // Note: Calling updateNavigationProperties while myInstallationFinished is updated causes ConcurrentModificationException\n myListeners.listen(myInstallationFinished, () -> ApplicationManager.getApplication().invokeLater(wizard::updateNavigationProperties));\n }", "public void goToStep (int step)\n\t{\n\t\tif (step < 0 || step > 4)\n\t\t\treturn;\n\t\t\t\n\t\tif (mCurrentStep == step)\n\t\t\treturn;\n\t\t\n\t\t\n\t\t// Hide the current step.\n\t\tswitch (mCurrentStep)\n\t\t{\n\t\t\tcase 0:\n\t\t\t\tmPanelZero.setVisible(false);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 1:\n\t\t\t\tmPanelOne.setVisible(false);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 2:\n\t\t\t\tmPanelTwo.setVisible(false);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 3:\n\t\t\t\tmPanelThree.setVisible(false);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 4:\n\t\t\t\tmPanelFour.setVisible(false);\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// Show the new step.\n\t\tswitch (step)\n\t\t{\n\t\t\tcase 0:\n\t\t\t\tif (mPanelZero == null)\n\t\t\t\t{\n\t\t\t\t\tmPanelZero = new CartogramWizardPanelZero(this);\n\t\t\t\t\tthis.getContentPane().add(mPanelZero);\n\t\t\t\t}\n\t\t\t\tmPanelZero.setVisible(true);\n\t\t\t\tmCurrentStep = 0;\n\t\t\t\tmWizardStepIconPanel.setStepIcon(1);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 1:\n\t\t\t\tif (mPanelOne == null)\n\t\t\t\t{\n\t\t\t\t\tmPanelOne = new CartogramWizardPanelOne(this);\n\t\t\t\t\tthis.getContentPane().add(mPanelOne);\n\t\t\t\t}\n\t\t\t\tmPanelOne.setVisible(true);\n\t\t\t\tmCurrentStep = 1;\n\t\t\t\tmWizardStepIconPanel.setStepIcon(2);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 2:\n\t\t\t\tif (mPanelTwo == null)\n\t\t\t\t{\n\t\t\t\t\tmPanelTwo = new CartogramWizardPanelTwo(this);\n\t\t\t\t\tthis.getContentPane().add(mPanelTwo);\n\t\t\t\t}\n\t\t\t\tmPanelTwo.setVisible(true);\n\t\t\t\tmCurrentStep = 2;\n\t\t\t\tmWizardStepIconPanel.setStepIcon(3);\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\tif (mPanelThree == null)\n\t\t\t\t{\n\t\t\t\t\tmPanelThree = new CartogramWizardPanelThree(this);\n\t\t\t\t\tthis.getContentPane().add(mPanelThree);\n\t\t\t\t}\n\t\t\t\tmPanelThree.setVisible(true);\n\t\t\t\tmCurrentStep = 3;\n\t\t\t\tmWizardStepIconPanel.setStepIcon(4);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 4:\n\t\t\t\tif (mPanelFour == null)\n\t\t\t\t{\n\t\t\t\t\tmPanelFour = new CartogramWizardPanelFour(this);\n\t\t\t\t\tthis.getContentPane().add(mPanelFour);\n\t\t\t\t}\n\t\t\t\tmPanelFour.setVisible(true);\n\t\t\t\tmCurrentStep = 4;\n\t\t\t\tmWizardStepIconPanel.setStepIcon(5);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "@Override\n\tpublic void setUpInfoPanel() {\n\t\t\n\t}", "@Override\r\n\tpublic void goToShowList() {\n\t\t\r\n\t}", "@Override\n public void show() {\n \n }", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }", "public WizardController controller()\r\n\t{\r\n\t\treturn _controller;\r\n\t}", "private void cmdExcelReportWidgetSelected() {\n\n\t}", "@Override\r\n\tpublic void show() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void show() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void show() {\n\t\t\r\n\t}", "@Override\n public void show() {\n\n }", "@Override\n public void show() {\n\n }", "@Override\n\tpublic void step() {\n\t}", "@Override\n\tpublic void step() {\n\t}", "@Override\n\tpublic void takeATurn() {\n\n\t}", "@Override\r\n\tpublic void show() {\n\r\n\t}" ]
[ "0.7273552", "0.6726467", "0.65493", "0.64980525", "0.6445059", "0.6409468", "0.6389658", "0.6354351", "0.6339485", "0.63271356", "0.62214434", "0.62174827", "0.6204928", "0.6179019", "0.6143559", "0.6142031", "0.6110855", "0.60899925", "0.6084227", "0.6045885", "0.60166705", "0.59822303", "0.5951579", "0.59376097", "0.5924987", "0.589905", "0.5895936", "0.5857078", "0.58515984", "0.5846605", "0.58465326", "0.58170325", "0.57855046", "0.57833195", "0.5782433", "0.5775092", "0.5763153", "0.5759482", "0.5752062", "0.57489717", "0.57446223", "0.5744606", "0.5741366", "0.5721001", "0.57153076", "0.5706766", "0.5706766", "0.5706766", "0.5696307", "0.5696307", "0.5688743", "0.56785285", "0.5664464", "0.5664306", "0.5656135", "0.56534004", "0.564792", "0.5645209", "0.5635002", "0.56331694", "0.5630174", "0.5630025", "0.56261855", "0.56243336", "0.56192774", "0.5598313", "0.55953205", "0.5594342", "0.5593085", "0.55868673", "0.55868673", "0.5575215", "0.5568801", "0.5568801", "0.555935", "0.55575794", "0.55556566", "0.5550428", "0.55502814", "0.55455714", "0.55416197", "0.5536218", "0.55361927", "0.55361927", "0.55361795", "0.55291927", "0.55290866", "0.5528666", "0.55215615", "0.55201817", "0.5511784", "0.5506458", "0.55007106", "0.55007106", "0.55007106", "0.549008", "0.549008", "0.54886883", "0.54886883", "0.54862183", "0.5482042" ]
0.0
-1
(nonJavadoc) Method declared on IWorkbenchWizard
public void init(final IWorkbench workbench1, final IStructuredSelection selection1) { this.workbench = workbench1; this.selection = selection1; this.setWindowTitle("SNL File Creation Wizard"); // this.setDefaultPageImageDescriptor(ImageDescriptor.createFromFile( // NewSNLProjectWizard.class, "sheet.gif")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IWizard getWizard();", "public void setWizard(IWizard newWizard);", "public interface WizardActions {\n\n /**\n * Return the options back to default\n */\n public void returnDefault();\n\n /**\n * Apply the current settings without closing the wizard page\n */\n public void apply();\n\n /**\n * Save the current settings\n */\n public void save();\n\n}", "public interface IWizard {\n\n /**\n * Returns the action that accepts wizard modification and builds the report view.\n * \n * @return\n */\n BuildAction getBuildAction();\n\n /**\n * Returns the action that discards wizard modification and builds the report view.\n * \n * @return\n */\n CancelAction getCancelAction();\n}", "public interface IWizardPage extends IDialogPage {\r\n\t/**\r\n\t * Returns whether the next page could be displayed.\r\n\t *\r\n\t * @return <code>true</code> if the next page could be displayed,\r\n\t * and <code>false</code> otherwise\r\n\t */\r\n\tpublic boolean canFlipToNextPage();\r\n\r\n\t/**\r\n\t * Returns this page's name.\r\n\t *\r\n\t * @return the name of this page\r\n\t */\r\n\tpublic String getName();\r\n\r\n\t/**\r\n\t * Returns the wizard page that would to be shown if the user was to\r\n\t * press the Next button.\r\n\t *\r\n\t * @return the next wizard page, or <code>null</code> if none\r\n\t */\r\n\tpublic IWizardPage getNextPage();\r\n\r\n\t/**\r\n\t * Returns the wizard page that would to be shown if the user was to\r\n\t * press the Back button.\r\n\t *\r\n\t * @return the previous wizard page, or <code>null</code> if none\r\n\t */\r\n\tpublic IWizardPage getPreviousPage();\r\n\r\n\t/**\r\n\t * Returns the wizard that hosts this wizard page.\r\n\t *\r\n\t * @return the wizard, or <code>null</code> if this page has not been\r\n\t * added to any wizard\r\n\t * @see #setWizard\r\n\t */\r\n\tpublic IWizard getWizard();\r\n\r\n\t/**\r\n\t * Returns whether this page is complete or not.\r\n\t * <p>\r\n\t * This information is typically used by the wizard to decide\r\n\t * when it is okay to finish.\r\n\t * </p>\r\n\t *\r\n\t * @return <code>true</code> if this page is complete, and\r\n\t * <code>false</code> otherwise\r\n\t */\r\n\tpublic boolean isPageComplete();\r\n\r\n\t/**\r\n\t * Sets the wizard page that would typically be shown\r\n\t * if the user was to press the Back button.\r\n\t * <p>\r\n\t * This method is called by the container.\r\n\t * </p>\r\n\t *\r\n\t * @param page the previous wizard page\r\n\t */\r\n\tpublic void setPreviousPage(IWizardPage page);\r\n\r\n\t/**\r\n\t * Sets the wizard that hosts this wizard page.\r\n\t * Once established, a page's wizard cannot be changed\r\n\t * to a different wizard.\r\n\t *\r\n\t * @param newWizard the wizard\r\n\t * @see #getWizard\r\n\t */\r\n\tpublic void setWizard(IWizard newWizard);\r\n}", "protected abstract AbstractPerfCakeEditWizard createWizard(IStructuredSelection selection);", "public NewEntryWizard()\n {\n setNeedsProgressMonitor( true );\n }", "public void init(IWorkbench workbench, IStructuredSelection selection) {\r\n \t\tthis.workbench = workbench;\r\n \t\tthis.selection = selection;\r\n \t\tsetWindowTitle(Reqif10EditorPlugin.INSTANCE.getString(\"_UI_Wizard_label\"));\r\n \t\tsetDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(Reqif10EditorPlugin.INSTANCE.getImage(\"full/wizban/NewReqif10.png\")));\r\n \t}", "public AbstractWizardPage()\n {\n super(true);\n }", "@Override\n public void init(IWorkbench workbench) {\n }", "public NewReviewWizard() {\n super();\n setNeedsProgressMonitor(true);\n setWindowTitle(\"New Review\");\n setHelpAvailable(false);\n }", "public void testWizards() {\n // open new file wizard\n NewFileWizardOperator nfwo = NewFileWizardOperator.invoke();\n nfwo.selectProject(\"SampleProject\");\n nfwo.selectCategory(\"Java\");\n nfwo.selectFileType(\"Java Class\");\n // go to next page\n nfwo.next();\n // create operator for the next page\n NewJavaFileNameLocationStepOperator nfnlso = new NewJavaFileNameLocationStepOperator();\n nfnlso.txtObjectName().typeText(\"MyNewClass\");\n // finish wizard\n //nfnlso.finish();\n // cancel wizard\n nfnlso.cancel();\n }", "@Override\n\tpublic void partOpened(IWorkbenchPart part) {\n\t}", "public NewPageWizard(IXWikiSpace sapce)\n {\n super();\n setWindowTitle(\"Add New Page...\");\n setNeedsProgressMonitor(false);\n this.space = sapce;\n }", "@Override\n\tpublic void init(IWorkbenchWindow arg0) {\n\n\t}", "public interface ActionDelegate {\n /** Performs some actions in response to a user's choosing entering a Project Name on the wizardS. */\n void onSelectProject();\n \n \n\n }", "@Override\n\tpublic void init(final IWorkbench arg0) {\n\n\t}", "public interface WizardScenePage {\n int pageBack = -1;\n int pageHere = -1;\n int pageNext = -1;\n\n abstract public boolean allowsPageBack();\n\n abstract public boolean allowsPageNext();\n\n abstract public boolean isPageValidate();\n\n abstract public void doCanceled();\n\n abstract public void doFinished();\n\n abstract public void doPageBack();\n\n abstract public void doPageHelp();\n\n abstract public void doPageNext();\n}", "public void testRegisterWizardPanel() {\n System.out.println(\"registerWizardPanel\");\n Object id = null;\n WizardPanelDescriptor panel = null;\n Wizard instance = new Wizard();\n instance.registerWizardPanel(id, panel);\n }", "public WizardModel(){ \n wp = new HashMap<Object,WizardPanelDescriptor>();\n step = 1;\n }", "public StandardSetCreationSelectionWizardPage(String pageName) {\r\n\r\n super(\"standardSetCreationSelectionWizardPage\");\r\n setMessage(pageName);\r\n\r\n }", "public void testGenericWizards() {\n // open new project wizard\n NewProjectWizardOperator npwo = NewProjectWizardOperator.invoke();\n npwo.selectCategory(\"Java Web\");\n npwo.selectProject(\"Web Application\");\n npwo.next();\n // create operator for next page\n WizardOperator wo = new WizardOperator(\"Web Application\");\n JTextFieldOperator txtName = new JTextFieldOperator((JTextField) new JLabelOperator(wo, \"Project Name:\").getLabelFor());\n txtName.clearText();\n txtName.typeText(\"MyApp\");\n wo.cancel();\n }", "public NewTargetFileWizard() {\n super();\n }", "@Override\n\tpublic void create(IWizardEntity entity, WizardRunner runner) {\n\t\t\n\t}", "public AddValidatorWizard() {\n super();\n initPages();\n setWindowTitle(Messages.title_newValidator);\n }", "public AbstractSOAProjectWizardPage(String pageName) {\r\n\t\tsuper(pageName);\r\n\t}", "@Override\n\t\t\t\t\tpublic void partVisible(IWorkbenchPartReference arg0) {\n\n\t\t\t\t\t}", "ProjectSelectionPanel(ProjectWizardPanel wizard) {\n this.wizard = wizard;\n initComponents();\n init();\n destination.getDocument().addDocumentListener(new DocumentListener() {\n public void insertUpdate(DocumentEvent e) { updateValidity(); }\n public void removeUpdate(DocumentEvent e) { updateValidity(); }\n public void changedUpdate(DocumentEvent e) {}\n });\n updateValidity();\n jRadioInsideEclipse.setSelected(true);\n enableLocation(false);\n TableColumn column = projectTable.getColumnModel().getColumn(0);\n column.setMaxWidth(25);\n column.setMinWidth(25);\n }", "protected DummyWizardPage()\n {\n super( \"\" ); //$NON-NLS-1$\n setTitle( Messages.getString( \"NewEntryWizard.NoConnectonSelected\" ) ); //$NON-NLS-1$\n setDescription( Messages.getString( \"NewEntryWizard.NoConnectonSelectedDescription\" ) ); //$NON-NLS-1$\n setImageDescriptor( BrowserCommonActivator.getDefault().getImageDescriptor(\n BrowserCommonConstants.IMG_ENTRY_WIZARD ) );\n setPageComplete( true );\n }", "CartogramWizardGoToStepAction (CartogramWizard wizard, int step)\n\t{\n\t\tmWizard = wizard;\n\t\tmStep = step;\n\t}", "@Override\n\tpublic void widgetSelected(SelectionEvent e) {\n\t\tif (! (getViewer().getSelection() instanceof IStructuredSelection))\n\t\t\treturn;\n\t\t\n\t\tIStructuredSelection selection = (IStructuredSelection) getViewer().getSelection();\n\n\t\tif (selection.getFirstElement() == null)\n\t\t\treturn;\n\n\t\twizard = createWizard(selection);\n\t\tif (WizardUtils.showWizardDialog(wizard) != Window.OK)\n\t\t\treturn;\n\t\t\n\t\t\n\t\tsuper.widgetSelected(e);\n\t\tgetViewer().refresh(selection.getFirstElement());;\n\t}", "public void addPages() {\n //super.addPages(); //<--- notice we're overriding here\n mainPage = new NewTargetWizardPage(\"newFilePage1\", getSelection());//$NON-NLS-1$\n mainPage.setTitle(TITLE);\n mainPage.setDescription(DESCRIPTION); \n addPage(mainPage);\n }", "@Override\n public void addPages() {\n super.addPages();\n page1 = new NewReviewWizardPage();\n addPage(page1);\n }", "@Override\n protected void onWizardStarting(@NotNull ModelWizard.Facade wizard) {\n String finishedText = message(\"android.sdk.manager.installer.install.finished\");\n myValidatorPanel.registerValidator(myInstallationFinished, new TrueValidator(Validator.Severity.INFO, finishedText));\n\n String installError = message(\"android.sdk.manager.installer.install.error\");\n myValidatorPanel.registerValidator(myInstallFailed, new FalseValidator(installError));\n\n myBackgroundAction.setWizard(wizard);\n\n // Note: Calling updateNavigationProperties while myInstallationFinished is updated causes ConcurrentModificationException\n myListeners.listen(myInstallationFinished, () -> ApplicationManager.getApplication().invokeLater(wizard::updateNavigationProperties));\n }", "@Override\r\n\tpublic void addPages() {\n\t\tprojectPage = new NewProjectWizardPage();\r\n\t\taddPage(projectPage);\r\n\t}", "public TableEditorWizard(Table table) {\t\n\t\tcreateDialog(table);\n\t}", "public CSSImportWizard() {\n\t\tsuper();\n\t\tsetNeedsProgressMonitor(true);\n\t}", "public NewTestWizardPage() {\n\t\tsuper(true, \"New Groovy Test Settings\");\n\n\t\tsetTitle(\"Groovy Test Class\");\n\t\tsetDescription(\"Create a new Groovy unit test class\");\n\t}", "private Wizard(final FXFinder javafxFinder) {\n this.javafxFinder = javafxFinder;\n wizard = new JFrame(\"Apache SIS setup\");\n final Container content = wizard.getContentPane();\n content.setLayout(new BorderLayout());\n /*\n * Back, Next, Cancel button.\n */\n { // For keeping variables in a local scope.\n final Box buttons = Box.createHorizontalBox();\n buttons.setBorder(new EmptyBorder(9, 12, 9, 15)); // Top, left, bottom, right.\n backButton = createButton(buttons, BACK); buttons.add(Box.createHorizontalStrut(10));\n nextButton = createButton(buttons, NEXT); buttons.add(Box.createHorizontalStrut(30));\n cancelButton = createButton(buttons, CANCEL);\n backButton.setEnabled(false);\n\n final JPanel bottom = new JPanel(new BorderLayout());\n bottom.add(new JSeparator(), BorderLayout.NORTH);\n bottom.add(buttons, java.awt.BorderLayout.EAST);\n content.add(bottom, BorderLayout.SOUTH);\n }\n /*\n * Navigation panel on the left side with the following titles\n * (currently shown page is highlighted):\n *\n * - Introduction\n * - Download\n * - Set directory\n * - Summary\n */\n final WizardPage[] pages = WizardPage.values();\n {\n titles = new JLabel[pages.length];\n final EmptyBorder padding = new EmptyBorder(3, 0, 3, 0);\n final Box summary = Box.createVerticalBox();\n for (int i=0; i<pages.length; i++) {\n final String title = (i == 0 ? SELECTED_TITLE_BULLET : TITLE_BULLET) + pages[i].title;\n final JLabel label = new JLabel(title, JLabel.LEFT);\n label.setForeground(i == 0 ? SELECTED_TITLE_COLOR : TITLE_COLOR);\n label.setBorder(padding);\n summary.add(titles[i] = label);\n }\n final JPanel pane = new JPanel();\n pane.setBackground(new Color(169, 204, 227));\n pane.setBorder(new EmptyBorder(40, 15, 9, 24)); // Top, left, bottom, right.\n pane.add(summary);\n content.add(pane, BorderLayout.WEST);\n }\n /*\n * The main content where text is shown, together with download button, directory chooser, etc.\n * The content of each page is created by `createPage(…)`. They all have in common to start with\n * a description text formatted in HTML.\n */\n {\n final Font font = new Font(Font.SERIF, Font.PLAIN, 14);\n javafxPath = new JLabel();\n javafxPath.setBorder(JAVAFX_PATH_BORDER);\n javafxPathError = new JLabel();\n javafxPathError.setForeground(Color.RED);\n javafxPathError.setFont(font);\n inflateProgress = new JProgressBar();\n cardPanel = new JPanel(new CardLayout());\n cardPanel.setBorder(new EmptyBorder(30, 30, 9, 30)); // Top, left, bottom, right.\n cardPanel.setBackground(Color.WHITE);\n for (final WizardPage page : pages) {\n cardPanel.add(createPage(page, font), page.name());\n // The initially visible component is the first added.\n }\n currentPage = pages[0];\n content.add(cardPanel, BorderLayout.CENTER);\n }\n wizard.setSize(WIDTH, 500); // Must be before `setLocationRelativeTo(…)`.\n wizard.setResizable(false);\n wizard.setLocationRelativeTo(null);\n wizard.addWindowListener(new WindowAdapter() {\n @Override public void windowClosing(WindowEvent event) {\n javafxFinder.cancel();\n }\n });\n }", "@Override\r\n\tpublic IWorkbenchPart getPart() {\n\t\treturn super.getPart();\r\n\t}", "@Override\n\tpublic void init(IWorkbench workbench, IStructuredSelection selection) {\n\t\t\n\t}", "public void setPreviousPage(IWizardPage page);", "@Override\n public void onStepClick(int index) {\n }", "public WizardContainer getWizardContainer()\n {\n return wizardContainer;\n }", "public void goToStep (int step)\n\t{\n\t\tif (step < 0 || step > 4)\n\t\t\treturn;\n\t\t\t\n\t\tif (mCurrentStep == step)\n\t\t\treturn;\n\t\t\n\t\t\n\t\t// Hide the current step.\n\t\tswitch (mCurrentStep)\n\t\t{\n\t\t\tcase 0:\n\t\t\t\tmPanelZero.setVisible(false);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 1:\n\t\t\t\tmPanelOne.setVisible(false);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 2:\n\t\t\t\tmPanelTwo.setVisible(false);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 3:\n\t\t\t\tmPanelThree.setVisible(false);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 4:\n\t\t\t\tmPanelFour.setVisible(false);\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// Show the new step.\n\t\tswitch (step)\n\t\t{\n\t\t\tcase 0:\n\t\t\t\tif (mPanelZero == null)\n\t\t\t\t{\n\t\t\t\t\tmPanelZero = new CartogramWizardPanelZero(this);\n\t\t\t\t\tthis.getContentPane().add(mPanelZero);\n\t\t\t\t}\n\t\t\t\tmPanelZero.setVisible(true);\n\t\t\t\tmCurrentStep = 0;\n\t\t\t\tmWizardStepIconPanel.setStepIcon(1);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 1:\n\t\t\t\tif (mPanelOne == null)\n\t\t\t\t{\n\t\t\t\t\tmPanelOne = new CartogramWizardPanelOne(this);\n\t\t\t\t\tthis.getContentPane().add(mPanelOne);\n\t\t\t\t}\n\t\t\t\tmPanelOne.setVisible(true);\n\t\t\t\tmCurrentStep = 1;\n\t\t\t\tmWizardStepIconPanel.setStepIcon(2);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 2:\n\t\t\t\tif (mPanelTwo == null)\n\t\t\t\t{\n\t\t\t\t\tmPanelTwo = new CartogramWizardPanelTwo(this);\n\t\t\t\t\tthis.getContentPane().add(mPanelTwo);\n\t\t\t\t}\n\t\t\t\tmPanelTwo.setVisible(true);\n\t\t\t\tmCurrentStep = 2;\n\t\t\t\tmWizardStepIconPanel.setStepIcon(3);\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\tif (mPanelThree == null)\n\t\t\t\t{\n\t\t\t\t\tmPanelThree = new CartogramWizardPanelThree(this);\n\t\t\t\t\tthis.getContentPane().add(mPanelThree);\n\t\t\t\t}\n\t\t\t\tmPanelThree.setVisible(true);\n\t\t\t\tmCurrentStep = 3;\n\t\t\t\tmWizardStepIconPanel.setStepIcon(4);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 4:\n\t\t\t\tif (mPanelFour == null)\n\t\t\t\t{\n\t\t\t\t\tmPanelFour = new CartogramWizardPanelFour(this);\n\t\t\t\t\tthis.getContentPane().add(mPanelFour);\n\t\t\t\t}\n\t\t\t\tmPanelFour.setVisible(true);\n\t\t\t\tmCurrentStep = 4;\n\t\t\t\tmWizardStepIconPanel.setStepIcon(5);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic void init(IWorkbench workbench, IStructuredSelection selection) {\n\t}", "public abstract WizardPageConfiguration getConfiguration();", "public void widgetSelected(SelectionEvent arg0) {\n\t\t\t\tIWorkbenchWizard wizard = new BasicNewProjectResourceWizard();\r\n\t\t\t\twizard.init(PlatformUI.getWorkbench(), new TreeSelection());\r\n\t\t\t\tWizardDialog dialog = new WizardDialog(getShell(), wizard);\r\n\t\t\t\tdialog.open();\r\n\t\t\t\tif (outputChooserTreeViewer.getTree().getItemCount() == 1) {\t\t\t\t\t\r\n\t\t\t\t\tvalidatePage();\r\n\t\t\t\t}\r\n\t\t\t}", "public NewReactionAcquisitionWizardPage() {\n\t\tsuper(\"SpectrumWizardPage\");\n\t\tsetTitle(\"Predicted from MEDEA wizard\");\n\t\tsetDescription(\"This wizard specifies he name of the file of the\" +\n\t\t\t\t\"predicted reaction. It is need to have into this folder other \" +\n\t\t\t\t\"folder with the name: -\");\n\t}", "@Override\r\n\t\t\tpublic void partActivated(IWorkbenchPartReference partRef) {\n\t\t\t\t\r\n\t\t\t}", "public IWizardPage getPreviousPage();", "public IWizardPage getNextPage();", "@Override\n public void init(final IWorkbenchWindow window) {\n }", "public Reqif10ModelWizardInitialObjectCreationPage(String pageId) {\r\n \t\t\tsuper(pageId);\r\n \t\t}", "@Override\n\tpublic void editTutorial() {\n\t\t\n\t}", "public interface IFinishTask\n\t{\n\t public boolean performFinish( NewConnectionProfileWizard delegatingWizard );\t \n\t}", "public abstract void activateWithConfiguration( WizardPageConfiguration configuration );", "private void openCodeGen(IWorkbenchWindow window) {\n\n\t\tlog.info(\"Trying to open CodeGen wizard.\");\n\t\tShell[] shell = ShellLookup.getInstance().getShells();\n\t\tfor (Shell sh : shell) {\n\t\t\tif (sh.getText() == CodeGenWizard.WIZZARD_NAME)\n\t\t\t\treturn;\n\t\t}\n\t\tINewWizard wizard = new CodeGenWizard();\n\t\tWizardDialog dialog = new WizardDialog(window.getShell(), wizard);\n\t\tdialog.setMinimumPageSize(150, 350);\n\n\t\tdialog.addPageChangedListener(new IPageChangedListener() {\n\n\t\t\t@Override\n\t\t\tpublic void pageChanged(PageChangedEvent event) {\n\t\t\t\tlog.info(\"Page changed listener was started.\");\n\t\t\t\tObject selected = event.getSelectedPage();\n\t\t\t\tif (selected instanceof PreviewPage) {\n\t\t\t\t\tPreviewPage prev = ((PreviewPage) selected);\n\t\t\t\t\tlog.debug(\"Active page -> 'PreviewPage'.\");\n\t\t\t\t\tdialog.updateButtons();\n\t\t\t\t} else if (selected instanceof MethodsPage) {\n\t\t\t\t\tlog.debug(\"Active page -> 'MethodsPage'.\");\n\t\t\t\t} else if (selected instanceof FirstPage) {\n\t\t\t\t\tlog.debug(\"Active page -> 'FirstPage'.\");\n\t\t\t\t\t((FirstPage) selected).dialogChanged();\n\t\t\t\t\tdialog.updateButtons();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tdialog.addPageChangingListener(new IPageChangingListener() {\n\n\t\t\t@Override\n\t\t\tpublic void handlePageChanging(PageChangingEvent event) {\n\t\t\t\tlog.info(\"Page changing listener was started.\");\n\t\t\t\tObject current = event.getCurrentPage();\n\t\t\t\tObject target = event.getTargetPage();\n\t\t\t\tif (current instanceof MethodsPage && target instanceof PreviewPage) {\n\t\t\t\t\tlog.debug(\"Switching between 'MethodsPage' -> 'PreviewPage'.\");\n\t\t\t\t\tMethodsPage meth = ((MethodsPage) current);\n\t\t\t\t\tPreviewPage prev = ((PreviewPage) target);\n\t\t\t\t\tlog.info(\"Trying to generate code.\");\n\t\t\t\t\tCodeGenerator g = new CodeGenerator(meth.getClassBuilder().getClassName(),\n\t\t\t\t\t\t\tmeth.getClassBuilder().getPackageName(), meth.getSelectedOptional());\n\t\t\t\t\tlog.info(\"Trying to update text area in 'PreviewPage'.\");\n\t\t\t\t\tg.setLastActiveShell(lastActiveShell);\n\t\t\t\t\tprev.updateAreaContent(g.generateCode());\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\n\t\tlog.info(\"Opening WizardDialog -> \" + wizard.getWindowTitle() + \"...\");\n\t\tdialog.open();\n\t}", "@Override\r\n\tpublic void selectionChanged(IWorkbenchPart part, ISelection selection) {\n\r\n\t}", "@Override\n\tpublic void init(IWorkbench workbench) {\n setPreferenceStore(new ScopedPreferenceStore(InstanceScope.INSTANCE, \"org.noiseplanet.noisemodelling.wps.preferences\"));\n setDescription(\"The Wps folder\");\n\t}", "@Override\r\n\tprotected IWizardPage updatePage(int index) {\r\n\t\tIHeadlessWizardContainer hwc = (IHeadlessWizardContainer) getContainer();\r\n\t\tif(!( hwc instanceof WizardContainer )){\r\n\t\t\thwc.updateButtons();\r\n\t\t\treturn super.updatePage(index);\r\n\t\t}\r\n\t\tWizardContainer container = (WizardContainer) hwc;\t\r\n\r\n\t\tIndexStore is = getIndexStore(index);\r\n\t\tString ts = ( is.titleStyle == null )? this.titleStyle: is.titleStyle;\r\n\t\tsetBarStyle( container.getToolBar(), index, ts );\r\n\t\tString bs = ( is.buttonStyle == null )? this.buttonbarStyle: is.buttonStyle;\r\n\t\tcontainer.setButtons( is.getButtons() );\r\n\t\tsetBarStyle( container.getButtonBar(), index, bs );\r\n\r\n\t\tfor( Buttons button: is.getButtons() ){\r\n\t\t\tcontainer.setButtonEnabled(button, is.isButtonEnabled(button));\r\n\t\t}\r\n\r\n\t\tboolean choice = ( index > 0 );\r\n\t\t\r\n\t\tif( this.needsPreviousAndNextButtons() ){\r\n\t\t\tcontainer.setButtonEnabled( IButtonWizardContainer.Buttons.PREVIOUS, choice);\t\t\r\n\t\t\tchoice = ( index < container.size() - 1 );\r\n\t\t\tcontainer.setButtonEnabled( IButtonWizardContainer.Buttons.NEXT, choice);\r\n\t\t}\r\n\t\tchoice = ( index >= container.getFinishIndex() );\r\n\t\tcontainer.setButtonEnabled( IButtonWizardContainer.Buttons.FINISH, choice);\r\n\t\tcontainer.updateButtons();\r\n\t\tfor( Buttons button: is.getButtons() ){\r\n\t\t\tcontainer.buttonVisible( button, is.isButtonVisible(button));\r\n\t\t}\r\n\r\n\t\treturn super.updatePage(index);\r\n\t}", "protected void setupUI() {\n\n }", "@Override\r\n\t\t\tpublic void partVisible(IWorkbenchPartReference partRef) {\n\t\t\t\t\r\n\t\t\t}", "public BJADWizard<T> getWizard()\n {\n return this.wizard;\n }", "@Override\n\t\t\t\t\tpublic void partInputChanged(IWorkbenchPartReference arg0) {\n\n\t\t\t\t\t}", "public void partActivated(IWorkbenchPartReference partRef) {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic boolean performFinish() {\n\t\tIWizardPage[] pages = this.getPages();\n\t\tBindFlowWizardPage bindpage = (BindFlowWizardPage) pages[0];\n\t\tString flowName = bindpage.getFlowName();\n\t\tcompositeService.setFlowname(flowName);\n\t\tIWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();\n\t\tString compositeFilePath = (new StringBuilder(\"/\")).append(projectName)\n\t\t\t\t.append(BipConstantUtil.CompositePath).append(compositeService.getBaseinfo().getServiceId()).append(\".composite\").toString();\n\t\tIFile compositeFile = root.getFile(new Path(compositeFilePath));\n\t\tcompositeService.setProject(compositeFile.getProject());\n\t\tHelpUtil.writeObject(compositeService, compositeFile);\n//\t\tShell shell = PlatformUI.getWorkbench().getModalDialogShellProvider().getShell();\n\t\t//给table赋值\n\t\ttable_flow.removeAll();\n\t\tTableItem tableItem = new TableItem(table_flow, SWT.NONE);\n\t\t// 判断是否绑定流程 20160531\n\t\tString flownamePath = \"\";\n\t\t// 判断是否绑定流程\n\t\tif (flowName != null) {\n\t\t\tflownamePath = flowName.substring(0, flowName.indexOf(\".\"));\n\t\t}\n\t\ttableItem.setText(0, flownamePath);\n\t\ttableItem.setText(1, flowName);\n\t\t\n//\t\tMessageDialog.openInformation(shell, \"绑定流程\", \"绑定成功\");\n\t\t//保存流程不用再刷新菜单 20160531\n//\t\tTreeView view = (TreeView) page.findView(\"wizard.view1\");\n//\t\tif (null != view) {\n//\t\t\tview.reload();\n//\t\t}\n\t\treturn true;\n\t}", "public void init(IWorkbenchWindow arg0) {\n\n\t}", "public ProjectWizardModel(WizardDescriptor wiz, String wizType) {\n super(wiz,wizType);\n }", "public IWorkbench getWorkbench() {\n \t\treturn workbench;\n \t}", "public CartogramWizard ()\n\t{\n\t\n\t\t// Set the window parameters.\n\t\tthis.setTitle(AppContext.shortProgramName + \" _ Cartogram Wizard\");\n\t\tthis.setSize(640, 480);\n\t\tthis.setLocation(30, 40);\n\t\tthis.setResizable(false);\n\t\tthis.setLayout(null);\n\t\t//this.setModal(true);\n\t\tthis.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);\n\t\tthis.addWindowListener(new CartogramWizardWindowListener());\n\t\t\n\t\t\n\t\t// Adding the cartogram wizard to the app context.\n\t\tAppContext.cartogramWizard = this;\n\t\t\n\t\t\n\t\t// Add icon panel at the left of the wizard window.\n\t\t// This panel contains the ScapeToad icon.\n\t\tif (mScapeToadIconPanel == null)\n\t\t{\n\t\t\tmScapeToadIconPanel = new ScapeToadIconPanel(this);\n\t\t}\n\t\t\n\t\tmScapeToadIconPanel.setLocation(30, 90);\n\t\tthis.add(mScapeToadIconPanel);\n\t\t\n\t\t\n\t\t\n\t\t// Add title panel.\n\t\tCartogramWizardTitlePanel titlePanel =\n\t\t\tnew CartogramWizardTitlePanel(this);\n\t\t\n\t\ttitlePanel.setLocation(30, 20);\n\t\tthis.add(titlePanel);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// Add icon panel at the left of the wizard window.\n\t\t// This panel contains the ScapeToad icon.\n\t\tmWizardStepIconPanel = new WizardStepIconPanel(this);\n\t\tmWizardStepIconPanel.setLocation(380, 20);\n\t\tthis.add(mWizardStepIconPanel);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// Ajouter l'introduction au wizard.\n\t\t// Explication des étapes à suivre :\n\t\t// 1. Sélectionner la couche des polygones (master layer).\n\t\t// 2. Sélectionner l'information statistique.\n\t\t// 3. Sélection des couches à transformer simultanément.\n\t\t\n\t\tmPanelZero = new CartogramWizardPanelZero(this);\n\t\tthis.getContentPane().add(mPanelZero);\n\t\t\n\t\tmCurrentStep = 0;\n\t\t\n\t\t\n\t\t\n\t\t// Add the running panel which is already created.\n\t\tmRunningPanel.setVisible(false);\n\t\tthis.add(mRunningPanel);\n\t\t\n\t\t\n\t\t// Add the finished panel which is already created.\n\t\tmFinishedPanel.setVisible(false);\n\t\tthis.add(mFinishedPanel);\n\t\t\n\t\t\t\t\n\t\t// Add the Cancel button.\n\t\tmCancelButton = new JButton(\"Cancel\");\n\t\tmCancelButton.setLocation(30, 404);\n\t\tmCancelButton.setSize(100, 26);\n\t\tmCancelButton.addActionListener(new CartogramWizardCloseAction());\n\t\tthis.getContentPane().add(mCancelButton);\n\t\t\n\t\t\n\t}", "public Object execute(ExecutionEvent event) throws ExecutionException {\t\n\t\tNewReusabilityWizardWindow applicatioWindow = new NewReusabilityWizardWindow();\t\n\t\tapplicatioWindow.open();\t\t\n\t\treturn null;\n\t}", "@Override\n public boolean canFinish() {\n IWizardPage page = getContainer().getCurrentPage();\n return super.canFinish() && page == getPages()[getPageCount()-1];\n }", "protected void setWizard(BJADWizard<T> wizard)\n {\n this.wizard = wizard;\n }", "public WizardPanel(String wizardTitle, String wizardDescription, Icon wizardIcon, Icon welcomeIcon, Dimension wizarddimensions,\n\t\t\tJLabel welcomeLabel) {\n\t\tthis.wizardIcon = wizardIcon;\n\t\tthis.welcomeTitle = wizardTitle;\n\t\tthis.welcomeDescription = wizardDescription;\n\t\twelcomePage = new WizardWelcomePanel(welcomeTitle, welcomeDescription, welcomeIcon, welcomeLabel);\n\t\tthis.finishedPage = new WizardFinishPanel();\n\t\tfinishedPage.setIcon(welcomeIcon);\n\t\ttry {\n\t\t\tjbInit();\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "protected boolean wizardhook_validateFinish() {\n return true;\n }", "public void setCurrentPanelDesc(Object id){ \n currentPanel = (WizardPanelDescriptor) wp.get(id);\n }", "public abstract T updateWizardData(T data);", "protected ImportCoreSchemasWizardPage()\n {\n super( \"ImportCoreSchemasWizardPage\" ); //$NON-NLS-1$\n setTitle( Messages.getString( \"ImportCoreSchemasWizardPage.ImportCoreSchemas\" ) ); //$NON-NLS-1$\n setDescription( Messages.getString( \"ImportCoreSchemasWizardPage.PleaseSelectCoreSchemas\" ) ); //$NON-NLS-1$\n setImageDescriptor( Activator.getDefault().getImageDescriptor( PluginConstants.IMG_SCHEMAS_IMPORT_WIZARD ) );\n }", "protected String getWizardWindowTitle() {\n\t\treturn DropWizardMessages.Wizard_Window_Title;\n\t}", "public void initialize(TemplateWizard wiz) {\n this.wizard = wiz;\n }", "public WizardStepIconPanel getWizardStepIconPanel ()\n\t{\n\t\treturn mWizardStepIconPanel;\n\t}", "@Override\n\tpublic void partClosed(IWorkbenchPart part) {\n\t}", "@Override\n public void fireInitialStateViewEvents() {\n ViewEvents.fireWizardButtonEnabledEvent(getPanelName(), WizardButton.FINISH, false);\n\n }", "public void init(IWorkbench workbench) {\r\n // do nothing\r\n }", "@Override\n public void storeSettings(WizardDescriptor wiz) {\n wiz.putProperty(NewDetectorWizardAction.PROP_NAME_CREATE_VIA_TEMPLATE, getComponent().getViaDetectorTemplate().isSelected());\n wiz.putProperty(PROP_NAME_DETECTOR_NAME, getComponent().getDetectorName().getText());\n wiz.putProperty(PROP_NAME_DETECTOR_DESCRIPTION, getComponent().getDetectorDescription().getText());\n wiz.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, null);\n }", "@Override\r\n public void doHelpAction() {\n BIReportService.getInstance().traceHelpClick(project.getBasePath(), ConversionHelpEnum.PATH_SETTING);\r\n\r\n ApplicationManager.getApplication().invokeLater(() -> {\r\n BrowserUtil.browse(allianceDomain + HmsConvertorBundle.message(\"directory_url\"));\r\n }, ModalityState.any());\r\n }", "public void removeWizard() {\n\t\tyellowWizard = null;\n\t\tplayer.getHintIconsManager().removeAll();\n\t\tplayer.WizardUsed = true;\n\t}", "public WizardPanel(String wizardTitle, String wizardDescription, Icon wizardIcon, Icon welcomeIcon,\n\t\t\tDimension wizarddimensions) {\n\t\tthis(wizardTitle, wizardDescription, wizardIcon, welcomeIcon, wizarddimensions, null);\n\t}", "@Override\n\tpublic void addPages() {\n\t\t_fileWizard = new NewPlotFilenameWizardPage(selection);\n\t\t_scaleWizard = new ScaleWizardPage(selection);\n\t\t_coastWizard = new CoastWizardPage(selection);\n\t\t_gridWizard = new GridWizardPage(selection);\n\n\t\t// check there's ETOPO data before we add the page\n\t\t_etopoWizard = new ETOPOWizardPage(selection);\n\n\t\taddPage(_fileWizard);\n\t\taddPage(_scaleWizard);\n\t\taddPage(_coastWizard);\n\t\taddPage(_gridWizard);\n\t\tif (_etopoWizard.isAvailable())\n\t\t\taddPage(_etopoWizard);\n\t}", "public void init(IWorkbenchWindow window)\n\t{\n\t}", "@Override\n\t\t\t\t\tpublic void partHidden(IWorkbenchPartReference arg0) {\n\n\t\t\t\t\t}", "CartogramWizardPanelOne (JFrame contentFrame)\n\t{\n\t\t\n\t\tmCartogramWizard = (CartogramWizard)contentFrame;\n\t\n\t\tint width = 440;\n\t\tint height = 340;\n\t\n\t\tthis.setLocation(160, 90);\n\t\tthis.setSize(width, height);\n\t\tthis.setLayout(null);\n\t\t\t\t\n\t\t\n\t\t// Add the Next button\n\t\tmNextButton = new JButton(\"Next >\");\n\t\tmNextButton.setLocation(340, 314);\n\t\tmNextButton.setSize(100, 26);\n\t\tmNextButton.setMnemonic(KeyEvent.VK_ACCEPT);\n\t\t\n\t\tmNextButton.addActionListener(new\n\t\t\tCartogramWizardGoToStepAction(mCartogramWizard, 2));\n\t\t\n\t\tthis.add(mNextButton);\n\t\t\n\t\t\n\t\t// Add the Back button\n\t\tJButton backButton = new JButton(\"< Back\");\n\t\tbackButton.setLocation(235, 314);\n\t\tbackButton.setSize(100, 26);\n\t\t\n\t\tbackButton.addActionListener(new\n\t\t\tCartogramWizardGoToStepAction(mCartogramWizard, 0));\n\t\t\t\n\t\tthis.add(backButton);\n\t\t\n\t\t\n\t\t// Add a pop-up menu with the list of available layers.\n\t\t\n\t\tJLabel layerMenuLabel = new JLabel(\"Spatial coverage:\");\n\t\tlayerMenuLabel.setFont(new Font(null, Font.PLAIN, 11));\n\t\tlayerMenuLabel.setBounds(0, 0, 190, 14);\n\t\tthis.add(layerMenuLabel);\n\t\t\n\t\tmLayerMenu = new JComboBox();\n\t\tmLayerMenu.setBounds(0, 20, 190, 26);\n\t\tmLayerMenu.setFont(new Font(null, Font.PLAIN, 11));\n\t\tmLayerMenu.setMaximumRowCount(20);\n\t\t\n\t\t// Add all polygon layers to the list.\n\t\tint nlayers = AppContext.layerManager.size();\n\t\t\n\t\t// Check for each layer whether it is a polygon layer or not.\n\t\tfor (int lyrcnt = 0; lyrcnt < nlayers; lyrcnt++)\n\t\t{\n\t\t\tLayer lyr = AppContext.layerManager.getLayer(lyrcnt);\n\t\t\tFeatureCollectionWrapper fcw = lyr.getFeatureCollectionWrapper();\n\t\t\tint nfeat = fcw.size();\n\t\t\tif (nfeat > 0)\n\t\t\t{\n\t\t\t\tFeature feat = (Feature)fcw.getFeatures().get(0);\n\t\t\t\tGeometry geom = feat.getGeometry();\n\t\t\t\tif (geom.getArea() != 0.0)\n\t\t\t\t{\n\t\t\t\t\tmLayerMenu.addItem(lyr.getName());\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t// If there is no layer for the cartogram deformation,\n\t\t// add a menu item \"<none>\" and disable the \"Next\" button.\n\t\tif (mLayerMenu.getItemCount() == 0)\n\t\t{\n\t\t\tmLayerMenu.addItem(\"<none>\");\n\t\t\tmNextButton.setEnabled(false);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmNextButton.setEnabled(true);\n\t\t}\n\t\t\n\t\t\t\n\t\tthis.add(mLayerMenu);\n\t\t\n\t\t\n\t\t\n\t\t// Adding the polygon image\n\t\tClassLoader cldr = this.getClass().getClassLoader();\n\t\tURL iconURL = cldr.getResource(\"Topology.png\");\n\t\tImageIcon topologyImage = new ImageIcon(iconURL);\n\n\t\t// Create a new label containing the image.\n\t\tJLabel iconLabel = new JLabel(topologyImage);\n\t\t\n\t\t// Setting the label parameters.\n\t\ticonLabel.setLayout(null);\n\t\ticonLabel.setSize(192, 239);\n\t\ticonLabel.setLocation(240, 30);\n\t\t\n\t\t// Add the icon label to this panel.\n\t\tthis.add(iconLabel);\n\t\t\n\t\t\n\t\t\n\t\t// Adding the explanatory text.\n\t\t// The message itself is read from a RTF file.\n\t\tJTextPane layerMenuTextPane = new JTextPane();\n\t\n\t\t// Get the content from the text file.\n\t\tString layerMenuText = null;\n\t\ttry\n\t\t{\n\t\t\tInputStream inStream = \n\t\t\t\tcldr.getResource(\"LayerMenuText.rtf\").openStream();\n\t\t\t\t\n\t\t\tStringBuffer inBuffer = new StringBuffer();\n\t\t\tint c;\n\t\t\t\n\t\t\twhile ((c = inStream.read()) != -1)\n\t\t\t{\n\t\t\t\tinBuffer.append((char)c);\n\t\t\t}\n\t\t\t\n\t\t\tinStream.close();\n\t\t\tlayerMenuText = inBuffer.toString();\n\t\t} \n\t\tcatch (Exception e) \n\t\t{\n\t\t\te.printStackTrace(); \n\t\t}\n\t\t\n\t\tlayerMenuTextPane.setContentType(\"text/rtf\");\n\t\tlayerMenuTextPane.setText(layerMenuText);\n\t\tlayerMenuTextPane.setEditable(false);\n\t\tlayerMenuTextPane.setFont(new Font(null, Font.PLAIN, 11));\n\t\tlayerMenuTextPane.setBackground(null);\n\t\tlayerMenuTextPane.setLocation(0, 60);\n\t\tlayerMenuTextPane.setSize(220, 240);\n\t\tthis.add(layerMenuTextPane);\n\t\t\n\t\t\n\t\t\n\t\t// ADD THE HELP BUTTON\n\t\t\n\t\t//ClassLoader cldr = this.getClass().getClassLoader();\n\t\t\n\t\tjava.net.URL imageURL = cldr.getResource(\"help-22.png\");\n\t\tImageIcon helpIcon = new ImageIcon(imageURL);\n\n\t\tJButton helpButton = \n\t\t\tnew JButton(helpIcon);\n\t\t\n\t\thelpButton.setVerticalTextPosition(SwingConstants.BOTTOM);\n\t\thelpButton.setHorizontalTextPosition(SwingConstants.CENTER);\n\t\thelpButton.setSize(30, 30);\n\t\thelpButton.setLocation(0, 312);\n\t\thelpButton.setFocusable(false);\n\t\thelpButton.setContentAreaFilled(false);\n\t\thelpButton.setBorderPainted(false);\n\t\t\n\t\thelpButton.addActionListener(new CartogramWizardShowURL(\n\t\t\t\"http://chorogram.choros.ch/scapetoad/help/a-cartogram-creation.php#cartogram-layer\"));\n\t\t\n\t\tthis.add(helpButton);\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "@Override\n\tpublic void goToFinishedPanel ()\n\t{\n\t\tAppContext.sizeErrorLegend.setVisible(true);\n\t\t\n\t\tmRunningPanel.setVisible(false);\n\t\tmFinishedPanel.setVisible(true);\n\t\tmWizardStepIconPanel.setStepIcon(7);\n\t}", "public JPanel getWizardManager() {\n return wizardManager;\n }", "public void init(IWorkbenchWindow window) {\n\t\t\r\n\t}", "public void partActivated(IWorkbenchPartReference ref) {\n\t\t\t\t\t}", "public void initByEngine( WizardEngine e )\n {\n initDialog();\n\n // Each wizard dialog must contains Next and Back commands\n // A better solution is not to include Back command on the first dialog\n // and not to include Next command on the last dialog\n // This leave as an exercise to readers\n addCommand( NEXT_COMMAND );\n addCommand( BACK_COMMAND );\n\n this.engine = e;\n\n super.setCommandListener( this );\n }", "public ProjectWizardModel(WizardDescriptor wiz) {\n this(wiz, PROJECT_WIZARD_TYPE );\n }", "private void addNewConnection() {\n\t\t IWizard wizard = new NewJmxConnectionWizard();\n\t\t WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard);\n\t\t dialog.open();\n\t\t\n\t}" ]
[ "0.79073346", "0.7296059", "0.72020376", "0.7083467", "0.6968243", "0.6734825", "0.6731393", "0.6696619", "0.6694467", "0.6620826", "0.6457025", "0.6381162", "0.63548726", "0.632734", "0.6317391", "0.62732476", "0.6249652", "0.6246008", "0.6198684", "0.6164277", "0.6160168", "0.61440396", "0.61440086", "0.6139931", "0.6126377", "0.611201", "0.6110278", "0.61026704", "0.60743475", "0.6068389", "0.60608745", "0.6055513", "0.60000455", "0.5998796", "0.5997235", "0.5990748", "0.5987358", "0.59870094", "0.5979579", "0.5974471", "0.5956407", "0.5955316", "0.5947992", "0.5943851", "0.59212404", "0.5915537", "0.5909774", "0.5873724", "0.58701295", "0.58405566", "0.58261424", "0.5823354", "0.58227706", "0.57828325", "0.57618934", "0.5756087", "0.5754777", "0.57452166", "0.5740451", "0.5735912", "0.57340145", "0.57269406", "0.57185274", "0.57105935", "0.5698272", "0.5695628", "0.56896377", "0.5683369", "0.5682548", "0.56768835", "0.56750447", "0.5672099", "0.5669444", "0.5663995", "0.566206", "0.56617767", "0.565701", "0.5636916", "0.56356466", "0.56243944", "0.56215173", "0.5605041", "0.56029665", "0.560085", "0.55926895", "0.55811447", "0.5567123", "0.5562775", "0.5558448", "0.5551348", "0.55504143", "0.554127", "0.55376196", "0.5537045", "0.5536264", "0.55317307", "0.5526704", "0.5520343", "0.5504226", "0.55019534" ]
0.6021647
32
(nonJavadoc) Performs the finish() method of the CFilePage
@Override public boolean performFinish() { return this.mainPage.finish(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void onFinish() {\r\n\t\t//used for create end html tags\r\n\t\tendHtmlPage(fout);\r\n\r\n\t\t//used for write every thing in html file\r\n\t\tfout.flush();\r\n\t\tfout.close();\r\n\t\t\r\n\t}", "private void finish() {\n }", "protected void finish() {\n }", "public void finish() { \n\t\t\n\t}", "public void finish() {\n\n\t}", "public void finish() {}", "public void finish();", "public void finish() throws IOException;", "public void finish() {\n\n }", "public void onFinish() {\n \t\tmdrFile.write();\n \n \t\t// Close everything\n \t\tfor (Closeable file : toClose)\n \t\t\tUtils.closeFile(file);\n \t}", "public void finish(){\n }", "@Override\n\tpublic void finish() {\n\t\t\n\t}", "void finish();", "void finish();", "void finish();", "void finish();", "void finish();", "protected abstract void finish();", "@Override\r\n\tpublic void finish() {\n\t\tsuper.finish();\r\n\t \r\n\t}", "public void finish() throws IOException {\n // Default implementation does nothing.\n }", "@Override\n\tpublic void finish() {\n\n\t}", "@Override\n\tpublic void finish() {\n\n\t}", "@Override\n\tpublic void finish() {\n\n\t}", "@Override\n\tpublic void finish()\n\t{\n\t\tsuper.finish();\n\t}", "@Override\n\tpublic void finish() {\n\t\tsuper.finish();\n\t}", "public abstract void finish();", "public void finish() throws IOException {\n\t\tthis.writeEOFRecord();\n\t\t}", "private void finishFile() {\n\t\twriter.println();\n\t\twriter.println(\"; wait for any key press:\");\n\t\twriter.println(\"mov ah, 0\");\n\t\twriter.println(\"int 16h\");\n\t\twriter.println();\n\t\twriter.println(\"ret\");\n\t}", "public void finish(){\n\t\tnotfinish = false;\n\t}", "boolean finish();", "public void finished();", "void innerFinish() {\r\n\t\t\t\t\t\tobserver.finish();\r\n\t\t\t\t\t\tclose();\r\n\t\t\t\t\t}", "public void finish() throws Exception {\n\t\t\n\t}", "public void finish() {\n System.out.println(name + \": Call explicit destroy()\");\n }", "@Override\n\tpublic void finish() {\n\t\tsuper.finish();\n\t\tstop();\n\t}", "public void finish() {\n if (rnaFile != null) {\n try {\n FileWriter writer = new FileWriter(rnaFile);\n writer.write(rna.toString());\n writer.close();\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }\n\n System.exit(0);\n }", "public void endPage() {\n\n\t\tif (super.getRequestWrapper().getSession(false) != null) {\n\t\t\tthis.dataComposer.endPage();\n\t\t}\n\t}", "@Override\n\tpublic void finish() {\n\t\tsuper.finish();\n\t\tSystem.exit(0);\n\t}", "@Override\n\t\tpublic void onFinish() {\n\t\t\tfinalizar();\n\t\t}", "@JavascriptInterface\n public void finish() {\n OBLogger.e(\"CLOSRE WINDOW\");\n ((Activity) mContext).finish();\n }", "@Override\n\tpublic void finish() {\n\t\tnewhelper.close();\n\t\tsuper.finish();\n\t}", "public void endFlatFile() {\n }", "private void gotoCompletePage() {\n WebkitUtil.forward(mWebView, AFTER_PRINT_PAGE);\n }", "@Override\n protected void end() {\n DemoUtils.fadeOutAndExit(getMainFrame(), 800);\n }", "@Override\n\t\t\tpublic void onComplete(Bundle values) {\n\n\t\t\t\tfinish();\n\t\t\t}", "protected void finishExecution() {\r\n\r\n\t}", "protected void finishUp() {\r\n // pushOutput(table, 0);\r\n viewDone(\"Done\");\r\n }", "public abstract void finished();", "public void finish() {\n printReport();\n printGlobalOpsPerSec();\n }", "@Override\n \tpublic void finished()\n \t{\n \t}", "private void fileExit() {\n try {\n ConnectWindow.tidyClose();\n }\n catch (Exception e) {\n displayError(e,this);\n }\n }", "@External\r\n\t@ClientFunc\r\n\tpublic MetaVar Finish();", "public void handleFinish()\n {\n }", "public void Exit(){\n\t\t\t\tclose();\n\t\t\t}", "boolean fileEnd();", "public void finish() {\n if (!isFinishing) {\n performFnishWithRequest(true);\n }\n }", "protected void end()\n\t{\n\t}", "@Override\n\tpublic void finish() {\n\t\tcancelDialog();\n\t\tsuper.finish();\n\t}", "@Override\r\n\tpublic void finish() {\n\t\tsuper.finish();\r\n\t\tif(!s.isClosed()){\r\n\t\t\ttry {\r\n\t\t\t\ts.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected void end() {\n isFinished();\n }", "String endFile();", "public boolean finished();", "public void exit() {\r\n\t\tdispose();\r\n\t}", "@Override\n\t\t\t\t\t\tpublic void finish() {\n\t\t\t\t\t\t\tSystem.out.println(\"下载成功\");\n\t\t\t\t\t\t}", "@Override\r\n\t\t\tpublic void onFinish() {\n\t\t\t\tsuper.onFinish();\r\n\t\t\t\tLog.i(\"finish\", \"finish\");\r\n\t\t\t\tdismissProgress();\r\n\t\t\t}", "public void finish() {\n Span span = GlobalTracer.get().activeSpan();\n if (this.tracingScope == null) {\n DDLogger.getLoggerImpl().debug(\"Unable to close tracing scope because it is null.\");\n } else {\n this.tracingScope.close();\n if (span != null) {\n span.finish();\n } else {\n DDLogger.getLoggerImpl().debug(\"Unable to finish span because it is null.\");\n }\n }\n if(this.shouldUseExtension) {\n Extension.flush();\n }\n }", "protected void end() {\n\t\tint page = maxPage;\n\t\tif (mListener != null) {\n\t\t\tmListener.OnJump(page);\n\t\t}\n\t\thide();\n\t}", "protected void end() {\n \n \n }", "protected void end() {\n\r\n\t}", "protected void end() {\n\t}", "protected void end() {\n\t}", "protected void end() {\n\t}", "protected void end() {\n\t}", "protected void end() {\n\t}", "protected void end() {\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 }", "protected void end() {\r\n }", "protected void end() {\r\n }", "protected void end() {\r\n }", "protected void end() {\r\n }", "public void onFinish() {\n\n\t}", "@Override\n\t\t\tpublic void onCancel() {\n\t\t\t\tfinish();\n\t\t\t}", "@Override\n\t\tpublic void onFinish() {\n\t\t}", "public void onFinish() {\n }", "public synchronized void close() throws IOException {\n\t\t\tfinish();\n\t\t\tout.close();\n\t\t}", "private void ending() {\n\t\tstartView.ending();\n\t\tSystem.exit(-1);\n\t}", "public void run() {\n finish();\n }", "private void downloadFinished() {\n downloadFinished = true;\n editor.getProgressBar().setVisible(false);\n editor.getProgressBarLabel().setVisible(false);\n editor.setOkEnabled(true);\n editor.getProgressBar().setValue(editor.getProgressBar().getMaximum());\n }", "public void finished() {\n\n\t\tencodeCounter = 0;\n\t}", "void ifDoneFinish() {\r\n\t\t\t\t\t\tif (wip.decrementAndGet() == 0) {\r\n\t\t\t\t\t\t\tobserver.finish();\r\n\t\t\t\t\t\t\tclose();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}", "public boolean finish() {\n/* 465 */ return finish(false);\n/* */ }", "@Override\n public void run() {\n \tfinish();\n }", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "public void finalize()\n\t{\n\t\tif (!isClosed) {\n\t\t\t// System.out.println(\"SimWriter: finalize() - writing closing bracket to file...\");\n\t\t\twList.writeToFile(\"\\n ]\", 0);\n\t\t\tisClosed = true;\n\t\t}\n\t\t//System.out.println(\"SimWriter: finalize() done\");\n\t}", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }" ]
[ "0.7536796", "0.72379816", "0.71765447", "0.7010793", "0.69816166", "0.68992907", "0.6894344", "0.6802313", "0.67846787", "0.6722731", "0.66588086", "0.66563576", "0.66296536", "0.66296536", "0.66296536", "0.66296536", "0.66296536", "0.6624666", "0.65926516", "0.65903825", "0.65696055", "0.65696055", "0.65696055", "0.6551646", "0.6524866", "0.6494898", "0.6481418", "0.6456086", "0.6311401", "0.6302054", "0.6272607", "0.62325907", "0.6223362", "0.618019", "0.61478585", "0.6144372", "0.6136643", "0.61268437", "0.6118643", "0.611202", "0.60901", "0.6056751", "0.6049975", "0.60295826", "0.6026734", "0.60085785", "0.6007713", "0.59970075", "0.59781414", "0.59662265", "0.59428304", "0.59416306", "0.59375125", "0.5934479", "0.59178185", "0.5911526", "0.5909227", "0.59070355", "0.59056574", "0.58899474", "0.5887332", "0.58672655", "0.58626056", "0.585285", "0.58468574", "0.5842696", "0.58108807", "0.5807329", "0.5799289", "0.5789312", "0.5789312", "0.5789312", "0.5789312", "0.5789312", "0.5789312", "0.5783306", "0.5758981", "0.5758981", "0.5758981", "0.5758981", "0.57580614", "0.5742393", "0.574063", "0.57388276", "0.5714376", "0.57084036", "0.56923634", "0.5692108", "0.5684343", "0.5684153", "0.56759655", "0.5670408", "0.5661886", "0.5661886", "0.5661886", "0.5655691", "0.56522775", "0.56522775", "0.56522775", "0.56522775" ]
0.62578905
31
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}", "public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.my_notes_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu){\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.menu, menu);\r\n return true;\r\n }" ]
[ "0.72500116", "0.7204146", "0.71987385", "0.7180757", "0.71107906", "0.7043322", "0.7041613", "0.7015376", "0.7013112", "0.6982869", "0.69475657", "0.6941377", "0.6937569", "0.69213736", "0.69213736", "0.6892679", "0.6887231", "0.6877873", "0.68772626", "0.68644464", "0.68644464", "0.68644464", "0.68644464", "0.6855815", "0.68494046", "0.68220186", "0.68183845", "0.68154365", "0.6815009", "0.6815009", "0.68082577", "0.6802161", "0.68002385", "0.67936224", "0.67918605", "0.679087", "0.67849934", "0.6760954", "0.67599845", "0.67507833", "0.67461413", "0.67461413", "0.67431796", "0.67413616", "0.6728648", "0.672732", "0.67251813", "0.67251813", "0.67232496", "0.67152804", "0.67092025", "0.67071015", "0.6702423", "0.6701286", "0.66991764", "0.66969806", "0.66888016", "0.66863585", "0.6686101", "0.6686101", "0.66828436", "0.6681769", "0.6679519", "0.6671908", "0.66700244", "0.6665301", "0.66587126", "0.66587126", "0.66587126", "0.6658098", "0.66570866", "0.66570866", "0.66570866", "0.665458", "0.66533303", "0.66528934", "0.66513336", "0.66495234", "0.66490155", "0.6648172", "0.6648159", "0.6647816", "0.6647625", "0.6645882", "0.66453695", "0.66441536", "0.66413796", "0.66374624", "0.66360414", "0.6635178", "0.66346484", "0.66346484", "0.66346484", "0.6632149", "0.66308904", "0.66287386", "0.66283447", "0.6627003", "0.6624185", "0.6621111", "0.662078" ]
0.0
-1
Helper method to set up the connection.
private void setUpConnection(final String IP_ADDR, final int portNumber) { Runnable runnable = new Runnable() { @Override public void run() { try { // Not thread safe (Destroy could be calling close at the same time) socket.connect((new InetSocketAddress( InetAddress.getByName(IP_ADDR), portNumber))); Log.d(TAG, "Connection Successfull"); } catch (UnknownHostException e) { Log.e(TAG, "Connection Failed"); e.printStackTrace(); } catch (IOException e) { Log.e(TAG, "Connection Failed"); e.printStackTrace(); } } }; connectionThread = new Thread(runnable); connectionThread.start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void connect() {\n\t\treadProperties();\n\t\tif (validateProperties())\n\t\t\tjuraMqttClient = createClient();\n\t}", "private void createConnection() {\n this.callbacks = getCallbacks();\n\n Properties props = new Properties();\n props.putAll(getTestProps());\n props.putAll(getProps());\n this.connection = Connections.create((ConnectionCallbacks) callbacks, props);\n configureConnection(connection);\n }", "public setup() {\n dbConnection = \"jdbc:\"+DEFAULT_DB_TYPE+\"://\"+DEFAULT_DB_HOST+\":\"+DEFAULT_DB_PORT+\"/\"+DEFAULT_DB_PATH;\n dbType = DEFAULT_DB_TYPE;\n dbUser = DEFAULT_DB_USER;\n dbPass = DEFAULT_DB_PASSWORD;\n beginSetup();\n }", "private void setupAndConnect() {\n URL url = getUrl(this.endpointUrl);\n connection = null;\n try {\n connection = (HttpURLConnection) url.openConnection();\n HttpURLConnection.setFollowRedirects(true);\n } catch (IOException e) {\n LOG.severe(\"Error connecting to Url : \" + url);\n LOG.severe(e.toString());\n }\n }", "public void setupConnection()\n\t{\n\t\ttry\n\t\t{\n\t\t\tdatabaseConnection = DriverManager.getConnection(connectionString);\n\t\t}\n\t\tcatch (SQLException currentException)\n\t\t{\n\t\t\tdisplaySQLErrors(currentException);\n\t\t}\n\t}", "public void setup_connections()\n {\n setup_servers();\n setup_clients();\n }", "public static void setUpConnection()\n\t{\n\t\ttry{\n\t\t\t//The information necessary to create a connection to the database, need to figure out what this will be\n\t\n\t\t\n\t\t\t// Register driver by finding the class that corresponds do it \n\t\t\tString driverName = \"oracle.jdbc.OracleDriver\"; \n\t\t\tClass.forName(driverName);\n\t\t\n\t\t\tconn = DriverManager.getConnection(URL, USR, PWD);\n\t\t\n\t\t\tSystem.out.println(\"Connected to C325.\");\n\t\t}catch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void establishConnection() {\n try {\n PropertiesLoader loader = new PropertiesLoader();\n String sshUser = loader.loadProperty().getProperty(\"sshUser\");\n String sshPassword = loader.loadProperty().getProperty(\"sshPassword\");\n String sshHost = loader.loadProperty().getProperty(\"sshHost\");\n int sshPort = Integer.parseInt(loader.loadProperty().getProperty(\"sshPort\"));\n String remoteHost = loader.loadProperty().getProperty(\"remoteHost\");\n int localPort = Integer.parseInt(loader.loadProperty().getProperty(\"localPort\"));\n int remotePort = Integer.parseInt(loader.loadProperty().getProperty(\"remotePort\"));\n\n String dbUrl = loader.loadProperty().getProperty(\"dbUrl\");\n String dbUser = loader.loadProperty().getProperty(\"dbUser\");\n String dbPassword = loader.loadProperty().getProperty(\"dbPassword\");\n\n DatabaseManager.doSshTunnel(sshUser, sshPassword, sshHost, sshPort, remoteHost, localPort, remotePort);\n connection = DriverManager.getConnection(dbUrl, dbUser, dbPassword);\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "public void initializeConnection() {\n\n cluster = Cluster.builder().addContactPoint(host).build();\n session = cluster.connect(keyspaceName);\n session.execute(\"USE \".concat(keyspaceName));\n }", "private void initConnection() {\n\t\tMysqlDataSource ds = new MysqlDataSource();\n\t\tds.setServerName(\"localhost\");\n\t\tds.setDatabaseName(\"sunshine\");\n\t\tds.setUser(\"root\");\n\t\tds.setPassword(\"sqlyella\");\n\t\ttry {\n\t\t\tConnection c = ds.getConnection();\n\t\t\tSystem.out.println(\"Connection ok\");\n\t\t\tthis.setConn(c);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void initializeConnection(){\n try{\n dbConnect = DriverManager.getConnection(DBURL, USERNAME, PASSWORD);\n } catch (SQLException ex){\n ex.printStackTrace();\n }\n }", "void createConnection();", "public void setConnection(Connection conn);", "public void connectToExternalServer()\n\t{\n\t\tbuildConnectionString(\"10.228.6.204\", \"\", \"ctec\", \"student\");\n\t\tsetupConnection();\n\t\t// createDatabase(\"Kyler\");\n\t}", "Connection createConnection();", "private void initialize() {\n try {\n Class.forName(\"org.postgresql.Driver\");\n } catch (ClassNotFoundException e) {\n LOGGER.error(\"DB: Unable to find sql driver.\", e);\n throw new AppRuntimeException(\"Unable to find sql driver\", e);\n }\n\n DbCred cred = getDbCred();\n this.connection = getConnection(cred);\n this.isInitialized.set(Boolean.TRUE);\n }", "private void openConnection () {\n\t\ttry {\n\t\t\tconnection = DriverManager.getConnection(\n\t\t\t\t\tPasswordProtector.HOST,\n\t\t\t\t\tPasswordProtector.USER,\n\t\t\t\t\tPasswordProtector.PASSWORD);\n\t\t\t} catch (SQLException e) {\n\t\t\t\tSystem.err.println(e.getMessage());\n\t\t\t}\n\t}", "protected void connectionEstablished() {}", "public void setConn(Connection conn) {this.conn = conn;}", "private void init() throws SQLException, MalformedURLException {\n\t\tconnection = connect();\n\t\tstmt = connection.createStatement();\n\t\tstmt.setQueryTimeout(30);\n\t}", "@PostConstruct\n public void init() {\n try {\n this.host = config.getConnectionHost();\n this.port = config.getConnectionPort();\n this.uri = config.getConnectionUri();\n } catch (final Exception e) {\n throw new IllegalStateException(\"Test failure: \" + e.getMessage(), e);\n }\n }", "public void connect(){\n if (connected) {\n // connection already established\n return;\n }\n // Create connection to Database\n Properties props = new Properties();\n props.setProperty(\"user\", DB_USER);\n props.setProperty(\"password\", DB_PASSWORD);\n //props.setProperty(\"ssl\", \"true\");\n //\"Connecting to database...\"\n try {\n Class.forName(\"org.postgresql.Driver\");\n String connection_string = generateURL();\n dbConnect = DriverManager.getConnection(connection_string, props);\n //\"Connection established\"\n status = \"Connection established\";\n connected = true;\n } catch (SQLException e) {\n //\"Connection failed: SQL error\"\n status = \"Connection failed: \" + e.getMessage();\n connected = false;\n } catch (Exception e) {\n //\"Connection failed: unknown error\"\n status = \"Connection failed: \" + e.getMessage();\n connected = false;\n }\n }", "public void openConnection(){\n\n\t\tString dbIP = getConfig().getString(\"mysql.ip\");\n\t\tString dbDB = getConfig().getString(\"mysql.databaseName\");\n\t\tString dbUN = getConfig().getString(\"mysql.username\");\n\t\tString dbPW = getConfig().getString(\"mysql.password\");\n\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\tconnection = DriverManager.getConnection(\"jdbc:mysql://\" + dbIP + \"/\" + dbDB, dbUN, dbPW);\n\t\t\tgetLogger().info(\"Connected to databse!\");\n\t\t} catch (SQLException ex) {\n\t\t\t// handle any errors\n\t\t\tgetLogger().info(\"SQLException: \" + ex.getMessage());\n\t\t\tgetLogger().info(\"SQLState: \" + ex.getSQLState());\n\t\t\tgetLogger().info(\"VendorError: \" + ex.getErrorCode());\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tgetLogger().info(\"Gabe, you done goof'd!\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private void connect() {\n try {\n Class.forName(\"org.sqlite.JDBC\");\n this.conn = DriverManager.getConnection(\"jdbc:sqlite:settings.db\");\n } catch (ClassNotFoundException | SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n System.exit(0);\n }\n }", "private void initConnection() throws DatabaseAccessException {\n\t\ttry {\n\t\t\tthis.connection = DriverManager.getConnection(this.driver + \":\" + this.path);\n\n\t\t} catch (SQLException e) {\n\t\t\t// unable to create the connection; access error\n\t\t\tthrow new DatabaseAccessException(Failure.CONNECTION);\n\t\t}\n\t}", "void setConnection(Connection con);", "public void init(){\n taskClient.connect(\"127.0.0.1\", 9123);\n }", "private final static void setup() {\r\n\r\n supportedSchemes = new SchemeRegistry();\r\n\r\n // Register the \"http\" and \"https\" protocol schemes, they are\r\n // required by the default operator to look up socket factories.\r\n SocketFactory sf = PlainSocketFactory.getSocketFactory();\r\n supportedSchemes.register(new Scheme(\"http\", sf, 80));\r\n sf = SSLSocketFactory.getSocketFactory();\r\n supportedSchemes.register(new Scheme(\"https\", sf, 80));\r\n\r\n // prepare parameters\r\n HttpParams params = new BasicHttpParams();\r\n HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);\r\n HttpProtocolParams.setContentCharset(params, \"UTF-8\");\r\n HttpProtocolParams.setUseExpectContinue(params, true);\r\n HttpProtocolParams.setHttpElementCharset(params, \"UTF-8\");\r\n HttpProtocolParams.setUserAgent(params, \"Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9) Gecko/2008052906 Firefox/3.0\");\r\n defaultParameters = params;\r\n }", "public void initConnection(){\n \t String HOST = \"jdbc:mysql://10.20.63.22:3306/cloud\";\n String USERNAME = \"root\";\n String PASSWORD = \"test\";\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n } catch (ClassNotFoundException ex) {\n ex.printStackTrace();\n }\n \n try {\n conn = DriverManager.getConnection(HOST, USERNAME, PASSWORD);\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n }", "public void initiateConnection() {\n\t\tif (Settings.getRemoteHostname() != null) {\n\t\t\ttry {\n\t\t\t\toutgoingConnection(new Socket(Settings.getRemoteHostname(), Settings.getRemotePort()));\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.error(\"failed to make connection to \" + Settings.getRemoteHostname() + \":\"\n\t\t\t\t\t\t+ Settings.getRemotePort() + \" :\" + e);\n\t\t\t\tSystem.exit(-1);\n\t\t\t}\n\t\t}\n\t}", "private void getConnection() {\r\n\r\n\t\ttry {\r\n\t\t\tClass.forName(driver);\r\n\t\t\tconn = DriverManager.getConnection(url, id, pw);\r\n\t\t\tSystem.out.println(\"[접속성공]\");\r\n\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\tSystem.out.println(\"error: 드라이버 로딩 실패 -\" + e);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(\"error:\" + e);\r\n\t\t}\r\n\r\n\t}", "private void getConnection() {\n con = this.dbc.getMySQLConnection();\n Logger.getLogger(SettingImplementation.class.getName()).log(Level.SEVERE, \"Connection Basic >>>>>\" + con);\n }", "public ServerConnection()\n {\n //Initializing of the variables used in the constructor\n this.hostAddress = \"http://localhost\";\n this.port = 8882;\n }", "public void buildConnect() {\n\t\ttry {\n\t\t\tClass.forName(jdbcDriver);\n\t\t\tconnection= DriverManager.getConnection(dbUrl, user, passwd);\n\t\t\tstatement= connection.createStatement();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public void setup(){\n this.cluster = Cluster.builder().addContactPoint(\"127.0.0.1\").build();\n this.session = this.cluster.connect(\"demo\");\n }", "protected void setUp()\n {\n /* Add any necessary initialization code here (e.g., open a socket). */\n }", "private DBConnection() \n {\n initConnection();\n }", "protected void setUp()\r\n {\r\n /* Add any necessary initialization code here (e.g., open a socket). */\r\n }", "public static void connect() throws IOException {\n\n if (PROJECT_ID == null || INSTANCE_ID == null) {\n if (sc != null) {\n sc.log(\"environment variables BIGTABLE_PROJECT, and BIGTABLE_INSTANCE need to be defined.\");\n }\n return;\n }\n\n connection = BigtableConfiguration.connect(PROJECT_ID, INSTANCE_ID);\n }", "public void initConnection() throws SQLException{\n\t\tuserCon = new UserDBHandler(\"jdbc:mysql://127.0.0.1:3306/users\", \"admin\", \"admin\");\n\t\tproductCon = new ProductDBHandler(\"jdbc:mysql://127.0.0.1:3306/products\", \"admin\", \"admin\");\n\t}", "private static void connect() {\n\t\ttry {\n\t\t\tif (connection == null) {\n\t\t\t\tClass.forName(\"org.mariadb.jdbc.Driver\");\n\t\t\t\tconnection = DriverManager.getConnection(url, user, password);\n\t\t\t\tconnection.setAutoCommit(false);\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\n\t\t}\n\t}", "private void openConnection(){}", "public void buildConnection()\n {\n try\n {\n myConn = DriverManager.getConnection(url, user, pw);\n statement = myConn.createStatement();\n }\n catch(CommunicationsException e)\n {\n System.err.println(e);\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Verbindungsfehler\");\n alert.setContentText(\"Verbindung zum SQL Server fehlgeschlagen\");\n alert.showAndWait();\n }\n catch(Exception e)\n {\n System.err.println(e);\n }\n\n }", "private void initializeConnectionData() throws IOException, ClassNotFoundException {\n\n\t\tFileInputStream fileInputStream = new FileInputStream(new File(AlohandesTransactionManager.CONNECTION_DATA_PATH));\n\t\tProperties properties = new Properties();\n\n\t\tproperties.load(fileInputStream);\n\t\tfileInputStream.close();\n\n\t\tthis.url = properties.getProperty(\"url\");\n\t\tthis.user = properties.getProperty(\"usuario\");\n\t\tthis.password = properties.getProperty(\"clave\");\n\t\tthis.driver = properties.getProperty(\"driver\");\n\n\t\t//Class.forName(driver);\n\t}", "private void initializeConnectionData() throws IOException, ClassNotFoundException {\n\n\t\tFileInputStream fileInputStream = new FileInputStream(new File(AlohaTransactionManager.CONNECTION_DATA_PATH));\n\t\tProperties properties = new Properties();\n\t\t\n\t\tproperties.load(fileInputStream);\n\t\tfileInputStream.close();\n\t\t\n\t\tthis.url = properties.getProperty(\"url\");\n\t\tthis.user = properties.getProperty(\"usuario\");\n\t\tthis.password = properties.getProperty(\"clave\");\n\t\tthis.driver = properties.getProperty(\"driver\");\n\t\t\n\t\t//Class.forName(driver);\n\t}", "public static void initialize()\n\t{\n\t\tProperties props = new Properties();\n\t\tFileInputStream in = new fileInputStream(\"database.properties\");\n\t\tprops.load(in);\n\t\tin.close();\n\t\tString drivers = props.getProperty(\"jdbc.drivers\");\n\t\tif (drivers != null)\n\t\t\tSystem.setProperty(\"jdbc.drivers\", drivers);\n\t\tString url = props.getProperty(\"jdbc.url\");\n\t\tString username = props.getProperty(\"jdbc.username\");\n\t\tString password = props.getProperty(\"jdbc.password\");\n\t\t\n\t\tSystem.out.println(\"url=\"+url+\" user=\"+username+\" password=\"+password);\n\n\t\tdbConnect = DriverManager.getConnection( url, username, password);\n\t\t\n\t\tinitializeDatabase();\n\t}", "public void establishConnection() {\n httpNetworkService = new HTTPNetworkService(handler);\n }", "public void connect() {\n try {\n socket = connectToBackEnd();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }", "@Override\n public void initializeConnection() throws SQLException, ClassNotFoundException {\n \n Class.forName(\"com.mysql.jdbc.Driver\");\n //setConnection(DriverManager.getConnection(\"jdbc:mysql://localhost/rabidusDB\",\"root\",\"password\"));\n setConnection(DriverManager.getConnection( host + \":3306/\" + databaseName, user, password));\n \n }", "public ConnectionManager() {\r\n\t\tthis(DEFAULT_PORT, true, true);\r\n\t}", "public static void init()\n {\n try\n {\n // The newInstance() call is a work around for some broken Java implementations\n Class.forName(\"com.mysql.jdbc.Driver\").newInstance();\n\n // Create a new configuration object\n BoneCPConfig config = new BoneCPConfig();\n\n // Setup the configuration\n config.setJdbcUrl(\"jdbc:mysql://cs304.c0mk5mvcjljr.us-west-2.rds.amazonaws.com/cs304\"); // jdbc url specific to your database, eg jdbc:mysql://127.0.0.1/yourdb\n config.setUsername(\"cs304\");\n config.setPassword(\"ubccs304\");\n config.setConnectionTestStatement(\"SELECT 1\");\n config.setConnectionTimeout(10, TimeUnit.SECONDS);\n config.setMinConnectionsPerPartition(5);\n config.setMaxConnectionsPerPartition(10);\n config.setPartitionCount(1);\n\n // Setup the connection pool\n _pool = new BoneCP(config);\n\n // Log\n LogManager.getLogger(DatabasePoolManager.class).info(\"Database configuration initialized\");\n }\n catch (Exception ex)\n {\n // Log\n LogManager.getLogger(DatabasePoolManager.class).fatal(\"Could not initialize Database configuration\", ex);\n }\n\n }", "public DBConnection() {\n this(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST, DB_PORT);\n }", "public void openConnection(){\r\n try {\r\n Driver dr = new FabricMySQLDriver();\r\n DriverManager.registerDriver(dr);\r\n log.info(\"registrable driver\");\r\n } catch (SQLException e) {\r\n log.error(e.getMessage());\r\n e.printStackTrace();\r\n }\r\n try {\r\n connection = DriverManager.getConnection(URL, USERNAME, PASSWORD);\r\n log.info(\"get connection\");\r\n } catch (SQLException e) {\r\n log.error(e.getMessage());\r\n e.printStackTrace();\r\n }\r\n }", "public void setConnection(String sConnection) throws IOException;", "public static void openConnection() {\n\t\tarcade.startConnection();\n\t}", "public void init() {\r\n \tconnection = Connect.initConnexion();\r\n \tSystem.out.println(\"connexion :\"+connection);\r\n }", "public void connect() {\n\n DatabaseGlobalAccess.getInstance().setEmf(Persistence.createEntityManagerFactory(\"PU_dashboarddb\"));\n DatabaseGlobalAccess.getInstance().setEm(DatabaseGlobalAccess.getInstance().getEmf().createEntityManager());\n DatabaseGlobalAccess.getInstance().getDatabaseData();\n DatabaseGlobalAccess.getInstance().setDbReachable(true);\n }", "private void connect() {\n if (this.connection == null && !this.connected) {\n try {\n this.connection = DriverManager.getConnection(this.dbUrl, this.dbUser, this.dbPassword);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n }", "private Connection () {}", "private void initConnection() throws MalformedURLException, IOException {\n httpConnection = (HttpURLConnection) new URL(initUrlParameter())\n .openConnection();\n httpConnection.setDoOutput(true);\n httpConnection.setDoInput(true);\n httpConnection.setRequestMethod(\"GET\");\n httpConnection.setRequestProperty(\"Content-Type\", \"application/json\");\n httpConnection.setRequestProperty(\"Authorization\",\n authentificator.generateBasicAuthorization());\n\n }", "protected Connection createConnection() {\n Properties connectionProperties = new Properties();\n JdbcPropertyAdapter adapter = getPropertyAdapter(dbType, properties);\n adapter.getExtraProperties(connectionProperties);\n\n String url = translator.getUrl(properties);\n logger.info(\"Opening connection to: \" + url);\n Connection connection;\n try {\n connection = DriverManager.getConnection(url, connectionProperties);\n connection.setAutoCommit(false);\n } catch (SQLException x) {\n throw translator.translate(x);\n }\n return connection;\n }", "public void setConnectionProperties(String hostname, String dbName, String username, String password);", "public static Connection establishConnection() {\n\t\tProperties props = new Properties();\n\t\tprops.setProperty(\"gssEncMode\", \"disable\");\n\t\tprops.setProperty(\"user\", \"pi\");\n\t\tprops.setProperty(\"password\", \"Bdw040795\"); // Should probably find a way to not have password in plaintext\n\t\tprops.setProperty(\"sslmode\", \"disable\");\n\t\tConnection WeatherDB;\n\t\ttry {\n\t\tWeatherDB = DriverManager.getConnection(\"jdbc:postgresql://10.0.0.100:5433/weather_app\", props);\n\t\treturn WeatherDB;\n\t\t} catch (SQLException e) {\n\t\te.printStackTrace();\n\t\tWeatherDB = null;\n\t\treturn WeatherDB;\n\t\t}\n\t}", "public void createConnection() {\n\t\tif (path != null) {\n\t\t\ttry {\n\t\t\t\tconn = DriverManager.getConnection(path);\n\t\t\t} catch(SQLException se){\n\t\t\t //Handle errors for JDBC\n\t\t\t se.printStackTrace();\n\t\t\t }catch(Exception e){\n\t\t\t //Handle errors for Class.forName\n\t\t\t e.printStackTrace();\n\t\t\t }\n\t\t}\n\t}", "private void setUpConnection(DataBaseProps dataBaseConfig) {\n\t\tHikariConfig hikariConfig = new HikariConfig();\r\n\t\thikariConfig.setDriverClassName(dataBaseConfig.getDriverName());\r\n\t\thikariConfig.setJdbcUrl(dataBaseConfig.getUrl());\r\n\t\thikariConfig.setUsername(dataBaseConfig.getUsername());\r\n\t\thikariConfig.setPassword(dataBaseConfig.getPassword());\r\n\t\thikariConfig.setMaximumPoolSize(maximumPoolSize);\r\n\t\thikariConfig.setValidationTimeout(validationTimeout);\r\n\t\thikariConfig.setConnectionTimeout(connectionTimeout);\r\n\t\thikariConfig.setIdleTimeout(idleTimeout);\r\n\t\thikariConfig.setMinimumIdle(minimumIdle);\r\n\t\tHikariDataSource dataSource = new HikariDataSource(hikariConfig);\r\n\t\tthis.jdbcTemplate = new NamedParameterJdbcTemplate(dataSource);\r\n\t}", "private static void dbConnect() {\r\n\t\tif (conn == null)\r\n\t\t\ttry {\r\n\t\t\t\tconn = DriverManager.getConnection(\"jdbc:mysql://localhost/sims?user=root&password=12345&useSSL=true\");\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t}", "public DBConn(){\n\t\t//Create a variable for the connection string.\n\t\tthis.connectionUrl = \"jdbc:sqlserver://localhost:1433;\" +\n\t\t \"databaseName=CSE132B; username=sa; password=cse132b\";\t\t//Daniel: integratedSecurity=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Kalvin: username=sa; password=cse132b\n\n\t\t// Declare the JDBC objects.\n\t\tthis.conn = null;\n\t\tthis.stmt = null;\n\t\tthis.rs = null;\n\t}", "private void connectToDB() {\n try {\n Class.forName(\"org.postgresql.Driver\");\n this.conn = DriverManager.getConnection(prs.getProperty(\"url\"),\n prs.getProperty(\"user\"), prs.getProperty(\"password\"));\n } catch (SQLException e1) {\n e1.printStackTrace();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n }", "private void connect() {\n connectionString = \"jdbc:mysql://\" + Config.getInstance().getMySQLServerName() + \":\" + Config.getInstance().getMySQLServerPort() + \"/\" + Config.getInstance().getMySQLDatabaseName();\n\n try {\n Assassin.p.getLogger().info(\"Attempting connection to MySQL...\");\n\n // Force driver to load if not yet loaded\n Class.forName(\"com.mysql.jdbc.Driver\");\n Properties connectionProperties = new Properties();\n connectionProperties.put(\"user\", Config.getInstance().getMySQLUserName());\n connectionProperties.put(\"password\", Config.getInstance().getMySQLUserPassword());\n connectionProperties.put(\"autoReconnect\", \"false\");\n connectionProperties.put(\"maxReconnects\", \"0\");\n connection = DriverManager.getConnection(connectionString, connectionProperties);\n\n Assassin.p.getLogger().info(\"Connection to MySQL was a success!\");\n }\n catch (SQLException ex) {\n connection = null;\n\n if (reconnectAttempt == 0 || reconnectAttempt >= 11) {\n Assassin.p.getLogger().severe(\"Connection to MySQL failed!\");\n printErrors(ex);\n }\n }\n catch (ClassNotFoundException ex) {\n connection = null;\n\n if (reconnectAttempt == 0 || reconnectAttempt >= 11) {\n Assassin.p.getLogger().severe(\"MySQL database driver not found!\");\n }\n }\n }", "private static void setConnection(){\n try{\n Class.forName(\"com.mysql.jdbc.Driver\");\n con = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/novel_rental\",\"root\",\"\");\n } catch (Exception e) {\n Logger.getLogger(NovelRepository.class.getName()).log(Level.SEVERE, null, e);\n System.out.println(e.getMessage());\n }\n }", "public void connect() {\n\n\t\ttry {\n\n\t\t\tClass.forName(\"com.mysql.cj.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException ex) {\n\t\t\tSystem.err.println(\"Unable to load MySQL Driver\");\n\t\t\t\n\t\t}\n\n\t\tString jdbcUrl = \"jdbc:mysql://localhost:3306/userinfo?useLegacyDatetimeCode=false&serverTimezone=UTC&useSSL=false\";\n\t\ttry {\n\t\t\t// DriverManager.registerDriver(new com.mysql.jdbc.Driver());\n\t\t\tConnection con = DriverManager.getConnection(jdbcUrl, \"root\", \"smmk143143\");\n\t\t\tconn = con;\n\t\t\t// Set auto commit as false.\n\t\t\tconn.setAutoCommit(false);\n\t\t\tSystem.out.println(\"接続済み/Connected\");\n\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"接続エラーが発生しました/Connection Error Occured\");\n\t\t\tSystem.out.println(e.getMessage());\n\n\t\t}\n\t}", "void init() throws CouldNotInitializeConnectionPoolException;", "private Connection() {\n\t\tSystem.out.println(\"--Connection Created--\");\n\t}", "public static void openConnection() {\n\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.cj.jdbc.Driver\");\n\t\t\tconexion = DriverManager.getConnection(\"jdbc:mysql://192.168.1.51:9090?useTimeone=true&serverTimezone=UTC\",\n\t\t\t\t\t\"remote\", \"Password123\");// credenciales temporales\n\t\t\tSystem.out.print(\"Server Connected\");\n\n\t\t} catch (SQLException | ClassNotFoundException ex) {\n\t\t\tSystem.out.print(\"No se ha podido conectar con mi base de datos\");\n\t\t\tSystem.out.println(ex.getMessage());\n\n\t\t}\n\n\t}", "public static void connect() {\n \t\tconnPool.start();\n \t}", "@Override\n public void connect(Properties conf) throws Exception {\n loadConfiguration(conf);\n hBaseOperation = new HBaseOperation(conf);\n hadoopConf = hBaseOperation.gethConf();\n hbaseConnections = new Connection[numConnection];\n for (int i = 0; i < numConnection; i++) {\n hbaseConnections[i] = ConnectionFactory.createConnection(hadoopConf);\n }\n currentConnectionID = new AtomicInteger(0);\n dataTableName = TableName.valueOf(this.dataTableNameString);\n logger.info(\"HBase connections established.\");\n }", "private void connect() throws Exception {\n\t\tConnection c = DriverManager.getConnection(\"jdbc:mysql://\" + details[0] + \":3306/\" + details[3], details[1], details[2]);\n\t\tsetConnection(c);\n\t}", "public void connect() {}", "protected void configureConnectionPool() {\n JdbcPropertyAdapter adapter = getPropertyAdapter(dbType, properties);\n JdbcConnectionProvider cp = new JdbcConnectionProvider(this.translator, adapter);\n this.connectionPool = new PoolConnectionProvider(cp, this.maxConnectionPoolSize);\n this.transactionProvider = new SimpleTransactionProvider(this.connectionPool);\n }", "public void setConnection(Connection connection) {\n this.connection = connection;\n }", "public static void connect() {\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n DataBaseConnect.connect = DriverManager\n .getConnection(\"jdbc:mysql://localhost/magazyn?\"\n + \"user=root&password=\");\n } catch (SQLException e1) {\n e1.printStackTrace();\n } catch (ClassNotFoundException e1) {\n e1.printStackTrace();\n }\n }", "void init() {\n CometUtils.printCometSdkVersion();\n validateInitialParams();\n this.connection = ConnectionInitializer.initConnection(\n this.apiKey, this.baseUrl, this.maxAuthRetries, this.getLogger());\n this.restApiClient = new RestApiClient(this.connection);\n // mark as initialized\n this.alive = true;\n }", "public static void connect()\n {\n conn = null;\n try {\n Class.forName(\"org.postgresql.Driver\");\n conn = DriverManager.getConnection(url, user, password);\n System.out.println(\"Connected to Server Successfully.\");\n }catch(Exception e) {\n System.out.println(e.getMessage());\n }\n }", "public SocketChannelTarantoolConnection() {\n\t\tthis(\"localhost\", 33013);\n\t}", "public void connect() {\n try {\n Class.forName(\"com.mysql.jdbc.Connection\");\n //characterEncoding=latin1&\n //Class.forName(\"org.apache.derby.jdbc.EmbeddedDriver\");\n //Connection conn = new Connection();\n url += \"?characterEncoding=latin1&useConfigs=maxPerformance&useSSL=false\";\n conn = DriverManager.getConnection(url, userName, password);\n if (conn != null) {\n System.out.println(\"Established connection to \"+url+\" Database\");\n }\n }\n catch(SQLException e) {\n throw new IllegalStateException(\"Cannot connect the database \"+url, e);\n }\n catch(ClassNotFoundException e) {\n e.printStackTrace();\n }\n\n }", "public Connection() {\n\t\t\n\t}", "private void init() {\r\n\t\tif (cn == null) {\r\n\t\t\ttry {\r\n\t\t\t\tcn = new XGConnection(url,login,passwd); // Etape 2 : r�cup�ration de la connexion\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tTimeUnit.MINUTES.sleep(1);\r\n\t\t\t\t} catch (InterruptedException e2) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te2.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcn.close();// lib�rer ressources de la m�moire.\r\n\t\t\t\t} catch (SQLException e1) {\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public MySQLEnvironment() throws GuacamoleException {\n\n // Init underlying JDBC environment\n super();\n\n }", "@BeforeClass\r\n public static void init() throws ConnectionException {\r\n\r\n Authenticated<EnterpriseConnection> authenticated = Authenticator.asUser(\r\n properties.getUserName(),\r\n properties.getPassword(),\r\n Connector::newEnterpriseConnection\r\n );\r\n\r\n runner.initialize(authenticated);\r\n\r\n }", "protected void startConnect() {\n if (tcp) {\n connection = new TCPConnection(this);\n } else {\n connection = new UDPConnection(this, udpSize);\n }\n connection.connect(remoteAddr, localAddr);\n }", "public void connexion() {\r\n\t\ttry {\r\n\r\n\t\t\tsoapConnFactory = SOAPConnectionFactory.newInstance();\r\n\t\t\tconnection = soapConnFactory.createConnection();\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "DBConnect() {\n \n }", "public UPKClient() {\n connectToServer(BASE_URL);\n }", "void getConnection() {\n }", "private void connect() throws SQLException, ClassNotFoundException,\n\t\t\tInstantiationException, IllegalAccessException {\n\t\tClass.forName(driver);\n\n\t\t// Setup the connection with the DB\n\t\tconnection = DriverManager.getConnection(url + dbName, userName,\n\t\t\t\tpassword);\n\t}", "public void DBConnect() {\n \tdatabase = new DatabaseAccess();\n \tif (database != null) {\n \t\ttry {\n \t\t\tString config = getServletContext().getInitParameter(\"dbConfig\");\n \t\t\tdatabase.GetConnectionProperties(config);\n \t\t\tdatabase.DatabaseConnect();\n \t\t}\n \t\tcatch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}\n }", "public final void setConnection(Connection connection) {\n this.conn = connection;\n }", "private void makeSQLConn() {\n\t\ttry {\n\t\t\tmyDB = new MySQLAccess();\n\t\t} catch (Exception e) { e.printStackTrace(); }\n\t}", "public void createConnection()\n\t{\n\t\ttry\n {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n // Get a connection\n conn = DriverManager.getConnection(dbURL, \"root\", \"root\"); \n System.out.println(\"Connected...\");\n }\n catch (Exception except)\n {\n except.printStackTrace();\n }\n\t}", "private static void setupConnection() {\r\n\t\t\r\n\t\t// Variable used to keep track of if a connection is sucessful\r\n\t\tboolean connectionSuccess;\r\n\t\t\r\n\t\t// Loop until a sucessful connection is made\r\n\t\tdo {\r\n\t\t\tconnectionSuccess = true;\r\n\t\t\t\r\n\t\t\t// Get server info from user\r\n\t\t\tString serverInfo = JOptionPane.showInputDialog(null, \"Please input the server IP and port\"\r\n\t\t\t\t\t+ \" in the form \\\"IP:Port\\\"\", \"Server Connection Details\", JOptionPane.PLAIN_MESSAGE);\r\n\t\t\t\r\n\t\t\t// If the X button or cancel is clicked exit the program\r\n\t\t\tif(serverInfo == null) {\r\n\t\t\t\tSystem.exit(-1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tString[] serverInfoArray = serverInfo.split(\":\", 2);\r\n\t\t\tint port = 0;\r\n\t\t\t\r\n\t\t\t// Check that both the port and IP have been inputted\r\n\t\t\tif(serverInfoArray.length > 1) {\r\n\t\t\t\t\r\n\t\t\t\t// Check that the port inputted is valid\r\n\t\t\t\ttry{\r\n\t\t\t\t\tport = Integer.parseInt(serverInfoArray[1]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(port > 65536 || port < 0) {\r\n\t\t\t\t\t\tshowMSG(PORT_ERROR_MSG);\r\n\t\t\t\t\t\tconnectionSuccess = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t} catch(NumberFormatException e) {\r\n\t\t\t\t\tshowMSG(PORT_ERROR_MSG);\r\n\t\t\t\t\tconnectionSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tshowMSG(\"Please input a port number and IP address\");\r\n\t\t\t\tconnectionSuccess = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// After port validation try to connect to the server\r\n\t\t\tif(connectionSuccess == true) {\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsock = new Socket(serverInfoArray[0], port);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tshowMSG(CONNECTION_ERROR_MSG);\r\n\t\t\t\t\tconnectionSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Loop until a successful connection to the server is made\r\n\t\t} while(connectionSuccess == false);\r\n\t\t\r\n\t\t\r\n\t\t// Setup buffered reader to read from the server\r\n\t\ttry {\r\n\t\t\tserverReader = new BufferedReader(new InputStreamReader(sock.getInputStream()));\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\tshowMSG(CONNECTION_ERROR_MSG);\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "private void connectToABBOE() throws IOException, IllegalArgumentsException {\n Socket socket = Biomine3000Utils.connectToServer(args);\n this.connection = new ABBOEConnection(CLIENT_PARAMS, socket, log);\n this.connection.init(new ObjectHandler());\n \n }" ]
[ "0.7159299", "0.713013", "0.7116666", "0.71038574", "0.7063128", "0.6980683", "0.6972886", "0.6700624", "0.66976964", "0.6639079", "0.64688075", "0.6448742", "0.6427745", "0.6400863", "0.63525665", "0.63502127", "0.6333331", "0.6322163", "0.6308445", "0.62955356", "0.6270565", "0.6266542", "0.62616414", "0.62482625", "0.6245528", "0.62441105", "0.6233548", "0.62327886", "0.6219576", "0.6200706", "0.6198703", "0.61968255", "0.6192142", "0.6190662", "0.6170184", "0.6167921", "0.6166856", "0.61637497", "0.61557233", "0.6148244", "0.6147132", "0.61467826", "0.61452496", "0.6143671", "0.6134076", "0.61296725", "0.6123178", "0.6118434", "0.6089768", "0.60875034", "0.60817164", "0.6080009", "0.60412747", "0.6033794", "0.60248363", "0.60234797", "0.60125524", "0.60123956", "0.6001237", "0.5986035", "0.5983112", "0.59789735", "0.5972063", "0.5971405", "0.5968043", "0.59636354", "0.5960569", "0.5960411", "0.59570754", "0.59566766", "0.5952818", "0.59378946", "0.59360695", "0.59289074", "0.5924108", "0.5923844", "0.5920205", "0.59167945", "0.59098184", "0.59057754", "0.5902305", "0.5893943", "0.58917135", "0.58910805", "0.58896035", "0.5882668", "0.5882035", "0.5881563", "0.587734", "0.58749956", "0.5869063", "0.5857276", "0.585573", "0.5854436", "0.5849929", "0.5849598", "0.58442324", "0.58401036", "0.5836802", "0.58339006", "0.5831919" ]
0.0
-1
Helper method to setup the UP, DOWN, LEFT, RIGHT buttons.
private void setUpButton(final String sendValue, int ID) { final Button button = (Button)findViewById(ID); button.setEnabled(true); button.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View arg0, MotionEvent arg1) { if (arg1.getAction() == MotionEvent.ACTION_DOWN) { button.setPressed(true); sendData(sendValue); } else if (arg1.getAction() == MotionEvent.ACTION_UP) { button.setPressed(false); } else if (button.isPressed()) { sendData(sendValue); } return true; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setupButtons() {\n\n\t\tstart = (ToggleButton) findViewById(R.id.start);\n\t\tprevious = (ImageButton) findViewById(R.id.prev);\n\t\tnext = (ImageButton) findViewById(R.id.next);\n\t\tplay = (ImageButton) findViewById(R.id.play);\n\t\tpause = (ImageButton) findViewById(R.id.pause);\n\t\tstart.setOnClickListener(this);\n\t\tprevious.setOnClickListener(this);\n\t\tnext.setOnClickListener(this);\n\t\tplay.setOnClickListener(this);\n\t\tpause.setOnClickListener(this);\n\t\tseekbar.setMax(300);\n\t\tseekbar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {\n\n\t\t\tpublic void onStopTrackingTouch(SeekBar seekBar) {\n\t\t\t\tcontroller.seek((float) seekBar.getProgress() / seekBar.getMax());\n\t\t\t}\n\n\t\t\tpublic void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n\t\t\t}\n\n\t\t\tpublic void onStartTrackingTouch(SeekBar seekBar) {\n\t\t\t}\n\t\t});\n\t}", "private void setupButtons() {\n\t\tsetupCreateCourse();\n\t\tsetupRemoveCourse();\n\t\tsetupCreateOffering();\n\t\tsetupRemoveOffering();\n\t\tsetupAddPreReq();\n\t\tsetupRemovePreReq();\n\t\tsetupBack();\n\t}", "public void actionPerformed(ActionEvent e)\r\n {\r\n if(e.getSource() == upButton)\r\n {\r\n upPressed();\r\n }//end if\r\n if(e.getSource() == downButton)\r\n {\r\n downPressed();\r\n }//end if\r\n if(e.getSource() == leftButton)\r\n {\r\n leftPressed();\r\n }//end if\r\n if(e.getSource() == rightButton)\r\n {\r\n rightPressed();\r\n }//end if\r\n }", "private void setupActionButtons() {\n setupLikeActionButton();\n setupRepostActionButton();\n setupMoreActionButton();\n }", "@Override\n public void initialiseButtons() {\n resumeButton = new Button(buttonLeft, resumeButtonTop, buttonRight, resumeButtonBottom, Assets.resume);\n restartButton = new Button(buttonLeft, restartButtonTop, buttonRight, restartButtonBottom, Assets.restart);\n instructionsButton = new Button(buttonLeft, instructionsButtonTop, buttonRight, instructionsButtonBottom, Assets.instructions);\n quitButton = new Button(buttonLeft, quitButtonTop, buttonRight, quitButtonBottom, Assets.quit);\n backArrowButton = new Button(-8,-10,120,100, Assets.backArrowButton);\n saveGameButton = new Button(buttonLeft,saveGameButtonTop,buttonRight,saveGameButtonBottom,Assets.saveGame);\n }", "public void initializeButtons(){\n\t\t\tplay.setBounds(40,90,280,30);\n\t\t\tadd(play);\n\t\t\tplay.addActionListener(new PlayGame());\n\t\t\tplay.setVisible(true);\n\t\t\t\n\t\t\tenterquestion.setBounds(40,140,280,30);\n\t\t\tadd(enterquestion);\n\t\t\tenterquestion.addActionListener(new EnterQuestion());\n\t\t\tenterquestion.setVisible(true);\n\t\t\t\n\t\t\tdirections.setBounds(40,190,280,30);\n\t\t\tadd(directions);\n\t\t\tdirections.addActionListener(new Instructor());\n\t\t\tdirections.setVisible(true);\n\t\t\t\n\t\t\t\n\t\t}", "private void setUpKeys() {\n inputManager.addMapping(\"Up\", new KeyTrigger(KeyInput.KEY_W));\n inputManager.addMapping(\"Down\", new KeyTrigger(KeyInput.KEY_S));\n inputManager.addMapping(\"Left\", new KeyTrigger(KeyInput.KEY_A));\n inputManager.addMapping(\"Right\", new KeyTrigger(KeyInput.KEY_D));\n inputManager.addMapping(\"Click\", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));\n inputManager.addListener(this, \"Up\");\n inputManager.addListener(this, \"Down\");\n inputManager.addListener(this, \"Left\");\n inputManager.addListener(this, \"Right\");\n inputManager.addListener(this, \"Click\");\n }", "private void setupButtons()\n\t{\n\t\tequals.setText(\"=\");\n\t\tequals.setBackground(Color.RED);\n\t\tequals.setForeground(Color.WHITE);\n\t\tequals.setOpaque(true);\n\t\tequals.setFont(new Font(\"Lucida Grande\", Font.PLAIN, 50));\n\t\tequals.setBorder(new CompoundBorder(new LineBorder(Color.LIGHT_GRAY, 5), new LineBorder(Color.BLACK, 3)));\n\t\tclear.setText(\"C\");\n\t\tclear.setBackground(new Color(0, 170, 100));\n\t\tclear.setForeground(Color.WHITE);\n\t\tclear.setOpaque(true);\n\t\tclear.setFont(new Font(\"Lucida Grande\", Font.PLAIN, 50));\n\t\tclear.setBorder(new CompoundBorder(new LineBorder(Color.LIGHT_GRAY, 5), new LineBorder(Color.BLACK, 3)));\n\t\tbackspace.setText(\"<--\");\n\t\tbackspace.setBackground(new Color(0, 170, 100));\n\t\tbackspace.setForeground(Color.WHITE);\n\t\tbackspace.setOpaque(true);\n\t\tbackspace.setFont(new Font(\"Lucida Grande\", Font.PLAIN, 35));\n\t\tbackspace.setBorder(new CompoundBorder(new LineBorder(Color.LIGHT_GRAY, 5), new LineBorder(Color.BLACK, 3)));\n\t\tnegative.setText(\"+/-\");\n\t\tnegative.setBackground(Color.GRAY);\n\t\tnegative.setForeground(Color.WHITE);\n\t\tnegative.setOpaque(true);\n\t\tnegative.setFont(new Font(\"Lucida Grande\", Font.PLAIN, 35));\n\t\tnegative.setBorder(new CompoundBorder(new LineBorder(Color.LIGHT_GRAY, 5), new LineBorder(Color.BLACK, 3)));\n\t}", "private void setUpOptionButtons() {\n setUpOptionOneButton();\n setUpOptionTwoButton();\n setUpOptionThreeButton();\n setUpProfileButton();\n setUpSignOutButton();\n }", "private void addControls() {\n\t\tarrow_up = new FlxSprite(FlxG.width/2-20,340);\r\n\t\tarrow_up.loadGraphic(R.drawable.arrow_up, false);\r\n\t\tarrow_up.setAlpha((float)0.7);\r\n\t\tthis.add(arrow_up);\r\n\t\t\r\n\t\tarrow_down = new FlxSprite(FlxG.width/2-20,400);\r\n\t\tarrow_down.loadGraphic(R.drawable.arrow_down, false);\r\n\t\tarrow_down.setAlpha((float)0.7);\r\n\t\tthis.add(arrow_down);\r\n\t\t\r\n\t\tarrow_right = new FlxSprite(FlxG.width/2+30,370);\r\n\t\tarrow_right.loadGraphic(R.drawable.arrow_right, false);\r\n\t\tarrow_right.setAlpha((float)0.7);\r\n\t\tthis.add(arrow_right);\r\n\t\t\r\n\t\tarrow_left = new FlxSprite(FlxG.width/2-70,370);\r\n\t\tarrow_left.loadGraphic(R.drawable.arrow_left, false);\r\n\t\tarrow_left.setAlpha((float)0.7);\r\n\t\tthis.add(arrow_left);\r\n\t}", "protected abstract boolean up(int button);", "private void initButtons() {\r\n\t\texitGameButton\t\t= game.screenHelper.createTextButton(BUTTON_EXIT_GAME_TEXT, BUTTON_EXIT_GAME_MOUSEOVER_TEXT, menuText);\r\n\t\tcancelExitButton\t= game.screenHelper.createTextButton(BUTTON_CANCEL_EXIT_TEXT, BUTTON_CANCEL_EXIT_MOUSEOVER_TEXT, menuText);\r\n\t\tcancelExitButton.addListener(new ChangeScreenInputListener(new MenuScreenChangeCommand()));\r\n\t\t// Event Listeners \r\n\t\t// TODO: clean up this giant piece of shitty code.\r\n\t\t\r\n\t\texitGameButton.addListener(new InputListener() {\r\n\t\t\tpublic boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {\r\n\t\t\t\texitGame();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t});\r\n\t}", "private void initButtons() {\n\t\taddGoalkeeper = new JButton(\"+\");\n\t\taddGoalkeeper.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tchangePlayer(0, e);\n\t\t\t}\n\t\t});\n\t\t\n\t\taddDefence1 = new JButton(\"+\");\n\t\taddDefence1.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tchangePlayer(1, e);\n\t\t\t}\n\t\t});\n\t\t\n\t\taddDefence2 = new JButton(\"+\");\n\t\taddDefence2.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tchangePlayer(2, e);\n\t\t\t}\n\t\t});\n\t\t\t\t\n\t\taddDefence3 = new JButton(\"+\");\n\t\taddDefence3.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tchangePlayer(3, e);\n\t\t\t}\n\t\t});\n\t\t\n\t\taddDefence4 = new JButton(\"+\");\n\t\taddDefence4.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tchangePlayer(4, e);\n\t\t\t}\n\t\t});\n\t\t\n\t\taddMiddle1 = new JButton(\"+\");\n\t\taddMiddle1.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tchangePlayer(5, e);\n\t\t\t}\n\t\t});\n\t\t\n\t\taddMiddle2 = new JButton(\"+\");\n\t\taddMiddle2.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tchangePlayer(6, e);\n\t\t\t}\n\t\t});\n\t\t\n\t\taddMiddle3 = new JButton(\"+\");\n\t\taddMiddle3.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tchangePlayer(7, e);\n\t\t\t}\n\t\t});\n\t\t\n\t\taddMiddle4 = new JButton(\"+\");\n\t\taddMiddle4.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tchangePlayer(8, e);\n\t\t\t}\n\t\t});\n\t\t\n\t\taddForward1 = new JButton(\"+\");\n\t\taddForward1.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tchangePlayer(9, e);\n\t\t\t}\n\t\t});\n\t\t\n\t\taddForward2 = new JButton(\"+\");\n\t\taddForward2.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tchangePlayer(10, e);\n\t\t\t}\n\t\t});\n\t}", "private void setButtons()\n\t{\n\t\tstartSim = new JButton(\"Start Sim\");\n\t\tstartSim.addActionListener(this);\n\t\tpauseSim = new JButton(\"Pause Sim\");\n\t\tpauseSim.addActionListener(this);\n\t\taddEat = new JButton(\"Add Eatery\");\n\t\taddEat.addActionListener(this);\n\t\tsubEat = new JButton(\"Subtract Eatery\");\n\t\tsubEat.addActionListener(this);\n\t\taddCash = new JButton(\"Add Cashier\");\n\t\taddCash.addActionListener(this);\n\t\tsubCash = new JButton(\"Subtract Cashier\");\n\t\tsubCash.addActionListener(this);\n\t}", "public void createGameButtons() {\n \tcreateGameButton(myResources.getString(\"startcommand\"), 1, GAME_BUTTON_XLOCATION, GAME_BUTTON_YLOCATION);\n \tcreateGameButton(myResources.getString(\"stopcommand\"), 0, GAME_BUTTON_XLOCATION * 3, GAME_BUTTON_YLOCATION);\n \tcreateGameButton(myResources.getString(\"speedup\"), SPEED_INCREASE, GAME_BUTTON_XLOCATION*5, GAME_BUTTON_YLOCATION);\n \tcreateGameButton(myResources.getString(\"slowdown\"), 1/SPEED_INCREASE, GAME_BUTTON_XLOCATION*7, GAME_BUTTON_YLOCATION);\n }", "@Override\n public void onClick(View view) {\n if (view.getId() == R.id.vv_btnUP) {\n if (buttonPressed[0] == false) {\n moveList.push(cv_robotController.cf_moveMotor(0, cv_sbAMotor.getProgress(), 0x20));\n moveList.push(cv_robotController.cf_moveMotor(1, cv_sbBMotor.getProgress(), 0x20));\n cv_tvAMotorPower.setText(\"\" + cv_sbBMotor.getProgress());\n buttonPressed[0] = true;\n cv_btnUP.setImageResource(R.drawable.arrow_up_gray);\n }\n else {\n cv_robotController.cf_moveMotor(0, 0, 0x00);\n cv_robotController.cf_moveMotor(1, 0, 0x00);\n moveList.clear();\n buttonPressed[0] = false;\n cv_btnUP.setImageResource(R.drawable.arrow_up_color);\n\n }\n\n cv_btnUP.setPressed(buttonPressed[0]);\n }\n\n //Reset\n if (view.getId() == R.id.vv_btnReset) {\n cv_robotController.cf_moveMotor(0, 0, 0x00);\n cv_robotController.cf_moveMotor(1, 0, 0x00);\n moveList.clear();\n for(int i = 0 ; i < cv_allButtons.length; i++){\n buttonPressed[i] = false;\n }\n cv_btnUP.setImageResource(R.drawable.arrow_up_color);\n cv_btnDown.setImageResource(R.drawable.arrow_down_color);\n cv_btnLeft.setImageResource(R.drawable.arrow_left_color);\n cv_btnRight.setImageResource(R.drawable.arrow_right_color);\n }\n\n //Down\n if (view.getId() == R.id.vv_btnDown) {\n if (buttonPressed[1] == false) {\n moveList.push(cv_robotController.cf_moveMotor(0, -cv_sbAMotor.getProgress(), 0x20));\n moveList.push(cv_robotController.cf_moveMotor(1, -cv_sbBMotor.getProgress(), 0x20));\n buttonPressed[1] = true;\n cv_btnDown.setImageResource(R.drawable.arrow_down_gray);\n }\n else {\n cv_robotController.cf_moveMotor(0, 0, 0x00);\n cv_robotController.cf_moveMotor(1, 0, 0x00);\n moveList.clear();\n buttonPressed[1] = false;\n cv_btnDown.setImageResource(R.drawable.arrow_down_color);\n }\n\n cv_btnDown.setPressed(buttonPressed[1]);\n }\n\n //Left\n if (view.getId() == R.id.vv_btnLeft) {\n if (!buttonPressed[2]) {\n cv_robotController.cf_moveMotor(1, 0, 0x00);\n cv_robotController.cf_moveMotor(0, cv_sbAMotor.getProgress(), 0x20);\n buttonPressed[2] = true;\n cv_btnLeft.setImageResource(R.drawable.arrow_left_gray);\n }\n else {\n if (!moveList.isEmpty()) {\n while (!moveList.isEmpty()) {\n Log.e(\"---------->\", \"-------------->\" + moveList.peek()[5]);\n cv_robotController.cf_moveMotor(moveList.pop());\n\n }\n }\n else {\n cv_robotController.cf_moveMotor(0, 0, 0x00);\n cv_robotController.cf_moveMotor(1, 0, 0x00);\n }\n\n buttonPressed[2] = false;\n cv_btnLeft.setImageResource(R.drawable.arrow_left_color);\n }\n\n cv_btnLeft.setPressed(buttonPressed[2]);\n }\n\n //Right\n if (view.getId() == R.id.vv_btnRight) {\n if (!buttonPressed[3]) {\n cv_robotController.cf_moveMotor(0, 0, 0x00);\n cv_robotController.cf_moveMotor(1, cv_sbAMotor.getProgress(), 0x20);\n buttonPressed[3] = true;\n cv_btnRight.setImageResource(R.drawable.arrow_right_gray);\n }\n else {\n if (!moveList.isEmpty()) {\n while (!moveList.isEmpty()) {\n Log.e(\"---------->\", \"-------------->\" + moveList.peek()[5]);\n cv_robotController.cf_moveMotor(moveList.pop());\n\n }\n }\n else {\n cv_robotController.cf_moveMotor(0, 0, 0x00);\n cv_robotController.cf_moveMotor(1, 0, 0x00);\n }\n\n buttonPressed[3] = false;\n cv_btnRight.setImageResource(R.drawable.arrow_right_color);\n }\n\n cv_btnRight.setPressed(buttonPressed[3]);\n }\n\n //C Motor-----------------------------------------------------------------------------------\n\n //Up\n if (view.getId() == R.id.vv_btnForwardC) {\n if (!buttonPressed[4]) {\n cv_robotController.cf_moveMotor(2, cv_sbPowerC.getProgress(), 0x20);\n\n buttonPressed[4] = true;\n }\n else {\n cv_robotController.cf_moveMotor(2, 0, 0x00);\n\n buttonPressed[4] = false;\n }\n\n cv_btnForwradC.setPressed(buttonPressed[4]);\n }\n\n //Down\n if (view.getId() == R.id.vv_btnBackwardC) {\n if (!buttonPressed[5]) {\n cv_robotController.cf_moveMotor(2, -cv_sbPowerC.getProgress(), 0x20);\n\n buttonPressed[5] = true;\n }\n else {\n cv_robotController.cf_moveMotor(2, 0, 0x00);\n\n buttonPressed[5] = false;\n }\n\n cv_btnBackwardC.setPressed(buttonPressed[5]);\n }\n }", "private void createButtons() {\n\tTexture startGameTex = new Texture(\n\t\tGdx.files.internal(\"assets/data/menu/menu_start.png\"));\n\tTexture plane_p1_tex = new Texture(\n\t\tGdx.files.internal(\"assets/data/menu/menu_player1.png\"));\n\tTexture plane_p2_tex = new Texture(\n\t\tGdx.files.internal(\"assets/data/menu/menu_player2.png\"));\n\n\tplayButton = new Button(\"\", font, 0, 0, new TextureRegion(startGameTex,\n\t\t0, 0, 161, 20), new TextureRegion(startGameTex, 0, 0, 161, 20),\n\t\tnew ScreenSwitchHandler(Screen.GAME));\n\tplaneButton_p1 = new Button(\"\", font, 0, 0, new TextureRegion(\n\t\tplane_p1_tex, 0, 0, 161, 20), new TextureRegion(plane_p1_tex,\n\t\t0, 0, 161, 20), new ScreenSwitchHandler(Screen.PLANE_P1));\n\tplaneButton_p2 = new Button(\"\", font, 0, 0, new TextureRegion(\n\t\tplane_p2_tex, 0, 0, 161, 20), new TextureRegion(plane_p2_tex,\n\t\t0, 0, 161, 20), new ScreenSwitchHandler(Screen.PLANE_P2));\n\toptionsButton = new Button(\"Options\", font, new ScreenSwitchHandler(\n\t\tScreen.OPTIONS));\n\texitButton = new Button(\"Exit\", font, new ButtonHandler() {\n\t @Override\n\t public void onClick() {\n\t\tGdx.app.exit();\n\t }\n\n\t @Override\n\t public void onRelease() {\n\t\t// TODO Auto-generated method stub\n\n\t }\n\t});\n }", "private void setActions(){\n login.setOnAction(e->login());\n simulate.setOnAction(e->simulate());\n scoreBoardButton.setOnAction(e->scoreBoard());\n viewBracket.setOnAction(e->viewBracket(selectedBracket, playerMap));\n clearButton.setOnAction(e->clear());\n resetButton.setOnAction(e->reset());\n finalizeButton.setOnAction(e->finalizeBracket());\n }", "public void init() {\r\n\r\n add(btnUn);\r\n add(btnDeux);\r\n add(btnTrois);\r\n add(btnQuatre);\r\n add(btnCinq);\r\n\r\n btnUn.setBounds(120, 120, 100, 75);\r\n btnDeux.setBounds(120, 310, 100, 75);\r\n btnDeux.setTransferHandler(new TransferHandler(\"icon\"));\r\n btnTrois.setBounds(360, 310, 100, 75);\r\n btnQuatre.setBounds(160, 600, 100, 75);\r\n btnQuatre.setTransferHandler(new TransferHandler(\"icon\"));\r\n btnCinq.setBounds(360, 600, 100, 75);\r\n\r\n }", "private void setupButtons() {\n\t\tButton scanButton = (Button) findViewById(R.id.button_scan);\n\n\t\tscanButton.setOnClickListener(new OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdoDiscovery();\n\t\t\t\t((Button) v).setText(\"Scanning\");\n\n\t\t\t\t((Button) v).setEnabled(false);\n\t\t\t\tButton cancelB = (Button) findViewById(R.id.button_cancel);\n\t\t\t\tcancelB.setText(\"Cancel Scan\");\n\t\t\t}\n\t\t});\n\n\t\tButton cancelButton = (Button) findViewById(R.id.button_cancel);\n\t\tcancelButton.setOnClickListener(new OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (m_BtAdapter.isDiscovering()) {\n\t\t\t\t\tm_BtAdapter.cancelDiscovery();\n\t\t\t\t\t((Button) v).setText(\"Back\");\n\t\t\t\t\t//setupViews();\n\t\t\t\t} else {\n\t\t\t\t\tsetResult(RESULT_CANCELED);\n\t\t\t\t\tfinish();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "private void setupPlayerUI() {\r\n // for now hide the player\r\n setPlayerVisible(false);\r\n\r\n // disable unnecesary buttons\r\n setButtonEnabled(mButtonPlayerSeekBackward, false);\r\n setButtonEnabled(mButtonPlayerSeekForward, false);\r\n setButtonEnabled(mButtonPlayerSkipBackward, false);\r\n\r\n setButtonEnabled(mButtonPlayerRepeat, false);\r\n }", "private void initButtonsListener(){\n initDraw();\n initResign();\n initRedo();\n }", "protected void setBetweenVolumeStateOnButtons() {\n mVolDownButton.setEnabled(true);\n mVolUpButton.setEnabled(true);\n }", "private void fixButtons() {\n\t\tfixModButtonListener();\n\t\tfixBuscarButtonListener();\n\t\tfixDeleteButtonListener();\n\t\tfixClearFieldsButtonListener();\n\t}", "public void addButtons(){\n\t\t//play button\n\t\tplayButton.addKeyListener(new KeyListener() {\n\n\t\t\t@Override\n\t\t\tpublic void keyTyped(KeyEvent e) {\n\t\t\t\tint value = e.getKeyCode();\n\t\t\t\tif (value == KeyEvent.VK_DOWN){\n\t\t\t\t\tleaderButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value == KeyEvent.VK_LEFT ){\n\t\t\t\t\tselectButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value ==KeyEvent.VK_UP){\n\t\t\t\t\tleaderButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if( value == KeyEvent.VK_RIGHT){\n\t\t\t\t\tmodifyButton.requestFocus();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void keyReleased(KeyEvent e) {\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tint value = e.getKeyCode();\n\t\t\t\tif (value == KeyEvent.VK_DOWN){\n\t\t\t\t\tleaderButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value == KeyEvent.VK_LEFT ){\n\t\t\t\t\tselectButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value ==KeyEvent.VK_UP){\n\t\t\t\t\tleaderButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if( value == KeyEvent.VK_RIGHT){\n\t\t\t\t\tmodifyButton.requestFocus();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tplayButton.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tGamePlay play = new GamePlay(1,null);\n\t\t\t\ttimer = new Timer(1000/60, play);\n\t\t\t\ttimer.start();\n\t\t\t\tviewFrame(false);\n\t\t\t}\n\t\t});\n\n\t\t//logout button\n\t\tlogoutButton.addKeyListener(new KeyListener() {\n\n\t\t\t@Override\n\t\t\tpublic void keyTyped(KeyEvent e) {\n\t\t\t\tint value = e.getKeyCode();\n\t\t\t\tif (value == KeyEvent.VK_DOWN){\n\t\t\t\t\tselectButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value == KeyEvent.VK_LEFT ){\n\t\t\t\t\tmodifyButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value ==KeyEvent.VK_UP){\n\t\t\t\t\tselectButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if( value == KeyEvent.VK_RIGHT){\n\t\t\t\t\tleaderButton.requestFocus();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void keyReleased(KeyEvent e) {\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tint value = e.getKeyCode();\n\t\t\t\tif (value == KeyEvent.VK_DOWN){\n\t\t\t\t\tselectButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value == KeyEvent.VK_LEFT ){\n\t\t\t\t\tmodifyButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value ==KeyEvent.VK_UP){\n\t\t\t\t\tselectButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if( value == KeyEvent.VK_RIGHT){\n\t\t\t\t\tleaderButton.requestFocus();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tlogoutButton.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tDrawLogin loginMenu = DrawLogin.getInstance();\n\t\t\t\tloginMenu.viewFrame(true);\n\t\t\t\tviewFrame(false);\n\t\t\t}\n\t\t});\n\n\t\t//load button\n\t\tloadButton.addKeyListener(new KeyListener() {\n\n\t\t\t@Override\n\t\t\tpublic void keyTyped(KeyEvent e) {\n\t\t\t\tint value = e.getKeyCode();\n\t\t\t\tif (value == KeyEvent.VK_DOWN){\n\t\t\t\t\tmodifyButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value == KeyEvent.VK_LEFT ){\n\t\t\t\t\tleaderButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value ==KeyEvent.VK_UP){\n\t\t\t\t\tmodifyButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if( value == KeyEvent.VK_RIGHT){\n\t\t\t\t\tselectButton.requestFocus();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void keyReleased(KeyEvent e) {\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tint value = e.getKeyCode();\n\t\t\t\tif (value == KeyEvent.VK_DOWN){\n\t\t\t\t\tmodifyButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value == KeyEvent.VK_LEFT ){\n\t\t\t\t\tleaderButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value ==KeyEvent.VK_UP){\n\t\t\t\t\tmodifyButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if( value == KeyEvent.VK_RIGHT){\n\t\t\t\t\tselectButton.requestFocus();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tloadButton.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tString result = null;\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tFile[] files;\n\t\t\t\t\t//Show user's loaded games\n\t\t\t\t\tList<String> results = new ArrayList<String>();\n\t\t\t\t\tif((new File(\"save/\" + Login.getUser().getUsername()).exists())){\n\t\t\t\t\t\tfiles = new File(\"save/\" + Login.getUser().getUsername()).listFiles();\n\n\t\t\t\t\t\t//If this pathname does not denote a directory, then listFiles() returns null. \n\n\t\t\t\t\t\tfor (File file : files) {\n\t\t\t\t\t\t\tif (file.isFile()) {\n\t\t\t\t\t\t\t\tresults.add(file.getName());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tresults.add(\" \");\n\t\t\t\t\t}\n\t\t\t\t\tif (EventQueue.isDispatchThread()) {\n\t\t\t\t\t\tJPanel panel = new JPanel();\n\t\t\t\t\t\tpanel.add(new JLabel(\"Please make a selection:\"));\n\t\t\t\t\t\tDefaultComboBoxModel model = new DefaultComboBoxModel();\n\t\t\t\t\t\tfor (String temp : results) {\n\t\t\t\t\t\t\tmodel.addElement(temp);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tJComboBox comboBox = new JComboBox(model);\n\t\t\t\t\t\tpanel.add(comboBox);\n\n\t\t\t\t\t\tint iResult = JOptionPane.showConfirmDialog(null, panel, \"Flavor\", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);\n\t\t\t\t\t\tswitch (iResult) {\n\t\t\t\t\t\tcase JOptionPane.OK_OPTION:\n\t\t\t\t\t\t\tresult = (String) comboBox.getSelectedItem();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif((new File(\"save/\" + Login.getUser().getUsername()).exists())){\n\t\t\t\t\t\tFileInputStream fileIn = new FileInputStream(\"save/\" + Login.getUser().getUsername() + \"/\" + result);\n\t\t\t\t\t\tObjectInputStream in = new ObjectInputStream(fileIn);\n\t\t\t\t\t\tgame = (Map) in.readObject();\n\t\t\t\t\t\tin.close();\n\t\t\t\t\t\tfileIn.close();\n\t\t\t\t\t}\n\t\t\t\t}catch(IOException i)\n\t\t\t\t{\n\t\t\t\t\ti.printStackTrace();\n\t\t\t\t\treturn;\n\t\t\t\t}catch(ClassNotFoundException c)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"map class not found\");\n\t\t\t\t\tc.printStackTrace();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tSystem.out.println(\"Load Game\");\n\t\t\t\tviewFrame(false);\n\t\t\t\tGamePlay play = new GamePlay(0, game);\n\t\t\t\ttimer = new Timer(1000/60, play);\n\t\t\t\ttimer.start();\n\t\t\t\tviewFrame(false);\n\t\t\t}\n\t\t});\n\n\n\t\t//modify button\n\t\tmodifyButton.addKeyListener(new KeyListener() {\n\n\t\t\t@Override\n\t\t\tpublic void keyTyped(KeyEvent e) {\n\t\t\t\tint value = e.getKeyCode();\n\t\t\t\tif (value == KeyEvent.VK_DOWN){\n\t\t\t\t\tloadButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value == KeyEvent.VK_LEFT ){\n\t\t\t\t\tplayButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value ==KeyEvent.VK_UP){\n\t\t\t\t\tloadButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if( value == KeyEvent.VK_RIGHT){\n\t\t\t\t\tlogoutButton.requestFocus();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void keyReleased(KeyEvent e) {\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tint value = e.getKeyCode();\n\t\t\t\tif (value == KeyEvent.VK_DOWN){\n\t\t\t\t\tloadButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value == KeyEvent.VK_LEFT ){\n\t\t\t\t\tplayButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value ==KeyEvent.VK_UP){\n\t\t\t\t\tloadButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if( value == KeyEvent.VK_RIGHT){\n\t\t\t\t\tlogoutButton.requestFocus();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tmodifyButton.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tModifyAccount md = new ModifyAccount();\n\t\t\t\tviewFrame(false);\n\t\t\t}\n\t\t});\n\n\t\t//leaderboard button\n\t\tleaderButton.addKeyListener(new KeyListener() {\n\n\t\t\t@Override\n\t\t\tpublic void keyTyped(KeyEvent e) {\n\t\t\t\tint value = e.getKeyCode();\n\t\t\t\tif (value == KeyEvent.VK_DOWN){\n\t\t\t\t\tplayButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value == KeyEvent.VK_LEFT ){\n\t\t\t\t\tlogoutButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value ==KeyEvent.VK_UP){\n\t\t\t\t\tplayButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if( value == KeyEvent.VK_RIGHT){\n\t\t\t\t\tloadButton.requestFocus();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void keyReleased(KeyEvent e) {\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tint value = e.getKeyCode();\n\t\t\t\tif (value == KeyEvent.VK_DOWN){\n\t\t\t\t\tplayButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value == KeyEvent.VK_LEFT ){\n\t\t\t\t\tlogoutButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value ==KeyEvent.VK_UP){\n\t\t\t\t\tplayButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if( value == KeyEvent.VK_RIGHT){\n\t\t\t\t\tloadButton.requestFocus();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tleaderButton.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t//Display leaderboard\n\t\t\t\ttry {\n\t\t\t\t\tLeaderboard lb = new Leaderboard();\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t}\n\t\t\t\tviewFrame(false);\n\t\t\t\tSystem.out.println(\"View Leaderboards\");\n\t\t\t}\n\t\t});\n\n\t\tselectButton.addKeyListener(new KeyListener() {\n\n\t\t\t@Override\n\t\t\tpublic void keyTyped(KeyEvent e) {\n\t\t\t\tint value = e.getKeyCode();\n\t\t\t\tif (value == KeyEvent.VK_DOWN){\n\t\t\t\t\tlogoutButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value == KeyEvent.VK_LEFT ){\n\t\t\t\t\tloadButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value ==KeyEvent.VK_UP){\n\t\t\t\t\tlogoutButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if( value == KeyEvent.VK_RIGHT){\n\t\t\t\t\tplayButton.requestFocus();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void keyReleased(KeyEvent e) {\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tint value = e.getKeyCode();\n\t\t\t\tif (value == KeyEvent.VK_DOWN){\n\t\t\t\t\tlogoutButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value == KeyEvent.VK_LEFT ){\n\t\t\t\t\tloadButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if(value ==KeyEvent.VK_UP){\n\t\t\t\t\tlogoutButton.requestFocus();\n\t\t\t\t}\n\t\t\t\telse if( value == KeyEvent.VK_RIGHT){\n\t\t\t\t\tplayButton.requestFocus();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tselectButton.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tviewFrame(false);\n\t\t\t\ttry {\n\t\t\t\t\tls = new LevelSelect();\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public void createButtons() {\n\t\tescapeBackground = new GRect(200, 150, 300, 400);\n\t\tescapeBackground.setFilled(true);\n\t\tescapeBackground.setColor(Color.gray);\n\n\t\tbutton1 = new GButton(\"Return to Game\", 250, 175, 200, 50, Color.cyan);\n\t\tbutton3 = new GButton(\"Exit Level\", 250, 330, 200, 50, Color.cyan);\n\t\tbutton4 = new GButton(\"Return to Menu\", 250, 475, 200, 50, Color.cyan);\n\n\t\tescapeButtons.add(button1);\n\t\tescapeButtons.add(button3);\n\t\tescapeButtons.add(button4);\n\n\t}", "private void setButtons(int width, int height) {\n\tint centerX = width / 2;\n\tint centerY = height / 2;\n\tplayButton.setPos(centerX - playButton.getWidth() / 2, centerY + 2\n\t\t* lineHeight);\n\tplaneButton_p1.setPos(centerX - planeButton_p1.getWidth() / 2, centerY\n\t\t+ 1 * lineHeight);\n\tplaneButton_p2.setPos(centerX - planeButton_p2.getWidth() / 2, centerY\n\t\t+ 0 * lineHeight);\n\toptionsButton.setPos(centerX - optionsButton.getWidth() / 2, centerY\n\t\t- 1 * lineHeight);\n\texitButton.setPos(centerX - exitButton.getWidth() / 2, centerY - 5\n\t\t* lineHeight);\n }", "private void configureButtons() {\n\n\t\t// Set button listeners\n\t\tfor(SLChannelControllerViews views : mChannelViews) {\n\t\t\tviews.getChannelButton().setOnTouchListener(new SLSeekBarOnTouchListener(views.getChannelSeekBar()));\n\t\t}\n\t}", "private void setUpKeyboardButtons() {\n mQWERTY = \"qwertyuiopasdfghjklzxcvbnm_\";\n mQWERTYWithDot = \"qwertyuiopasdfghjklzxcvbnm.\";\n\n mKeySize = mQWERTY.length();\n\n mLetterButtons = new Button[mQWERTY.length()];\n mKeyObjects = new KeyObject[mQWERTY.length() + 10];\n mIsShiftPressed = false;\n\n\n for (int i = 0; i < mQWERTY.length(); i++) {\n int id = getResources().getIdentifier(mQWERTY.charAt(i) + \"Button\", \"id\", getPackageName());\n mLetterButtons[i] = (Button) findViewById(id);\n\n final int finalI = i;\n mLetterButtons[i].setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n // create KeyObject when button is pressed and assign pressed features\n if (event.getAction() == MotionEvent.ACTION_DOWN) {\n mKeyObjects[finalI] = new KeyObject();\n\n Rect buttonShape = new Rect();\n v.getLocalVisibleRect(buttonShape);\n\n mKeyObjects[finalI].setPressedPressure(event.getPressure());\n mKeyObjects[finalI].setPressedTime(event.getEventTime());\n\n mKeyObjects[finalI].setCoordXPressed(event.getX());\n mKeyObjects[finalI].setCoordYPressed(event.getY());\n\n mKeyObjects[finalI].setCenterXCoord(buttonShape.exactCenterX());\n mKeyObjects[finalI].setCenterYCoord(buttonShape.exactCenterY());\n }\n\n // assign release features, check if button is canceled\n if (event.getAction() == MotionEvent.ACTION_UP) {\n mKeyObjects[finalI].setReleasedPressure(event.getPressure());\n mKeyObjects[finalI].setReleasedTime(event.getEventTime());\n\n mKeyObjects[finalI].setCoordXReleased(event.getX());\n mKeyObjects[finalI].setCoordYReleased(event.getY());\n\n if (mIsShiftPressed) {\n mKeyObjects[finalI].setKeyChar(Character.toUpperCase(mQWERTYWithDot.charAt(finalI)));\n } else {\n mKeyObjects[finalI].setKeyChar(mQWERTYWithDot.charAt(finalI));\n }\n\n Log.d(TAG, mKeyObjects[finalI].toString());\n\n\n // add key to buffer and update EditText\n if (mKeyBuffer.add(mKeyObjects[finalI]))\n if (mIsShiftPressed) {\n mPasswordEditText.append((mQWERTYWithDot.charAt(finalI) + \"\").toUpperCase());\n switchToLowerCase();\n } else {\n mPasswordEditText.append(mQWERTYWithDot.charAt(finalI) + \"\");\n }\n }\n\n return false;\n }\n });\n }\n\n mShiftButton = (Button) findViewById(R.id.shiftButton);\n mShiftButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if (mIsShiftPressed) {\n switchToLowerCase();\n } else {\n switchToUpperCase();\n }\n }\n });\n }", "private void initControlsPage()\r\n {\n \tString keyTitleString = \"KEYBOARD\";\r\n \tkeyTitleText = new OText(25, 200, 300, keyTitleString);\r\n \tkeyTitleText.setFont(\"Courier New\", 20, 1.0, 'C', Settings.themes.textColor);\r\n \t\r\n \t//Initialize the keyboard movement text\r\n \tString keyMoveString = \"Move Optimus with the WASD keys \"\r\n \t\t\t + \" <br> \"\r\n \t\t\t + \"as if they were the arrow keys.\";\r\n \tkeyMoveText = new OText(25, 225, 300, keyMoveString);\r\n \tkeyMoveText.setFont(\"Courier New\", 14, 1.0, 'C', Settings.themes.textColor);\r\n \t\r\n \t\r\n \t//Initialize the mouse title text\r\n \tString mouseTitleString = \"MOUSE\";\r\n \tmouseTitleText = new OText(375, 200, 300, mouseTitleString);\r\n \tmouseTitleText.setFont(\"Courier New\", 20, 1.0, 'C', Settings.themes.textColor);\r\n \t\r\n \t//Initialize the mouse text\r\n \tString mouseMoveString = \"Aim by moving the mouse and shoot bullets from Optimus in the direction of the cursor using both clicks. \";\r\n \tmouseText = new OText(375, 225, 300, mouseMoveString);\r\n \tmouseText.setFont(\"Courier New\", 14, 1.0, 'C', Settings.themes.textColor);\r\n }", "private void initCommandButtons(char[] levelLetters) {\n\t\tthis.btnTopFirst = (Button) findViewById(R.id.buttonTopFirst);\n\t\tthis.btnTopSecond = (Button) findViewById(R.id.buttonTopSecond);\n\t\tthis.btnTopThird = (Button) findViewById(R.id.buttonTopThird);\n\t\tthis.btnTopFourth = (Button) findViewById(R.id.buttonTopFourth);\n\n\t\tthis.btnBotFirst = (Button) findViewById(R.id.buttonBotFirst);\n\t\tthis.btnBotSecond = (Button) findViewById(R.id.buttonBotSecond);\n\t\tthis.btnBotThird = (Button) findViewById(R.id.buttonBotThird);\n\t\tthis.btnBotFourth = (Button) findViewById(R.id.buttonBotFourth);\n\t\tthis.letterButtons = new Button[] { btnBotFirst, btnBotSecond,\n\t\t\t\tbtnBotThird, btnBotFourth, btnTopFirst, btnTopSecond,\n\t\t\t\tbtnTopThird, btnTopFourth };\n\t\tthis.btnEndWord = (Button) findViewById(R.id.btnEndWord);\n\n\t\t// End word should be disabled by default\n\t\tthis.btnEndWord.setEnabled(false);\n\n\t\t// Populate level letters\n\t\tint index = 0;\n\t\tfor (Button btn : this.letterButtons) {\n\t\t\tbtn.setText(\"\" + levelLetters[index]);\n\t\t\tindex++;\n\t\t}\n\t}", "public void onRightUp();", "private void configureButtons() {\n\n backToMenu = new JButton(\"Menu\");\n if(isWatching){\n backToMenu.setBounds(575, 270, 100, 50);\n }\n else{\n backToMenu.setBounds(30, 800, 100, 50);\n }\n backToMenu.setFont(new Font(\"Broadway\", Font.PLAIN, 20));\n backToMenu.setBackground(Color.RED);\n backToMenu.setFocusable(false);\n backToMenu.addActionListener(this);\n add(backToMenu);\n }", "public UpShiftButton(){\r\n\t\tsuper();\r\n\t\tBufferedImage image = null;\r\n\t\ttry {\r\n\t\t\tURL file = getClass().getResource(\"/resources/arrow_up.png\");\r\n\t\t\timage = ImageIO.read(file);\r\n\t\t} catch (IOException ioex) {\r\n\t\t\tSystem.err.println(\"load error: \" + ioex.getMessage());\r\n\t\t}\r\n\t\tImageIcon icon = new ImageIcon(image);\r\n\t\tthis.setIcon(icon);\r\n\t\t_shiftIndex = 0;\r\n\t\t_theGame = null;\r\n\t\tthis.addActionListener(new UpShiftListener());\r\n\t}", "private void checkDirectionalButtonsForQuestion() {\n\t\tfor (int i = UP; i <= LEFT; i++) {\n\t\t\tif (gameActions[i].isPressed()) {\n\t\t\t\tdialog.move(i);\n\t\t\t}\n\t\t}\n\t}", "private OI() {\n\t\t\n\t\tJoystickButton intakeIn = new JoystickButton(//gunner, \n\t\t\t\tdriver, JOYSTICK_INTAKE);\n\t\tJoystickButton intakeOut = new JoystickButton(//gunner, \n\t\t\t\tdriver, JOYSTICK_REVERSE_INTAKE);\n\t\tJoystickButton pivotOut = new JoystickButton(//gunner,\t\t\t\tThese create officially each button on the driver remote\n\t\t\t\tdriver, JOYSTICK_PIVOT_OUT);\n\t\tJoystickButton pivotIn = new JoystickButton(//gunner,\t\t\t\tusing the button numbers created above\n\t\t\t\tdriver, JOYSTICK_PIVOT_IN);\n\t\tJoystickButton climbRelease = new JoystickButton(//gunner,\n\t\t\t\tdriver, JOYSTICK_ClIMB_RELEASE);\n\t\tJoystickButton climbUp = new JoystickButton(//gunner,\n\t\t\t\tdriver, JOYSTICK_CLIMB_UP);\n\t\tJoystickButton climbBrake = new JoystickButton(\n\t\t\t\tdriver, JOYSTICK_BRAKE);\n\t\tJoystickButton climbUndoBrake = new JoystickButton(\n\t\t\t\tdriver, JOYSTICK_UNDO_BRAKE);\n\t\t\n\t\t/*\n\t\t * JoystickButton intakeIn = new JoystickButton(//left, \n\t\t\t\tright, JOYSTICK_INTAKE);\n\t\t * JoystickButton intakeOut = new JoystickButton(//left, \n\t\t\t\tright, JOYSTICK_REVERSE_INTAKE);\n\t\t * JoystickButton pivotOut = new JoystickButton(//left,\t\t\t\tThese create officially each button on the driver remote\n\t\t\t\tright, JOYSTICK_PIVOT_OUT);\n\t\t * JoystickButton pivotIn = new JoystickButton(//left,\t\t\t\tusing the button numbers created above\n\t\t\t\tright, JOYSTICK_PIVOT_IN);\n\t\t * JoystickButton climbRelease = new JoystickButton(//left,\n\t\t\t\tright, JOYSTICK_ClIMB_RELEASE);\n\t\t * JoystickButton climbUp = new JoystickButton(//left,\n\t\t\t\tright, JOYSTICK_CLIMB_UP);\n\t\t * JoystickButton climbBrake = new JoystickButton(//left,\n\t\t\t\tright, JOYSTICK_BRAKE);\n\t\t * JoystickButton climbUndoBrake = new JoystickButton(//left,\n\t\t\t\tright, JOYSTICK_UNDO_BRAKE);\n\t\t */\n\t\t\n\t\t\n\t\tintakeIn.whileHeld(new IntakeIn());\t\t\t//Executes intakeIn WHILE the button is pressed\n\t\tintakeIn.whenReleased(new IntakeStop());\t//executes intakestop WHEN the button is let go\n\t\t\n\t\tintakeOut.whileHeld(new IntakeOut());\t\n\t\tintakeOut.whenReleased(new IntakeStop());\n\t\t\n\t\tpivotIn.whileHeld(new PivotIn());\n\t\tpivotIn.whenReleased(new PivotStop());\t\t\t\t\t\t\t//These bind the buttons to a specific command\n\t\t\n\t\tpivotOut.whileHeld(new PivotOut());\n\t\tpivotOut.whenReleased(new PivotStop());\n\t\t\n\t\tclimbRelease.whileHeld(new ClimbRelease());\n\t\tclimbRelease.whenReleased(new ClimbStop());\n\t\t\n\t\tclimbUp.whileHeld(new ClimbUp());\n\t\tclimbUp.whenReleased(new ClimbStop());\n\t\t\n\t\tclimbBrake.whileHeld(new ClimbBrake());\n\t\tclimbBrake.whenReleased(new BrakeStop());\n\t\t\n\t\tclimbUndoBrake.whileHeld(new ClimbBrakeUndo());\n\t\tclimbUndoBrake.whenReleased(new BrakeStop());\n\t}", "private void setupSettings() {\n add(announcementBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n add(currentGamesBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n add(chatRoomBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n add(friendsListBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n add(leaderboardBtn).expandX().width(ChessGame.MENU_WIDTH);\n row();\n }", "@Override\n\tprotected void loadButtons() {\n\t\tList<Button> buttons = new ArrayList<>();\n\t\tfinal int square_size = 100;\n\t\tfinal int seperator_size = 20;\n\t\tfinal int numButtons = 2;\n\t\tint y = (getHeight() - 100) / 2;\n\t\tint x = (getWidth() - (square_size * numButtons) - (seperator_size * (numButtons - 1))) / 2;\n\t\tint sep = square_size + seperator_size;\n\t\t// Paint button.\n\t\ttry {\n\t\t\tbuttons.add(new Button(getImage(IconHandler.path_paint), \"Toggle paint\", x, y,\n\t\t\t\t\tsquare_size, square_size, new Runnable() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tsetUsingTextures(!isUsingTextures());\n\t\t\t\t\t\t\trepaint();\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\tbuttons.add(new Button(getImage(IconHandler.path_fullscreen), \"Toggle full-screen\", x + sep, y,\n\t\t\t\t\tsquare_size, square_size, new Runnable() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tgetFrame().toggleArrangeSide();\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tsetButtons(buttons);\n\t}", "protected void resetSideButtons(){\n mFightButton.setText(\"FIGHT\");\n mPokemonButton.setText(\"POKEMON\");\n mBagButton.setText(\"BAG\");\n mRunButton.setText(\"RUN\");\n mFightButton.setBackgroundColor(PokemonApp.FIGHT_COLOR);\n mPokemonButton.setBackgroundColor(PokemonApp.POKEMON_COLOR);\n mBagButton.setBackgroundColor(PokemonApp.BAG_COLOR);\n mRunButton.setBackgroundColor(PokemonApp.RUN_COLOR);\n }", "private void setControls() {\n calendarDisplayBox.addEventFilter(KEY_PRESSED, event -> {\n switch (event.getCode()) {\n case LEFT:\n logger.info(\"LEFT arrow Pressed.\");\n displayPreviousWeek();\n indicateCalendarDisplayTimeChanged();\n break;\n case RIGHT:\n logger.info(\"RIGHT arrow Pressed.\");\n displayNextWeek();\n indicateCalendarDisplayTimeChanged();\n break;\n default:\n }\n });\n }", "public void init()\n {\n Container screen = getContentPane();\n buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.Y_AXIS));\n buttonPanel.add(attackButton);\n attackButton.setBackground(Color.WHITE);\n buttonPanel.add(defendButton);\n buttonPanel.add(fireButton);\n buttonPanel.add(iceButton);\n buttonPanel.add(hPotionButton);\n buttonPanel.add(mPotionButton);\n attackButton.addActionListener(this);\n defendButton.addActionListener(this);\n hPotionButton.addActionListener(this);\n mPotionButton.addActionListener(this);\n fireButton.addActionListener(this);\n iceButton.addActionListener(this);\n offScreen = new BufferedImage(500,500, BufferedImage.TYPE_INT_RGB);\n add(buttonPanel, BorderLayout.EAST);\n }", "private void setupInteraction() {\n\n\t\ttxtPort.setOnKeyReleased(new EventHandler<KeyEvent>() {\n\t\t\tpublic void handle(KeyEvent e) {\n\t\t\t\tString port = txtPort.getText();\n\t\t\t\tif (!Pattern.matches(\"[0-9]+\", port)) {\n\t\t\t\t\ttxtPort.clear();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfinal DropShadow shadow = new DropShadow();\n\t\t// Adds shadows if mouse moves towards the button\n\t\tbtnLogin.addEventHandler(MouseEvent.MOUSE_ENTERED,\n\t\t\t\tnew EventHandler<MouseEvent>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void handle(MouseEvent e) {\n\t\t\t\t\t\tbtnLogin.setEffect(shadow);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t// Removes shadows if mouse moves away from the button\n\t\tbtnLogin.addEventHandler(MouseEvent.MOUSE_EXITED,\n\t\t\t\tnew EventHandler<MouseEvent>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void handle(MouseEvent e) {\n\t\t\t\t\t\tbtnLogin.setEffect(null);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\ttxtNickname.setOnKeyReleased(new EventHandler<KeyEvent>() {\n\n\t\t\t@Override\n\t\t\tpublic void handle(KeyEvent e) {\n\t\t\t\t// Login only possible when TxtNickname isn't empty\n\t\t\t\tString name = txtNickname.getText();\n\t\t\t\tname = name.trim();\n\t\t\t\tif (name != null && !name.isEmpty()) {\n\t\t\t\t\tbtnLogin.setDisable(false);\n\t\t\t\t\tif (e.getCode() == KeyCode.ENTER) {\n\t\t\t\t\t\tsetController();\n\t\t\t\t\t\ttryLogin();\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tbtnLogin.setDisable(true);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t});\n\t\tbtnLogin.setOnAction(new EventHandler<ActionEvent>() {\n\n\t\t\t@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\tsetController();\n\t\t\t\ttryLogin();\n\t\t\t}\n\t\t});\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n if (e.getActionCommand().equals(\"Up\")){\n //System.out.println(\"Up button clicked!!\");\n jLabel.setText(\"You pressed the up button\");\n }\n // else if -> for several buttons...\n else {\n //System.out.println(\"Down button clicked!!\");\n jLabel.setText(\"You pressed the down button\");\n }\n }", "public void setupToggleButtons(){\n\t\ttoggle_textContacts.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n\t\t public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n\t\t if (isChecked) {\n\t\t // The toggle is enabled\n\t\t\t if(prefsHandler.getSettings().getIsFirstTextContacts())\n\t\t\t {\n\t\t\t \tshowTextContactsTutorialDialog();\n\t\t\t }\n\t\t\t \n\t\t \tLinearLayout.LayoutParams layout_desc = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);\n\t\t textContactsSmallFrame.setLayoutParams(layout_desc);\n\t\t } else {\n\t\t \t// resize the frame to just show the top button\n\t\t \tLinearLayout.LayoutParams layout_desc = new LinearLayout.LayoutParams(0, 0);\n\t\t textContactsSmallFrame.setLayoutParams(layout_desc);\n\t\t }\n\t\t }\n\t\t});\n\t\t\n\t\ttoggle_NFRadio.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n\t\t public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n\t\t if (!isChecked) {\n\t\t // The toggle is disabled\n\t\t\t if(prefsHandler.getSettings().getIsFirstMusic())\n\t\t\t {\n\t\t\t \tshowMusicTutorialDialog();\n\t\t\t }\n\t\t \t// resize the frame to just show the top button\n\t\t \tLinearLayout.LayoutParams layout_desc = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);\n\t\t NFRadioSmallFrame.setLayoutParams(layout_desc);\n\t\t } else {\n\t\t \t// the toggle is enabled\n\t\t\t if(prefsHandler.getSettings().getIsFirstNewsFeed())\n\t\t\t {\n\t\t\t \tshowNewsTutorialDialog();\n\t\t\t }\n\t\t\t \n\t\t \tLinearLayout.LayoutParams layout_desc = new LinearLayout.LayoutParams(0, 0);\n\t\t NFRadioSmallFrame.setLayoutParams(layout_desc);\n\t\t }\n\t\t }\n\t\t});\n\t\t\n\t\ttoggle_ShakeToWake.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n\t\t public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n\t\t \tif(isChecked&&prefsHandler.getSettings().getIsFirstShakeToWake())\n\t\t {\n\t\t \t\tshowShakeTutorialDialog();\n\t\t }\n\t\t }\n\t\t});\n\t}", "private void setUpKeys() {\n inputManager.addMapping(\"Left\", new KeyTrigger(KeyInput.KEY_A));\n inputManager.addMapping(\"Right\", new KeyTrigger(KeyInput.KEY_D));\n inputManager.addMapping(\"Up\", new KeyTrigger(KeyInput.KEY_W));\n inputManager.addMapping(\"Down\", new KeyTrigger(KeyInput.KEY_S));\n //inputManager.addMapping(\"Shoot\", new KeyTrigger (KeyInput.KEY_LSHIFT));\n inputManager.addMapping(\"Jump\", new KeyTrigger(KeyInput.KEY_SPACE));\n inputManager.addListener(this, \"Left\");\n inputManager.addListener(this, \"Right\");\n inputManager.addListener(this, \"Up\");\n inputManager.addListener(this, \"Down\");\n \n inputManager.addListener(this, \"Jump\");\n }", "public void setupInitEnable(){\n fwdButton.setEnabled(false);\n revButton.setEnabled(false);\n leftButton.setEnabled(false);\n rightButton.setEnabled(false);\n this.powerIcon.setEnabled(false);\n lServoWarn.setEnabled(false);\n rServoWarn.setEnabled(false); \n slideAuto.setEnabled(true); \n }", "public void setupHandlers(){\n\t\trestartButtonHandler rbh = new restartButtonHandler();\n\t\trestart.addActionListener(rbh);\n\t\tInstructionButtonHandler ibh = new InstructionButtonHandler();\n\t\tinstruction.addActionListener(ibh);\n\t\tCardButtonHandler cbh = new CardButtonHandler();\n\t\tfor (int i = 0; i < 4; i++){\n\t\t\tfor(int j = 0; j < 6; j++){\n\t\t\t\t\tbuttons[i][j].addActionListener(cbh);\n\t\t\t}\n\t\t}\n\t\t\n\t}", "private static void buttonSetup() {\n \n // For all buttons except clear and equals=, update display\n for(JButton i:buttonOrder) {\n if(i.equals(clear) || i.equals(equals))\n continue;\n i.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent evt) {\n if(displayString.toString().equals(\"ERROR\")) {\n displayString.replace(0, displayString.length(), i.getText());\n numField.setText(displayString.toString());\n } else {\n displayString.append(i.getText());\n numField.setText(displayString.toString());\n }\n }\n });\n }\n \n // Clears display\n clear.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent evt) {\n displayString.delete(0, displayString.length());\n numField.setText(displayString.toString());\n }\n });\n \n // Clears display, shows result\n equals.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent evt) {\n equationParse(displayString);\n }\n });\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n upBtn = new javax.swing.JButton();\n downBtn = new javax.swing.JButton();\n leftBtn = new javax.swing.JButton();\n rightBtn = new javax.swing.JButton();\n upTextField = new javax.swing.JTextField();\n downTextField = new javax.swing.JTextField();\n leftTextField = new javax.swing.JTextField();\n rightTextField = new javax.swing.JTextField();\n canvas = new java.awt.Canvas();\n button1Btn = new javax.swing.JButton();\n button2Btn = new javax.swing.JButton();\n button1TextField = new javax.swing.JTextField();\n button2TextField = new javax.swing.JTextField();\n startBtn = new javax.swing.JButton();\n stopBtn = new javax.swing.JButton();\n abutBtn = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);\n setTitle(\"RPi Joystick emulator\");\n setResizable(false);\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowClosing(java.awt.event.WindowEvent evt) {\n formWindowClosing(evt);\n }\n });\n addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n formKeyPressed(evt);\n }\n });\n\n upBtn.setText(\"UP\");\n upBtn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n upBtnActionPerformed(evt);\n }\n });\n\n downBtn.setText(\"DOWN\");\n downBtn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n downBtnActionPerformed(evt);\n }\n });\n\n leftBtn.setText(\"LEFT\");\n leftBtn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n leftBtnActionPerformed(evt);\n }\n });\n\n rightBtn.setText(\"RIGHT\");\n rightBtn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n rightBtnActionPerformed(evt);\n }\n });\n\n upTextField.setEditable(false);\n upTextField.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n upTextFieldKeyPressed(evt);\n }\n });\n\n downTextField.setEditable(false);\n downTextField.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n downTextFieldKeyPressed(evt);\n }\n });\n\n leftTextField.setEditable(false);\n leftTextField.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n leftTextFieldKeyPressed(evt);\n }\n });\n\n rightTextField.setEditable(false);\n rightTextField.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n rightTextFieldKeyPressed(evt);\n }\n });\n\n canvas.setBackground(new java.awt.Color(255, 255, 255));\n canvas.setMinimumSize(new java.awt.Dimension(200, 200));\n canvas.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n canvasKeyPressed(evt);\n }\n public void keyReleased(java.awt.event.KeyEvent evt) {\n canvasKeyReleased(evt);\n }\n });\n\n button1Btn.setText(\"BUTTON 1\");\n button1Btn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n button1BtnActionPerformed(evt);\n }\n });\n\n button2Btn.setText(\"BUTTON 2\");\n button2Btn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n button2BtnActionPerformed(evt);\n }\n });\n\n button1TextField.setEditable(false);\n button1TextField.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n button1TextFieldKeyPressed(evt);\n }\n });\n\n button2TextField.setEditable(false);\n button2TextField.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n button2TextFieldKeyPressed(evt);\n }\n });\n\n startBtn.setText(\"Start\");\n startBtn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n startBtnActionPerformed(evt);\n }\n });\n\n stopBtn.setText(\"Stop\");\n stopBtn.setEnabled(false);\n stopBtn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n stopBtnActionPerformed(evt);\n }\n });\n\n abutBtn.setText(\"?\");\n abutBtn.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n abutBtnActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(button1Btn, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)\n .addComponent(rightBtn, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(leftBtn, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(downBtn, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(upBtn, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(button2Btn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(button1TextField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)\n .addComponent(rightTextField, javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(leftTextField, javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(downTextField, javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(upTextField, javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(button2TextField))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(canvas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(abutBtn)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(stopBtn)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(startBtn)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(upBtn)\n .addComponent(upTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(downTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(downBtn))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(leftBtn)\n .addComponent(leftTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(rightBtn)\n .addComponent(rightTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(button1Btn)\n .addComponent(button1TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(button2Btn)\n .addComponent(button2TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addComponent(canvas, javax.swing.GroupLayout.PREFERRED_SIZE, 216, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(stopBtn)\n .addComponent(startBtn))\n .addComponent(abutBtn))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "protected void updateButtons() {\n int currentIndex = tabbedPane.getSelectedIndex();\n if( currentIndex == 0) {\n backButton.setEnabled(false);\n forwardButton.setText(\"weiter\");\n }\n if(currentIndex > 0) {\n backButton.setEnabled(true);\n forwardButton.setText(\"weiter\");\n }\n \n if(currentIndex == 6) {\n forwardButton.setText(\"würfeln\");\n }\n \n }", "protected abstract boolean down(int button);", "private void pushButtonUp(Floor floor)\r\n\t{\r\n\t\tdirectionButtonPanels[floor.getNumber()][1]=LiftButton.ACTIVE;\r\n\t}", "public JButtonsPanel() {\r\n setBorder(BorderFactory.createEtchedBorder(Color.GREEN, new Color(148, 145, 140)));\r\n\r\n jOpen.setText(BTN_OPEN);\r\n jOpen.setToolTipText(MSG_OPEN);\r\n jOpen.setBounds(new Rectangle(BTN_LEFT, BTN_VSPACE, BTN_WIDTH, BTN_HEIGHT));\r\n add(jOpen);\r\n\r\n jCheckHealth.setText(BTN_CHECK_HEALTH);\r\n jCheckHealth.setToolTipText(MSG_CHECK_HEALTH);\r\n jCheckHealth.setBounds(new Rectangle(BTN_LEFT, (int) (jOpen.getBounds().getMaxY() + BTN_VSPACE), BTN_WIDTH, BTN_HEIGHT));\r\n add(jCheckHealth);\r\n\r\n jClose.setText(BTN_CLOSE);\r\n jClose.setToolTipText(MSG_CLOSE);\r\n jClose.setBounds(new Rectangle(BTN_LEFT, (int) (jCheckHealth.getBounds().getMaxY() + BTN_VSPACE), BTN_WIDTH, BTN_HEIGHT));\r\n add(jClose);\r\n\r\n jClaim.setText(BTN_CLAIM);\r\n jClaim.setToolTipText(MSG_CLAIM);\r\n jClaim.setBounds(new Rectangle(BTN_LEFT, (int) (jClose.getBounds().getMaxY() + BTN_VSPACE), BTN_WIDTH, BTN_HEIGHT));\r\n add(jClaim);\r\n\r\n jRelease.setText(BTN_RELEASE);\r\n jRelease.setToolTipText(MSG_RELEASE);\r\n jRelease.setBounds(new Rectangle(BTN_LEFT, (int) (jClaim.getBounds().getMaxY() + BTN_VSPACE), BTN_WIDTH, BTN_HEIGHT));\r\n add(jRelease);\r\n\r\n jDeviceEnable.setText(BTN_DEVICE_ENABLE);\r\n jDeviceEnable.setToolTipText(MSG_DEVICE_ENABLE);\r\n jDeviceEnable.setBounds(new Rectangle(BTN_LEFT, (int) (jRelease.getBounds().getMaxY() + BTN_VSPACE), BTN_WIDTH, BTN_HEIGHT));\r\n add(jDeviceEnable);\r\n\r\n jDeviceDisable.setText(BTN_DEVICE_DISABLE);\r\n jDeviceDisable.setToolTipText(MSG_DEVICE_DISABLE);\r\n jDeviceDisable.setBounds(new Rectangle(BTN_LEFT, (int) (jDeviceEnable.getBounds().getMaxY() + BTN_VSPACE), BTN_WIDTH, BTN_HEIGHT));\r\n add(jDeviceDisable);\r\n\r\n jClearData.setText(BTN_CLEAR_DATA);\r\n jClearData.setToolTipText(MSG_CLEAR_DATA);\r\n jClearData.setBounds(new Rectangle(BTN_LEFT, (int) (jDeviceDisable.getBounds().getMaxY() + BTN_VSPACE), BTN_WIDTH, BTN_HEIGHT));\r\n add(jClearData);\r\n\r\n jBeginEnrollCapture.setText(BTN_BEGIN_ENROLL_CAPTURE);\r\n jBeginEnrollCapture.setToolTipText(MSG_BEGIN_ENROLL_CAPTURE);\r\n jBeginEnrollCapture.setBounds(new Rectangle(BTN_LEFT, (int) (jClearData.getBounds().getMaxY() + BTN_VSPACE), BTN_WIDTH, BTN_HEIGHT));\r\n add(jBeginEnrollCapture);\r\n\r\n jEndCapture.setText(BTN_END_CAPTURE);\r\n jEndCapture.setToolTipText(MSG_END_CAPTURE);\r\n jEndCapture.setBounds(new Rectangle(BTN_LEFT, (int) (jBeginEnrollCapture.getBounds().getMaxY() + BTN_VSPACE), BTN_WIDTH, BTN_HEIGHT));\r\n add(jEndCapture);\r\n\r\n jBeginVerifyCapture.setText(BTN_BEGIN_VERIFY_CAPTURE);\r\n jBeginVerifyCapture.setToolTipText(MSG_BEGIN_VERIFY_CAPTURE);\r\n jBeginVerifyCapture.setBounds(new Rectangle(BTN_LEFT, (int) (jEndCapture.getBounds().getMaxY() + BTN_VSPACE), BTN_WIDTH, BTN_HEIGHT));\r\n add(jBeginVerifyCapture);\r\n\r\n jIdentifyMatch.setText(BTN_IDENTIFY_MATCH);\r\n jIdentifyMatch.setToolTipText(MSG_IDENTIFY_MATCH);\r\n jIdentifyMatch.setBounds(new Rectangle(BTN_LEFT, (int) (jBeginVerifyCapture.getBounds().getMaxY() + BTN_VSPACE), BTN_WIDTH, BTN_HEIGHT));\r\n add(jIdentifyMatch);\r\n\r\n jVerifyMatch.setText(BTN_VERIFY_MATCH);\r\n jVerifyMatch.setToolTipText(MSG_VERIFY_MATCH);\r\n jVerifyMatch.setBounds(new Rectangle(BTN_LEFT, (int) (jIdentifyMatch.getBounds().getMaxY() + BTN_VSPACE), BTN_WIDTH, BTN_HEIGHT));\r\n add(jVerifyMatch);\r\n\r\n jIdentify.setText(BTN_IDENTIFY);\r\n jIdentify.setToolTipText(MSG_IDENTIFY);\r\n jIdentify.setBounds(new Rectangle(BTN_LEFT, (int) (jVerifyMatch.getBounds().getMaxY() + BTN_VSPACE), BTN_WIDTH, BTN_HEIGHT));\r\n add(jIdentify);\r\n\r\n jVerify.setText(BTN_VERIFY);\r\n jVerify.setToolTipText(MSG_VERIFY);\r\n jVerify.setBounds(new Rectangle(BTN_LEFT, (int) (jIdentify.getBounds().getMaxY() + BTN_VSPACE), BTN_WIDTH, BTN_HEIGHT));\r\n add(jVerify);\r\n }", "@Override\n\tvoid setupAction() {\n\n\t\tgetButton().setOnAction(event -> {\n\t\t\tmainPrevCommandBox.addText(mainTextInput.getText());\n\t\t\tfor (Turtle t : getThisTurtleList()) {\n\n\t\t\t\tlanguage = ((LanguageCombo) mainLanguageComboBox).getLanguage();\n\t\t\t\tCommand test = new Command(mainTextInput.getText(), t, variableMap, userCommandMap, language);\n\t\t\t\ttest.execute();\n\n\t\t\t}\n\t\t\tmainVarTable.updateVars(variableMap);\n\t\t\tmainFuncTable.updateCommandFuncs(userCommandMap);\n\t\t\tmainTurtleTable.updateValues();\n\n\t\t\tmainTextInput.clear();\n\n\t\t});\n\t}", "public void upPressed() {\n\t\tif (edit) {\n\t\t\tcurrentDeck.up();\n\t\t} else {\n\t\t\tactiveNode.nextChild();\n\t\t}\n\t}", "private void packupbtn() {\n\t\tif (symbel_int == -1) {\r\n\t\t\tLog.d(\"play_menu\", \"play_menu\");\r\n\t\t\ttran_sur.setVisibility(View.VISIBLE);\r\n\t\t\tplay_menu_arrow1.setImageResource(R.drawable.arrow_up);\r\n\t\t\tsymbel_int = symbel_int * -1;\r\n\t\t\tslowdown();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void initGui()\n {\n this.controlList.clear();\n //Keyboard.enableRepeatEvents(true);\n\n int var1 = (this.width - this.bookImageWidth) / 2;\n int var2 = (this.height - this.bookImageHeight - 40) / 2;\n this.controlList.add(this.buttonNextPage = new GuiButtonNextPage(1, var1 + 120, var2 + 154, true));\n this.controlList.add(this.buttonPreviousPage = new GuiButtonNextPage(2, var1 + 38, var2 + 154, false));\n this.controlList.add(this.buttonIndex = new GuiButtonNextPage(8, var1 + 28, var2 + 10, false));\n this.controlList.add(this.buttonMenu1 = new GuiButtonSelect(3, var1 + 35, var2 + 30, 110, 20, \"\"));\n this.controlList.add(this.buttonMenu2 = new GuiButtonSelect(4, var1 + 35, var2 + 55, 110, 20, \"\"));\n this.controlList.add(this.buttonMenu3 = new GuiButtonSelect(5, var1 + 35, var2 + 80, 110, 20, \"\"));\n this.controlList.add(this.buttonMenu4 = new GuiButtonSelect(6, var1 + 35, var2 + 105, 110, 20, \"\"));\n this.controlList.add(this.buttonMenu5 = new GuiButtonSelect(7, var1 + 35, var2 + 130, 110, 20, \"\"));\n this.controlList.add(this.bookmark = new GuiButtonBookmark(9, var1 + 142, var2 + 7, false));\n this.updateButtons();\n }", "private void setupButtons() {\n\n btnCancel.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n finishActivity(null, null);\n }\n });\n\n btnCreate.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Pub validatedData = validateFormData();\n\n if ( validatedData != null )\n uploadImagesIfNecessaryThenRegisterNewPub(validatedData);\n }\n });\n }", "public void initializeButtons() {\n\n playGameButton = (Button) findViewById(R.id.playGameButton);\n freePlayButton = (Button) findViewById(R.id.freePlayButton);\n informationIcon = (ImageView) findViewById(R.id.informationAboutGame);\n }", "private void setupUI(){\n this.setupTimerSchedule(controller, 0, 500);\n this.setupFocusable(); \n this.setupSensSlider();\n this.setupInitEnable();\n this.setupDebugger();\n }", "@FXML public void handleToggleButtons() {\n\t\t\n\t\t// binarySplitButton\n\t\tif (binarySplitButton.isSelected()) {\n\t\t\tbinarySplitButton.setText(\"True\");\n\t\t} else {\n\t\t\tbinarySplitButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// collapseTreeButton\n\t\tif (collapseTreeButton.isSelected()) {\n\t\t\tcollapseTreeButton.setText(\"True\");\n\t\t} else {\n\t\t\tcollapseTreeButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// debugButton\n\t\tif (debugButton.isSelected()) {\n\t\t\tdebugButton.setText(\"True\");\n\t\t} else {\n\t\t\tdebugButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// doNotCheckCapabilitiesButton\n\t\tif (doNotCheckCapabilitiesButton.isSelected()) {\n\t\t\tdoNotCheckCapabilitiesButton.setText(\"True\");\n\t\t} else {\n\t\t\tdoNotCheckCapabilitiesButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// doNotMakeSplitPAVButton\n\t\tif (doNotMakeSplitPAVButton.isSelected()) {\n\t\t\tdoNotMakeSplitPAVButton.setText(\"True\");\n\t\t} else {\n\t\t\tdoNotMakeSplitPAVButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// reduceErrorPruningButton\n\t\tif (reduceErrorPruningButton.isSelected()) {\n\t\t\treduceErrorPruningButton.setText(\"True\");\n\t\t} else {\n\t\t\treduceErrorPruningButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// saveInstanceDataButton\n\t\tif (saveInstanceDataButton.isSelected()) {\n\t\t\tsaveInstanceDataButton.setText(\"True\");\n\t\t} else {\n\t\t\tsaveInstanceDataButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// subTreeRaisingButton\n\t\tif (subTreeRaisingButton.isSelected()) {\n\t\t\tsubTreeRaisingButton.setText(\"True\");\n\t\t} else {\n\t\t\tsubTreeRaisingButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// unprunedButton\n\t\tif (unprunedButton.isSelected()) {\n\t\t\tunprunedButton.setText(\"True\");\n\t\t} else {\n\t\t\tunprunedButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// useLaplaceButton\n\t\tif (useLaplaceButton.isSelected()) {\n\t\t\tuseLaplaceButton.setText(\"True\");\n\t\t} else {\n\t\t\tuseLaplaceButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// useMDLcorrectionButton\n\t\tif (useMDLcorrectionButton.isSelected()) {\n\t\t\tuseMDLcorrectionButton.setText(\"True\");\n\t\t} else {\n\t\t\tuseMDLcorrectionButton.setText(\"False\");\n\t\t}\n\t\t\n\t}", "private void initButtons() {\n HBox buttons = new HBox(50);\n yes = new Button(\"Yes!\");\n no = new Button(\"No!\");\n buttons.getChildren().addAll(yes,no);\n buttons.setAlignment(Pos.CENTER);\n root.getChildren().addAll(buttons);\n }", "public void registerButtons()\n\t{\n\t\tplot.addActionListener(new ButtonListener());\n\t\tin.addActionListener(new ButtonListener(1));\n\t\tout.addActionListener(new ButtonListener(2));\n\t\t\n\t}", "public void UpdateVariables(boolean Up, boolean Down, boolean Right, boolean Left){\r\n\t\tup = Up; down = Down; \r\n\t\tif(!left)right = Right; \r\n\t\tif(!right)left = Left;\r\n\t}", "@Override\n public void initKeys()\n {\n inputManager.addMapping(\"Left\", new KeyTrigger(KeyInput.KEY_J));\n inputManager.addMapping(\"Right\", new KeyTrigger(KeyInput.KEY_L));\n inputManager.addMapping(\"Up\", new KeyTrigger(KeyInput.KEY_I));\n inputManager.addMapping(\"Down\", new KeyTrigger(KeyInput.KEY_K));\n inputManager.addMapping(\"Orient\", new KeyTrigger(KeyInput.KEY_O));\n inputManager.addMapping(\"pick target\", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));\n\n // Add the names to the listener.\n inputManager.addListener(analogListener, \"Left\", \"Right\", \"Up\", \"Down\", \"Orient\");\n inputManager.addListener(actionListener, \"pick target\");\n }", "protected void up() {\n move(positionX, positionY - 1);\n orientation = BattleGrid.RIGHT_ANGLE * 3;\n }", "public ButtonPanel(ModelController c, ArrayList<Turtle> t) {\n\tsliderCurrent = 5;\n\tCONTROLLER = c;\n\tTURTLE = t;\n\tmakeUpButton();\n\tmakeDownButton();\n\tmakeLeftButton();\n }", "private void createBeginningButtons() {\n\t createStartButtons(myResources.getString(\"game1\"), 0, 0);\n\t\tcreateStartButtons(myResources.getString(\"game2\"), 0, 1);\n\t\tcreateStartButtons(myResources.getString(\"game3\"), 0, 2);\n\t\tcreateStartButtons(myResources.getString(\"game4\"), 0, 3);\n\t\tcreateStartButtons(myResources.getString(\"game5\"), 0, 4);\n\t\tcreateInstructionButton();\n\t\tcreateStartingLabel();\n\t\tcreateGridSizeButton();\n }", "private void initiateChoiceButtons() {\n\t\trock = new JButton(\"Rock\");\n\t\trock.setPreferredSize(selectionButtonSize);\n\t\tpaper = new JButton(\"Paper\");\n\t\tpaper.setPreferredSize(selectionButtonSize);\n\t\tscissors = new JButton(\"Scissors\");\n\t\tscissors.setPreferredSize(selectionButtonSize);\n\n\t\taddButtonListener();\n\t}", "private void initializeFeatures() {\n\t\tint buttonLength = 2*super.getXLength()/3;\n\t\tint buttonHeight = super.getYLength()/6;\n\t\tint startX = super.getXPos() + super.getXLength()/2 - buttonLength/2; \n\t\tint startY = super.getYPos() + super.getYLength()/2 - buttonHeight/2;\n\t\tint spacingBetweenButtons = 10; \n\t\tstart = new StartButton(parent,startX,startY,buttonLength,buttonHeight);\n\t\tinstructions = new InstructionsButton(parent,startX,startY + spacingBetweenButtons+buttonHeight,buttonLength,buttonHeight);\n\t\tquit = new QuitButton(parent,startX,startY + 2*(buttonHeight + spacingBetweenButtons),buttonLength,buttonHeight);\n\t}", "private void updateDirection()\n {\n if (Math.abs(InputSystem.LT_Button_Control_Stick) > 0.1)\n {\n // if lt button is pressed, reverse direction of elevator\n setReverseDirection(true);\n }\n else\n {\n setReverseDirection(false);\n }\n }", "@Override\n public final void initButtons(int x, int y, int addy){\n \n String data = s_datapath;\n addButton(data + \"SM_NeuesSpiel\" + s_typ, x, y, 1);\n addButton(data + \"OM_SpielSpeichern\" + s_typ, x, y + addy, 2);\n addButton(data + \"SM_SpielLaden\" + s_typ, x, y + addy * 2, 3);\n //addButton(data,x, y + addy*3, 4);\n addButton(data + \"Menu_Element_Blank\" + s_typ, x,/*715*/ y + addy * 4, 5);\n addButton(data + \"SM_SpielBeenden\" + s_typ, x,/*845*/ y + addy * 5, 6);\n }", "private static void caseDefault() {\n\n // Drive\n axLeftX.setAxis(null, 0); //Mecanum (Arcade) Left/Right turn\n axLeftY.setAxis(null, 0); //Mecanum (Arcade) Fwd/Bkwd\n axRightX.setAxis(null, 0); //Mecanum Rotate orientation\n axRightY.setAxis(null, 0); //unassigned\n\n btnGyroReset.setButton(null, 0); // reset gyro to 0\n\n btnHoldLeft.setButton(null, 0); //??\n btnHoldCenter.setButton(null, 0); //??\n btnHoldRight.setButton(null, 0); //??\n \n // Gear\n btnPickupGear.setButton(null, 0); // Pickup gear off floor\n btnPlaceGear.setButton(null, 0); // Place gear on ship peg\n \n // Shooter\n btnShooter.setButton(null, 0); // Start shooter then feeder(s)\n btnAgitator.setButton(null, 0); // Agitate the ball bin\n \n // Climb\n btnClimber.setButton(null, 0); // Climber rotating\n\n }", "public void up() {\n\t\tswitch (facing){\n\t\tcase \"RIGHT\" :\n\t\t\tvely = 0;\n\t\t\tvelx = 1.5;\n\t\t\tbreak;\n\t\tcase \"LEFT\" :\n\t\t\tvely = 0;\n\t\t\tvelx = -1.5;\n\t\t\tbreak;\n\t\tcase \"UP\" :\n\t\t\tvely = -1.5;\n\t\t\tvelx = 0;\n\t\t\tbreak;\n\t\tcase \"DOWN\" :\n\t\t\tvely = 1.5;\n\t\t\tvelx = 0;\n\t\t\tbreak;\n\t\t}\n\t}", "protected void init(){\n ac = new ButtonEventManager(this);\n \n nameField = new JTextField();\n \n done = new JButton(\"DONE\");\n back = new JButton(\"MAIN MENU\");\n quit = new JButton(\"QUIT\");\n \n done.setActionCommand(\"go to game menu after saving\");\n back.setActionCommand(\"go to the main menu\");\n quit.setActionCommand(\"quit the game\");\n \n Font font = new Font(\"Arial\", Font.PLAIN, 10);\n \n nameField.setFont(font);\n \n nameField.setBounds(2 * this.getWidth() / 3 - buttonWidth / 2, (int)(0.4 * this.getHeight() - textFieldHeight / 2), buttonWidth, textFieldHeight);\n \n done.setBounds((this.getWidth() / 2 - buttonWidth) / 2, (int)(0.7 * this.getHeight() - buttonHeight / 2), buttonWidth, buttonHeight);\n back.setBounds((this.getWidth() - buttonWidth) / 2, (int)(0.7 * this.getHeight() - buttonHeight / 2), buttonWidth, buttonHeight);\n quit.setBounds(3 * (this.getWidth() - buttonWidth) / 2, (int)(0.7 * this.getHeight() - buttonHeight / 2), buttonWidth, buttonHeight);\n \n done.addActionListener(ac);\n back.addActionListener(ac);\n quit.addActionListener(ac);\n \n add(nameField);\n \n add(done);\n add(back);\n add(quit);\n }", "private void fillEventActionMap() {\r\n\t\t\r\n\t\teventActionMap.put(UpButtonEvent.class, new LiftAction() {\r\n\t\t\t@Override\r\n\t\t\tpublic void execute(LiftEvent e) {\r\n\t\t\t\tUpButtonEvent event = (UpButtonEvent) e;\r\n\t\t\t\tSystem.out.println(\"up \"+event.getFloor());\r\n\t\t\t\tif(directionButtonPanels[event.getFloor()][1]==LiftButton.NOT_ACTIVE){\r\n\t\t\t\t\tpushButtonUp(new Floor(event.getFloor()));\r\n\t\t\t\t\tif (direction == Direction.STOP) {\r\n\t\t\t\t\t\tif (event.getFloor() > actualFloor.getNumber()) {\r\n\t\t\t\t\t\t\tconnection.send(new ChangeDirectionEvent(Direction.UP,actualFloor.getNumber()));\r\n\t\t\t\t\t\t\tdirection=Direction.UP;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (event.getFloor() < actualFloor.getNumber()) {\r\n\t\t\t\t\t\t\tconnection.send(new ChangeDirectionEvent(Direction.DOWN,actualFloor.getNumber()));\r\n\t\t\t\t\t\t\tdirection=Direction.DOWN;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tconnection.send(new ChangeDirectionEvent(Direction.UP,event.getFloor()));\r\n\t\t\t\t\t\t\tdirection=Direction.UP;\r\n\t\t\t\t\t\t\tclearButtonUp(actualFloor);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//readyToRide=true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\teventActionMap.put(DownButtonEvent.class, new LiftAction() {\r\n\t\t\t@Override\r\n\t\t\tpublic void execute(LiftEvent e) {\r\n\t\t\t\tDownButtonEvent event = (DownButtonEvent) e;\r\n\t\t\t\tSystem.out.println(\"down \"+event.getFloor());\r\n\t\t\t\tif(directionButtonPanels[event.getFloor()][0]==LiftButton.NOT_ACTIVE){\r\n\t\t\t\t\tpushButtonDown(new Floor(event.getFloor()));\r\n\t\t\t\t\tif (direction == Direction.STOP) {\r\n\t\t\t\t\t\tif (event.getFloor() > actualFloor.getNumber()) {\r\n\t\t\t\t\t\t\tconnection.send(new ChangeDirectionEvent(Direction.UP,actualFloor.getNumber()));\r\n\t\t\t\t\t\t\tdirection=Direction.UP;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (event.getFloor() < actualFloor.getNumber()) {\r\n\t\t\t\t\t\t\tconnection.send(new ChangeDirectionEvent(Direction.DOWN,actualFloor.getNumber()));\r\n\t\t\t\t\t\t\tdirection=Direction.DOWN;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tconnection.send(new ChangeDirectionEvent(Direction.DOWN,event.getFloor()));\r\n\t\t\t\t\t\t\tdirection=Direction.DOWN;\r\n\t\t\t\t\t\t\tclearButtonDown(actualFloor);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//readyToRide=true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\teventActionMap.put(InnerButtonEvent.class, new LiftAction() {\t\r\n\t\t\t@Override\r\n\t\t\tpublic void execute(LiftEvent e) {\r\n\t\t\t\tInnerButtonEvent event = (InnerButtonEvent) e;\r\n\t\t\t\tSystem.out.println(\"Inner \"+event.getFloor());\r\n\t\t\t\tif(buttonPanel[event.getFloor()]==LiftButton.NOT_ACTIVE){\r\n\t\t\t\t\tpushButton(new Floor(event.getFloor()));\r\n\t\t\t\t\tif (direction == Direction.STOP) {\r\n\t\t\t\t\t\tif (actualFloor.getNumber() == event.getFloor()) {\r\n\t\t\t\t\t\t\tconnection.send(new LiftStopEvent(event.getFloor()));\r\n\t\t\t\t\t\t\tclearButton(actualFloor);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tSystem.out.println(\"Chyba tu nie powinno byc. driver linijka 150\");\r\n\t\t\t\t\t\t\tif (event.getFloor() > actualFloor.getNumber()) {\r\n\t\t\t\t\t\t\t\tconnection.send(new ChangeDirectionEvent(Direction.UP, actualFloor.getNumber()));\r\n\t\t\t\t\t\t\t\tdirection=Direction.UP;\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\tconnection.send(new ChangeDirectionEvent(Direction.DOWN, actualFloor.getNumber()));\r\n\t\t\t\t\t\t\t\tdirection=Direction.DOWN;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t//readyToRide=true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\teventActionMap.put(LiftIsReadyEvent.class, new LiftAction() {\r\n\t\t\t@Override\r\n\t\t\tpublic void execute(LiftEvent e) {\r\n\t\t\t\tSystem.out.println(\"lift ready in driver\");\r\n\t\t\t\treadyToRide=true;\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\teventActionMap.put(LiftOnTheFloorEvent.class, new LiftAction(){\r\n\t\t\t@Override\r\n\t\t\tpublic void execute(LiftEvent e) {\r\n\t\t\t\tSystem.out.println(\"na pietrze\");\r\n\t\t\t\tLiftOnTheFloorEvent event = (LiftOnTheFloorEvent) e;\r\n\t\t\t\t\r\n\t\t\t\tactualFloor = new Floor(event.getFloor());\r\n\t\t\t\tdestinationFloor=getDestinationFloor(directionButtonPanels, buttonPanel, direction, actualFloor);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif (buttonPanel[event.getFloor()] == LiftButton.ACTIVE) {\r\n\t\t\t\t\tclearButton(actualFloor);\r\n\t\t\t\t\tif (direction == Direction.DOWN) {\r\n\t\t\t\t\t\tif (directionButtonPanels[event.getFloor()][0] == LiftButton.ACTIVE) {\r\n\t\t\t\t\t\t\tconnection.send(new LiftStopEvent(event.getFloor()));\r\n\t\t\t\t\t\t\tclearButtonDown(actualFloor);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (directionButtonPanels[event.getFloor()][1] == LiftButton.ACTIVE) {\r\n\t\t\t\t\t\t\tif (actualFloor.getNumber() == destinationFloor.getNumber()) {\r\n\t\t\t\t\t\t\t\tconnection.send(new ChangeDirectionEvent(Direction.UP, event.getFloor()));\r\n\t\t\t\t\t\t\t\tclearButtonUp(actualFloor);\r\n\t\t\t\t\t\t\t\tdirection=Direction.UP;\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\tconnection.send(new LiftStopEvent(event.getFloor()));\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 (actualFloor.getNumber() == destinationFloor.getNumber()) {\r\n\t\t\t\t\t\t\t\tif (getHighestDirBut(directionButtonPanels).getNumber()==0) {\r\n\t\t\t\t\t\t\t\t\tif (getHighestButPan(buttonPanel).getNumber()==0) {\r\n\t\t\t\t\t\t\t\t\t\tconnection.send(new ChangeDirectionEvent(Direction.STOP, event.getFloor()));\r\n\t\t\t\t\t\t\t\t\t\tdirection=Direction.STOP;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\tconnection.send(new ChangeDirectionEvent(Direction.UP, event.getFloor()));\r\n\t\t\t\t\t\t\t\t\t\tdirection=Direction.UP;\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\telse {\r\n\t\t\t\t\t\t\t\t\tconnection.send(new ChangeDirectionEvent(Direction.UP, event.getFloor()));\r\n\t\t\t\t\t\t\t\t\tdirection=Direction.UP;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tconnection.send(new LiftStopEvent(event.getFloor()));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (direction == Direction.UP) {\r\n\t\t\t\t\t\tif (directionButtonPanels[event.getFloor()][1] == LiftButton.ACTIVE) {\r\n\t\t\t\t\t\t\tconnection.send(new LiftStopEvent(event.getFloor()));\r\n\t\t\t\t\t\t\tclearButtonUp(actualFloor);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (directionButtonPanels[event.getFloor()][0] == LiftButton.ACTIVE) {\r\n\t\t\t\t\t\t\tif (actualFloor.getNumber() == destinationFloor.getNumber()) {\r\n\t\t\t\t\t\t\t\tconnection.send(new ChangeDirectionEvent(Direction.DOWN, event.getFloor()));\r\n\t\t\t\t\t\t\t\tclearButtonDown(actualFloor);\r\n\t\t\t\t\t\t\t\tdirection=Direction.DOWN;\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\tconnection.send(new LiftStopEvent(event.getFloor()));\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 (actualFloor.getNumber() == destinationFloor.getNumber()) {\r\n\t\t\t\t\t\t\t\tif (getLowestDirBut(directionButtonPanels).getNumber()==numberOfFloors-1) {\r\n\t\t\t\t\t\t\t\t\tif (getLowestButPan(buttonPanel).getNumber()==numberOfFloors-1) {\r\n\t\t\t\t\t\t\t\t\t\tconnection.send(new ChangeDirectionEvent(Direction.STOP, event.getFloor()));\r\n\t\t\t\t\t\t\t\t\t\tdirection=Direction.STOP;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\tconnection.send(new ChangeDirectionEvent(Direction.DOWN, event.getFloor()));\r\n\t\t\t\t\t\t\t\t\t\tdirection=Direction.DOWN;\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"22222222\"); \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\telse {\r\n\t\t\t\t\t\t\t\t\tconnection.send(new ChangeDirectionEvent(Direction.DOWN, event.getFloor()));\r\n\t\t\t\t\t\t\t\t\tdirection=Direction.DOWN;\r\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"1111111111\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tconnection.send(new LiftStopEvent(event.getFloor()));\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//clearButton(actualFloor);\r\n\t\t\t\t\treadyToRide = false;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (direction == Direction.DOWN) {\r\n\t\t\t\t\t\tif (directionButtonPanels[event.getFloor()][0] == LiftButton.ACTIVE) {\r\n\t\t\t\t\t\t\tconnection.send(new LiftStopEvent(event.getFloor()));\r\n\t\t\t\t\t\t\tclearButtonDown(actualFloor);\r\n\t\t\t\t\t\t\treadyToRide = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (directionButtonPanels[event.getFloor()][1] == LiftButton.ACTIVE) {\r\n\t\t\t\t\t\t\tif (actualFloor.getNumber() == destinationFloor.getNumber()) {\r\n\t\t\t\t\t\t\t\tconnection.send(new ChangeDirectionEvent(Direction.UP, event.getFloor()));\r\n\t\t\t\t\t\t\t\tclearButtonUp(actualFloor);\r\n\t\t\t\t\t\t\t\tdirection=Direction.UP;\r\n\t\t\t\t\t\t\t\treadyToRide = 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}\r\n\t\t\t\t\telse if (direction == Direction.UP) {\r\n\t\t\t\t\t\tif (directionButtonPanels[event.getFloor()][1] == LiftButton.ACTIVE) {\r\n\t\t\t\t\t\t\tconnection.send(new LiftStopEvent(event.getFloor()));\r\n\t\t\t\t\t\t\tclearButtonUp(actualFloor);\r\n\t\t\t\t\t\t\treadyToRide = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (directionButtonPanels[event.getFloor()][0] == LiftButton.ACTIVE) {\r\n\t\t\t\t\t\t\tif (actualFloor.getNumber() == destinationFloor.getNumber()) {\r\n\t\t\t\t\t\t\t\tconnection.send(new ChangeDirectionEvent(Direction.DOWN, event.getFloor()));\r\n\t\t\t\t\t\t\t\tclearButtonDown(actualFloor);\r\n\t\t\t\t\t\t\t\tdirection=Direction.DOWN;\r\n\t\t\t\t\t\t\t\treadyToRide = 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}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\teventActionMap.put(SimulationStartEvent.class, new LiftAction() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void execute(LiftEvent e) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\teventActionMap.put(SimulationStopEvent.class, new LiftAction() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void execute(LiftEvent e) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t}", "private void setupPlaybackButtons(RadioPlayer player, View parentView) {\n setupButton(player, parentView, R.id.small_play_button);\n setupButton(player, parentView, R.id.play_button);\n setupButton(player, parentView, R.id.next_button);\n setupButton(player, parentView, R.id.previous_button);\n }", "private void boundButtons() {\r\n \tsingleplayer = (Button) findViewById(R.id.single);\r\n \tsingleplayer.setTypeface(tf);\r\n \tsingleplayer.setOnClickListener(new OnClickListener() {\r\n \t\t\r\n \t\t/** Start a drawing surface for one player*/\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\tIntent intent = new Intent(Main.this, DrawingActivitySingle.class);\r\n\t\t\t\tstartActivity(intent);\r\n\t\t}});\r\n \t\r\n \tmultiplayer = (Button) findViewById(R.id.multi);\r\n \tmultiplayer.setTypeface(tf);\r\n \tmultiplayer.setOnClickListener(new OnClickListener() {\r\n \t\t\r\n \t\t/** Connect to other users to start a drawing surface*/\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\tif (multiplayer.isEnabled()) {\r\n\t\t\t\t\tmultiplayer.setEnabled(false);\r\n\t\t\t\t\t\r\n\t\t\t\t\tinitMultiPlayer();\r\n\t\t\t\t}\r\n\t\t}});\r\n \t\r\n \toptions = (Button) findViewById(R.id.options);\r\n \toptions.setTypeface(tf);\r\n \toptions.setOnClickListener(new OnClickListener() {\r\n \t\t\r\n \t\t/** Start the options menu */\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\tIntent intent = new Intent(Main.this, Options.class);\r\n\t\t\t\tstartActivity(intent);\r\n\t\t}});\r\n }", "public void resetButtonsMode() {\n host.getMidiOutPort(0).sendMidi(0xB0, 34, 1);\n }", "protected void setupUI() {\n textView = (TextView) findViewById(R.id.textView);\n viewGradeButton = (Button) findViewById(R.id.viewAllBillsButton);\n viewDash = (Button) findViewById(R.id.viewDash);\n\n //Listen if the buttons is clicked\n viewGradeButton.setOnClickListener(onClickViewGradeButton);\n viewDash.setOnClickListener(onClickViewDash);\n\n }", "private void setupButtons() {\n for (int i = 0; i < players.size(); i++) {\n final int j = i + 1;\n players.get(i).setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n buttonPushed(j);\n }\n });\n }\n }", "private void setupButtons() {\n final ButtonGroup btngrp = new ButtonGroup();\n\n for (final AbstractAction actn : myToolActions) {\n final JToggleButton btn = new JToggleButton(actn);\n btn.addActionListener(actn);\n btngrp.add(btn);\n add(btn);\n }\n\n btngrp.clearSelection();\n btngrp.getElements().nextElement().setSelected(true);\n\n }", "public void upPressed() {\n System.out.println(\"upPressed()\");\n current.rotate();\n display.showBlocks();\n }", "public void setupActions() {\n getActionManager().setup(getView());\n }", "public void setupUI() {\n users = (Button) findViewById(R.id.btnUtilisateur);\n services = (Button) findViewById(R.id.btnServices);\n }", "@Override\n\tpublic void setStates(){\n\t\tleftButton.visible = booklet.pageNumber > 0;\n\t\trightButton.visible = booklet.pageNumber + 1 < totalPages;\n\t\t\n\t\t//Check the mouse to see if it updated and we need to change pages.\n\t\tint wheelMovement = InterfaceInput.getTrackedMouseWheel();\n\t\tif(wheelMovement < 0 && rightButton.visible){\n\t\t\t++booklet.pageNumber;\n\t\t}else if(wheelMovement > 0 && leftButton.visible){\n\t\t\t--booklet.pageNumber;\n\t\t}\n\t\t\n\t\t//Set the visible labels based on the current page.\n\t\tfor(int i=0; i<pageTextLabels.size(); ++ i){\n\t\t\tfor(GUIComponentLabel label : pageTextLabels.get(i)){\n\t\t\t\tlabel.visible = booklet.pageNumber == i;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Set the TOC buttons visible if we're on the TOC page.\n\t\tfor(GUIComponentButton button : contentsButtons){\n\t\t\tbutton.visible = booklet.pageNumber == 1 && !booklet.definition.booklet.disableTOC;\n\t\t}\n\t\t\n\t\t//Set the TOC button to be visible on other pages.\n\t\tif(contentsButton != null){\n\t\t\tcontentsButton.visible = booklet.pageNumber > 1;\n\t\t}\n\t}", "private void setDrawButtonHandlers() {\n \tfinal ModPageView tempPagesView = pagesView;\n \t\n \tthis.readModeButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdrawLayout.setVisibility(View.GONE);\n\t\t\t\tmenuLayout.setVisibility(View.VISIBLE);\n\t\t\t\tpdfMode=READMODE;\n\t\t\t\tdrawMode=NORMALMODE;\n\t\t\t}\n \t});\n \t\n \tthis.rotateLeftButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t//tempPagesView.rotate(-1);\n\t\t\t\tdrawingSurface.undo();\n if( drawingSurface.hasMoreUndo() == false ){\n rotateLeftButton.setEnabled( false );\n }\n rotateRightButton.setEnabled( true );\n\t\t\t\tdrawMode=NORMALMODE;\n\t\t\t}\n \t});\n\n \tthis.rotateRightButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t//tempPagesView.rotate(1);\n\t\t\t\tdrawingSurface.redo();\n if( drawingSurface.hasMoreRedo() == false ){\n rotateRightButton.setEnabled( false );\n }\n\n rotateLeftButton.setEnabled( true );\n\t\t\t\tdrawMode=NORMALMODE;\n\t\t\t}\n \t});\n\n \tthis.browseButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tstartActivity(new Intent(OpenFileActivity.this, AddBookActivity.class));\n\t\t\t}\n \t});\n \t\n \tthis.drawPenButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdrawMode=PENMODE;\n\t\t\t\tpdfMode=DRAWMODE;\n\t\t\t\tpenBalloonLayout.setVisibility(View.GONE);\n\t\t\t}\n \t});\n \t\n \tthis.drawPenButton.setOnLongClickListener(new View.OnLongClickListener() {\n\n\t\t\tpublic boolean onLongClick(View v) {\n\t\t\t//\tpenBalloonLayout.setVisibility(View.VISIBLE);\n\t\t\t\treturn true;\n\t\t\t}\n \t});\n \t\n \tthis.drawHighlightButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdrawMode=HIGHLIGHTMODE;\n\t\t\t\tpdfMode=DRAWMODE;\n\t\t\t\thighlightBalloonLayout.setVisibility(View.GONE);\n\t\t\t}\n \t});\n \t\n \tthis.drawHighlightButton.setOnLongClickListener(new View.OnLongClickListener() {\n\n\t\t\tpublic boolean onLongClick(View v) {\n\t\t\t//\thighlightBalloonLayout.setVisibility(View.VISIBLE);\n\t\t\t\treturn true;\n\t\t\t}\n \t});\n \t\n \tthis.drawShapeBUtton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdrawMode=shapeSelected;\n\t\t\t\tpdfMode=DRAWMODE;\n\t\t\t\tshapeBalloonLayout.setVisibility(View.GONE);\n\t\t\t}\n \t});\n \t\n \tthis.selectCircleButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdrawMode=CIRCLEMODE;\n\t\t\t\tpdfMode=DRAWMODE;\n\t\t\t\tshapeBalloonLayout.setVisibility(View.GONE);\n\t\t\t}\n \t});\n \t\n \tthis.selectSquareButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdrawMode=SQUAREMODE;\n\t\t\t\tpdfMode=DRAWMODE;\n\t\t\t\tshapeBalloonLayout.setVisibility(View.GONE);\n\t\t\t}\n \t});\n \t\n \tthis.selectTriangleButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdrawMode=TRIANGLEMODE;\n\t\t\t\tpdfMode=DRAWMODE;\n\t\t\t\tshapeBalloonLayout.setVisibility(View.GONE);\n\t\t\t}\n \t});\n \t\n \tthis.drawShapeBUtton.setOnLongClickListener(new View.OnLongClickListener() {\n\n\t\t\tpublic boolean onLongClick(View v) {\n\t\t\t\tSystem.out.println(\"sssssss\");\n\t\t\t\tshapeBalloonLayout.setVisibility(View.VISIBLE);\n\t\t\t\treturn true;\n\t\t\t}\n \t});\n \t\n \tthis.drawColorButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif(colorBalloonLayout.getVisibility()==View.GONE){\n\t\t\t\t\tcolorBalloonLayout.setVisibility(View.VISIBLE);\n\t\t\t\t}else{\n\t\t\t\t\tcolorBalloonLayout.setVisibility(View.GONE);\n\t\t\t\t}\n\t\t\t}\n \t});\n \t\n \tthis.drawColorButton.setOnLongClickListener(new View.OnLongClickListener() {\n\n\t\t\tpublic boolean onLongClick(View v) {\n\t\t\t\tcolorBalloonLayout.setVisibility(View.VISIBLE);\n\t\t\t\treturn true;\n\t\t\t}\n \t});\n \t\n \tthis.selectBlackColorButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tchangeColor(BLACK);\n\t\t\t\tcolorImage.setBackgroundDrawable(getResources().getDrawable(drawColorId[0]));\n\t\t\t\tcolorBalloonLayout.setVisibility(View.GONE);\n\t\t\t}\n \t});\n \t\n \tthis.selectRedColorButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tchangeColor(RED);\n\t\t\t\tcolorImage.setBackgroundDrawable(getResources().getDrawable(drawColorId[1]));\n\t\t\t\tcolorBalloonLayout.setVisibility(View.GONE);\n\t\t\t}\n \t});\n \t\n \tthis.selectBlueColorButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tchangeColor(BLUE);\n\t\t\t\tcolorImage.setBackgroundDrawable(getResources().getDrawable(drawColorId[2]));\n\t\t\t\tcolorBalloonLayout.setVisibility(View.GONE);\n\t\t\t}\n \t});\n \t\n \t\n \t\n \tthis.selectGreenColorButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tchangeColor(GREEN);\n\t\t\t\tcolorImage.setBackgroundDrawable(getResources().getDrawable(drawColorId[3]));\n\t\t\t\tcolorBalloonLayout.setVisibility(View.GONE);\n\t\t\t}\n \t});\n \t\n \tthis.selectPinkColorButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tchangeColor(PINK);\n\t\t\t\tcolorImage.setBackgroundDrawable(getResources().getDrawable(drawColorId[4]));\n\t\t\t\tcolorBalloonLayout.setVisibility(View.GONE);\n\t\t\t}\n \t});\n \t\n \tthis.selectYellowColorButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tchangeColor(YELLOW);\n\t\t\t\tcolorImage.setBackgroundDrawable(getResources().getDrawable(drawColorId[5]));\n\t\t\t\tcolorBalloonLayout.setVisibility(View.GONE);\n\t\t\t}\n \t});\n \t\n \tthis.selectWhiteColorButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tchangeColor(WHITE);\n\t\t\t\tcolorImage.setBackgroundDrawable(getResources().getDrawable(drawColorId[6]));\n\t\t\t\tcolorBalloonLayout.setVisibility(View.GONE);\n\t\t\t}\n \t});\n \t\n \tthis.drawErasorButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdrawMode=ERASORMODE;\n\t\t\t\tpdfMode=DRAWMODE;\n\t\t\t\terasorBalloonLayout.setVisibility(View.GONE);\n\t\t\t}\n \t});\n \t\n \tthis.drawErasorButton.setOnLongClickListener(new View.OnLongClickListener() {\n\n\t\t\tpublic boolean onLongClick(View v) {\n\t\t\t\terasorBalloonLayout.setVisibility(View.VISIBLE);\n\t\t\t\treturn true;\n\t\t\t}\n \t});\n \t\n \tthis.clearDrawButton.setOnClickListener(new View.OnClickListener() {\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdrawingSurface.clearDraw();\n\t\t\t\t\n\t\t\t\terasorBalloonLayout.setVisibility(View.GONE);\n\t\t\t}\n \t});\n }", "private void setDiceRollerButtons() {\n\n registerListener(R.id.buttond2);\n registerListener(R.id.buttond3);\n registerListener(R.id.buttond4);\n registerListener(R.id.buttond6);\n registerListener(R.id.buttond8);\n registerListener(R.id.buttond10);\n registerListener(R.id.buttond12);\n registerListener(R.id.buttond20);\n registerListener(R.id.buttond24);\n registerListener(R.id.buttond100);\n\n registerListener(R.id.buttonListaTiradas);\n }", "void init(){\n\n //to do associations\n mButtonBottomLeftCorner = findViewById(R.id.idButtonBottomLeftCorner);\n mButtonBottomRightCorner = findViewById(R.id.idButtonBottomRightCorner);\n mButtonTopLeftCorner = findViewById(R.id.idButtonTopLeftCorner);\n mButtonTopRightCorner = findViewById(R.id.idButtonTopRightCorner);\n\n //to set behavior\n\n mButtonBottomLeftCorner.setOnClickListener(this);\n mButtonBottomRightCorner.setOnClickListener(this);\n mButtonTopLeftCorner.setOnClickListener(this);\n mButtonTopRightCorner.setOnClickListener(this);\n\n }", "@Test\n\tpublic void addButtonsTest() throws Exception {\n\t\t\n\t\tif (Configuration.featureamp &&\n\t\t\t\tConfiguration.playengine &&\n\t\t\t\tConfiguration.choosefile &&\n\t\t\t\tConfiguration.skins &&\n\t\t\t\tConfiguration.gui &&\n\t\t\t\tConfiguration.light &&\n\t\t\t\tConfiguration.filesupport &&\n\t\t\t\tConfiguration.showcover &&\n\t\t\t\tConfiguration.reorderplaylist && \n\t\t\t\t!Configuration.queuetrack \n\t\t\t\t) {\n\t\t\tstart();\n\t\t\t\n\t\t\tgui.addButtons();\n\t\t\tJFrame g = (JFrame) MemberModifier.field(Application.class, \"frmAsd\").get(gui);\n\t\t\tJButton button =null;\n\t\t\tJButton button2 =null;\n\t\t\t\n\t\t\tfor (int i = 0; i < g.getContentPane().getComponentCount(); i++) {\n\t\t\t\tif(g.getContentPane().getComponent(i).getName()!= null && g.getContentPane().getComponent(i).getName().equals(\"trackUp\")) {\n\t\t\t\t\tbutton = (JButton) g.getContentPane().getComponent(i);\n\t\t\t\t}\n\t\t\t\telse if(g.getContentPane().getComponent(i).getName()!= null && g.getContentPane().getComponent(i).getName().equals(\"trackDown\")) {\n\t\t\t\t\tbutton2 = (JButton) g.getContentPane().getComponent(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tassertTrue(button.getBounds().getX() == 506);\n\t\t\tassertTrue(button.getBounds().getY() == 327);\n\t\t\tassertTrue(button.getBounds().getWidth() == 120);\n\t\t\tassertTrue(button.getBounds().getHeight() == 25);\n\t\t\tassertTrue(button.getActionListeners()!= null);\n\t\t\t\n\t\t\tassertTrue(button2.getBounds().getX() == 506);\n\t\t\tassertTrue(button2.getBounds().getY() == 360);\n\t\t\tassertTrue(button2.getBounds().getWidth() == 120);\n\t\t\tassertTrue(button2.getBounds().getHeight() == 25);\n\t\t\tassertTrue(button2.getActionListeners()!= null);\n\t\t}\n\t}", "private void addButtons() {\r\n\t\troot.getChildren().add(button); // creating the Easy button \r\n\t\tb1 = new Button(\"Easy\");\r\n\t\tb1.setOnAction(new EventHandler<ActionEvent>() {\r\n\t\t\t@Override\r\n\t\t\tpublic void handle(ActionEvent ke) {\r\n\t\t\t\tdiff = \"Easy\";\r\n\t\t\t}\r\n\t\t});\r\n\t\troot.getChildren().add(b1); // creating the Normal button\r\n\t\tb2 = new Button(\"Normal\");\r\n\t\tb2.setOnAction(new EventHandler<ActionEvent>() {\r\n\t\t\t@Override\r\n\t\t\tpublic void handle(ActionEvent ke) {\r\n\t\t\t\tdiff = \"Normal\";\r\n\t\t\t}\r\n\t\t});\r\n\t\tb2.setLayoutX(50);\r\n\t\troot.getChildren().add(b2); // creating the Hard button\r\n\t\tb3 = new Button(\"Hard\");\r\n\t\tb3.setOnAction(new EventHandler<ActionEvent>() {\r\n\t\t\t@Override\r\n\t\t\tpublic void handle(ActionEvent ke) {\r\n\t\t\t\tdiff = \"Hard\";\r\n\t\t\t}\r\n\t\t});\r\n\t\tb3.setLayoutX(115);\r\n\t\troot.getChildren().add(b3);\r\n\t}", "private void pushButtonDown(Floor floor)\r\n\t{\r\n\t\tdirectionButtonPanels[floor.getNumber()][0]=LiftButton.ACTIVE;\r\n\t}", "private void setupButtonPanel() {\n\n Dimension btnSize = new Dimension(100, 50);\n\n exitButton = new JButton(\"Exit\");\n playAgainButton = new JButton(\"Play Again\");\n\n exitButton.setPreferredSize(btnSize);\n playAgainButton.setPreferredSize(btnSize);\n\n buttonPanel.add(playAgainButton);\n buttonPanel.add(exitButton);\n fullPanel.add(buttonPanel, BorderLayout.SOUTH);\n\n playAgainButton.addActionListener(actionEvent -> {\n GameOver.this.dispose();\n new MainScreen();\n });\n exitButton.addActionListener(actionEvent -> System.exit(0));\n }", "public void setDirection(){\n\n if (gameStatus != demoPlay)\n client_sb.i_Button = direct;\n\n TankMoveDelay++;\n StarGun_GSR loc=(StarGun_GSR)client_sb.getGameStateRecord();\n\n if (TankMoveDelay >= 1 &&\n loc.getPlayerX() < StarGun_SB.PLAYER_RIGHT_BORDER &&\n\t loc.getPlayerX() > 0) {\n TankMoveDelay = 0;\n switch (direct) {\n\tcase StarGun_SB.DIRECT_LEFT:\n\t if (TankPos==0)TankPos=iTankAmount-1;\n\t else TankPos--;\n\t\t\t\t break;\n case StarGun_SB.DIRECT_RIGHT:\n\t if (TankPos==iTankAmount-1)TankPos=0;\n\t else TankPos++;\n\t\t\t\t break;\n }\n }\n }", "@Override\n\tprotected void InitButtonListener() {\n\t\timgbtnOK.setOnClickListener(new View.OnClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tClickOK();\n\t\t\t\tCursurIndex = 3;\n\t\t\t\tHandleCursurDisplay.sendMessage(HandleCursurDisplay.obtainMessage(CursurIndex));\n\t\t\t}\n\t\t});\n\t\timgbtnPlus.setOnClickListener(new View.OnClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tClickPlus();\n\t\t\t\tCursurIndex = 2;\n\t\t\t\tHandleCursurDisplay.sendMessage(HandleCursurDisplay.obtainMessage(CursurIndex));\n\t\t\t}\n\t\t});\n\t\timgbtnMinus.setOnClickListener(new View.OnClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tClickMinus();\n\t\t\t\tCursurIndex = 1;\n\t\t\t\tHandleCursurDisplay.sendMessage(HandleCursurDisplay.obtainMessage(CursurIndex));\n\t\t\t}\n\t\t});\n\t}", "@Override\r\n\tpublic int ToggleUp() {\n\t\treturn 0;\r\n\t}", "public static void OptionsComponents() {\n\t\tInterface.controls.setPreferredSize(Interface.dim);\n\t\tInterface.controls.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.controls.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.controls.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.controls.setForeground(Color.white);\n\t\t\n\t\tInterface.controls2.setPreferredSize(Interface.dim);\n\t\tInterface.controls2.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.controls2.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.controls2.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.controls2.setForeground(Color.white);\n\t\t\n\t\t\n\t\tInterface.sound.setPreferredSize(Interface.dim);\n\t\tInterface.sound.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.sound.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.sound.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.sound.setForeground(Color.white);\n\t\t\n\t\tInterface.soundOn.setPreferredSize(Interface.dim);\n\t\tInterface.soundOn.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.soundOn.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.soundOn.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.soundOn.setForeground(Color.white);\n\t\t\n\t\tInterface.soundOff.setPreferredSize(Interface.dim);\n\t\tInterface.soundOff.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.soundOff.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.soundOff.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.soundOff.setForeground(Color.white);\n\t\t\n\t\t\n\t\tInterface.backtomain.setPreferredSize(Interface.dim);\n\t\tInterface.backtomain.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.backtomain.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.backtomain.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.backtomain.setForeground(Color.white);\n\t\t\n\t\t\n\t\tInterface.save.setPreferredSize(Interface.dim);\n\t\tInterface.save.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.save.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.save.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.save.setForeground(Color.white);\n\t\t\n\t\t\n\t\tInterface.backtooptions.setPreferredSize(Interface.dim);\n\t\tInterface.backtooptions.setIcon(new ImageIcon(Interface.Button));\n\t\tInterface.backtooptions.setHorizontalTextPosition(JButton.CENTER);\n\t\tInterface.backtooptions.setVerticalTextPosition(JButton.CENTER);\n\t\tInterface.backtooptions.setForeground(Color.white);\n\t\t\n\t\t\n\t\tInterface.player1.setForeground(Color.white);\n\t\tInterface.player2.setForeground(Color.white);\n\t\tInterface.up1.setForeground(Color.white);\n\t\tInterface.up2.setForeground(Color.white);\n\t\tInterface.down1.setForeground(Color.white);\n\t\tInterface.down2.setForeground(Color.white);\n\t\tInterface.right1.setForeground(Color.white);\n\t\tInterface.right2.setForeground(Color.white);\n\t\tInterface.left1.setForeground(Color.white);\n\t\tInterface.left2.setForeground(Color.white);\n\t\tInterface.bomb1.setForeground(Color.white);\n\t\tInterface.bomb2.setForeground(Color.white);\n\t\tInterface.boxNumber.setForeground(Color.white);\n\t\tInterface.getUp1.setEditable(false);\n\t\tInterface.getUp2.setEditable(false);\n\t\tInterface.getDown1.setEditable(false);\n\t\tInterface.getDown2.setEditable(false);\n\t\tInterface.getRight1.setEditable(false);\n\t\tInterface.getRight2.setEditable(false);\n\t\tInterface.getLeft1.setEditable(false);\n\t\tInterface.getLeft2.setEditable(false);\n\t\tInterface.getBomb1.setEditable(false);\n\t\tInterface.getBomb2.setEditable(false);\n\t}", "private void setUpClickListerns ()\n\t{\n\t\tLinearLayout temp_layout ;\n\t\tButton temp_button ;\n\t\tfor (int i = 0 ; i<numPad.getChildCount() ; i++)\n\t\t{\n\t\t\ttemp_layout = (LinearLayout) numPad.getChildAt(i);\n\t\t\tfor (int j = 0;j< temp_layout.getChildCount() ; j++)\n\t\t\t{\n\t\t\t\ttemp_button = (Button) temp_layout.getChildAt(j);\n\t\t\t\ttemp_button.setOnClickListener(this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tchangePass.setOnClickListener(this);\n\t\tclear.setOnClickListener(this);\n\t\tpassField.setFocusable(false);\n\t}", "private void makeFrontGUIButtons(){\n Dimension preferred = getPreferredSize();\n\n optionsButton = new JButton();\n makeFrontButton(optionsButton, \"optionsIcon\", \"showOptions\", new Rectangle((int) preferred.getWidth() - 60, (int) preferred.getHeight() - (int) (preferred.getHeight() * 0.98), 39, 37));\n makeSearchButton();\n\n zoomInButton = new JButton();\n makeFrontButton(zoomInButton, \"plusIcon\", \"zoomIn\", new Rectangle((int) preferred.getWidth() - 60, (int) preferred.getHeight() - (int) preferred.getHeight() / 3 * 2, 39, 37));\n\n zoomOutButton = new JButton();\n makeFrontButton(zoomOutButton, \"minusIcon\", \"zoomOut\", new Rectangle((int) preferred.getWidth() - 60, (int) preferred.getHeight() - (int) (preferred.getHeight() / 3 * 2 + 45), 39, 37));\n\n makeShowRoutePanelButton();\n\n fullscreenButton = new JButton();\n makeFrontButton(fullscreenButton, \"fullscreenIcon\", \"fullscreen\", new Rectangle((int) preferred.getWidth() - 60, (int) (preferred.getHeight() - preferred.getHeight() / 3 * 2 + 100), 39, 37));\n\n mapTypeButton = new JButton();\n makeFrontButton(mapTypeButton, \"layerIcon\", \"mapType\", new Rectangle((int) preferred.getWidth() - 49, (int) (preferred.getHeight() - preferred.getHeight() / 3 * 2 - 45), 39, 37));\n makeCloseDirectionListPanel();\n }", "private void createButtons() {\n Button helpSettingsButton = new Button(\"\",\n new Button.ClickListener() {\n private static final long serialVersionUID = -5797923866320649518L;\n\n @Override\n public void buttonClick(ClickEvent event) {\n settingsPresenter.navigateToHelp();\n }\n });\n\n// Button skillSettingsButton = new Button(\"\",\n// new Button.ClickListener() {\n// private static final long serialVersionUID = 7147554466396214893L;\n//\n// @Override\n// public void buttonClick(ClickEvent event) {\n// settingsPresenter.navigateToSkills();\n// }\n// });\n// skillSettingsButton.addStyleName(\"icon-cog\");\n\n Button medicSettingsButton = new Button(\"\",\n new Button.ClickListener() {\n private static final long serialVersionUID = 7147554466396214893L;\n\n @Override\n public void buttonClick(ClickEvent event) {\n settingsPresenter.navigateToMedic();\n }\n });\n\n\n Button logoutButton = new Button(\"\",\n new Button.ClickListener() {\n private static final long serialVersionUID = -1096188732209266611L;\n\n @Override\n public void buttonClick(ClickEvent event) {\n settingsPresenter.navigateBack();\n }\n });\n logoutButton.addStyleName(\"default\");\n\n // Adding and aligning the 3 Buttons.\n //Setting a Description for the buttons which is displayed when flying over the button\n super.verticalNavigation.addComponent(helpSettingsButton);\n super.verticalNavigation.setComponentAlignment(helpSettingsButton, Alignment.MIDDLE_CENTER);\n helpSettingsButton.setDescription(\"Set the Help options for the Patient\");\n helpSettingsButton.setIcon(new ThemeResource(\"img/contacgg.png\"), BUTTON_HELP_SETTINGS);\n helpSettingsButton.setWidth(BUTTON_WIDTH);\n helpSettingsButton.setHeight(BUTTON_HEIGHT);\n\n super.verticalNavigation.addComponent(medicSettingsButton);\n super.verticalNavigation.setComponentAlignment(medicSettingsButton, Alignment.MIDDLE_CENTER);\n medicSettingsButton.setDescription(\"Set the Medication options for the Patient\");\n medicSettingsButton.setIcon(new ThemeResource(\"img/medicine-icon-cog.png\"),BUTTON_MEDIC_SETTINGS);\n medicSettingsButton.setWidth(BUTTON_WIDTH);\n medicSettingsButton.setHeight(BUTTON_HEIGHT);\n\n// addComponent(skillSettingsButton);\n// setComponentAlignment(skillSettingsButton, Alignment.MIDDLE_CENTER);\n// skillSettingsButton.setDescription(\"Set the Skill options for the Patient\");\n// skillSettingsButton.setIcon(new ThemeResource(\"img/skill2-icon-cog.png\"), BUTTON_SKILL_SETTINGS);\n// skillSettingsButton.setWidth(BUTTON_WIDTH);\n// skillSettingsButton.setHeight(BUTTON_HEIGHT);\n\n logoutButton.setWidth(BUTTON_WIDTH);\n super.verticalNavigation.addComponent(logoutButton);\n super.verticalNavigation.setComponentAlignment(logoutButton, Alignment.MIDDLE_CENTER);\n logoutButton.setDescription(\"You will be logged out\");\n logoutButton.setIcon(new ThemeResource(\"img/logout.png\"), BUTTON_LOGOUT);\n logoutButton.setWidth(BUTTON_WIDTH);\n logoutButton.setHeight(BUTTON_HEIGHT);\n\n }", "public int checkMenuButtons() {\n\n // computing the coordinates of the cursor\n\n mouseX = (float) ((currentPos.x * 1.0f - window.getWidth() / 2f) / (window.getWidth() / 2f));\n mouseY = (float) ((currentPos.y * 1.0f - window.getHeight() / 2f) / (window.getHeight() / 2f));\n\n float checkX = ((2f - 0.4f * boxRatio) / 2) - 1;\n int checkButton = 0;\n\n if (checkX < mouseX && mouseX < (checkX + 0.4f * boxRatio) && mouseY > -0.24f && mouseY < -0.157f) {\n checkButton = 11;\n }\n\n if (checkX < mouseX && mouseX < (checkX + 0.4f * boxRatio) && mouseY > -0.24f && mouseY < -0.157f && isLeftButtonPressed()) {\n checkButton = 12;\n }\n\n\n // coordinates of the 2nd button\n\n if (checkX < mouseX && mouseX < (checkX + 0.4f * boxRatio) && mouseY > -0.098f && mouseY < -0.0098f) {\n checkButton = 21;\n }\n\n if (checkX < mouseX && mouseX < (checkX + 0.4f * boxRatio) && mouseY > -0.098f && mouseY < -0.0098f && isLeftButtonPressed()) {\n checkButton = 22;\n }\n\n\n // coordinates of the 3rd button\n\n if (checkX < mouseX && mouseX < (checkX + 0.4f * boxRatio) && mouseY > 0.05f && mouseY < 0.144f) {\n checkButton = 31;\n }\n\n if (checkX < mouseX && mouseX < (checkX + 0.4f * boxRatio) && mouseY > 0.05f && mouseY < 0.144f && isLeftButtonPressed()) {\n checkButton = 32;\n }\n\n // coordinates of the 1st button\n\n if (checkX < mouseX && mouseX < (checkX + 0.4f * boxRatio) && mouseY > 0.2f && mouseY < 0.29f) {\n checkButton = 41;\n }\n\n if (checkX < mouseX && mouseX < (checkX + 0.4f * boxRatio) && mouseY > 0.2f && mouseY < 0.29f && isLeftButtonPressed()) {\n checkButton = 42;\n }\n\n if (checkX < mouseX && mouseX < (checkX + 0.4f * boxRatio) && mouseY > 0.35f && mouseY < 0.44f) {\n checkButton = 51;\n }\n\n if (checkX < mouseX && mouseX < (checkX + 0.4f * boxRatio) && mouseY > 0.35f && mouseY < 0.44f && isLeftButtonPressed()) {\n checkButton = 52;\n }\n\n return checkButton;\n }" ]
[ "0.6861657", "0.6720127", "0.663566", "0.66304874", "0.65174615", "0.6422317", "0.63521254", "0.62752914", "0.6254942", "0.61912847", "0.61194754", "0.60766286", "0.5981597", "0.59608555", "0.59244275", "0.5919035", "0.591381", "0.5893786", "0.58828825", "0.5871448", "0.5870099", "0.58517855", "0.5847992", "0.58458465", "0.582321", "0.58213353", "0.5815547", "0.58121485", "0.57864046", "0.5774996", "0.57723296", "0.5771727", "0.576167", "0.5759238", "0.5755465", "0.5754401", "0.5751864", "0.57461864", "0.5737786", "0.5714592", "0.57039946", "0.5700913", "0.56856024", "0.56676817", "0.5652916", "0.5651056", "0.56352556", "0.5628157", "0.56256765", "0.5616561", "0.560711", "0.5596678", "0.5589296", "0.5588871", "0.5584735", "0.557741", "0.5563838", "0.5556034", "0.55504936", "0.5542238", "0.55375534", "0.5531122", "0.5530363", "0.55298054", "0.5525963", "0.5522847", "0.552111", "0.55211014", "0.55113465", "0.5506076", "0.5504436", "0.54943085", "0.5491606", "0.5488552", "0.54868937", "0.5486236", "0.5486088", "0.54778796", "0.54774654", "0.54733634", "0.5472055", "0.54698926", "0.5468108", "0.54549736", "0.5449385", "0.5446258", "0.5444159", "0.54424685", "0.54320085", "0.5431093", "0.54290193", "0.5427004", "0.5423056", "0.5418859", "0.54134387", "0.5412679", "0.54036605", "0.5399822", "0.5392131", "0.5391807", "0.5379278" ]
0.0
-1